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  if (nNum < maList.size())
773  return maList[nNum];
774 
775  return nullptr;
776 }
777 
778 
780 {
781  bool bRet(false);
782  SdrObject* pParentSdrObject(getSdrObjectFromSdrObjList());
783 
784  if(nullptr != pParentSdrObject)
785  {
786  SdrPage* pSdrPage(pParentSdrObject->getSdrPageFromSdrObject());
787 
788  if(nullptr != pSdrPage)
789  {
790  bRet = pSdrPage->IsReadOnly();
791  }
792  }
793 
794  return bRet;
795 }
796 
798 {
799  const size_t nObj = GetObjCount();
800  for( size_t i = nObj; i>0; )
801  UnGroupObj(--i);
802 }
803 
804 void SdrObjList::UnGroupObj( size_t nObjNum )
805 {
806  // if the given object is no group, this method is a noop
807  SdrObject* pUngroupObj = GetObj( nObjNum );
808  if( pUngroupObj )
809  {
810  SdrObjList* pSrcLst = pUngroupObj->GetSubList();
811  if(pSrcLst)
812  if(auto pUngroupGroup = dynamic_cast<SdrObjGroup*>( pUngroupObj))
813  {
814  // ungroup recursively (has to be head recursion,
815  // otherwise our indices will get trashed when doing it in
816  // the loop)
817  pSrcLst->FlattenGroups();
818 
819  // the position at which we insert the members of rUngroupGroup
820  size_t nInsertPos( pUngroupGroup->GetOrdNum() );
821 
822  const size_t nCount = pSrcLst->GetObjCount();
823  for( size_t i=0; i<nCount; ++i )
824  {
825  SdrObject* pObj = pSrcLst->RemoveObject(0);
826  InsertObject(pObj, nInsertPos);
827  ++nInsertPos;
828  }
829 
830  RemoveObject(nInsertPos);
831  }
832  }
833 #ifdef DBG_UTIL
834  else
835  OSL_FAIL("SdrObjList::UnGroupObj: object index invalid");
836 #endif
837 }
838 
840 
842  SdrObject& rObject,
843  const sal_uInt32 nNewPosition)
844 {
845  // When the navigation order container has not yet been created then
846  // create one now. It is initialized with the z-order taken from
847  // maList.
848  if (!mxNavigationOrder)
849  {
850  mxNavigationOrder.emplace(maList.begin(), maList.end());
851  }
852  OSL_ASSERT(bool(mxNavigationOrder));
853  OSL_ASSERT( mxNavigationOrder->size() == maList.size());
854 
855  tools::WeakReference<SdrObject> aReference (&rObject);
856 
857  // Look up the object whose navigation position is to be changed.
858  auto iObject = ::std::find(
859  mxNavigationOrder->begin(),
860  mxNavigationOrder->end(),
861  aReference);
862  if (iObject == mxNavigationOrder->end())
863  {
864  // The given object is not a member of the navigation order.
865  return;
866  }
867 
868  // Move the object to its new position.
869  const sal_uInt32 nOldPosition = ::std::distance(mxNavigationOrder->begin(), iObject);
870  if (nOldPosition == nNewPosition)
871  return;
872 
873  mxNavigationOrder->erase(iObject);
874  sal_uInt32 nInsertPosition (nNewPosition);
875  // Adapt insertion position for the just erased object.
876  if (nNewPosition >= nOldPosition)
877  nInsertPosition -= 1;
878  if (nInsertPosition >= mxNavigationOrder->size())
879  mxNavigationOrder->push_back(aReference);
880  else
881  mxNavigationOrder->insert(mxNavigationOrder->begin()+nInsertPosition, aReference);
882 
884 
885  // The navigation order is written out to file so mark the model as modified.
887 }
888 
889 
890 SdrObject* SdrObjList::GetObjectForNavigationPosition (const sal_uInt32 nNavigationPosition) const
891 {
893  {
894  // There is a user defined navigation order. Make sure the object
895  // index is correct and look up the object in mxNavigationOrder.
896  if (nNavigationPosition >= mxNavigationOrder->size())
897  {
898  OSL_ASSERT(nNavigationPosition < mxNavigationOrder->size());
899  }
900  else
901  return (*mxNavigationOrder)[nNavigationPosition].get();
902  }
903  else
904  {
905  // There is no user defined navigation order. Use the z-order
906  // instead.
907  if (nNavigationPosition >= maList.size())
908  {
909  OSL_ASSERT(nNavigationPosition < maList.size());
910  }
911  else
912  return maList[nNavigationPosition];
913  }
914  return nullptr;
915 }
916 
917 
919 {
920  mxNavigationOrder.reset();
922 }
923 
924 
926 {
928  {
929  if (mxNavigationOrder)
930  {
931  mbIsNavigationOrderDirty = false;
932 
933  sal_uInt32 nIndex (0);
934  for (auto& rpObject : *mxNavigationOrder)
935  {
936  rpObject->SetNavigationPosition(nIndex);
937  ++nIndex;
938  }
939  }
940  }
941 
942  return bool(mxNavigationOrder);
943 }
944 
945 
946 void SdrObjList::SetNavigationOrder (const uno::Reference<container::XIndexAccess>& rxOrder)
947 {
948  if (rxOrder.is())
949  {
950  const sal_Int32 nCount = rxOrder->getCount();
951  if (static_cast<sal_uInt32>(nCount) != maList.size())
952  return;
953 
954  if (!mxNavigationOrder)
955  mxNavigationOrder = std::vector<tools::WeakReference<SdrObject>>(nCount);
956 
957  for (sal_Int32 nIndex=0; nIndex<nCount; ++nIndex)
958  {
959  uno::Reference<uno::XInterface> xShape (rxOrder->getByIndex(nIndex), uno::UNO_QUERY);
961  if (pObject == nullptr)
962  break;
963  (*mxNavigationOrder)[nIndex] = pObject;
964  }
965 
967  }
968  else
969  {
971  }
972 }
973 
974 
976  SdrObject& rObject,
977  const sal_uInt32 nInsertPosition)
978 {
979  OSL_ASSERT(nInsertPosition<=maList.size());
980 
981  // Update the navigation positions.
983  {
984  // The new object does not have a user defined position so append it
985  // to the list.
986  rObject.SetNavigationPosition(mxNavigationOrder->size());
987  mxNavigationOrder->push_back(&rObject);
988  }
989 
990  // Insert object into object list. Because the insert() method requires
991  // a valid iterator as insertion position, we have to use push_back() to
992  // insert at the end of the list.
993  if (nInsertPosition >= maList.size())
994  maList.push_back(&rObject);
995  else
996  maList.insert(maList.begin()+nInsertPosition, &rObject);
997  mbObjOrdNumsDirty=true;
998 }
999 
1000 
1002  SdrObject& rNewObject,
1003  const sal_uInt32 nObjectPosition)
1004 {
1005  if (nObjectPosition >= maList.size())
1006  {
1007  OSL_ASSERT(nObjectPosition<maList.size());
1008  return;
1009  }
1010 
1011  // Update the navigation positions.
1013  {
1014  // A user defined position of the object that is to be replaced is
1015  // not transferred to the new object so erase the former and append
1016  // the later object from/to the navigation order.
1017  OSL_ASSERT(nObjectPosition < maList.size());
1018  tools::WeakReference<SdrObject> aReference (maList[nObjectPosition]);
1019  auto iObject = ::std::find(
1020  mxNavigationOrder->begin(),
1021  mxNavigationOrder->end(),
1022  aReference);
1023  if (iObject != mxNavigationOrder->end())
1024  mxNavigationOrder->erase(iObject);
1025 
1026  mxNavigationOrder->push_back(&rNewObject);
1027 
1028  mbIsNavigationOrderDirty = true;
1029  }
1030 
1031  maList[nObjectPosition] = &rNewObject;
1032  mbObjOrdNumsDirty=true;
1033 }
1034 
1035 
1037  const sal_uInt32 nObjectPosition)
1038 {
1039  if (nObjectPosition >= maList.size())
1040  {
1041  OSL_ASSERT(nObjectPosition<maList.size());
1042  return;
1043  }
1044 
1045  // Update the navigation positions.
1047  {
1048  tools::WeakReference<SdrObject> aReference (maList[nObjectPosition]);
1049  auto iObject = ::std::find(
1050  mxNavigationOrder->begin(),
1051  mxNavigationOrder->end(),
1052  aReference);
1053  if (iObject != mxNavigationOrder->end())
1054  mxNavigationOrder->erase(iObject);
1055  mbIsNavigationOrderDirty = true;
1056  }
1057 
1058  maList.erase(maList.begin()+nObjectPosition);
1059  mbObjOrdNumsDirty=true;
1060 }
1061 
1063 {
1064  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrObjList"));
1065  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1066  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name()));
1067 
1068  size_t nObjCount = GetObjCount();
1069  for (size_t i = 0; i < nObjCount; ++i)
1070  {
1071  if (const SdrObject* pObject = GetObj(i))
1072  pObject->dumpAsXml(pWriter);
1073  }
1074 
1075  (void)xmlTextWriterEndElement(pWriter);
1076 }
1077 
1078 
1080 {
1081  sal_uInt16 nCount=GetCount();
1082  for (sal_uInt16 i=0; i<nCount; i++) {
1083  delete GetObject(i);
1084  }
1085  aList.clear();
1086 }
1087 
1088 
1089 // PageUser section
1090 
1092 {
1093  maPageUsers.push_back(&rNewUser);
1094 }
1095 
1097 {
1098  const sdr::PageUserVector::iterator aFindResult = ::std::find(maPageUsers.begin(), maPageUsers.end(), &rOldUser);
1099  if(aFindResult != maPageUsers.end())
1100  {
1101  maPageUsers.erase(aFindResult);
1102  }
1103 }
1104 
1105 
1106 // DrawContact section
1107 
1108 std::unique_ptr<sdr::contact::ViewContact> SdrPage::CreateObjectSpecificViewContact()
1109 {
1110  return std::make_unique<sdr::contact::ViewContactOfSdrPage>(*this);
1111 }
1112 
1114 {
1115  if (!mpViewContact)
1116  const_cast<SdrPage*>(this)->mpViewContact =
1117  const_cast<SdrPage*>(this)->CreateObjectSpecificViewContact();
1118 
1119  return *mpViewContact;
1120 }
1121 
1123 {
1124  if (!mpViewContact)
1126 
1127  return *mpViewContact;
1128 }
1129 
1131 {
1132  if(mpStyleSheet)
1133  {
1135  maProperties.SetParent(nullptr);
1136  mpStyleSheet = nullptr;
1137  }
1138 }
1139 
1141 {
1142  if(mpStyleSheet != &rNewStyleSheet)
1143  {
1145  mpStyleSheet = &rNewStyleSheet;
1146  StartListening(rNewStyleSheet);
1147  maProperties.SetParent(&rNewStyleSheet.GetItemSet());
1148  }
1149 }
1150 
1151 static void ImpPageChange(SdrPage& rSdrPage)
1152 {
1153  rSdrPage.ActionChanged();
1154  rSdrPage.getSdrModelFromSdrPage().SetChanged();
1155  SdrHint aHint(SdrHintKind::PageOrderChange, &rSdrPage);
1156  rSdrPage.getSdrModelFromSdrPage().Broadcast(aHint);
1157 }
1158 
1160 : SfxListener(),
1161  mpSdrPage(&rSdrPage),
1162  mpStyleSheet(nullptr),
1163  maProperties(
1164  mpSdrPage->getSdrModelFromSdrPage().GetItemPool(),
1166 {
1167  if(!rSdrPage.IsMasterPage())
1168  {
1169  maProperties.Put(XFillStyleItem(drawing::FillStyle_NONE));
1170  }
1171 }
1172 
1174 {
1176 }
1177 
1179 {
1180  switch(rHint.GetId())
1181  {
1182  case SfxHintId::DataChanged :
1183  {
1184  // notify change, broadcast
1186  break;
1187  }
1188  case SfxHintId::Dying :
1189  {
1190  // Style needs to be forgotten
1192  break;
1193  }
1194  default: break;
1195  }
1196 }
1197 
1199 {
1200  assert(mpSdrPage);
1201  return mpSdrPage->IsInserted();
1202 }
1203 
1204 
1206 {
1207  OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
1208  maProperties.Put(rSet);
1210 }
1211 
1213 {
1214  OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
1215  maProperties.Put(rItem);
1217 }
1218 
1219 void SdrPageProperties::ClearItem(const sal_uInt16 nWhich)
1220 {
1221  maProperties.ClearItem(nWhich);
1223 }
1224 
1226 {
1227  if(pStyleSheet)
1228  {
1229  ImpAddStyleSheet(*pStyleSheet);
1230  }
1231  else
1232  {
1234  }
1235 
1237 }
1238 
1239 
1240 SdrPage::SdrPage(SdrModel& rModel, bool bMasterPage)
1241 : SdrObjList(),
1242  maPageUsers(),
1243  mrSdrModelFromSdrPage(rModel),
1244  mnWidth(10),
1245  mnHeight(10),
1246  mnBorderLeft(0),
1247  mnBorderUpper(0),
1248  mnBorderRight(0),
1249  mnBorderLower(0),
1250  mpLayerAdmin(new SdrLayerAdmin(&rModel.GetLayerAdmin())),
1251  mxUnoPage(),
1252  nPageNum(0),
1253  mbMaster(bMasterPage),
1254  mbInserted(false),
1255  mbObjectsNotPersistent(false),
1256  mbPageBorderOnlyLeftRight(false)
1257 {
1258  mpSdrPageProperties.reset(new SdrPageProperties(*this));
1259 }
1260 
1262 {
1263  if( mxUnoPage.is() ) try
1264  {
1265  uno::Reference< lang::XComponent > xPageComponent( mxUnoPage, uno::UNO_QUERY_THROW );
1266  mxUnoPage.clear();
1267  xPageComponent->dispose();
1268  }
1269  catch( const uno::Exception& )
1270  {
1271  DBG_UNHANDLED_EXCEPTION("svx");
1272  }
1273 
1274  // tell all the registered PageUsers that the page is in destruction
1275  // This causes some (all?) PageUsers to remove themselves from the list
1276  // of page users. Therefore we have to use a copy of the list for the
1277  // iteration.
1278  sdr::PageUserVector aListCopy (maPageUsers.begin(), maPageUsers.end());
1279  for(sdr::PageUser* pPageUser : aListCopy)
1280  {
1281  DBG_ASSERT(pPageUser, "SdrPage::~SdrPage: corrupt PageUser list (!)");
1282  pPageUser->PageInDestruction(*this);
1283  }
1284 
1285  // Clear the vector. This means that user do not need to call RemovePageUser()
1286  // when they get called from PageInDestruction().
1287  maPageUsers.clear();
1288 
1289  mpLayerAdmin.reset();
1290 
1292 
1293  mpViewContact.reset();
1294  mpSdrPageProperties.reset();
1295 }
1296 
1297 void SdrPage::lateInit(const SdrPage& rSrcPage)
1298 {
1299  assert(!mpViewContact);
1300  assert(!mxUnoPage.is());
1301 
1302  // copy all the local parameters to make this instance
1303  // a valid copy of source page before copying and inserting
1304  // the contained objects
1305  mbMaster = rSrcPage.mbMaster;
1307  mnWidth = rSrcPage.mnWidth;
1308  mnHeight = rSrcPage.mnHeight;
1309  mnBorderLeft = rSrcPage.mnBorderLeft;
1310  mnBorderUpper = rSrcPage.mnBorderUpper;
1311  mnBorderRight = rSrcPage.mnBorderRight;
1312  mnBorderLower = rSrcPage.mnBorderLower;
1314  nPageNum = rSrcPage.nPageNum;
1315 
1316  if(rSrcPage.TRG_HasMasterPage())
1317  {
1320  }
1321  else
1322  {
1324  }
1325 
1327 
1328  {
1329  mpSdrPageProperties.reset(new SdrPageProperties(*this));
1330 
1331  if(!IsMasterPage())
1332  {
1333  mpSdrPageProperties->PutItemSet(rSrcPage.getSdrPageProperties().GetItemSet());
1334  }
1335 
1336  mpSdrPageProperties->SetStyleSheet(rSrcPage.getSdrPageProperties().GetStyleSheet());
1337  }
1338 
1339  // Now copy the contained objects
1340  if(0 != rSrcPage.GetObjCount())
1341  {
1342  CopyObjects(rSrcPage);
1343  }
1344 }
1345 
1347 {
1348  rtl::Reference<SdrPage> pClonedPage(new SdrPage(rTargetModel));
1349  pClonedPage->lateInit(*this);
1350  return pClonedPage;
1351 }
1352 
1353 void SdrPage::SetSize(const Size& aSiz)
1354 {
1355  bool bChanged(false);
1356 
1357  if(aSiz.Width() != mnWidth)
1358  {
1359  mnWidth = aSiz.Width();
1360  bChanged = true;
1361  }
1362 
1363  if(aSiz.Height() != mnHeight)
1364  {
1365  mnHeight = aSiz.Height();
1366  bChanged = true;
1367  }
1368 
1369  if(bChanged)
1370  {
1371  SetChanged();
1372  }
1373 }
1374 
1376 {
1377  return Size(mnWidth,mnHeight);
1378 }
1379 
1380 sal_Int32 SdrPage::GetWidth() const
1381 {
1382  return mnWidth;
1383 }
1384 
1386 {
1387  // square: handle like portrait format
1388  Size aSiz(GetSize());
1389  if (aSiz.Width()!=aSiz.Height()) {
1390  if ((eOri==Orientation::Portrait) == (aSiz.Width()>aSiz.Height())) {
1391  // coverity[swapped_arguments : FALSE] - this is in the correct order
1392  SetSize(Size(aSiz.Height(),aSiz.Width()));
1393  }
1394  }
1395 }
1396 
1398 {
1399  // square: handle like portrait format
1400  Orientation eRet=Orientation::Portrait;
1401  Size aSiz(GetSize());
1402  if (aSiz.Width()>aSiz.Height()) eRet=Orientation::Landscape;
1403  return eRet;
1404 }
1405 
1406 sal_Int32 SdrPage::GetHeight() const
1407 {
1408  return mnHeight;
1409 }
1410 
1411 void SdrPage::SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 nLwr)
1412 {
1413  bool bChanged(false);
1414 
1415  if(mnBorderLeft != nLft)
1416  {
1417  mnBorderLeft = nLft;
1418  bChanged = true;
1419  }
1420 
1421  if(mnBorderUpper != nUpp)
1422  {
1423  mnBorderUpper = nUpp;
1424  bChanged = true;
1425  }
1426 
1427  if(mnBorderRight != nRgt)
1428  {
1429  mnBorderRight = nRgt;
1430  bChanged = true;
1431  }
1432 
1433  if(mnBorderLower != nLwr)
1434  {
1435  mnBorderLower = nLwr;
1436  bChanged = true;
1437  }
1438 
1439  if(bChanged)
1440  {
1441  SetChanged();
1442  }
1443 }
1444 
1445 void SdrPage::SetLeftBorder(sal_Int32 nBorder)
1446 {
1447  if(mnBorderLeft != nBorder)
1448  {
1449  mnBorderLeft = nBorder;
1450  SetChanged();
1451  }
1452 }
1453 
1454 void SdrPage::SetUpperBorder(sal_Int32 nBorder)
1455 {
1456  if(mnBorderUpper != nBorder)
1457  {
1458  mnBorderUpper = nBorder;
1459  SetChanged();
1460  }
1461 }
1462 
1463 void SdrPage::SetRightBorder(sal_Int32 nBorder)
1464 {
1465  if(mnBorderRight != nBorder)
1466  {
1467  mnBorderRight=nBorder;
1468  SetChanged();
1469  }
1470 }
1471 
1472 void SdrPage::SetLowerBorder(sal_Int32 nBorder)
1473 {
1474  if(mnBorderLower != nBorder)
1475  {
1476  mnBorderLower=nBorder;
1477  SetChanged();
1478  }
1479 }
1480 
1481 sal_Int32 SdrPage::GetLeftBorder() const
1482 {
1483  return mnBorderLeft;
1484 }
1485 
1486 sal_Int32 SdrPage::GetUpperBorder() const
1487 {
1488  return mnBorderUpper;
1489 }
1490 
1491 sal_Int32 SdrPage::GetRightBorder() const
1492 {
1493  return mnBorderRight;
1494 }
1495 
1496 sal_Int32 SdrPage::GetLowerBorder() const
1497 {
1498  return mnBorderLower;
1499 }
1500 
1502 {
1503  if (bIn != mbBackgroundFullSize)
1504  {
1505  mbBackgroundFullSize = bIn;
1506  SetChanged();
1507  }
1508 }
1509 
1511 {
1512  return mbBackgroundFullSize;
1513 }
1514 
1515 // #i68775# React on PageNum changes (from Model in most cases)
1516 void SdrPage::SetPageNum(sal_uInt16 nNew)
1517 {
1518  if(nNew != nPageNum)
1519  {
1520  // change
1521  nPageNum = nNew;
1522 
1523  // notify visualisations, also notifies e.g. buffered MasterPages
1524  ActionChanged();
1525  }
1526 }
1527 
1528 sal_uInt16 SdrPage::GetPageNum() const
1529 {
1530  if (!mbInserted)
1531  return 0;
1532 
1533  if (mbMaster) {
1534  if (getSdrModelFromSdrPage().IsMPgNumsDirty())
1536  } else {
1537  if (getSdrModelFromSdrPage().IsPagNumsDirty())
1539  }
1540  return nPageNum;
1541 }
1542 
1544 {
1545  // For test purposes, use the new ViewContact for change
1546  // notification now.
1547  ActionChanged();
1549 }
1550 
1552 {
1553  return const_cast< SdrPage* >(this);
1554 }
1555 
1556 // MasterPage interface
1557 
1559 {
1560  if(mpMasterPageDescriptor && &(mpMasterPageDescriptor->GetUsedPage()) == &rNew)
1561  return;
1562 
1565 
1566  mpMasterPageDescriptor.reset(new sdr::MasterPageDescriptor(*this, rNew));
1568 }
1569 
1571 {
1573  {
1574  SetChanged();
1575 
1576  // the flushViewObjectContacts() will do needed invalidates by deleting the involved VOCs
1577  mpMasterPageDescriptor->GetUsedPage().GetViewContact().flushViewObjectContacts();
1578 
1579  mpMasterPageDescriptor.reset();
1580  }
1581 }
1582 
1584 {
1585  DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPage(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1586  return mpMasterPageDescriptor->GetUsedPage();
1587 }
1588 
1590 {
1591  DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1592  return mpMasterPageDescriptor->GetVisibleLayers();
1593 }
1594 
1596 {
1597  DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_SetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1598  mpMasterPageDescriptor->SetVisibleLayers(rNew);
1599 }
1600 
1602 {
1603  DBG_ASSERT(mpMasterPageDescriptor != nullptr, "TRG_GetMasterPageDescriptorViewContact(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
1604  return mpMasterPageDescriptor->GetViewContact();
1605 }
1606 
1607 // used from SdrModel::RemoveMasterPage
1609 {
1610  if(TRG_HasMasterPage())
1611  {
1612  if(&TRG_GetMasterPage() == &rRemovedPage)
1613  {
1615  }
1616  }
1617 }
1618 
1620 {
1621  std::unordered_set<OUString> aNameSet;
1622  for (size_t no(0); no < GetObjCount(); ++no)
1623  {
1624  SdrObject* pObj(GetObj(no));
1625  if(nullptr != pObj)
1626  {
1627  if (!pObj->GetName().isEmpty())
1628  {
1629  pObj->MakeNameUnique(aNameSet);
1630  SdrObjList* pSdrObjList = pObj->GetSubList(); // group
1631  if (pSdrObjList)
1632  {
1633  SdrObject* pListObj;
1634  SdrObjListIter aIter(pSdrObjList, SdrIterMode::DeepWithGroups);
1635  while (aIter.IsMore())
1636  {
1637  pListObj = aIter.Next();
1638  pListObj->MakeNameUnique(aNameSet);
1639  }
1640  }
1641  }
1642  }
1643  }
1644 }
1645 
1646 const SdrPageGridFrameList* SdrPage::GetGridFrameList(const SdrPageView* /*pPV*/, const tools::Rectangle* /*pRect*/) const
1647 {
1648  return nullptr;
1649 }
1650 
1652 {
1653  return *mpLayerAdmin;
1654 }
1655 
1657 {
1658  return *mpLayerAdmin;
1659 }
1660 
1661 OUString SdrPage::GetLayoutName() const
1662 {
1663  return OUString();
1664 }
1665 
1666 void SdrPage::SetInserted( bool bIns )
1667 {
1668  if( mbInserted == bIns )
1669  return;
1670 
1671  mbInserted = bIns;
1672 
1673  // #i120437# go over whole hierarchy, not only over object level null (seen from grouping)
1675 
1676  while ( aIter.IsMore() )
1677  {
1678  SdrObject* pObj = aIter.Next();
1679  if ( auto pOleObj = dynamic_cast<SdrOle2Obj* >(pObj) )
1680  {
1681  if( mbInserted )
1682  pOleObj->Connect();
1683  else
1684  pOleObj->Disconnect();
1685  }
1686  }
1687 }
1688 
1689 void SdrPage::SetUnoPage(uno::Reference<drawing::XDrawPage> const& xNewPage)
1690 {
1691  mxUnoPage = xNewPage;
1692 }
1693 
1694 uno::Reference< uno::XInterface > const & SdrPage::getUnoPage()
1695 {
1696  if( !mxUnoPage.is() )
1697  {
1698  // create one
1700  }
1701 
1702  return mxUnoPage;
1703 }
1704 
1705 uno::Reference< uno::XInterface > SdrPage::createUnoPage()
1706 {
1707  css::uno::Reference< css::uno::XInterface > xInt =
1708  static_cast<cppu::OWeakObject*>( new SvxFmDrawPage( this ) );
1709  return xInt;
1710 }
1711 
1713 {
1714  return pObj->GetStyleSheet();
1715 }
1716 
1718 // #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value
1719 Color SdrPage::GetPageBackgroundColor( SdrPageView const * pView, bool bScreenDisplay ) const
1720 {
1721  Color aColor;
1722 
1723  if(bScreenDisplay && (!pView || pView->GetApplicationDocumentColor() == COL_AUTO))
1724  {
1725  svtools::ColorConfig aColorConfig;
1726  aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor;
1727  }
1728  else
1729  {
1730  aColor = pView->GetApplicationDocumentColor();
1731  }
1732 
1733  const SfxItemSet* pBackgroundFill = &getSdrPageProperties().GetItemSet();
1734 
1735  if(!IsMasterPage() && TRG_HasMasterPage())
1736  {
1737  if(drawing::FillStyle_NONE == pBackgroundFill->Get(XATTR_FILLSTYLE).GetValue())
1738  {
1739  pBackgroundFill = &TRG_GetMasterPage().getSdrPageProperties().GetItemSet();
1740  }
1741  }
1742 
1743  GetDraftFillColor(*pBackgroundFill, aColor);
1744 
1745  return aColor;
1746 }
1747 
1750 // #i75566# GetBackgroundColor -> GetPageBackgroundColor
1751 {
1752  return GetPageBackgroundColor( nullptr );
1753 }
1754 
1761  const sdr::contact::ViewObjectContact& /*rOriginal*/,
1762  const sdr::contact::DisplayInfo& /*rDisplayInfo*/,
1763  bool /*bEdit*/)
1764 {
1765  // this will be handled in the application if needed
1766  return true;
1767 }
1768 
1769 // DrawContact support: Methods for handling Page changes
1771 {
1772  // Do necessary ViewContact actions
1774 
1775  // #i48535# also handle MasterPage change
1776  if(TRG_HasMasterPage())
1777  {
1779  }
1780 }
1781 
1783 {
1784  return *mpSdrPageProperties;
1785 }
1786 
1788 {
1789  return *mpSdrPageProperties;
1790 }
1791 
1793 {
1795  {
1796  return mpMasterPageDescriptor->getCorrectSdrPageProperties();
1797  }
1798  else
1799  {
1800  return &getSdrPageProperties();
1801  }
1802 }
1803 
1804 
1805 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetUnoPage(css::uno::Reference< css::drawing::XDrawPage > const &)
Definition: svdpage.cxx:1689
SdrPage & TRG_GetMasterPage() const
Definition: svdpage.cxx:1583
void AddPageUser(sdr::PageUser &rNewUser)
Definition: svdpage.cxx:1091
double mnHeight
std::unique_ptr< sdr::MasterPageDescriptor > mpMasterPageDescriptor
Definition: svdpage.hxx:425
void SetNavigationPosition(const sal_uInt32 nPosition)
Definition: svdobj.cxx:950
::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:804
virtual void SetSize(const Size &aSiz)
Definition: svdpage.cxx:1353
SdrPageProperties(SdrPage &rSdrPage)
Definition: svdpage.cxx:1159
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:960
Color GetPageBackgroundColor() const
deprecated returns an averaged background color of this page
Definition: svdpage.cxx:1749
sdr::PageUserVector maPageUsers
Definition: svdpage.hxx:381
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int32 GetHeight() const
Definition: svdpage.cxx:1406
void ClearItem(const sal_uInt16 nWhich=0)
Definition: svdpage.cxx:1219
void impClearSdrObjList(bool bBroadcast)
Definition: svdpage.cxx:77
virtual void SetOrientation(Orientation eOri)
Definition: svdpage.cxx:1385
void ReplaceObjectInContainer(SdrObject &rObject, const sal_uInt32 nObjectPosition)
Replace an object in the object list.
Definition: svdpage.cxx:1001
const tools::Rectangle & GetAllObjBoundRect() const
Definition: svdpage.cxx:700
virtual ViewContact * GetParentContact() const
virtual Orientation GetOrientation() const
Definition: svdpage.cxx:1397
bool mbObjOrdNumsDirty
Definition: svdpage.hxx:71
SdrPage(const SdrPage &)=delete
void PutItem(const SfxPoolItem &rItem)
Definition: svdpage.cxx:1212
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:946
sal_Int32 mnBorderRight
Definition: svdpage.hxx:410
virtual void SetLeftBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1445
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
Definition: unoshape.cxx:3997
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:1178
virtual rtl::Reference< SdrPage > CloneSdrPage(SdrModel &rTargetModel) const
Definition: svdpage.cxx:1346
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:1491
void RecalcObjOrdNums()
recalculate order numbers / ZIndex
Definition: svdpage.cxx:239
bool IsInserted() const
Definition: svdobj.hxx:741
void RecalcPageNums(bool bMaster)
Definition: svdmodel.cxx:1154
size_t GetObjCount() const
Definition: svdpage.cxx:764
void MakePageObjectsNamesUnique()
Definition: svdpage.cxx:1619
SdrObject * GetObjectForNavigationPosition(const sal_uInt32 nNavigationPosition) const
Return the object for the given navigation position.
Definition: svdpage.cxx:890
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:138
virtual bool isUsedByModel() const override
Definition: svdpage.cxx:1198
bool mbRectsDirty
Definition: svdpage.hxx:72
void TRG_ClearMasterPage()
Definition: svdpage.cxx:1570
std::optional< std::vector< tools::WeakReference< SdrObject > > > mxNavigationOrder
This list, if it exists, defines the navigation order.
Definition: svdpage.hxx:231
virtual SfxItemSet & GetItemSet()
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:473
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:661
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1496
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:1705
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:1760
void ImpAddStyleSheet(SfxStyleSheet &rNewStyleSheet)
Definition: svdpage.cxx:1140
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:750
void BegUndo()
Definition: svdmodel.cxx:363
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1481
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:1261
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1669
constexpr tools::Long Width() const
virtual bool IsReadOnly() const
linked page or linked group object
Definition: svdpage.cxx:779
void RemoveObjectFromContainer(const sal_uInt32 nObjectPosition)
Remove an object from the object list.
Definition: svdpage.cxx:1036
bool IsMore() const
Definition: svditer.hxx:62
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:269
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdmodel.cxx:497
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:2228
bool isLocked() const
Definition: svdmodel.hxx:546
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: svdpage.cxx:1551
void MakeNameUnique()
Definition: svdobj.cxx:3088
std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdpage.cxx:1108
void BurnInStyleSheetAttributes()
Definition: svdobj.cxx:1849
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:1558
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1149
void RemovePageUser(sdr::PageUser &rOldUser)
Definition: svdpage.cxx:1096
const Color & GetApplicationDocumentColor() const
Definition: svdpagv.hxx:255
SdrObject * GetConnectedNode(bool bTail1) const override
Definition: svdoedge.cxx:495
void SetStyleSheet(SfxStyleSheet *pStyleSheet)
Definition: svdpage.cxx:1225
constexpr bool IsEmpty() const
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:1516
#define DBG_UNHANDLED_EXCEPTION(...)
OUString SvxResId(std::string_view aId)
Definition: dialmgr.cxx:25
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:1646
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:528
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1062
virtual SfxStyleSheet * GetTextStyleSheetForObject(SdrObject *pObj) const
Definition: svdpage.cxx:1712
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
Definition: svdpage.cxx:1589
Size GetSize() const
Definition: svdpage.cxx:1375
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1486
void SetBackgroundFullSize(bool bIn)
Definition: svdpage.cxx:1501
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:1454
static void ImpPageChange(SdrPage &rSdrPage)
Definition: svdpage.cxx:1151
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:902
const SdrLayerAdmin & GetLayerAdmin() const
changing the layers does not set the modified-flag!
Definition: svdpage.cxx:1651
size
bool HasObjectNavigationOrder() const
Return whether there is an explicit, user defined, object navigation order.
Definition: svdpage.cxx:839
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:1661
SdrPageProperties & getSdrPageProperties()
Definition: svdpage.cxx:1782
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:1173
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:1847
OUString GetName() const
Definition: svdobj.cxx:804
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:841
void EndUndo()
Definition: svdmodel.cxx:434
void SetParent(const SfxItemSet *pNew)
virtual void SetRightBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1463
void lateInit(const SdrPage &rSrcPage)
Definition: svdpage.cxx:1297
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:1845
virtual void SetLowerBorder(sal_Int32 nBorder)
Definition: svdpage.cxx:1472
SdrObject * Next()
Definition: svditer.hxx:63
void ActionChanged()
Definition: svdpage.cxx:1770
void InsertedStateChange()
Definition: svdobj.cxx:2624
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Broadcast(const SfxHint &rHint)
void SetInserted(bool bNew=true)
Definition: svdpage.cxx:1666
void sort(std::vector< sal_Int32 > &sortOrder)
Definition: svdpage.cxx:568
sdr::contact::ViewContact & TRG_GetMasterPageDescriptorViewContact() const
Definition: svdpage.cxx:1601
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:1608
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:1113
constexpr tools::Long Height() const
bool RecalcNavigationPositions()
Set the navigation position of all SdrObjects to their position in the mxNavigationOrder list...
Definition: svdpage.cxx:925
void ClearSdrObjList()
Definition: svdpage.cxx:114
void SetOrdNum(sal_uInt32 nNum)
Definition: svdobj.cxx:915
SfxStyleSheet * GetStyleSheet() const
Definition: svdpage.hxx:341
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
Definition: svdpage.cxx:1694
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:918
const SdrPageProperties * getCorrectSdrPageProperties() const
Definition: svdpage.cxx:1792
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:1595
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:1660
void InsertObjectIntoContainer(SdrObject &rObject, const sal_uInt32 nInsertPosition)
Insert an SdrObject into maList.
Definition: svdpage.cxx:975
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:512
SdrObjList()
Definition: svdpage.cxx:65
virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr)
Definition: svdpage.cxx:1411
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:1642
void ImpRemoveStyleSheet()
Definition: svdpage.cxx:1130
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:1510
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:1380
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:305
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:235
sal_uInt16 GetPageNum() const
Definition: svdpage.cxx:1528
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:1543
aStr
void RecalcRects()
Definition: svdpage.cxx:249
void PutItemSet(const SfxItemSet &rSet)
Definition: svdpage.cxx:1205
void FlattenGroups()
Makes the object list flat, i.e.
Definition: svdpage.cxx:797
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:127
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo