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