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