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 : mbObjOrdNumsDirty(false),
67  mbRectsDirty(false),
68  mbIsNavigationOrderDirty(false)
69 {
71 }
72 
73 void SdrObjList::impClearSdrObjList(bool bBroadcast)
74 {
75  SdrModel* pSdrModelFromRemovedSdrObject(nullptr);
76 
77  while(!maList.empty())
78  {
79  // remove last object from list
80  SdrObject* pObj(maList.back());
82 
83  // flushViewObjectContacts() is done since SdrObject::Free is not guaranteed
84  // to delete the object and thus refresh visualisations
85  pObj->GetViewContact().flushViewObjectContacts();
86 
87  if(bBroadcast)
88  {
89  if(nullptr == pSdrModelFromRemovedSdrObject)
90  {
91  pSdrModelFromRemovedSdrObject = &pObj->getSdrModelFromSdrObject();
92  }
93 
94  // sent remove hint (after removal, see RemoveObject())
95  // TTTT SdrPage not needed, can be accessed using SdrObject
97  pObj->getSdrModelFromSdrObject().Broadcast(aHint);
98  }
99 
100  // delete the object itself
101  SdrObject::Free( pObj );
102  }
103 
104  if(bBroadcast && nullptr != pSdrModelFromRemovedSdrObject)
105  {
106  pSdrModelFromRemovedSdrObject->SetChanged();
107  }
108 }
109 
111 {
112  // clear SdrObjects with broadcasting
113  impClearSdrObjList(true);
114 }
115 
117 {
118  // clear SdrObjects without broadcasting
119  impClearSdrObjList(false);
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 
134 void SdrObjList::CopyObjects(const SdrObjList& rSrcList)
135 {
136  // clear SdrObjects with broadcasting
137  ClearSdrObjList();
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  SdrObject* pDO(pSO->CloneSdrObject(rTargetSdrModel));
158 
159  if(nullptr != pDO)
160  {
161  NbcInsertObject(pDO, 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  const size_t nCount = GetObjCount();
238  for (size_t no=0; no<nCount; ++no) {
239  SdrObject* pObj=GetObj(no);
240  pObj->SetOrdNum(no);
241  }
242  mbObjOrdNumsDirty=false;
243 }
244 
246 {
249  const size_t nCount = GetObjCount();
250  for (size_t i=0; i<nCount; ++i) {
251  SdrObject* pObj=GetObj(i);
252  if (i==0) {
255  } else {
258  }
259  }
260 }
261 
263 {
264  mbRectsDirty=true;
265  SdrObject* pParentSdrObject(getSdrObjectFromSdrObjList());
266 
267  if(nullptr != pParentSdrObject)
268  {
269  pParentSdrObject->SetBoundAndSnapRectsDirty();
270  }
271 }
272 
274 {
276 
277  if(pParent)
278  {
279  pParent->ActionChildInserted(rChild.GetViewContact());
280  }
281 }
282 
283 void SdrObjList::NbcInsertObject(SdrObject* pObj, size_t nPos)
284 {
285  DBG_ASSERT(pObj!=nullptr,"SdrObjList::NbcInsertObject(NULL)");
286  if (pObj==nullptr)
287  return;
288 
289  DBG_ASSERT(!pObj->IsInserted(),"The object already has the status Inserted.");
290  const size_t nCount = GetObjCount();
291  if (nPos>nCount) nPos=nCount;
292  InsertObjectIntoContainer(*pObj,nPos);
293 
294  if (nPos<nCount) mbObjOrdNumsDirty=true;
295  pObj->SetOrdNum(nPos);
296  pObj->setParentOfSdrObject(this);
297 
298  // Inform the parent about change to allow invalidations at
299  // evtl. existing parent visualisations
300  impChildInserted(*pObj);
301 
302  if (!mbRectsDirty) {
303  mbRectsDirty = true;
304  }
305  pObj->InsertedStateChange(); // calls the UserCall (among others)
306 }
307 
309 {
310  std::unordered_set<rtl::OUString> aNameSet;
311  InsertObjectThenMakeNameUnique(pObj, aNameSet);
312 }
313 
314 void SdrObjList::InsertObjectThenMakeNameUnique(SdrObject* pObj, std::unordered_set<OUString>& rNameSet, size_t nPos)
315 {
316  InsertObject(pObj, nPos);
317  if (pObj->GetName().isEmpty())
318  return;
319 
320  pObj->MakeNameUnique(rNameSet);
321  SdrObjList* pSdrObjList = pObj->GetSubList(); // group
322  if (pSdrObjList)
323  {
324  SdrObject* pListObj;
325  SdrObjListIter aIter(pSdrObjList, SdrIterMode::DeepWithGroups);
326  while (aIter.IsMore())
327  {
328  pListObj = aIter.Next();
329  pListObj->MakeNameUnique(rNameSet);
330  }
331  }
332 }
333 
334 void SdrObjList::InsertObject(SdrObject* pObj, size_t nPos)
335 {
336  DBG_ASSERT(pObj!=nullptr,"SdrObjList::InsertObject(NULL)");
337 
338  if(!pObj)
339  return;
340 
341  // if anchor is used, reset it before grouping
343  {
344  const Point& rAnchorPos = pObj->GetAnchorPos();
345  if(rAnchorPos.X() || rAnchorPos.Y())
346  pObj->NbcSetAnchorPos(Point());
347  }
348 
349  // do insert to new group
350  NbcInsertObject(pObj, nPos);
351 
352  // In case the object is inserted into a group and doesn't overlap with
353  // the group's other members, it needs an own repaint.
354  SdrObject* pParentSdrObject(getSdrObjectFromSdrObjList());
355 
356  if(pParentSdrObject)
357  {
358  // only repaint here
359  pParentSdrObject->ActionChanged();
360  }
361 
362  // TODO: We need a different broadcast here!
363  // Repaint from object number ... (heads-up: GroupObj)
365  {
366  SdrHint aHint(SdrHintKind::ObjectInserted, *pObj);
367  pObj->getSdrModelFromSdrObject().Broadcast(aHint);
368  }
369 
371 }
372 
374 {
375  if (nObjNum >= maList.size())
376  {
377  OSL_ASSERT(nObjNum<maList.size());
378  return nullptr;
379  }
380 
381  const size_t nCount = GetObjCount();
382  SdrObject* pObj=maList[nObjNum];
383  RemoveObjectFromContainer(nObjNum);
384 
385  DBG_ASSERT(pObj!=nullptr,"Could not find object to remove.");
386  if (pObj!=nullptr)
387  {
388  // flushViewObjectContacts() clears the VOC's and those invalidate
390 
391  DBG_ASSERT(pObj->IsInserted(),"The object does not have the status Inserted.");
392 
393  // tdf#121022 Do first remove from SdrObjList - InsertedStateChange
394  // relies now on IsInserted which uses getParentSdrObjListFromSdrObject
395  pObj->setParentOfSdrObject(nullptr);
396 
397  // calls UserCall, among other
398  pObj->InsertedStateChange();
399 
400  if (!mbObjOrdNumsDirty)
401  {
402  // optimizing for the case that the last object has to be removed
403  if (nObjNum+1!=nCount) {
404  mbObjOrdNumsDirty=true;
405  }
406  }
408  }
409  return pObj;
410 }
411 
413 {
414  if (nObjNum >= maList.size())
415  {
416  OSL_ASSERT(nObjNum<maList.size());
417  return nullptr;
418  }
419 
420  const size_t nCount = GetObjCount();
421  SdrObject* pObj=maList[nObjNum];
422  RemoveObjectFromContainer(nObjNum);
423 
424  DBG_ASSERT(pObj!=nullptr,"Object to remove not found.");
425  if(pObj)
426  {
427  // flushViewObjectContacts() clears the VOC's and those invalidate
429  DBG_ASSERT(pObj->IsInserted(),"The object does not have the status Inserted.");
430 
431  // TODO: We need a different broadcast here.
432  if (pObj->getSdrPageFromSdrObject()!=nullptr)
433  {
434  SdrHint aHint(SdrHintKind::ObjectRemoved, *pObj);
435  pObj->getSdrModelFromSdrObject().Broadcast(aHint);
436  }
437 
439 
440  // tdf#121022 Do first remove from SdrObjList - InsertedStateChange
441  // relies now on IsInserted which uses getParentSdrObjListFromSdrObject
442  pObj->setParentOfSdrObject(nullptr);
443 
444  // calls, among other things, the UserCall
445  pObj->InsertedStateChange();
446 
447  if (!mbObjOrdNumsDirty)
448  {
449  // optimization for the case that the last object is removed
450  if (nObjNum+1!=nCount) {
451  mbObjOrdNumsDirty=true;
452  }
453  }
454 
456  SdrObject* pParentSdrObject(getSdrObjectFromSdrObjList());
457 
458  if(pParentSdrObject && !GetObjCount())
459  {
460  // empty group created; it needs to be repainted since it's
461  // visualization changes
462  pParentSdrObject->ActionChanged();
463  }
464  }
465  return pObj;
466 }
467 
469 {
470  if (nObjNum >= maList.size())
471  {
472  OSL_ASSERT(nObjNum<maList.size());
473  return nullptr;
474  }
475  if (pNewObj == nullptr)
476  {
477  OSL_ASSERT(pNewObj!=nullptr);
478  return nullptr;
479  }
480 
481  SdrObject* pObj=maList[nObjNum];
482  DBG_ASSERT(pObj!=nullptr,"SdrObjList::ReplaceObject: Could not find object to remove.");
483  if (pObj!=nullptr) {
484  DBG_ASSERT(pObj->IsInserted(),"SdrObjList::ReplaceObject: the object does not have status Inserted.");
485 
486  // TODO: We need a different broadcast here.
487  if (pObj->getSdrPageFromSdrObject()!=nullptr)
488  {
489  SdrHint aHint(SdrHintKind::ObjectRemoved, *pObj);
490  pObj->getSdrModelFromSdrObject().Broadcast(aHint);
491  }
492 
493  // Change parent and replace in SdrObjList
494  pObj->setParentOfSdrObject(nullptr);
495  ReplaceObjectInContainer(*pNewObj,nObjNum);
496 
497  // tdf#121022 InsertedStateChange uses the parent
498  // to detect if pObj is inserted or not, so have to call
499  // it *after* changing these settings, else an obviously wrong
500  // 'SdrUserCallType::Inserted' would be sent
501  pObj->InsertedStateChange();
502 
503  // flushViewObjectContacts() clears the VOC's and those
504  // trigger the evtl. needed invalidate(s)
506 
507  // Setup data at new SdrObject - it already *is* inserted to
508  // the SdrObjList due to 'ReplaceObjectInContainer' above
509  pNewObj->SetOrdNum(nObjNum);
510  pNewObj->setParentOfSdrObject(this);
511 
512  // Inform the parent about change to allow invalidations at
513  // evtl. existing parent visualisations, but also react on
514  // newly inserted SdrObjects (as e.g. GraphCtrlUserCall does)
515  impChildInserted(*pNewObj);
516 
517  pNewObj->InsertedStateChange();
518 
519  // TODO: We need a different broadcast here.
520  if (pNewObj->getSdrPageFromSdrObject()!=nullptr) {
521  SdrHint aHint(SdrHintKind::ObjectInserted, *pNewObj);
522  pNewObj->getSdrModelFromSdrObject().Broadcast(aHint);
523  }
524 
526 
528  }
529  return pObj;
530 }
531 
532 SdrObject* SdrObjList::SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
533 {
534  if (nOldObjNum >= maList.size() || nNewObjNum >= maList.size())
535  {
536  OSL_ASSERT(nOldObjNum<maList.size());
537  OSL_ASSERT(nNewObjNum<maList.size());
538  return nullptr;
539  }
540 
541  SdrObject* pObj=maList[nOldObjNum];
542  if (nOldObjNum==nNewObjNum) return pObj;
543  DBG_ASSERT(pObj!=nullptr,"SdrObjList::SetObjectOrdNum: Object not found.");
544  if (pObj!=nullptr) {
545  DBG_ASSERT(pObj->IsInserted(),"SdrObjList::SetObjectOrdNum: the object does not have status Inserted.");
546  RemoveObjectFromContainer(nOldObjNum);
547  InsertObjectIntoContainer(*pObj,nNewObjNum);
548 
549  // No need to delete visualisation data since same object
550  // gets inserted again. Also a single ActionChanged is enough
551  pObj->ActionChanged();
552 
553  pObj->SetOrdNum(nNewObjNum);
554  mbObjOrdNumsDirty=true;
555 
556  // TODO: We need a different broadcast here.
557  if (pObj->getSdrPageFromSdrObject()!=nullptr)
560  }
561  return pObj;
562 }
563 
564 void SdrObjList::SetExistingObjectOrdNum(SdrObject* pObj, size_t nNewObjNum)
565 {
566  assert(std::find(maList.begin(), maList.end(), pObj) != maList.end() && "This method requires that the child object already be inserted");
567  assert(pObj->IsInserted() && "SdrObjList::SetObjectOrdNum: the object does not have status Inserted.");
568 
569  // I am deliberately bypassing getOrdNum() because I don't want to unnecessarily
570  // trigger RecalcObjOrdNums()
571  const sal_uInt32 nOldOrdNum = pObj->m_nOrdNum;
572  if (!mbObjOrdNumsDirty && nOldOrdNum == nNewObjNum)
573  return;
574 
575  // Update the navigation positions.
577  {
578  tools::WeakReference<SdrObject> aReference (pObj);
579  auto iObject = ::std::find(
580  mxNavigationOrder->begin(),
581  mxNavigationOrder->end(),
582  aReference);
583  mxNavigationOrder->erase(iObject);
585  // The new object does not have a user defined position so append it
586  // to the list.
588  mxNavigationOrder->push_back(pObj);
589  }
590  if (nOldOrdNum < maList.size() && maList[nOldOrdNum] == pObj)
591  maList.erase(maList.begin()+nOldOrdNum);
592  else
593  {
594  auto it = std::find(maList.begin(), maList.end(), pObj);
595  maList.erase(it);
596  }
597  // Insert object into object list. Because the insert() method requires
598  // a valid iterator as insertion position, we have to use push_back() to
599  // insert at the end of the list.
600  if (nNewObjNum >= maList.size())
601  maList.push_back(pObj);
602  else
603  maList.insert(maList.begin()+nNewObjNum, pObj);
604 
605  mbObjOrdNumsDirty=true;
606 
607  // No need to delete visualisation data since same object
608  // gets inserted again. Also a single ActionChanged is enough
609  pObj->ActionChanged();
610 
611  pObj->SetOrdNum(nNewObjNum);
612  mbObjOrdNumsDirty=true;
613 
614  // TODO: We need a different broadcast here.
615  if (pObj->getSdrPageFromSdrObject()!=nullptr)
618 }
619 
620 void SdrObjList::sort( std::vector<sal_Int32>& sortOrder)
621 {
622  // no negative indexes and indexes larger than maList size are allowed
623  auto it = std::find_if( sortOrder.begin(), sortOrder.end(), [this](const sal_Int32& rIt)
624  { return ( rIt < 0 || o3tl::make_unsigned(rIt) >= maList.size() ); } );
625  if ( it != sortOrder.end())
626  throw css::lang::IllegalArgumentException("negative index of shape", nullptr, 1);
627 
628  // no duplicates
629  std::vector<bool> aNoDuplicates(sortOrder.size(), false);
630  for (size_t i = 0; i < sortOrder.size(); ++i )
631  {
632  size_t idx = static_cast<size_t>( sortOrder[i] );
633 
634  if ( aNoDuplicates[idx] )
635  throw css::lang::IllegalArgumentException("duplicate index of shape", nullptr, 2);
636 
637  aNoDuplicates[idx] = true;
638  }
639 
640  // example sortOrder [2 0 1]
641  // example maList [T T S T T] ( T T = shape with textbox, S = just a shape )
642  // (shapes at positions 0 and 2 have a textbox)
643 
644  std::vector<SdrObject*> aNewList(maList.size());
645  std::set<sal_Int32> aShapesWithTextbox;
646  std::vector<sal_Int32> aIncrements;
647  std::vector<sal_Int32> aDuplicates;
648 
649  if ( maList.size() > 1)
650  {
651  for (size_t i = 1; i< maList.size(); ++i)
652  {
653  // if this shape is a textbox, then look at its left neighbour
654  // (shape this textbox is in)
655  // and insert the number of textboxes to the left of it
656  if (maList[i]->IsTextBox())
657  aShapesWithTextbox.insert( i - 1 - aShapesWithTextbox.size() );
658  }
659  // example aShapesWithTextbox [0 2]
660  }
661 
662  if (aShapesWithTextbox.size() != maList.size() - sortOrder.size())
663  {
664  throw lang::IllegalArgumentException("mismatch of no. of shapes", nullptr, 0);
665  }
666 
667  for (size_t i = 0; i< sortOrder.size(); ++i)
668  {
669 
670  if (aShapesWithTextbox.count(sortOrder[i]) > 0)
671  aDuplicates.push_back(sortOrder[i]);
672 
673  aDuplicates.push_back(sortOrder[i]);
674 
675  // example aDuplicates [2 2 0 0 1]
676  }
677  assert(aDuplicates.size() == maList.size());
678 
679  aIncrements.push_back(0);
680  for (size_t i = 1; i< sortOrder.size(); ++i)
681  {
682  if (aShapesWithTextbox.count(i - 1))
683  aIncrements.push_back(aIncrements[i-1] + 1 );
684  else
685  aIncrements.push_back(aIncrements[i-1]);
686 
687  // example aIncrements [0 1 1]
688  }
689  assert(aIncrements.size() == sortOrder.size());
690 
691  std::vector<sal_Int32> aNewSortOrder(maList.size());
692  sal_Int32 nPrev = -1;
693  for (size_t i = 0; i< aDuplicates.size(); ++i)
694  {
695  if (nPrev != aDuplicates[i])
696  aNewSortOrder[i] = aDuplicates[i] + aIncrements[aDuplicates[i]];
697  else
698  aNewSortOrder[i] = aNewSortOrder[i-1] + 1;
699 
700  nPrev = aDuplicates[i];
701 
702  // example aNewSortOrder [3 4 0 1 2]
703  }
704  assert(aNewSortOrder.size() == maList.size());
705 
706 #ifndef NDEBUG
707  {
708  std::vector<sal_Int32> tmp(aNewSortOrder);
709  std::sort(tmp.begin(), tmp.end());
710  for (size_t i = 0; i < tmp.size(); ++i)
711  {
712  assert(size_t(tmp[i]) == i);
713  }
714  }
715 #endif
716 
717  SdrModel & rModel(getSdrPageFromSdrObjList()->getSdrModelFromSdrPage());
718  bool const isUndo(rModel.IsUndoEnabled());
719  if (isUndo)
720  {
721  rModel.BegUndo(SvxResId(STR_SortShapes));
722  }
723 
724  for (size_t i = 0; i < aNewSortOrder.size(); ++i)
725  {
726  aNewList[i] = maList[ aNewSortOrder[i] ];
727  if (isUndo && i != sal::static_int_cast<size_t>(aNewSortOrder[i]))
728  {
730  *aNewList[i], aNewSortOrder[i], i));
731  }
732  aNewList[i]->SetOrdNum(i);
733  }
734 
735  if (isUndo)
736  {
737  rModel.EndUndo();
738  }
739 
740  std::swap(aNewList, maList);
741 }
742 
744 {
745  if (mbRectsDirty) {
746  const_cast<SdrObjList*>(this)->RecalcRects();
747  const_cast<SdrObjList*>(this)->mbRectsDirty=false;
748  }
749  return maSdrObjListSnapRect;
750 }
751 
753 {
754  // #i106183# for deep group hierarchies like in chart2, the invalidates
755  // through the hierarchy are not correct; use a 2nd hint for the needed
756  // recalculation. Future versions will have no bool flag at all, but
757  // just maSdrObjListOutRect in empty state to represent an invalid state, thus
758  // it's a step in the right direction.
760  {
761  const_cast<SdrObjList*>(this)->RecalcRects();
762  const_cast<SdrObjList*>(this)->mbRectsDirty=false;
763  }
764  return maSdrObjListOutRect;
765 }
766 
768 {
769  size_t nCount=GetObjCount();
770  size_t nNum=0;
771 
772  while (nNum<nCount)
773  {
774  SdrObject* pObj = GetObj(nNum);
775 
776  pObj->NbcReformatText();
777  nCount=GetObjCount(); // ReformatText may delete an object
778  nNum++;
779  }
780 
781 }
782 
784 {
786 }
787 
793 {
794  // #i120437# go over whole hierarchy, not only over object level null (seen from grouping)
796 
797  while(aIter.IsMore())
798  {
799  SdrObject* pObj = aIter.Next();
800  if (pObj->GetObjIdentifier() != OBJ_EDGE)
801  continue;
802 
803  SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* >(pObj);
804  pSdrEdgeObj->Reformat();
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 
822 SdrObject* SdrObjList::GetObj(size_t nNum) const
823 {
824  if (nNum < maList.size())
825  return maList[nNum];
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 
856 void 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  SdrObject* pObj = pSrcLst->RemoveObject(0);
878  InsertObject(pObj, 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.
900  if (!mxNavigationOrder)
901  {
902  mxNavigationOrder.emplace(maList.begin(), maList.end());
903  }
904  OSL_ASSERT(bool(mxNavigationOrder));
905  OSL_ASSERT( mxNavigationOrder->size() == maList.size());
906 
907  tools::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 
942 SdrObject* 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();
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];
965  }
966  return nullptr;
967 }
968 
969 
971 {
972  mxNavigationOrder.reset();
974 }
975 
976 
978 {
980  {
981  if (mxNavigationOrder)
982  {
983  mbIsNavigationOrderDirty = false;
984 
985  sal_uInt32 nIndex (0);
986  for (auto& rpObject : *mxNavigationOrder)
987  {
988  rpObject->SetNavigationPosition(nIndex);
989  ++nIndex;
990  }
991  }
992  }
993 
994  return bool(mxNavigationOrder);
995 }
996 
997 
998 void 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<tools::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 
1018  mbIsNavigationOrderDirty = true;
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.
1038  rObject.SetNavigationPosition(mxNavigationOrder->size());
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  tools::WeakReference<SdrObject> aReference (maList[nObjectPosition]);
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 
1080  mbIsNavigationOrderDirty = true;
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  tools::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);
1107  mbIsNavigationOrderDirty = true;
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 
1160 std::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 
1203 static void ImpPageChange(SdrPage& rSdrPage)
1204 {
1205  rSdrPage.ActionChanged();
1206  rSdrPage.getSdrModelFromSdrPage().SetChanged();
1207  SdrHint aHint(SdrHintKind::PageOrderChange, &rSdrPage);
1208  rSdrPage.getSdrModelFromSdrPage().Broadcast(aHint);
1209 }
1210 
1212 : mpSdrPage(&rSdrPage),
1213  mpStyleSheet(nullptr),
1214  maProperties(
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 (!)");
1259  maProperties.Put(rSet);
1261 }
1262 
1264 {
1265  OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
1266  maProperties.Put(rItem);
1268 }
1269 
1270 void 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 
1290 
1291 SdrPage::SdrPage(SdrModel& rModel, bool bMasterPage)
1292 : mrSdrModelFromSdrPage(rModel),
1293  mnWidth(10),
1294  mnHeight(10),
1295  mnBorderLeft(0),
1296  mnBorderUpper(0),
1297  mnBorderRight(0),
1298  mnBorderLower(0),
1299  mpLayerAdmin(new SdrLayerAdmin(&rModel.GetLayerAdmin())),
1300  nPageNum(0),
1301  mbMaster(bMasterPage),
1302  mbInserted(false),
1303  mbObjectsNotPersistent(false),
1304  mbPageBorderOnlyLeftRight(false)
1305 {
1306  mpSdrPageProperties.reset(new SdrPageProperties(*this));
1307 }
1308 
1310 {
1311  if( mxUnoPage.is() ) try
1312  {
1313  uno::Reference< lang::XComponent > xPageComponent( mxUnoPage, uno::UNO_QUERY_THROW );
1314  mxUnoPage.clear();
1315  xPageComponent->dispose();
1316  }
1317  catch( const uno::Exception& )
1318  {
1319  DBG_UNHANDLED_EXCEPTION("svx");
1320  }
1321 
1322  // tell all the registered PageUsers that the page is in destruction
1323  // This causes some (all?) PageUsers to remove themselves from the list
1324  // of page users. Therefore we have to use a copy of the list for the
1325  // iteration.
1326  sdr::PageUserVector aListCopy (maPageUsers.begin(), maPageUsers.end());
1327  for(sdr::PageUser* pPageUser : aListCopy)
1328  {
1329  DBG_ASSERT(pPageUser, "SdrPage::~SdrPage: corrupt PageUser list (!)");
1330  pPageUser->PageInDestruction(*this);
1331  }
1332 
1333  // Clear the vector. This means that user do not need to call RemovePageUser()
1334  // when they get called from PageInDestruction().
1335  maPageUsers.clear();
1336 
1337  mpLayerAdmin.reset();
1338 
1340 
1341  mpViewContact.reset();
1342  mpSdrPageProperties.reset();
1343 }
1344 
1345 void SdrPage::lateInit(const SdrPage& rSrcPage)
1346 {
1347  assert(!mpViewContact);
1348  assert(!mxUnoPage.is());
1349 
1350  // copy all the local parameters to make this instance
1351  // a valid copy of source page before copying and inserting
1352  // the contained objects
1353  mbMaster = rSrcPage.mbMaster;
1355  mnWidth = rSrcPage.mnWidth;
1356  mnHeight = rSrcPage.mnHeight;
1357  mnBorderLeft = rSrcPage.mnBorderLeft;
1358  mnBorderUpper = rSrcPage.mnBorderUpper;
1359  mnBorderRight = rSrcPage.mnBorderRight;
1360  mnBorderLower = rSrcPage.mnBorderLower;
1362  nPageNum = rSrcPage.nPageNum;
1363 
1364  if(rSrcPage.TRG_HasMasterPage())
1365  {
1368  }
1369  else
1370  {
1372  }
1373 
1375 
1376  {
1377  mpSdrPageProperties.reset(new SdrPageProperties(*this));
1378 
1379  if(!IsMasterPage())
1380  {
1381  mpSdrPageProperties->PutItemSet(rSrcPage.getSdrPageProperties().GetItemSet());
1382  }
1383 
1384  mpSdrPageProperties->SetStyleSheet(rSrcPage.getSdrPageProperties().GetStyleSheet());
1385  }
1386 
1387  // Now copy the contained objects
1388  if(0 != rSrcPage.GetObjCount())
1389  {
1390  CopyObjects(rSrcPage);
1391  }
1392 }
1393 
1395 {
1396  rtl::Reference<SdrPage> pClonedPage(new SdrPage(rTargetModel));
1397  pClonedPage->lateInit(*this);
1398  return pClonedPage;
1399 }
1400 
1401 void SdrPage::SetSize(const Size& aSiz)
1402 {
1403  bool bChanged(false);
1404 
1405  if(aSiz.Width() != mnWidth)
1406  {
1407  mnWidth = aSiz.Width();
1408  bChanged = true;
1409  }
1410 
1411  if(aSiz.Height() != mnHeight)
1412  {
1413  mnHeight = aSiz.Height();
1414  bChanged = true;
1415  }
1416 
1417  if(bChanged)
1418  {
1419  SetChanged();
1420  }
1421 }
1422 
1424 {
1425  return Size(mnWidth,mnHeight);
1426 }
1427 
1428 sal_Int32 SdrPage::GetWidth() const
1429 {
1430  return mnWidth;
1431 }
1432 
1434 {
1435  // square: handle like portrait format
1436  Size aSiz(GetSize());
1437  if (aSiz.Width()!=aSiz.Height()) {
1438  if ((eOri==Orientation::Portrait) == (aSiz.Width()>aSiz.Height())) {
1439  // coverity[swapped_arguments : FALSE] - this is in the correct order
1440  SetSize(Size(aSiz.Height(),aSiz.Width()));
1441  }
1442  }
1443 }
1444 
1446 {
1447  // square: handle like portrait format
1448  Orientation eRet=Orientation::Portrait;
1449  Size aSiz(GetSize());
1450  if (aSiz.Width()>aSiz.Height()) eRet=Orientation::Landscape;
1451  return eRet;
1452 }
1453 
1454 sal_Int32 SdrPage::GetHeight() const
1455 {
1456  return mnHeight;
1457 }
1458 
1459 void SdrPage::SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 nLwr)
1460 {
1461  bool bChanged(false);
1462 
1463  if(mnBorderLeft != nLft)
1464  {
1465  mnBorderLeft = nLft;
1466  bChanged = true;
1467  }
1468 
1469  if(mnBorderUpper != nUpp)
1470  {
1471  mnBorderUpper = nUpp;
1472  bChanged = true;
1473  }
1474 
1475  if(mnBorderRight != nRgt)
1476  {
1477  mnBorderRight = nRgt;
1478  bChanged = true;
1479  }
1480 
1481  if(mnBorderLower != nLwr)
1482  {
1483  mnBorderLower = nLwr;
1484  bChanged = true;
1485  }
1486 
1487  if(bChanged)
1488  {
1489  SetChanged();
1490  }
1491 }
1492 
1493 void SdrPage::SetLeftBorder(sal_Int32 nBorder)
1494 {
1495  if(mnBorderLeft != nBorder)
1496  {
1497  mnBorderLeft = nBorder;
1498  SetChanged();
1499  }
1500 }
1501 
1502 void SdrPage::SetUpperBorder(sal_Int32 nBorder)
1503 {
1504  if(mnBorderUpper != nBorder)
1505  {
1506  mnBorderUpper = nBorder;
1507  SetChanged();
1508  }
1509 }
1510 
1511 void SdrPage::SetRightBorder(sal_Int32 nBorder)
1512 {
1513  if(mnBorderRight != nBorder)
1514  {
1515  mnBorderRight=nBorder;
1516  SetChanged();
1517  }
1518 }
1519 
1520 void SdrPage::SetLowerBorder(sal_Int32 nBorder)
1521 {
1522  if(mnBorderLower != nBorder)
1523  {
1524  mnBorderLower=nBorder;
1525  SetChanged();
1526  }
1527 }
1528 
1529 sal_Int32 SdrPage::GetLeftBorder() const
1530 {
1531  return mnBorderLeft;
1532 }
1533 
1534 sal_Int32 SdrPage::GetUpperBorder() const
1535 {
1536  return mnBorderUpper;
1537 }
1538 
1539 sal_Int32 SdrPage::GetRightBorder() const
1540 {
1541  return mnBorderRight;
1542 }
1543 
1544 sal_Int32 SdrPage::GetLowerBorder() const
1545 {
1546  return mnBorderLower;
1547 }
1548 
1550 {
1551  if (bIn != mbBackgroundFullSize)
1552  {
1553  mbBackgroundFullSize = bIn;
1554  SetChanged();
1555  }
1556 }
1557 
1559 {
1560  return mbBackgroundFullSize;
1561 }
1562 
1563 // #i68775# React on PageNum changes (from Model in most cases)
1564 void SdrPage::SetPageNum(sal_uInt16 nNew)
1565 {
1566  if(nNew != nPageNum)
1567  {
1568  // change
1569  nPageNum = nNew;
1570 
1571  // notify visualisations, also notifies e.g. buffered MasterPages
1572  ActionChanged();
1573  }
1574 }
1575 
1576 sal_uInt16 SdrPage::GetPageNum() const
1577 {
1578  if (!mbInserted)
1579  return 0;
1580 
1581  if (mbMaster) {
1582  if (getSdrModelFromSdrPage().IsMPgNumsDirty())
1584  } else {
1585  if (getSdrModelFromSdrPage().IsPagNumsDirty())
1587  }
1588  return nPageNum;
1589 }
1590 
1592 {
1593  // For test purposes, use the new ViewContact for change
1594  // notification now.
1595  ActionChanged();
1597 }
1598 
1600 {
1601  return const_cast< SdrPage* >(this);
1602 }
1603 
1604 // MasterPage interface
1605 
1607 {
1608  if(mpMasterPageDescriptor && &(mpMasterPageDescriptor->GetUsedPage()) == &rNew)
1609  return;
1610 
1613 
1614  mpMasterPageDescriptor.reset(new sdr::MasterPageDescriptor(*this, rNew));
1616 }
1617 
1619 {
1621  {
1622  SetChanged();
1623 
1624  // the flushViewObjectContacts() will do needed invalidates by deleting the involved VOCs
1625  mpMasterPageDescriptor->GetUsedPage().GetViewContact().flushViewObjectContacts();
1626 
1627  mpMasterPageDescriptor.reset();
1628  }
1629 }
1630 
1632 {
1633  DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPage(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1634  return mpMasterPageDescriptor->GetUsedPage();
1635 }
1636 
1638 {
1639  DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1640  return mpMasterPageDescriptor->GetVisibleLayers();
1641 }
1642 
1644 {
1645  DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_SetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1646  mpMasterPageDescriptor->SetVisibleLayers(rNew);
1647 }
1648 
1650 {
1651  DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPageDescriptorViewContact(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1652  return mpMasterPageDescriptor->GetViewContact();
1653 }
1654 
1655 // used from SdrModel::RemoveMasterPage
1657 {
1658  if(TRG_HasMasterPage())
1659  {
1660  if(&TRG_GetMasterPage() == &rRemovedPage)
1661  {
1663  }
1664  }
1665 }
1666 
1668 {
1669  std::unordered_set<OUString> aNameSet;
1670  for (size_t no(0); no < GetObjCount(); ++no)
1671  {
1672  SdrObject* pObj(GetObj(no));
1673  if(nullptr != pObj)
1674  {
1675  if (!pObj->GetName().isEmpty())
1676  {
1677  pObj->MakeNameUnique(aNameSet);
1678  SdrObjList* pSdrObjList = pObj->GetSubList(); // group
1679  if (pSdrObjList)
1680  {
1681  SdrObject* pListObj;
1682  SdrObjListIter aIter(pSdrObjList, SdrIterMode::DeepWithGroups);
1683  while (aIter.IsMore())
1684  {
1685  pListObj = aIter.Next();
1686  pListObj->MakeNameUnique(aNameSet);
1687  }
1688  }
1689  }
1690  }
1691  }
1692 }
1693 
1694 const SdrPageGridFrameList* SdrPage::GetGridFrameList(const SdrPageView* /*pPV*/, const tools::Rectangle* /*pRect*/) const
1695 {
1696  return nullptr;
1697 }
1698 
1700 {
1701  return *mpLayerAdmin;
1702 }
1703 
1705 {
1706  return *mpLayerAdmin;
1707 }
1708 
1709 OUString SdrPage::GetLayoutName() const
1710 {
1711  return OUString();
1712 }
1713 
1714 void SdrPage::SetInserted( bool bIns )
1715 {
1716  if( mbInserted == bIns )
1717  return;
1718 
1719  mbInserted = bIns;
1720 
1721  // #i120437# go over whole hierarchy, not only over object level null (seen from grouping)
1723 
1724  while ( aIter.IsMore() )
1725  {
1726  SdrObject* pObj = aIter.Next();
1727  if ( auto pOleObj = dynamic_cast<SdrOle2Obj* >(pObj) )
1728  {
1729  if( mbInserted )
1730  pOleObj->Connect();
1731  else
1732  pOleObj->Disconnect();
1733  }
1734  }
1735 }
1736 
1737 void SdrPage::SetUnoPage(uno::Reference<drawing::XDrawPage> const& xNewPage)
1738 {
1739  mxUnoPage = xNewPage;
1740 }
1741 
1742 uno::Reference< uno::XInterface > const & SdrPage::getUnoPage()
1743 {
1744  if( !mxUnoPage.is() )
1745  {
1746  // create one
1748  }
1749 
1750  return mxUnoPage;
1751 }
1752 
1753 uno::Reference< uno::XInterface > SdrPage::createUnoPage()
1754 {
1755  css::uno::Reference< css::uno::XInterface > xInt =
1756  static_cast<cppu::OWeakObject*>( new SvxFmDrawPage( this ) );
1757  return xInt;
1758 }
1759 
1761 {
1762  return pObj->GetStyleSheet();
1763 }
1764 
1766 // #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value
1767 Color SdrPage::GetPageBackgroundColor( SdrPageView const * pView, bool bScreenDisplay ) const
1768 {
1769  Color aColor;
1770 
1771  if(bScreenDisplay && (!pView || pView->GetApplicationDocumentColor() == COL_AUTO))
1772  {
1773  svtools::ColorConfig aColorConfig;
1774  aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor;
1775  }
1776  else
1777  {
1778  aColor = pView->GetApplicationDocumentColor();
1779  }
1780 
1781  const SfxItemSet* pBackgroundFill = &getSdrPageProperties().GetItemSet();
1782 
1783  if(!IsMasterPage() && TRG_HasMasterPage())
1784  {
1785  if(drawing::FillStyle_NONE == pBackgroundFill->Get(XATTR_FILLSTYLE).GetValue())
1786  {
1787  pBackgroundFill = &TRG_GetMasterPage().getSdrPageProperties().GetItemSet();
1788  }
1789  }
1790 
1791  GetDraftFillColor(*pBackgroundFill, aColor);
1792 
1793  return aColor;
1794 }
1795 
1798 // #i75566# GetBackgroundColor -> GetPageBackgroundColor
1799 {
1800  return GetPageBackgroundColor( nullptr );
1801 }
1802 
1809  const sdr::contact::ViewObjectContact& /*rOriginal*/,
1810  const sdr::contact::DisplayInfo& /*rDisplayInfo*/,
1811  bool /*bEdit*/)
1812 {
1813  // this will be handled in the application if needed
1814  return true;
1815 }
1816 
1817 // DrawContact support: Methods for handling Page changes
1819 {
1820  // Do necessary ViewContact actions
1822 
1823  // #i48535# also handle MasterPage change
1824  if(TRG_HasMasterPage())
1825  {
1827  }
1828 }
1829 
1831 {
1832  return *mpSdrPageProperties;
1833 }
1834 
1836 {
1837  return *mpSdrPageProperties;
1838 }
1839 
1841 {
1843  {
1844  return mpMasterPageDescriptor->getCorrectSdrPageProperties();
1845  }
1846  else
1847  {
1848  return &getSdrPageProperties();
1849  }
1850 }
1851 
1852 
1853 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetUnoPage(css::uno::Reference< css::drawing::XDrawPage > const &)
Definition: svdpage.cxx:1737
SdrPage & TRG_GetMasterPage() const
Definition: svdpage.cxx:1631
void AddPageUser(sdr::PageUser &rNewUser)
Definition: svdpage.cxx:1143
double mnHeight
std::unique_ptr< sdr::MasterPageDescriptor > mpMasterPageDescriptor
Definition: svdpage.hxx:425
void SetNavigationPosition(const sal_uInt32 nPosition)
Definition: svdobj.cxx:947
::std::vector< PageUser * > PageUserVector
Definition: sdrpageuser.hxx:46
sal_Int32 mnWidth
Definition: svdpage.hxx:406
sal_Int32 nIndex
tools::Rectangle maSdrObjListOutRect
Definition: svdpage.hxx:225
void UnGroupObj(size_t nObjNum)
Ungroup the object at the given index.
Definition: svdpage.cxx:856
virtual void SetSize(const Size &aSiz)
Definition: svdpage.cxx:1401
SdrPageProperties(SdrPage &rSdrPage)
Definition: svdpage.cxx:1211
void NbcReformatAllTextObjects()
reformat all text objects, e.g. when changing printer
Definition: svdpage.cxx:767
virtual ~SdrObjList()
Definition: svdpage.cxx:116
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:957
Color GetPageBackgroundColor() const
deprecated returns an averaged background color of this page
Definition: svdpage.cxx:1797
sdr::PageUserVector maPageUsers
Definition: svdpage.hxx:381
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int32 GetHeight() const
Definition: svdpage.cxx:1454
void ClearItem(const sal_uInt16 nWhich=0)
Definition: svdpage.cxx:1270
void impClearSdrObjList(bool bBroadcast)
Definition: svdpage.cxx:73
virtual void SetOrientation(Orientation eOri)
Definition: svdpage.cxx:1433
sal_uInt32 m_nOrdNum
Definition: svdobj.hxx:955
void ReplaceObjectInContainer(SdrObject &rObject, const sal_uInt32 nObjectPosition)
Replace an object in the object list.
Definition: svdpage.cxx:1053
const tools::Rectangle & GetAllObjBoundRect() const
Definition: svdpage.cxx:752
virtual ViewContact * GetParentContact() const
virtual Orientation GetOrientation() const
Definition: svdpage.cxx:1445
bool mbObjOrdNumsDirty
Definition: svdpage.hxx:231
SdrPage(const SdrPage &)=delete
void PutItem(const SfxPoolItem &rItem)
Definition: svdpage.cxx:1263
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
sal_Int32 mnBorderRight
Definition: svdpage.hxx:410
virtual void SetLeftBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1493
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
Definition: unoshape.cxx:4009
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:283
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: svdpage.cxx:1229
virtual rtl::Reference< SdrPage > CloneSdrPage(SdrModel &rTargetModel) const
Definition: svdpage.cxx:1394
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:822
sal_Int32 GetRightBorder() const
Definition: svdpage.cxx:1539
void RecalcObjOrdNums()
recalculate order numbers / ZIndex
Definition: svdpage.cxx:235
bool IsInserted() const
Definition: svdobj.hxx:742
void RecalcPageNums(bool bMaster)
Definition: svdmodel.cxx:1157
size_t GetObjCount() const
Definition: svdpage.cxx:816
void MakePageObjectsNamesUnique()
Definition: svdpage.cxx:1667
SdrObject * GetObjectForNavigationPosition(const sal_uInt32 nNavigationPosition) const
Return the object for the given navigation position.
Definition: svdpage.cxx:942
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:134
virtual bool isUsedByModel() const override
Definition: svdpage.cxx:1249
bool mbRectsDirty
Definition: svdpage.hxx:232
void TRG_ClearMasterPage()
Definition: svdpage.cxx:1618
std::optional< std::vector< tools::WeakReference< SdrObject > > > mxNavigationOrder
This list, if it exists, defines the navigation order.
Definition: svdpage.hxx:230
virtual SfxItemSet & GetItemSet()
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:471
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:659
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1544
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:334
virtual css::uno::Reference< css::uno::XInterface > createUnoPage()
Definition: svdpage.cxx:1753
EmbeddedObjectRef * pObject
SVX_DLLPRIVATE void setParentOfSdrObject(SdrObjList *pNew)
Definition: svdobj.cxx:284
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:1808
void ImpAddStyleSheet(SfxStyleSheet &rNewStyleSheet)
Definition: svdpage.cxx:1192
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:748
void BegUndo()
Definition: svdmodel.cxx:366
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1529
SfxHintId GetId() const
SfxStyleSheet * mpStyleSheet
Definition: svdpage.hxx:314
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:251
void ConnectToNode(bool bTail1, SdrObject *pObj) override
Definition: svdoedge.cxx:471
virtual ~SdrPage() override
Definition: svdpage.cxx:1309
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1666
constexpr tools::Long Width() const
void SetExistingObjectOrdNum(SdrObject *pExistingObj, size_t nNewObjNum)
Modify ZOrder of an SdrObject, object must already be in the list.
Definition: svdpage.cxx:564
virtual bool IsReadOnly() const
linked page or linked group object
Definition: svdpage.cxx:831
void RemoveObjectFromContainer(const sal_uInt32 nObjectPosition)
Remove an object from the object list.
Definition: svdpage.cxx:1088
bool IsMore() const
Definition: svditer.hxx:62
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:269
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdmodel.cxx:500
int nCount
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
css::uno::Reference< css::uno::XInterface > mxUnoPage
Definition: svdpage.hxx:416
bool mbInserted
Definition: svdpage.hxx:430
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2225
bool isLocked() const
Definition: svdmodel.hxx:549
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: svdpage.cxx:1599
void MakeNameUnique()
Definition: svdobj.cxx:3085
std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdpage.cxx:1160
void BurnInStyleSheetAttributes()
Definition: svdobj.cxx:1846
sal_Int32 mnBorderLeft
Definition: svdpage.hxx:408
sal_Int32 mnBorderUpper
Definition: svdpage.hxx:409
SvGenericNameContainerMapImpl maProperties
void ReformatAllTextObjects()
Definition: svdpage.cxx:783
void TRG_SetMasterPage(SdrPage &rNew)
Definition: svdpage.cxx:1606
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1152
void RemovePageUser(sdr::PageUser &rOldUser)
Definition: svdpage.cxx:1148
const Color & GetApplicationDocumentColor() const
Definition: svdpagv.hxx:251
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:510
SdrObject * GetConnectedNode(bool bTail1) const override
Definition: svdoedge.cxx:495
void SetStyleSheet(SfxStyleSheet *pStyleSheet)
Definition: svdpage.cxx:1276
constexpr bool IsEmpty() const
void ReformatAllEdgeObjects()
#103122# reformats all edge objects that are connected to other objects
Definition: svdpage.cxx:792
void SetPageNum(sal_uInt16 nNew)
Definition: svdpage.cxx:1564
#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:1694
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
std::vector< SdrObject * > maList
Definition: svdpage.hxx:227
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:531
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1114
virtual SfxStyleSheet * GetTextStyleSheetForObject(SdrObject *pObj) const
Definition: svdpage.cxx:1760
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
Definition: svdpage.cxx:1637
Size GetSize() const
Definition: svdpage.cxx:1423
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1534
void SetBackgroundFullSize(bool bIn)
Definition: svdpage.cxx:1549
void ActionChanged() const
Definition: svdobj.cxx:263
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)
virtual void SetUpperBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1502
static void ImpPageChange(SdrPage &rSdrPage)
Definition: svdpage.cxx:1203
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:279
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:900
const SdrLayerAdmin & GetLayerAdmin() const
changing the layers does not set the modified-flag!
Definition: svdpage.cxx:1699
size
bool HasObjectNavigationOrder() const
Return whether there is an explicit, user defined, object navigation order.
Definition: svdpage.cxx:891
bool IsMasterPage() const
Definition: svdpage.hxx:451
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:1709
SdrPageProperties & getSdrPageProperties()
Definition: svdpage.cxx:1830
void InsertObjectThenMakeNameUnique(SdrObject *pObj)
Definition: svdpage.cxx:308
bool TRG_HasMasterPage() const
Definition: svdpage.hxx:487
virtual SdrObject * NbcRemoveObject(size_t nObjNum)
remove from list without delete
Definition: svdpage.cxx:373
void flushViewObjectContacts(bool bWithHierarchy=true)
virtual ~SdrPageProperties() override
Definition: svdpage.cxx:1224
Abstract DrawObject.
Definition: svdobj.hxx:259
virtual void ActionChanged()
virtual SdrObject * RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:412
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
Definition: svdmodel.cxx:1850
OUString GetName() const
Definition: svdobj.cxx:802
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:893
void EndUndo()
Definition: svdmodel.cxx:437
void SetParent(const SfxItemSet *pNew)
virtual void SetRightBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1511
void lateInit(const SdrPage &rSrcPage)
Definition: svdpage.cxx:1345
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:1842
virtual void SetLowerBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1520
SdrObject * Next()
Definition: svditer.hxx:63
void ActionChanged()
Definition: svdpage.cxx:1818
void InsertedStateChange()
Definition: svdobj.cxx:2621
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Broadcast(const SfxHint &rHint)
void SetInserted(bool bNew=true)
Definition: svdpage.cxx:1714
void sort(std::vector< sal_Int32 > &sortOrder)
Definition: svdpage.cxx:620
sdr::contact::ViewContact & TRG_GetMasterPageDescriptorViewContact() const
Definition: svdpage.cxx:1649
bool IsInserted() const
Definition: svdpage.hxx:453
void BurnInStyleSheetAttributes()
convert attributes of the style to hard formatting
Definition: svdpage.cxx:808
virtual SdrObject * ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
Replace existing object by different one.
Definition: svdpage.cxx:468
void TRG_ImpMasterPageRemoved(const SdrPage &rRemovedPage)
Definition: svdpage.cxx:1656
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:1165
constexpr tools::Long Height() const
bool RecalcNavigationPositions()
Set the navigation position of all SdrObjects to their position in the mxNavigationOrder list...
Definition: svdpage.cxx:977
void ClearSdrObjList()
Definition: svdpage.cxx:110
void SetOrdNum(sal_uInt32 nNum)
Definition: svdobj.cxx:912
SfxStyleSheet * GetStyleSheet() const
Definition: svdpage.hxx:341
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
Definition: svdpage.cxx:1742
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:970
const SdrPageProperties * getCorrectSdrPageProperties() const
Definition: svdpage.cxx:1840
double mnWidth
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
virtual SdrPage * getSdrPageFromSdrObjList() const
Definition: svdpage.cxx:122
static void impChildInserted(SdrObject const &rChild)
simple ActionChildInserted forwarder to have it on a central place
Definition: svdpage.cxx:273
void SetSdrObjListRectsDirty()
Definition: svdpage.cxx:262
void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet &rNew)
Definition: svdpage.cxx:1643
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectOrdNum(SdrObject &rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
Definition: svdundo.cxx:1666
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1657
void InsertObjectIntoContainer(SdrObject &rObject, const sal_uInt32 nInsertPosition)
Insert an SdrObject into maList.
Definition: svdpage.cxx:1027
SdrObjList()
Definition: svdpage.cxx:65
virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr)
Definition: svdpage.cxx:1459
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:1639
void ImpRemoveStyleSheet()
Definition: svdpage.cxx:1182
bool mbPageBorderOnlyLeftRight
Definition: svdpage.hxx:434
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
Modify ZOrder of an SdrObject.
Definition: svdpage.cxx:532
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
bool IsBackgroundFullSize() const
Definition: svdpage.cxx:1558
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:1428
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:305
std::unique_ptr< SdrPageProperties > mpSdrPageProperties
Definition: svdpage.hxx:415
tools::Rectangle maSdrObjListSnapRect
Definition: svdpage.hxx:226
bool GetDraftFillColor(const SfxItemSet &rSet, Color &rCol)
Returns a replacement for an XFillStyle.
Definition: svdetc.cxx:241
sal_uInt16 GetPageNum() const
Definition: svdpage.cxx:1576
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:743
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:128
void SetChanged()
Definition: svdpage.cxx:1591
aStr
void RecalcRects()
Definition: svdpage.cxx:245
void PutItemSet(const SfxItemSet &rSet)
Definition: svdpage.cxx:1256
void FlattenGroups()
Makes the object list flat, i.e.
Definition: svdpage.cxx:849
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:129
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo