LibreOffice Module svx (master) 1
svdpage.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
20#include <memory>
21#include <cassert>
22#include <set>
23#include <unordered_set>
24
25#include <svx/svdpage.hxx>
26#include <svx/unoshape.hxx>
27
28#include <o3tl/safeint.hxx>
29#include <string.h>
30
31#include <tools/debug.hxx>
33
34#include <svtools/colorcfg.hxx>
35#include <svx/svdetc.hxx>
36#include <svx/svdobj.hxx>
37#include <svx/svdogrp.hxx>
38#include <svx/svdoedge.hxx>
39#include <svx/svdoole2.hxx>
40#include <svx/svditer.hxx>
41#include <svx/svdmodel.hxx>
42#include <svx/svdlayer.hxx>
43#include <svx/svdpagv.hxx>
44#include <svx/svdundo.hxx>
45#include <svx/xfillit0.hxx>
46#include <svx/fmdpage.hxx>
48#include <svx/ColorSets.hxx>
49
53#include <algorithm>
54#include <svl/hint.hxx>
55#include <rtl/strbuf.hxx>
56#include <libxml/xmlwriter.h>
57
58#include <com/sun/star/lang/IllegalArgumentException.hpp>
59
60using namespace ::com::sun::star;
61
63
65: mbObjOrdNumsDirty(false),
66 mbRectsDirty(false),
67 mbIsNavigationOrderDirty(false)
68{
69}
70
71void SdrObjList::impClearSdrObjList(bool bBroadcast)
72{
73 SdrModel* pSdrModelFromRemovedSdrObject(nullptr);
74
75 while(!maList.empty())
76 {
77 // remove last object from list
80
81 // flushViewObjectContacts() is done since SdrObject::Free is not guaranteed
82 // to delete the object and thus refresh visualisations
83 pObj->GetViewContact().flushViewObjectContacts();
84
85 if(bBroadcast)
86 {
87 if(nullptr == pSdrModelFromRemovedSdrObject)
88 {
89 pSdrModelFromRemovedSdrObject = &pObj->getSdrModelFromSdrObject();
90 }
91
92 // sent remove hint (after removal, see RemoveObject())
93 // TTTT SdrPage not needed, can be accessed using SdrObject
95 pObj->getSdrModelFromSdrObject().Broadcast(aHint);
96 }
97 pObj->setParentOfSdrObject(nullptr);
98 }
99
100 if(bBroadcast && nullptr != pSdrModelFromRemovedSdrObject)
101 {
102 pSdrModelFromRemovedSdrObject->SetChanged();
103 }
104}
105
107{
108 // clear SdrObjects with broadcasting
109 impClearSdrObjList(true);
110}
111
113{
114 // clear SdrObjects without broadcasting
115 while(!maList.empty())
116 {
117 // remove last object from list
118 SdrObject& rObj = *maList.back();
119 rObj.setParentOfSdrObject(nullptr);
120 maList.pop_back();
121 }
122}
123
125{
126 // default is no page and returns zero
127 return nullptr;
128}
129
131{
132 // default is no SdrObject (SdrObjGroup)
133 return nullptr;
134}
135
137{
138 // clear SdrObjects with broadcasting
140
141 mbObjOrdNumsDirty = false;
142 mbRectsDirty = false;
143 size_t nCloneErrCnt(0);
144 const size_t nCount(rSrcList.GetObjCount());
145
146 if(nullptr == getSdrObjectFromSdrObjList() && nullptr == getSdrPageFromSdrObjList())
147 {
148 OSL_ENSURE(false, "SdrObjList which is not part of SdrPage or SdrObject (!)");
149 return;
150 }
151
152 SdrModel& rTargetSdrModel(nullptr == getSdrObjectFromSdrObjList()
153 ? getSdrPageFromSdrObjList()->getSdrModelFromSdrPage()
154 : getSdrObjectFromSdrObjList()->getSdrModelFromSdrObject());
155
156 for (size_t no(0); no < nCount; ++no)
157 {
158 SdrObject* pSO(rSrcList.GetObj(no));
159 rtl::Reference<SdrObject> pDO(pSO->CloneSdrObject(rTargetSdrModel));
160
161 if(pDO)
162 {
163 NbcInsertObject(pDO.get(), SAL_MAX_SIZE);
164 }
165 else
166 {
167 nCloneErrCnt++;
168 }
169 }
170
171 // and now for the Connectors
172 // The new objects would be shown in the rSrcList
173 // and then the object connections are made.
174 // Similar implementation are setup as the following:
175 // void SdrObjList::CopyObjects(const SdrObjList& rSrcList)
176 // SdrModel* SdrExchangeView::CreateMarkedObjModel() const
177 // BOOL SdrExchangeView::Paste(const SdrModel& rMod,...)
178 // void SdrEditView::CopyMarked()
179 if (nCloneErrCnt==0) {
180 for (size_t no=0; no<nCount; ++no) {
181 const SdrObject* pSrcOb=rSrcList.GetObj(no);
182 const SdrEdgeObj* pSrcEdge=dynamic_cast<const SdrEdgeObj*>( pSrcOb );
183 if (pSrcEdge!=nullptr) {
184 SdrObject* pSrcNode1=pSrcEdge->GetConnectedNode(true);
185 SdrObject* pSrcNode2=pSrcEdge->GetConnectedNode(false);
186 if (pSrcNode1!=nullptr && pSrcNode1->getParentSdrObjListFromSdrObject()!=pSrcEdge->getParentSdrObjListFromSdrObject()) pSrcNode1=nullptr; // can't do this
187 if (pSrcNode2!=nullptr && pSrcNode2->getParentSdrObjListFromSdrObject()!=pSrcEdge->getParentSdrObjListFromSdrObject()) pSrcNode2=nullptr; // across all lists (yet)
188 if (pSrcNode1!=nullptr || pSrcNode2!=nullptr) {
189 SdrObject* pEdgeObjTmp=GetObj(no);
190 SdrEdgeObj* pDstEdge=dynamic_cast<SdrEdgeObj*>( pEdgeObjTmp );
191 if (pDstEdge!=nullptr) {
192 if (pSrcNode1!=nullptr) {
193 sal_uInt32 nDstNode1=pSrcNode1->GetOrdNum();
194 SdrObject* pDstNode1=GetObj(nDstNode1);
195 if (pDstNode1!=nullptr) { // else we get an error!
196 pDstEdge->ConnectToNode(true,pDstNode1);
197 } else {
198 OSL_FAIL("SdrObjList::operator=(): pDstNode1==NULL!");
199 }
200 }
201 if (pSrcNode2!=nullptr) {
202 sal_uInt32 nDstNode2=pSrcNode2->GetOrdNum();
203 SdrObject* pDstNode2=GetObj(nDstNode2);
204 if (pDstNode2!=nullptr) { // else the node was probably not selected
205 pDstEdge->ConnectToNode(false,pDstNode2);
206 } else {
207 OSL_FAIL("SdrObjList::operator=(): pDstNode2==NULL!");
208 }
209 }
210 } else {
211 OSL_FAIL("SdrObjList::operator=(): pDstEdge==NULL!");
212 }
213 }
214 }
215 }
216 } else {
217#ifdef DBG_UTIL
218 OStringBuffer aStr("SdrObjList::operator=(): Error when cloning ");
219
220 if(nCloneErrCnt == 1)
221 {
222 aStr.append("a drawing object.");
223 }
224 else
225 {
226 aStr.append(OString::number(static_cast<sal_Int32>(nCloneErrCnt))
227 + " drawing objects.");
228 }
229
230 aStr.append(" Not copying connectors.");
231
232 OSL_FAIL(aStr.getStr());
233#endif
234 }
235}
236
238{
239 size_t no=0;
240 for (const rtl::Reference<SdrObject>& pObj : maList)
241 pObj->SetOrdNum(no++);
242 mbObjOrdNumsDirty=false;
243}
244
246{
249 const size_t nCount = GetObjCount();
250 for (size_t i=0; i<nCount; ++i) {
251 SdrObject* pObj=GetObj(i);
252 if (i==0) {
255 } else {
258 }
259 }
260}
261
263{
264 mbRectsDirty=true;
265 SdrObject* pParentSdrObject(getSdrObjectFromSdrObjList());
266
267 if(nullptr != pParentSdrObject)
268 {
269 pParentSdrObject->SetBoundAndSnapRectsDirty();
270 }
271}
272
274{
276
277 if(pParent)
278 {
279 pParent->ActionChildInserted(rChild.GetViewContact());
280 }
281}
282
284{
285 DBG_ASSERT(pObj!=nullptr,"SdrObjList::NbcInsertObject(NULL)");
286 if (pObj==nullptr)
287 return;
288
289 DBG_ASSERT(!pObj->IsInserted(),"The object already has the status Inserted.");
290 const size_t nCount = GetObjCount();
291 if (nPos>nCount) nPos=nCount;
293
294 if (nPos<nCount) mbObjOrdNumsDirty=true;
295 pObj->SetOrdNum(nPos);
296 pObj->setParentOfSdrObject(this);
297
298 // Inform the parent about change to allow invalidations at
299 // evtl. existing parent visualisations
300 impChildInserted(*pObj);
301
302 if (!mbRectsDirty) {
303 mbRectsDirty = true;
304 }
305 pObj->InsertedStateChange(); // calls the UserCall (among others)
306}
307
309{
310 std::unordered_set<rtl::OUString> aNameSet;
311 InsertObjectThenMakeNameUnique(pObj, aNameSet);
312}
313
314void SdrObjList::InsertObjectThenMakeNameUnique(SdrObject* pObj, std::unordered_set<OUString>& rNameSet, size_t nPos)
315{
316 InsertObject(pObj, nPos);
317 if (pObj->GetName().isEmpty())
318 return;
319
320 pObj->MakeNameUnique(rNameSet);
321 SdrObjList* pSdrObjList = pObj->GetSubList(); // group
322 if (pSdrObjList)
323 {
324 SdrObject* pListObj;
326 while (aIter.IsMore())
327 {
328 pListObj = aIter.Next();
329 pListObj->MakeNameUnique(rNameSet);
330 }
331 }
332}
333
334void SdrObjList::InsertObject(SdrObject* pObj, size_t nPos)
335{
336 DBG_ASSERT(pObj!=nullptr,"SdrObjList::InsertObject(NULL)");
337
338 if(!pObj)
339 return;
340
341 // if anchor is used, reset it before grouping
343 {
344 const Point& rAnchorPos = pObj->GetAnchorPos();
345 if(rAnchorPos.X() || rAnchorPos.Y())
346 pObj->NbcSetAnchorPos(Point());
347 }
348
349 // do insert to new group
350 NbcInsertObject(pObj, nPos);
351
352 // In case the object is inserted into a group and doesn't overlap with
353 // the group's other members, it needs an own repaint.
354 SdrObject* pParentSdrObject(getSdrObjectFromSdrObjList());
355
356 if(pParentSdrObject)
357 {
358 // only repaint here
359 pParentSdrObject->ActionChanged();
360 }
361
362 // TODO: We need a different broadcast here!
363 // Repaint from object number ... (heads-up: GroupObj)
365 {
367 pObj->getSdrModelFromSdrObject().Broadcast(aHint);
368 }
369
371}
372
374{
375 if (nObjNum >= maList.size())
376 {
377 OSL_ASSERT(nObjNum<maList.size());
378 return nullptr;
379 }
380
381 const size_t nCount = GetObjCount();
382 rtl::Reference<SdrObject> pObj=maList[nObjNum];
384
385 DBG_ASSERT(pObj!=nullptr,"Could not find object to remove.");
386 if (pObj!=nullptr)
387 {
388 // flushViewObjectContacts() clears the VOC's and those invalidate
389 pObj->GetViewContact().flushViewObjectContacts();
390
391 DBG_ASSERT(pObj->IsInserted(),"The object does not have the status Inserted.");
392
393 // tdf#121022 Do first remove from SdrObjList - InsertedStateChange
394 // relies now on IsInserted which uses getParentSdrObjListFromSdrObject
395 pObj->setParentOfSdrObject(nullptr);
396
397 // calls UserCall, among other
398 pObj->InsertedStateChange();
399
401 {
402 // optimizing for the case that the last object has to be removed
403 if (nObjNum+1!=nCount) {
405 }
406 }
408 }
409 return pObj;
410}
411
413{
414 if (nObjNum >= maList.size())
415 {
416 OSL_ASSERT(nObjNum<maList.size());
417 return nullptr;
418 }
419
420 const size_t nCount = GetObjCount();
421 rtl::Reference<SdrObject> pObj=maList[nObjNum];
423
424 DBG_ASSERT(pObj!=nullptr,"Object to remove not found.");
425 if(pObj)
426 {
427 // flushViewObjectContacts() clears the VOC's and those invalidate
428 pObj->GetViewContact().flushViewObjectContacts();
429 DBG_ASSERT(pObj->IsInserted(),"The object does not have the status Inserted.");
430
431 // TODO: We need a different broadcast here.
432 if (pObj->getSdrPageFromSdrObject()!=nullptr)
433 {
435 pObj->getSdrModelFromSdrObject().Broadcast(aHint);
436 }
437
438 pObj->getSdrModelFromSdrObject().SetChanged();
439
440 // tdf#121022 Do first remove from SdrObjList - InsertedStateChange
441 // relies now on IsInserted which uses getParentSdrObjListFromSdrObject
442 pObj->setParentOfSdrObject(nullptr);
443
444 // calls, among other things, the UserCall
445 pObj->InsertedStateChange();
446
448 {
449 // optimization for the case that the last object is removed
450 if (nObjNum+1!=nCount) {
452 }
453 }
454
456 SdrObject* pParentSdrObject(getSdrObjectFromSdrObjList());
457
458 if(pParentSdrObject && !GetObjCount())
459 {
460 // empty group created; it needs to be repainted since it's
461 // visualization changes
462 pParentSdrObject->ActionChanged();
463 }
464 }
465 return pObj;
466}
467
469{
470 if (nObjNum >= maList.size())
471 {
472 OSL_ASSERT(nObjNum<maList.size());
473 return nullptr;
474 }
475 if (pNewObj == nullptr)
476 {
477 OSL_ASSERT(pNewObj!=nullptr);
478 return nullptr;
479 }
480
481 rtl::Reference<SdrObject> pObj=maList[nObjNum];
482 DBG_ASSERT(pObj!=nullptr,"SdrObjList::ReplaceObject: Could not find object to remove.");
483 if (pObj!=nullptr) {
484 DBG_ASSERT(pObj->IsInserted(),"SdrObjList::ReplaceObject: the object does not have status Inserted.");
485
486 // TODO: We need a different broadcast here.
487 if (pObj->getSdrPageFromSdrObject()!=nullptr)
488 {
490 pObj->getSdrModelFromSdrObject().Broadcast(aHint);
491 }
492
493 // Change parent and replace in SdrObjList
494 pObj->setParentOfSdrObject(nullptr);
495 ReplaceObjectInContainer(*pNewObj,nObjNum);
496
497 // tdf#121022 InsertedStateChange uses the parent
498 // to detect if pObj is inserted or not, so have to call
499 // it *after* changing these settings, else an obviously wrong
500 // 'SdrUserCallType::Inserted' would be sent
501 pObj->InsertedStateChange();
502
503 // flushViewObjectContacts() clears the VOC's and those
504 // trigger the evtl. needed invalidate(s)
505 pObj->GetViewContact().flushViewObjectContacts();
506
507 // Setup data at new SdrObject - it already *is* inserted to
508 // the SdrObjList due to 'ReplaceObjectInContainer' above
509 pNewObj->SetOrdNum(nObjNum);
510 pNewObj->setParentOfSdrObject(this);
511
512 // Inform the parent about change to allow invalidations at
513 // evtl. existing parent visualisations, but also react on
514 // newly inserted SdrObjects (as e.g. GraphCtrlUserCall does)
515 impChildInserted(*pNewObj);
516
517 pNewObj->InsertedStateChange();
518
519 // TODO: We need a different broadcast here.
520 if (pNewObj->getSdrPageFromSdrObject()!=nullptr) {
521 SdrHint aHint(SdrHintKind::ObjectInserted, *pNewObj);
522 pNewObj->getSdrModelFromSdrObject().Broadcast(aHint);
523 }
524
526
528 }
529 return pObj;
530}
531
532SdrObject* SdrObjList::SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
533{
534 if (nOldObjNum >= maList.size() || nNewObjNum >= maList.size())
535 {
536 OSL_ASSERT(nOldObjNum<maList.size());
537 OSL_ASSERT(nNewObjNum<maList.size());
538 return nullptr;
539 }
540
541 rtl::Reference<SdrObject> pObj=maList[nOldObjNum];
542 if (nOldObjNum==nNewObjNum) return pObj.get();
543 DBG_ASSERT(pObj!=nullptr,"SdrObjList::SetObjectOrdNum: Object not found.");
544 if (pObj!=nullptr) {
545 DBG_ASSERT(pObj->IsInserted(),"SdrObjList::SetObjectOrdNum: the object does not have status Inserted.");
546 RemoveObjectFromContainer(nOldObjNum);
547 InsertObjectIntoContainer(*pObj,nNewObjNum);
548
549 // No need to delete visualisation data since same object
550 // gets inserted again. Also a single ActionChanged is enough
551 pObj->ActionChanged();
552
553 pObj->SetOrdNum(nNewObjNum);
555
556 // TODO: We need a different broadcast here.
557 if (pObj->getSdrPageFromSdrObject()!=nullptr)
558 pObj->getSdrModelFromSdrObject().Broadcast(SdrHint(SdrHintKind::ObjectChange, *pObj));
559 pObj->getSdrModelFromSdrObject().SetChanged();
560 }
561 return pObj.get();
562}
563
564void SdrObjList::SetExistingObjectOrdNum(SdrObject* pObj, size_t nNewObjNum)
565{
566 assert(std::find(maList.begin(), maList.end(), pObj) != maList.end() && "This method requires that the child object already be inserted");
567 assert(pObj->IsInserted() && "SdrObjList::SetObjectOrdNum: the object does not have status Inserted.");
568
569 // I am deliberately bypassing getOrdNum() because I don't want to unnecessarily
570 // trigger RecalcObjOrdNums()
571 const sal_uInt32 nOldOrdNum = pObj->m_nOrdNum;
572 if (!mbObjOrdNumsDirty && nOldOrdNum == nNewObjNum)
573 return;
574
575 // Update the navigation positions.
577 {
578 unotools::WeakReference<SdrObject> aReference (pObj);
579 auto iObject = ::std::find(
580 mxNavigationOrder->begin(),
581 mxNavigationOrder->end(),
582 aReference);
583 mxNavigationOrder->erase(iObject);
585 // The new object does not have a user defined position so append it
586 // to the list.
588 mxNavigationOrder->push_back(pObj);
589 }
590 if (nOldOrdNum < maList.size() && maList[nOldOrdNum] == pObj)
591 maList.erase(maList.begin()+nOldOrdNum);
592 else
593 {
594 auto it = std::find(maList.begin(), maList.end(), pObj);
595 maList.erase(it);
596 }
597 // Insert object into object list. Because the insert() method requires
598 // a valid iterator as insertion position, we have to use push_back() to
599 // insert at the end of the list.
600 if (nNewObjNum >= maList.size())
601 maList.push_back(pObj);
602 else
603 maList.insert(maList.begin()+nNewObjNum, pObj);
604
606
607 // No need to delete visualisation data since same object
608 // gets inserted again. Also a single ActionChanged is enough
609 pObj->ActionChanged();
610
611 pObj->SetOrdNum(nNewObjNum);
613
614 // TODO: We need a different broadcast here.
615 if (pObj->getSdrPageFromSdrObject()!=nullptr)
618}
619
620void SdrObjList::sort( std::vector<sal_Int32>& sortOrder)
621{
622 // no negative indexes and indexes larger than maList size are allowed
623 auto it = std::find_if( sortOrder.begin(), sortOrder.end(), [this](const sal_Int32& rIt)
624 { return ( rIt < 0 || o3tl::make_unsigned(rIt) >= maList.size() ); } );
625 if ( it != sortOrder.end())
626 throw css::lang::IllegalArgumentException("negative index of shape", nullptr, 1);
627
628 // no duplicates
629 std::vector<bool> aNoDuplicates(sortOrder.size(), false);
630 for (size_t i = 0; i < sortOrder.size(); ++i )
631 {
632 size_t idx = static_cast<size_t>( sortOrder[i] );
633
634 if ( aNoDuplicates[idx] )
635 throw css::lang::IllegalArgumentException("duplicate index of shape", nullptr, 2);
636
637 aNoDuplicates[idx] = true;
638 }
639
640 // example sortOrder [2 0 1]
641 // example maList [T T S T T] ( T T = shape with textbox, S = just a shape )
642 // (shapes at positions 0 and 2 have a textbox)
643
644 std::deque<rtl::Reference<SdrObject>> aNewList(maList.size());
645 std::set<sal_Int32> aShapesWithTextbox;
646 std::vector<sal_Int32> aIncrements;
647 std::vector<sal_Int32> aDuplicates;
648
649 if ( maList.size() > 1)
650 {
651 for (size_t i = 1; i< maList.size(); ++i)
652 {
653 // if this shape is a textbox, then look at its left neighbour
654 // (shape this textbox is in)
655 // and insert the number of textboxes to the left of it
656 if (maList[i]->IsTextBox())
657 aShapesWithTextbox.insert( i - 1 - aShapesWithTextbox.size() );
658 }
659 // example aShapesWithTextbox [0 2]
660 }
661
662 if (aShapesWithTextbox.size() != maList.size() - sortOrder.size())
663 {
664 throw lang::IllegalArgumentException("mismatch of no. of shapes", nullptr, 0);
665 }
666
667 for (size_t i = 0; i< sortOrder.size(); ++i)
668 {
669
670 if (aShapesWithTextbox.count(sortOrder[i]) > 0)
671 aDuplicates.push_back(sortOrder[i]);
672
673 aDuplicates.push_back(sortOrder[i]);
674
675 // example aDuplicates [2 2 0 0 1]
676 }
677 assert(aDuplicates.size() == maList.size());
678
679 aIncrements.push_back(0);
680 for (size_t i = 1; i< sortOrder.size(); ++i)
681 {
682 if (aShapesWithTextbox.count(i - 1))
683 aIncrements.push_back(aIncrements[i-1] + 1 );
684 else
685 aIncrements.push_back(aIncrements[i-1]);
686
687 // example aIncrements [0 1 1]
688 }
689 assert(aIncrements.size() == sortOrder.size());
690
691 std::vector<sal_Int32> aNewSortOrder(maList.size());
692 sal_Int32 nPrev = -1;
693 for (size_t i = 0; i< aDuplicates.size(); ++i)
694 {
695 if (nPrev != aDuplicates[i])
696 aNewSortOrder[i] = aDuplicates[i] + aIncrements[aDuplicates[i]];
697 else
698 aNewSortOrder[i] = aNewSortOrder[i-1] + 1;
699
700 nPrev = aDuplicates[i];
701
702 // example aNewSortOrder [3 4 0 1 2]
703 }
704 assert(aNewSortOrder.size() == maList.size());
705
706#ifndef NDEBUG
707 {
708 std::vector<sal_Int32> tmp(aNewSortOrder);
709 std::sort(tmp.begin(), tmp.end());
710 for (size_t i = 0; i < tmp.size(); ++i)
711 {
712 assert(size_t(tmp[i]) == i);
713 }
714 }
715#endif
716
717 SdrModel & rModel(getSdrPageFromSdrObjList()->getSdrModelFromSdrPage());
718 bool const isUndo(rModel.IsUndoEnabled());
719 if (isUndo)
720 {
722 }
723
724 for (size_t i = 0; i < aNewSortOrder.size(); ++i)
725 {
726 aNewList[i] = maList[ aNewSortOrder[i] ];
727 aNewList[i]->SetOrdNum(i);
728 }
729
730 std::swap(aNewList, maList);
731}
732
734{
735 if (mbRectsDirty) {
736 const_cast<SdrObjList*>(this)->RecalcRects();
737 const_cast<SdrObjList*>(this)->mbRectsDirty=false;
738 }
740}
741
743{
744 // #i106183# for deep group hierarchies like in chart2, the invalidates
745 // through the hierarchy are not correct; use a 2nd hint for the needed
746 // recalculation. Future versions will have no bool flag at all, but
747 // just maSdrObjListOutRect in empty state to represent an invalid state, thus
748 // it's a step in the right direction.
750 {
751 const_cast<SdrObjList*>(this)->RecalcRects();
752 const_cast<SdrObjList*>(this)->mbRectsDirty=false;
753 }
754 return maSdrObjListOutRect;
755}
756
758{
759 size_t nCount=GetObjCount();
760 size_t nNum=0;
761
762 while (nNum<nCount)
763 {
764 SdrObject* pObj = GetObj(nNum);
765
766 pObj->NbcReformatText();
767 nCount=GetObjCount(); // ReformatText may delete an object
768 nNum++;
769 }
770
771}
772
774{
776}
777
783{
785}
786
788{
789 // #i120437# go over whole hierarchy, not only over object level null (seen from grouping)
790 for(size_t nIdx(0), nCount(rObjList.GetObjCount()); nIdx < nCount; ++nIdx)
791 {
792 SdrObject* pSdrObject(rObjList.GetObjectForNavigationPosition(nIdx));
793 const SdrObjList* pChildren(pSdrObject->getChildrenOfSdrObject());
794 const bool bIsGroup(nullptr != pChildren);
795 if(!bIsGroup)
796 {
797 if (pSdrObject->GetObjIdentifier() == SdrObjKind::Edge)
798 {
799 SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* >(pSdrObject);
800 pSdrEdgeObj->Reformat();
801 }
802 }
803 else
804 {
805 ImplReformatAllEdgeObjects(*pChildren);
806 }
807 }
808}
809
811{
812 for(size_t a = 0; a < GetObjCount(); ++a)
813 {
815 }
816}
817
819{
820 return maList.size();
821}
822
823
824SdrObject* SdrObjList::GetObj(size_t nNum) const
825{
826 if (nNum < maList.size())
827 return maList[nNum].get();
828
829 return nullptr;
830}
831
832
834{
835 bool bRet(false);
836 SdrObject* pParentSdrObject(getSdrObjectFromSdrObjList());
837
838 if(nullptr != pParentSdrObject)
839 {
840 SdrPage* pSdrPage(pParentSdrObject->getSdrPageFromSdrObject());
841
842 if(nullptr != pSdrPage)
843 {
844 bRet = pSdrPage->IsReadOnly();
845 }
846 }
847
848 return bRet;
849}
850
852{
853 const size_t nObj = GetObjCount();
854 for( size_t i = nObj; i>0; )
855 UnGroupObj(--i);
856}
857
858void SdrObjList::UnGroupObj( size_t nObjNum )
859{
860 // if the given object is no group, this method is a noop
861 SdrObject* pUngroupObj = GetObj( nObjNum );
862 if( pUngroupObj )
863 {
864 SdrObjList* pSrcLst = pUngroupObj->GetSubList();
865 if(pSrcLst)
866 if(auto pUngroupGroup = dynamic_cast<SdrObjGroup*>( pUngroupObj))
867 {
868 // ungroup recursively (has to be head recursion,
869 // otherwise our indices will get trashed when doing it in
870 // the loop)
871 pSrcLst->FlattenGroups();
872
873 // the position at which we insert the members of rUngroupGroup
874 size_t nInsertPos( pUngroupGroup->GetOrdNum() );
875
876 const size_t nCount = pSrcLst->GetObjCount();
877 for( size_t i=0; i<nCount; ++i )
878 {
879 rtl::Reference<SdrObject> pObj = pSrcLst->RemoveObject(0);
880 InsertObject(pObj.get(), nInsertPos);
881 ++nInsertPos;
882 }
883
884 RemoveObject(nInsertPos);
885 }
886 }
887#ifdef DBG_UTIL
888 else
889 OSL_FAIL("SdrObjList::UnGroupObj: object index invalid");
890#endif
891}
892
894
896 SdrObject& rObject,
897 const sal_uInt32 nNewPosition)
898{
899 // When the navigation order container has not yet been created then
900 // create one now. It is initialized with the z-order taken from
901 // maList.
903 {
904 mxNavigationOrder.emplace(maList.begin(), maList.end());
905 }
906 OSL_ASSERT(bool(mxNavigationOrder));
907 OSL_ASSERT( mxNavigationOrder->size() == maList.size());
908
909 unotools::WeakReference<SdrObject> aReference (&rObject);
910
911 // Look up the object whose navigation position is to be changed.
912 auto iObject = ::std::find(
913 mxNavigationOrder->begin(),
914 mxNavigationOrder->end(),
915 aReference);
916 if (iObject == mxNavigationOrder->end())
917 {
918 // The given object is not a member of the navigation order.
919 return;
920 }
921
922 // Move the object to its new position.
923 const sal_uInt32 nOldPosition = ::std::distance(mxNavigationOrder->begin(), iObject);
924 if (nOldPosition == nNewPosition)
925 return;
926
927 mxNavigationOrder->erase(iObject);
928 sal_uInt32 nInsertPosition (nNewPosition);
929 // Adapt insertion position for the just erased object.
930 if (nNewPosition >= nOldPosition)
931 nInsertPosition -= 1;
932 if (nInsertPosition >= mxNavigationOrder->size())
933 mxNavigationOrder->push_back(aReference);
934 else
935 mxNavigationOrder->insert(mxNavigationOrder->begin()+nInsertPosition, aReference);
936
938
939 // The navigation order is written out to file so mark the model as modified.
941}
942
943
944SdrObject* SdrObjList::GetObjectForNavigationPosition (const sal_uInt32 nNavigationPosition) const
945{
947 {
948 // There is a user defined navigation order. Make sure the object
949 // index is correct and look up the object in mxNavigationOrder.
950 if (nNavigationPosition >= mxNavigationOrder->size())
951 {
952 OSL_ASSERT(nNavigationPosition < mxNavigationOrder->size());
953 }
954 else
955 return (*mxNavigationOrder)[nNavigationPosition].get().get();
956 }
957 else
958 {
959 // There is no user defined navigation order. Use the z-order
960 // instead.
961 if (nNavigationPosition >= maList.size())
962 {
963 OSL_ASSERT(nNavigationPosition < maList.size());
964 }
965 else
966 return maList[nNavigationPosition].get();
967 }
968 return nullptr;
969}
970
971
973{
974 mxNavigationOrder.reset();
976}
977
978
980{
982 {
984 {
986
987 sal_uInt32 nIndex (0);
988 for (auto& rpObject : *mxNavigationOrder)
989 {
990 rpObject.get()->SetNavigationPosition(nIndex);
991 ++nIndex;
992 }
993 }
994 }
995
996 return bool(mxNavigationOrder);
997}
998
999
1000void SdrObjList::SetNavigationOrder (const uno::Reference<container::XIndexAccess>& rxOrder)
1001{
1002 if (rxOrder.is())
1003 {
1004 const sal_Int32 nCount = rxOrder->getCount();
1005 if (static_cast<sal_uInt32>(nCount) != maList.size())
1006 return;
1007
1008 if (!mxNavigationOrder)
1009 mxNavigationOrder = std::vector<unotools::WeakReference<SdrObject>>(nCount);
1010
1011 for (sal_Int32 nIndex=0; nIndex<nCount; ++nIndex)
1012 {
1013 uno::Reference<uno::XInterface> xShape (rxOrder->getByIndex(nIndex), uno::UNO_QUERY);
1015 if (pObject == nullptr)
1016 break;
1017 (*mxNavigationOrder)[nIndex] = pObject;
1018 }
1019
1021 }
1022 else
1023 {
1025 }
1026}
1027
1028
1030 SdrObject& rObject,
1031 const sal_uInt32 nInsertPosition)
1032{
1033 OSL_ASSERT(nInsertPosition<=maList.size());
1034
1035 // Update the navigation positions.
1037 {
1038 // The new object does not have a user defined position so append it
1039 // to the list.
1041 mxNavigationOrder->push_back(&rObject);
1042 }
1043
1044 // Insert object into object list. Because the insert() method requires
1045 // a valid iterator as insertion position, we have to use push_back() to
1046 // insert at the end of the list.
1047 if (nInsertPosition >= maList.size())
1048 maList.push_back(&rObject);
1049 else
1050 maList.insert(maList.begin()+nInsertPosition, &rObject);
1051 mbObjOrdNumsDirty=true;
1052}
1053
1054
1056 SdrObject& rNewObject,
1057 const sal_uInt32 nObjectPosition)
1058{
1059 if (nObjectPosition >= maList.size())
1060 {
1061 OSL_ASSERT(nObjectPosition<maList.size());
1062 return;
1063 }
1064
1065 // Update the navigation positions.
1067 {
1068 // A user defined position of the object that is to be replaced is
1069 // not transferred to the new object so erase the former and append
1070 // the later object from/to the navigation order.
1071 OSL_ASSERT(nObjectPosition < maList.size());
1072 unotools::WeakReference<SdrObject> aReference (maList[nObjectPosition].get());
1073 auto iObject = ::std::find(
1074 mxNavigationOrder->begin(),
1075 mxNavigationOrder->end(),
1076 aReference);
1077 if (iObject != mxNavigationOrder->end())
1078 mxNavigationOrder->erase(iObject);
1079
1080 mxNavigationOrder->push_back(&rNewObject);
1081
1083 }
1084
1085 maList[nObjectPosition] = &rNewObject;
1086 mbObjOrdNumsDirty=true;
1087}
1088
1089
1091 const sal_uInt32 nObjectPosition)
1092{
1093 if (nObjectPosition >= maList.size())
1094 {
1095 OSL_ASSERT(nObjectPosition<maList.size());
1096 return;
1097 }
1098
1099 // Update the navigation positions.
1101 {
1102 unotools::WeakReference<SdrObject> aReference (maList[nObjectPosition]);
1103 auto iObject = ::std::find(
1104 mxNavigationOrder->begin(),
1105 mxNavigationOrder->end(),
1106 aReference);
1107 if (iObject != mxNavigationOrder->end())
1108 mxNavigationOrder->erase(iObject);
1110 }
1111
1112 maList.erase(maList.begin()+nObjectPosition);
1113 mbObjOrdNumsDirty=true;
1114}
1115
1117{
1118 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrObjList"));
1119 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1120 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name()));
1121
1122 size_t nObjCount = GetObjCount();
1123 for (size_t i = 0; i < nObjCount; ++i)
1124 {
1125 if (const SdrObject* pObject = GetObj(i))
1126 pObject->dumpAsXml(pWriter);
1127 }
1128
1129 (void)xmlTextWriterEndElement(pWriter);
1130}
1131
1132
1134{
1135 sal_uInt16 nCount=GetCount();
1136 for (sal_uInt16 i=0; i<nCount; i++) {
1137 delete GetObject(i);
1138 }
1139 aList.clear();
1140}
1141
1142
1143// PageUser section
1144
1146{
1147 maPageUsers.push_back(&rNewUser);
1148}
1149
1151{
1152 const sdr::PageUserVector::iterator aFindResult = ::std::find(maPageUsers.begin(), maPageUsers.end(), &rOldUser);
1153 if(aFindResult != maPageUsers.end())
1154 {
1155 maPageUsers.erase(aFindResult);
1156 }
1157}
1158
1159
1160// DrawContact section
1161
1162std::unique_ptr<sdr::contact::ViewContact> SdrPage::CreateObjectSpecificViewContact()
1163{
1164 return std::make_unique<sdr::contact::ViewContactOfSdrPage>(*this);
1165}
1166
1168{
1169 if (!mpViewContact)
1170 const_cast<SdrPage*>(this)->mpViewContact =
1171 const_cast<SdrPage*>(this)->CreateObjectSpecificViewContact();
1172
1173 return *mpViewContact;
1174}
1175
1177{
1178 if (!mpViewContact)
1180
1181 return *mpViewContact;
1182}
1183
1185{
1186 if(mpStyleSheet)
1187 {
1189 maProperties.SetParent(nullptr);
1190 mpStyleSheet = nullptr;
1191 }
1192}
1193
1195{
1196 if(mpStyleSheet != &rNewStyleSheet)
1197 {
1199 mpStyleSheet = &rNewStyleSheet;
1200 StartListening(rNewStyleSheet);
1201 maProperties.SetParent(&rNewStyleSheet.GetItemSet());
1202 }
1203}
1204
1205static void ImpPageChange(SdrPage& rSdrPage)
1206{
1207 rSdrPage.ActionChanged();
1209 SdrHint aHint(SdrHintKind::PageOrderChange, &rSdrPage);
1210 rSdrPage.getSdrModelFromSdrPage().Broadcast(aHint);
1211}
1212
1214 : mpSdrPage(&rSdrPage)
1215 , mpStyleSheet(nullptr)
1216 , maProperties(
1217 mpSdrPage->getSdrModelFromSdrPage().GetItemPool(),
1219{
1220 if (!rSdrPage.IsMasterPage())
1221 {
1222 maProperties.Put(XFillStyleItem(drawing::FillStyle_NONE));
1223 }
1224
1225 if (rSdrPage.getSdrModelFromSdrPage().IsWriter())
1226 {
1227 mpTheme.reset(new model::Theme("Office"));
1228 auto const* pColorSet = svx::ColorSets::get().getColorSet(u"LibreOffice");
1229 if (pColorSet)
1230 {
1231 std::unique_ptr<model::ColorSet> pDefaultColorSet(new model::ColorSet(*pColorSet));
1232 mpTheme->SetColorSet(std::move(pDefaultColorSet));
1233 }
1234 }
1235}
1236
1238{
1240}
1241
1243{
1244 switch(rHint.GetId())
1245 {
1246 case SfxHintId::DataChanged :
1247 {
1248 // notify change, broadcast
1250 break;
1251 }
1252 case SfxHintId::Dying :
1253 {
1254 // Style needs to be forgotten
1256 break;
1257 }
1258 default: break;
1259 }
1260}
1261
1263{
1264 assert(mpSdrPage);
1265 return mpSdrPage->IsInserted();
1266}
1267
1268
1270{
1271 OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
1274}
1275
1277{
1278 OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
1279 maProperties.Put(rItem);
1281}
1282
1283void SdrPageProperties::ClearItem(const sal_uInt16 nWhich)
1284{
1285 maProperties.ClearItem(nWhich);
1287}
1288
1290{
1291 if(pStyleSheet)
1292 {
1293 ImpAddStyleSheet(*pStyleSheet);
1294 }
1295 else
1296 {
1298 }
1299
1301}
1302
1303void SdrPageProperties::SetTheme(std::unique_ptr<model::Theme> pTheme)
1304{
1305 mpTheme = std::move(pTheme);
1306
1307 if (mpTheme && mpTheme->GetColorSet() && mpSdrPage->IsMasterPage())
1308 {
1310 sal_uInt16 nPageCount = rModel.GetPageCount();
1311 for (sal_uInt16 nPage = 0; nPage < nPageCount; ++nPage)
1312 {
1313 SdrPage* pPage = rModel.GetPage(nPage);
1314 if (!pPage->TRG_HasMasterPage() || &pPage->TRG_GetMasterPage() != mpSdrPage)
1315 {
1316 continue;
1317 }
1318
1319 svx::ThemeColorChanger aChanger(pPage);
1320 aChanger.apply(*mpTheme->GetColorSet());
1321 }
1322 }
1323}
1324
1325std::unique_ptr<model::Theme> const& SdrPageProperties::GetTheme() const
1326{
1327 return mpTheme;
1328}
1329
1331{
1332 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrPageProperties"));
1333 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1334
1335 if (mpTheme)
1336 {
1337 mpTheme->dumpAsXml(pWriter);
1338 }
1339
1340 (void)xmlTextWriterEndElement(pWriter);
1341}
1342
1343SdrPage::SdrPage(SdrModel& rModel, bool bMasterPage)
1344: mrSdrModelFromSdrPage(rModel),
1345 mnWidth(10),
1346 mnHeight(10),
1347 mnBorderLeft(0),
1348 mnBorderUpper(0),
1349 mnBorderRight(0),
1350 mnBorderLower(0),
1351 mpLayerAdmin(new SdrLayerAdmin(&rModel.GetLayerAdmin())),
1352 nPageNum(0),
1353 mbMaster(bMasterPage),
1354 mbInserted(false),
1355 mbObjectsNotPersistent(false),
1356 mbPageBorderOnlyLeftRight(false)
1357{
1358 mpSdrPageProperties.reset(new SdrPageProperties(*this));
1359}
1360
1362{
1363 if( mxUnoPage.is() ) try
1364 {
1365 uno::Reference< lang::XComponent > xPageComponent( mxUnoPage, uno::UNO_QUERY_THROW );
1366 mxUnoPage.clear();
1367 xPageComponent->dispose();
1368 }
1369 catch( const uno::Exception& )
1370 {
1372 }
1373
1374 // tell all the registered PageUsers that the page is in destruction
1375 // This causes some (all?) PageUsers to remove themselves from the list
1376 // of page users. Therefore we have to use a copy of the list for the
1377 // iteration.
1378 sdr::PageUserVector aListCopy (maPageUsers.begin(), maPageUsers.end());
1379 for(sdr::PageUser* pPageUser : aListCopy)
1380 {
1381 DBG_ASSERT(pPageUser, "SdrPage::~SdrPage: corrupt PageUser list (!)");
1382 pPageUser->PageInDestruction(*this);
1383 }
1384
1385 // Clear the vector. This means that user do not need to call RemovePageUser()
1386 // when they get called from PageInDestruction().
1387 maPageUsers.clear();
1388
1389 mpLayerAdmin.reset();
1390
1392
1393 mpViewContact.reset();
1394 mpSdrPageProperties.reset();
1395}
1396
1397void SdrPage::lateInit(const SdrPage& rSrcPage)
1398{
1399 assert(!mpViewContact);
1400 assert(!mxUnoPage.is());
1401
1402 // copy all the local parameters to make this instance
1403 // a valid copy of source page before copying and inserting
1404 // the contained objects
1405 mbMaster = rSrcPage.mbMaster;
1407 mnWidth = rSrcPage.mnWidth;
1408 mnHeight = rSrcPage.mnHeight;
1409 mnBorderLeft = rSrcPage.mnBorderLeft;
1410 mnBorderUpper = rSrcPage.mnBorderUpper;
1411 mnBorderRight = rSrcPage.mnBorderRight;
1412 mnBorderLower = rSrcPage.mnBorderLower;
1414 nPageNum = rSrcPage.nPageNum;
1415
1416 if(rSrcPage.TRG_HasMasterPage())
1417 {
1420 }
1421 else
1422 {
1424 }
1425
1427
1428 {
1429 mpSdrPageProperties.reset(new SdrPageProperties(*this));
1430
1431 if(!IsMasterPage())
1432 {
1433 mpSdrPageProperties->PutItemSet(rSrcPage.getSdrPageProperties().GetItemSet());
1434 }
1435
1436 mpSdrPageProperties->SetStyleSheet(rSrcPage.getSdrPageProperties().GetStyleSheet());
1437 }
1438
1439 // Now copy the contained objects
1440 if(0 != rSrcPage.GetObjCount())
1441 {
1442 CopyObjects(rSrcPage);
1443 }
1444}
1445
1447{
1448 rtl::Reference<SdrPage> pClonedPage(new SdrPage(rTargetModel));
1449 pClonedPage->lateInit(*this);
1450 return pClonedPage;
1451}
1452
1453void SdrPage::SetSize(const Size& aSiz)
1454{
1455 bool bChanged(false);
1456
1457 if(aSiz.Width() != mnWidth)
1458 {
1459 mnWidth = aSiz.Width();
1460 bChanged = true;
1461 }
1462
1463 if(aSiz.Height() != mnHeight)
1464 {
1465 mnHeight = aSiz.Height();
1466 bChanged = true;
1467 }
1468
1469 if(bChanged)
1470 {
1471 SetChanged();
1472 }
1473}
1474
1476{
1477 return Size(mnWidth,mnHeight);
1478}
1479
1481{
1482 return mnWidth;
1483}
1484
1486{
1487 // square: handle like portrait format
1488 Size aSiz(GetSize());
1489 if (aSiz.Width()!=aSiz.Height()) {
1490 if ((eOri==Orientation::Portrait) == (aSiz.Width()>aSiz.Height())) {
1491 // coverity[swapped_arguments : FALSE] - this is in the correct order
1492 SetSize(Size(aSiz.Height(),aSiz.Width()));
1493 }
1494 }
1495}
1496
1498{
1499 // square: handle like portrait format
1500 Orientation eRet=Orientation::Portrait;
1501 Size aSiz(GetSize());
1502 if (aSiz.Width()>aSiz.Height()) eRet=Orientation::Landscape;
1503 return eRet;
1504}
1505
1507{
1508 return mnHeight;
1509}
1510
1511void SdrPage::SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 nLwr)
1512{
1513 bool bChanged(false);
1514
1515 if(mnBorderLeft != nLft)
1516 {
1517 mnBorderLeft = nLft;
1518 bChanged = true;
1519 }
1520
1521 if(mnBorderUpper != nUpp)
1522 {
1523 mnBorderUpper = nUpp;
1524 bChanged = true;
1525 }
1526
1527 if(mnBorderRight != nRgt)
1528 {
1529 mnBorderRight = nRgt;
1530 bChanged = true;
1531 }
1532
1533 if(mnBorderLower != nLwr)
1534 {
1535 mnBorderLower = nLwr;
1536 bChanged = true;
1537 }
1538
1539 if(bChanged)
1540 {
1541 SetChanged();
1542 }
1543}
1544
1545void SdrPage::SetLeftBorder(sal_Int32 nBorder)
1546{
1547 if(mnBorderLeft != nBorder)
1548 {
1550 SetChanged();
1551 }
1552}
1553
1554void SdrPage::SetUpperBorder(sal_Int32 nBorder)
1555{
1556 if(mnBorderUpper != nBorder)
1557 {
1559 SetChanged();
1560 }
1561}
1562
1563void SdrPage::SetRightBorder(sal_Int32 nBorder)
1564{
1565 if(mnBorderRight != nBorder)
1566 {
1568 SetChanged();
1569 }
1570}
1571
1572void SdrPage::SetLowerBorder(sal_Int32 nBorder)
1573{
1574 if(mnBorderLower != nBorder)
1575 {
1577 SetChanged();
1578 }
1579}
1580
1581sal_Int32 SdrPage::GetLeftBorder() const
1582{
1583 return mnBorderLeft;
1584}
1585
1587{
1588 return mnBorderUpper;
1589}
1590
1592{
1593 return mnBorderRight;
1594}
1595
1597{
1598 return mnBorderLower;
1599}
1600
1602{
1603 if (bIn != mbBackgroundFullSize)
1604 {
1606 SetChanged();
1607 }
1608}
1609
1611{
1612 return mbBackgroundFullSize;
1613}
1614
1615// #i68775# React on PageNum changes (from Model in most cases)
1616void SdrPage::SetPageNum(sal_uInt16 nNew)
1617{
1618 if(nNew != nPageNum)
1619 {
1620 // change
1621 nPageNum = nNew;
1622
1623 // notify visualisations, also notifies e.g. buffered MasterPages
1624 ActionChanged();
1625 }
1626}
1627
1628sal_uInt16 SdrPage::GetPageNum() const
1629{
1630 if (!mbInserted)
1631 return 0;
1632
1633 if (mbMaster) {
1634 if (getSdrModelFromSdrPage().IsMPgNumsDirty())
1636 } else {
1637 if (getSdrModelFromSdrPage().IsPagNumsDirty())
1639 }
1640 return nPageNum;
1641}
1642
1644{
1645 // For test purposes, use the new ViewContact for change
1646 // notification now.
1647 ActionChanged();
1649}
1650
1652{
1653 return const_cast< SdrPage* >(this);
1654}
1655
1656// MasterPage interface
1657
1659{
1660 if(mpMasterPageDescriptor && &(mpMasterPageDescriptor->GetUsedPage()) == &rNew)
1661 return;
1662
1665
1666 mpMasterPageDescriptor.reset(new sdr::MasterPageDescriptor(*this, rNew));
1668}
1669
1671{
1673 {
1674 SetChanged();
1675
1676 // the flushViewObjectContacts() will do needed invalidates by deleting the involved VOCs
1677 mpMasterPageDescriptor->GetUsedPage().GetViewContact().flushViewObjectContacts();
1678
1679 mpMasterPageDescriptor.reset();
1680 }
1681}
1682
1684{
1685 DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPage(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1686 return mpMasterPageDescriptor->GetUsedPage();
1687}
1688
1690{
1691 DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1692 return mpMasterPageDescriptor->GetVisibleLayers();
1693}
1694
1696{
1697 DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_SetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1698 mpMasterPageDescriptor->SetVisibleLayers(rNew);
1699}
1700
1702{
1703 DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPageDescriptorViewContact(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1704 return mpMasterPageDescriptor->GetViewContact();
1705}
1706
1707// used from SdrModel::RemoveMasterPage
1709{
1710 if(TRG_HasMasterPage())
1711 {
1712 if(&TRG_GetMasterPage() == &rRemovedPage)
1713 {
1715 }
1716 }
1717}
1718
1720{
1721 std::unordered_set<OUString> aNameSet;
1722 for (size_t no(0); no < GetObjCount(); ++no)
1723 {
1724 SdrObject* pObj(GetObj(no));
1725 if(nullptr != pObj)
1726 {
1727 if (!pObj->GetName().isEmpty())
1728 {
1729 pObj->MakeNameUnique(aNameSet);
1730 SdrObjList* pSdrObjList = pObj->GetSubList(); // group
1731 if (pSdrObjList)
1732 {
1733 SdrObject* pListObj;
1734 SdrObjListIter aIter(pSdrObjList, SdrIterMode::DeepWithGroups);
1735 while (aIter.IsMore())
1736 {
1737 pListObj = aIter.Next();
1738 pListObj->MakeNameUnique(aNameSet);
1739 }
1740 }
1741 }
1742 }
1743 }
1744}
1745
1747{
1748 return nullptr;
1749}
1750
1752{
1753 return *mpLayerAdmin;
1754}
1755
1757{
1758 return *mpLayerAdmin;
1759}
1760
1762{
1763 return OUString();
1764}
1765
1766void SdrPage::SetInserted( bool bIns )
1767{
1768 if( mbInserted == bIns )
1769 return;
1770
1771 mbInserted = bIns;
1772
1773 // #i120437# go over whole hierarchy, not only over object level null (seen from grouping)
1775
1776 while ( aIter.IsMore() )
1777 {
1778 SdrObject* pObj = aIter.Next();
1779 if ( auto pOleObj = dynamic_cast<SdrOle2Obj* >(pObj) )
1780 {
1781 if( mbInserted )
1782 pOleObj->Connect();
1783 else
1784 pOleObj->Disconnect();
1785 }
1786 }
1787}
1788
1789void SdrPage::SetUnoPage(uno::Reference<drawing::XDrawPage> const& xNewPage)
1790{
1791 mxUnoPage = xNewPage;
1792}
1793
1794uno::Reference< uno::XInterface > const & SdrPage::getUnoPage()
1795{
1796 if( !mxUnoPage.is() )
1797 {
1798 // create one
1800 }
1801
1802 return mxUnoPage;
1803}
1804
1805uno::Reference< uno::XInterface > SdrPage::createUnoPage()
1806{
1807 css::uno::Reference< css::uno::XInterface > xInt =
1808 static_cast<cppu::OWeakObject*>( new SvxFmDrawPage( this ) );
1809 return xInt;
1810}
1811
1813{
1814 return pObj->GetStyleSheet();
1815}
1816
1818// #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value
1819Color SdrPage::GetPageBackgroundColor( SdrPageView const * pView, bool bScreenDisplay ) const
1820{
1821 Color aColor;
1822
1823 if(bScreenDisplay && (!pView || pView->GetApplicationDocumentColor() == COL_AUTO))
1824 {
1825 svtools::ColorConfig aColorConfig;
1826 aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor;
1827 }
1828 else
1829 {
1830 aColor = pView->GetApplicationDocumentColor();
1831 }
1832
1833 const SfxItemSet* pBackgroundFill = &getSdrPageProperties().GetItemSet();
1834
1836 {
1837 if(drawing::FillStyle_NONE == pBackgroundFill->Get(XATTR_FILLSTYLE).GetValue())
1838 {
1839 pBackgroundFill = &TRG_GetMasterPage().getSdrPageProperties().GetItemSet();
1840 }
1841 }
1842
1843 GetDraftFillColor(*pBackgroundFill, aColor);
1844
1845 return aColor;
1846}
1847
1850// #i75566# GetBackgroundColor -> GetPageBackgroundColor
1851{
1852 return GetPageBackgroundColor( nullptr );
1853}
1854
1861 const sdr::contact::ViewObjectContact& /*rOriginal*/,
1862 const sdr::contact::DisplayInfo& /*rDisplayInfo*/,
1863 bool /*bEdit*/)
1864{
1865 // this will be handled in the application if needed
1866 return true;
1867}
1868
1870{
1871 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrPage"));
1872 SdrObjList::dumpAsXml(pWriter);
1873
1874 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("width"));
1875 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%s",
1876 BAD_CAST(OString::number(mnWidth).getStr()));
1877 (void)xmlTextWriterEndElement(pWriter);
1878 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("height"));
1879 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%s",
1880 BAD_CAST(OString::number(mnHeight).getStr()));
1881 (void)xmlTextWriterEndElement(pWriter);
1882
1884 {
1885 mpSdrPageProperties->dumpAsXml(pWriter);
1886 }
1887
1888 (void)xmlTextWriterEndElement(pWriter);
1889}
1890
1891// DrawContact support: Methods for handling Page changes
1893{
1894 // Do necessary ViewContact actions
1896
1897 // #i48535# also handle MasterPage change
1898 if(TRG_HasMasterPage())
1899 {
1901 }
1902}
1903
1905{
1906 return *mpSdrPageProperties;
1907}
1908
1910{
1911 return *mpSdrPageProperties;
1912}
1913
1915{
1917 {
1918 return mpMasterPageDescriptor->getCorrectSdrPageProperties();
1919 }
1920 else
1921 {
1922 return &getSdrPageProperties();
1923 }
1924}
1925
1926
1927/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:130
void ConnectToNode(bool bTail1, SdrObject *pObj) override
Definition: svdoedge.cxx:471
SdrObject * GetConnectedNode(bool bTail1) const override
Definition: svdoedge.cxx:495
void Reformat()
updates edges that are connected to the edges of this object as if the connected objects send a repai...
Definition: svdoedge.cxx:1661
bool isLocked() const
Definition: svdmodel.hxx:555
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1144
bool IsWriter() const
Definition: svdmodel.hxx:579
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdmodel.cxx:517
void RecalcPageNums(bool bMaster)
Definition: svdmodel.cxx:1149
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
Definition: svdmodel.cxx:548
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1869
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1879
SdrObject * Next()
Definition: svditer.hxx:63
bool IsMore() const
Definition: svditer.hxx:62
const tools::Rectangle & GetAllObjBoundRect() const
Definition: svdpage.cxx:742
void ReformatAllTextObjects()
Definition: svdpage.cxx:773
void ClearSdrObjList()
Definition: svdpage.cxx:106
void InsertObjectThenMakeNameUnique(SdrObject *pObj)
Definition: svdpage.cxx:308
virtual rtl::Reference< SdrObject > ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
Replace existing object by different one.
Definition: svdpage.cxx:468
virtual SdrPage * getSdrPageFromSdrObjList() const
Definition: svdpage.cxx:124
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
Modify ZOrder of an SdrObject.
Definition: svdpage.cxx:532
virtual ~SdrObjList()
Definition: svdpage.cxx:112
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1116
bool mbRectsDirty
Definition: svdpage.hxx:235
void ImplReformatAllEdgeObjects(const SdrObjList &)
Definition: svdpage.cxx:787
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:334
void SetObjectNavigationPosition(SdrObject &rObject, const sal_uInt32 nNewNavigationPosition)
Set the navigation position of the given object to the specified value.
Definition: svdpage.cxx:895
tools::Rectangle maSdrObjListOutRect
Definition: svdpage.hxx:228
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:824
size_t GetObjCount() const
Definition: svdpage.cxx:818
void BurnInStyleSheetAttributes()
convert attributes of the style to hard formatting
Definition: svdpage.cxx:810
virtual bool IsReadOnly() const
linked page or linked group object
Definition: svdpage.cxx:833
std::deque< rtl::Reference< SdrObject > > maList
Definition: svdpage.hxx:230
void SetSdrObjListRectsDirty()
Definition: svdpage.cxx:262
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:136
void RecalcRects()
Definition: svdpage.cxx:245
void ReplaceObjectInContainer(SdrObject &rObject, const sal_uInt32 nObjectPosition)
Replace an object in the object list.
Definition: svdpage.cxx:1055
std::optional< std::vector< unotools::WeakReference< SdrObject > > > mxNavigationOrder
This list, if it exists, defines the navigation order.
Definition: svdpage.hxx:233
SdrObjList()
Definition: svdpage.cxx:64
void SetExistingObjectOrdNum(SdrObject *pExistingObj, size_t nNewObjNum)
Modify ZOrder of an SdrObject, object must already be in the list.
Definition: svdpage.cxx:564
void RecalcObjOrdNums()
recalculate order numbers / ZIndex
Definition: svdpage.cxx:237
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:283
const tools::Rectangle & GetAllObjSnapRect() const
Definition: svdpage.cxx:733
bool HasObjectNavigationOrder() const
Return whether there is an explicit, user defined, object navigation order.
Definition: svdpage.cxx:893
void FlattenGroups()
Makes the object list flat, i.e.
Definition: svdpage.cxx:851
virtual rtl::Reference< SdrObject > NbcRemoveObject(size_t nObjNum)
remove from list without delete
Definition: svdpage.cxx:373
void impClearSdrObjList(bool bBroadcast)
Definition: svdpage.cxx:71
void RemoveObjectFromContainer(const sal_uInt32 nObjectPosition)
Remove an object from the object list.
Definition: svdpage.cxx:1090
void NbcReformatAllTextObjects()
reformat all text objects, e.g. when changing printer
Definition: svdpage.cxx:757
SdrObject * GetObjectForNavigationPosition(const sal_uInt32 nNavigationPosition) const
Return the object for the given navigation position.
Definition: svdpage.cxx:944
void UnGroupObj(size_t nObjNum)
Ungroup the object at the given index.
Definition: svdpage.cxx:858
void SetNavigationOrder(const css::uno::Reference< css::container::XIndexAccess > &rxOrder)
Set the navigation order to the one defined by the given list of XShape objects.
Definition: svdpage.cxx:1000
void ReformatAllEdgeObjects()
#103122# reformats all edge objects that are connected to other objects
Definition: svdpage.cxx:782
bool mbObjOrdNumsDirty
Definition: svdpage.hxx:234
void sort(std::vector< sal_Int32 > &sortOrder)
Definition: svdpage.cxx:620
tools::Rectangle maSdrObjListSnapRect
Definition: svdpage.hxx:229
bool RecalcNavigationPositions()
Set the navigation position of all SdrObjects to their position in the mxNavigationOrder list.
Definition: svdpage.cxx:979
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:412
bool mbIsNavigationOrderDirty
This flag is <TRUE> when the mpNavigation list has been changed but the indices of the referenced Sdr...
Definition: svdpage.hxx:238
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:130
static void impChildInserted(SdrObject const &rChild)
simple ActionChildInserted forwarder to have it on a central place
Definition: svdpage.cxx:273
void InsertObjectIntoContainer(SdrObject &rObject, const sal_uInt32 nInsertPosition)
Insert an SdrObject into maList.
Definition: svdpage.cxx:1029
void ClearObjectNavigationOrder()
Restore the navigation order to that defined by the z-order.
Definition: svdpage.cxx:972
Abstract DrawObject.
Definition: svdobj.hxx:260
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
Definition: unoshape.cxx:4003
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1599
void InsertedStateChange()
Definition: svdobj.cxx:2609
SVX_DLLPRIVATE void setParentOfSdrObject(SdrObjList *pNew)
Definition: svdobj.cxx:294
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1617
void ActionChanged() const
Definition: svdobj.cxx:273
void MakeNameUnique()
Definition: svdobj.cxx:3057
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
Definition: svdobj.cxx:869
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:715
void SetNavigationPosition(const sal_uInt32 nPosition)
Definition: svdobj.cxx:916
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:926
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:318
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1626
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2208
virtual const OUString & GetName() const
Definition: svdobj.cxx:769
virtual SdrObjList * getChildrenOfSdrObject() const
Definition: svdobj.cxx:323
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:261
sal_uInt32 m_nOrdNum
Definition: svdobj.hxx:964
void SetOrdNum(sal_uInt32 nNum)
Definition: svdobj.cxx:881
void BurnInStyleSheetAttributes()
Definition: svdobj.cxx:1806
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:626
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:279
virtual void NbcReformatText()
Definition: svdobj.cxx:1802
bool IsInserted() const
Definition: svdobj.hxx:749
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:509
SdrPageGridFrame * GetObject(sal_uInt16 i) const
Definition: svdpage.hxx:301
sal_uInt16 GetCount() const
Definition: svdpage.hxx:307
std::vector< SdrPageGridFrame * > aList
Definition: svdpage.hxx:297
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: svdpage.cxx:1242
std::unique_ptr< model::Theme > mpTheme
Definition: svdpage.hxx:320
void ImpAddStyleSheet(SfxStyleSheet &rNewStyleSheet)
Definition: svdpage.cxx:1194
const SfxItemSet & GetItemSet() const
Definition: svdpage.hxx:340
void SetStyleSheet(SfxStyleSheet *pStyleSheet)
Definition: svdpage.cxx:1289
SfxStyleSheet * mpStyleSheet
Definition: svdpage.hxx:319
SfxItemSet maProperties
Definition: svdpage.hxx:321
SdrPageProperties(SdrPage &rSdrPage)
Definition: svdpage.cxx:1213
SdrPage * mpSdrPage
Definition: svdpage.hxx:318
void PutItemSet(const SfxItemSet &rSet)
Definition: svdpage.cxx:1269
void SetTheme(std::unique_ptr< model::Theme > pTheme)
Definition: svdpage.cxx:1303
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1330
std::unique_ptr< model::Theme > const & GetTheme() const
Definition: svdpage.cxx:1325
void PutItem(const SfxPoolItem &rItem)
Definition: svdpage.cxx:1276
virtual ~SdrPageProperties() override
Definition: svdpage.cxx:1237
void ImpRemoveStyleSheet()
Definition: svdpage.cxx:1184
virtual bool isUsedByModel() const override
Definition: svdpage.cxx:1262
SfxStyleSheet * GetStyleSheet() const
Definition: svdpage.hxx:347
void ClearItem(const sal_uInt16 nWhich=0)
Definition: svdpage.cxx:1283
const Color & GetApplicationDocumentColor() const
Definition: svdpagv.hxx:251
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:377
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: svdpage.cxx:1651
std::unique_ptr< SdrLayerAdmin > mpLayerAdmin
Definition: svdpage.hxx:425
virtual void SetLeftBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1545
sal_Int32 mnBorderRight
Definition: svdpage.hxx:421
sal_Int32 mnBorderLeft
Definition: svdpage.hxx:419
virtual rtl::Reference< SdrPage > CloneSdrPage(SdrModel &rTargetModel) const
Definition: svdpage.cxx:1446
void TRG_SetMasterPage(SdrPage &rNew)
Definition: svdpage.cxx:1658
void TRG_ClearMasterPage()
Definition: svdpage.cxx:1670
void MakePageObjectsNamesUnique()
Definition: svdpage.cxx:1719
void ActionChanged()
Definition: svdpage.cxx:1892
sal_Int32 mnBorderUpper
Definition: svdpage.hxx:420
const sdr::contact::ViewContact & GetViewContact() const
Definition: svdpage.cxx:1167
sal_Int32 mnBorderLower
Definition: svdpage.hxx:422
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
Definition: svdpage.cxx:1794
bool IsInserted() const
Definition: svdpage.hxx:464
bool mbInserted
Definition: svdpage.hxx:441
virtual ~SdrPage() override
Definition: svdpage.cxx:1361
SdrPage & TRG_GetMasterPage() const
Definition: svdpage.cxx:1683
void TRG_ImpMasterPageRemoved(const SdrPage &rRemovedPage)
Definition: svdpage.cxx:1708
sal_uInt16 GetPageNum() const
Definition: svdpage.cxx:1628
sdr::PageUserVector maPageUsers
Definition: svdpage.hxx:392
virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr)
Definition: svdpage.cxx:1511
virtual void SetLowerBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1572
bool mbPageBorderOnlyLeftRight
Definition: svdpage.hxx:445
std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdpage.cxx:1162
sal_uInt16 nPageNum
Definition: svdpage.hxx:438
void SetUnoPage(css::uno::Reference< css::drawing::XDrawPage > const &)
Definition: svdpage.cxx:1789
css::uno::Reference< css::uno::XInterface > mxUnoPage
Definition: svdpage.hxx:427
tools::Long mnWidth
Definition: svdpage.hxx:417
const SdrLayerAdmin & GetLayerAdmin() const
changing the layers does not set the modified-flag!
Definition: svdpage.cxx:1751
virtual OUString GetLayoutName() const
Definition: svdpage.cxx:1761
bool mbMaster
Definition: svdpage.hxx:440
void RemovePageUser(sdr::PageUser &rOldUser)
Definition: svdpage.cxx:1150
std::unique_ptr< SdrPageProperties > mpSdrPageProperties
Definition: svdpage.hxx:426
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: svdpage.cxx:1869
bool IsMasterPage() const
Definition: svdpage.hxx:462
void SetBackgroundFullSize(bool bIn)
Definition: svdpage.cxx:1601
void lateInit(const SdrPage &rSrcPage)
Definition: svdpage.cxx:1397
Size GetSize() const
Definition: svdpage.cxx:1475
virtual const SdrPageGridFrameList * GetGridFrameList(const SdrPageView *pPV, const tools::Rectangle *pRect) const
for snap-to-grid in Writer, also for AlignObjects if 1 object is marked if pRect !...
Definition: svdpage.cxx:1746
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1586
virtual void SetRightBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1563
virtual void SetUpperBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1554
virtual Orientation GetOrientation() const
Definition: svdpage.cxx:1497
virtual bool checkVisibility(const sdr::contact::ViewObjectContact &rOriginal, const sdr::contact::DisplayInfo &rDisplayInfo, bool bEdit)
this method returns true if the object from the ViewObjectContact should be visible on this page whil...
Definition: svdpage.cxx:1860
sal_Int32 GetRightBorder() const
Definition: svdpage.cxx:1591
std::unique_ptr< sdr::MasterPageDescriptor > mpMasterPageDescriptor
Definition: svdpage.hxx:436
void AddPageUser(sdr::PageUser &rNewUser)
Definition: svdpage.cxx:1145
virtual css::uno::Reference< css::uno::XInterface > createUnoPage()
Definition: svdpage.cxx:1805
bool mbBackgroundFullSize
Background object to represent the whole page.
Definition: svdpage.hxx:423
void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet &rNew)
Definition: svdpage.cxx:1695
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1581
virtual void SetOrientation(Orientation eOri)
Definition: svdpage.cxx:1485
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
Definition: svdpage.hxx:394
void SetInserted(bool bNew=true)
Definition: svdpage.cxx:1766
bool mbObjectsNotPersistent
Definition: svdpage.hxx:442
sdr::contact::ViewContact & TRG_GetMasterPageDescriptorViewContact() const
Definition: svdpage.cxx:1701
bool TRG_HasMasterPage() const
Definition: svdpage.hxx:498
SdrPageProperties & getSdrPageProperties()
Definition: svdpage.cxx:1904
Color GetPageBackgroundColor() const
deprecated returns an averaged background color of this page
Definition: svdpage.cxx:1849
void SetPageNum(sal_uInt16 nNew)
Definition: svdpage.cxx:1616
void SetChanged()
Definition: svdpage.cxx:1643
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
Definition: svdpage.cxx:1689
bool IsBackgroundFullSize() const
Definition: svdpage.cxx:1610
const SdrPageProperties * getCorrectSdrPageProperties() const
Definition: svdpage.cxx:1914
SdrModel & getSdrModelFromSdrPage() const
Definition: svdpage.hxx:401
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1596
tools::Long GetHeight() const
Definition: svdpage.cxx:1506
tools::Long mnHeight
Definition: svdpage.hxx:418
virtual void SetSize(const Size &aSiz)
Definition: svdpage.cxx:1453
virtual SfxStyleSheet * GetTextStyleSheetForObject(SdrObject *pObj) const
Definition: svdpage.cxx:1812
tools::Long GetWidth() const
Definition: svdpage.cxx:1480
SdrPage(const SdrPage &)=delete
static std::unique_ptr< SdrUndoAction > CreateUndoSort(SdrPage &rPage, ::std::vector< sal_Int32 > const &rSortOrder)
Definition: svdundo.cxx:1689
void Broadcast(const SfxHint &rHint)
SfxHintId GetId() const
void SetParent(const SfxItemSet *pNew)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
virtual SfxItemSet & GetItemSet()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void ActionChildInserted(ViewContact &rChild)
virtual ViewContact * GetParentContact() const
virtual void ActionChanged()
ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart=true) const
static ColorSets & get()
Definition: ColorSets.cxx:26
const model::ColorSet & getColorSet(sal_uInt32 nIndex) const
Definition: ColorSets.hxx:37
void apply(model::ColorSet const &rColorSet) override
tools::Rectangle & Union(const tools::Rectangle &rRect)
constexpr bool IsEmpty() const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
int nCount
#define DBG_ASSERT(sCon, aError)
#define DBG_UNHANDLED_EXCEPTION(...)
float u
EmbeddedObjectRef * pObject
struct _xmlTextWriter * xmlTextWriterPtr
const sal_uInt16 idx[]
sal_Int32 nIndex
uno_Any a
sal_uInt16 nPos
aStr
SvGenericNameContainerMapImpl maProperties
tools::Long const nBorder
size
int i
::std::vector< PageUser * > PageUserVector
Definition: sdrpageuser.hxx:46
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
Orientation
double mnWidth
double mnHeight
static SfxItemSet & rSet
bool GetDraftFillColor(const SfxItemSet &rSet, Color &rCol)
Returns a replacement for an XFillStyle.
Definition: svdetc.cxx:241
@ Edge
OLE object.
static void ImpPageChange(SdrPage &rSdrPage)
Definition: svdpage.cxx:1205
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)