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