LibreOffice Module svx (master) 1
sdrmasterpagedescriptor.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
22#include <svx/svdpage.hxx>
23#include <svx/xdef.hxx>
24#include <svx/xfillit0.hxx>
25#include <svl/itemset.hxx>
26
27using namespace com::sun::star;
28
29namespace sdr
30{
32 : maOwnerPage(aOwnerPage),
33 maUsedPage(aUsedPage)
34 {
35 // all layers visible
37
38 // register at used page
40 }
41
43 {
44 // de-register at used page
46
47 mpViewContact.reset();
48 }
49
50 // ViewContact part
52 {
53 if(!mpViewContact)
54 {
55 mpViewContact.reset(
57 }
58
59 return *mpViewContact;
60 }
61
62 // this method is called from the destructor of the referenced page.
63 // do all necessary action to forget the page. It is not necessary to call
64 // RemovePageUser(), that is done from the destructor.
66 {
68 }
69
71 {
72 if(rNew != maVisibleLayers)
73 {
74 maVisibleLayers = rNew;
76 }
77 }
78
79
81 {
82 const SdrPage* pCorrectPage = &GetOwnerPage();
83 const SdrPageProperties* pCorrectProperties = &pCorrectPage->getSdrPageProperties();
84
85 if(drawing::FillStyle_NONE == pCorrectProperties->GetItemSet().Get(XATTR_FILLSTYLE).GetValue())
86 {
87 pCorrectPage = &GetUsedPage();
88 pCorrectProperties = &pCorrectPage->getSdrPageProperties();
89 }
90
91 if(pCorrectPage->IsMasterPage() && !pCorrectProperties->GetStyleSheet())
92 {
93 // #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets,
94 // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all
95 // MasterPages should have a StyleSheet exactly for this reason, but historically
96 // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others).
97 pCorrectProperties = nullptr;
98 }
99
100 return pCorrectProperties;
101 }
102} // end of namespace sdr
103
104/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetAll()
Definition: svdsob.hxx:75
const SfxItemSet & GetItemSet() const
Definition: svdpage.hxx:342
SfxStyleSheet * GetStyleSheet() const
Definition: svdpage.hxx:349
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
void TRG_ClearMasterPage()
Definition: svdpage.cxx:1645
void RemovePageUser(sdr::PageUser &rOldUser)
Definition: svdpage.cxx:1122
bool IsMasterPage() const
Definition: svdpage.hxx:464
void AddPageUser(sdr::PageUser &rNewUser)
Definition: svdpage.cxx:1117
SdrPageProperties & getSdrPageProperties()
Definition: svdpage.cxx:1877
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const SdrPageProperties * getCorrectSdrPageProperties() const
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
sdr::contact::ViewContact & GetViewContact() const
MasterPageDescriptor(SdrPage &aOwnerPage, SdrPage &aUsedPage)
void SetVisibleLayers(const SdrLayerIDSet &rNew)
virtual void PageInDestruction(const SdrPage &rPage) override
virtual void ActionChanged()
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)