LibreOffice Module sw (master) 1
unodraw.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 <sal/config.h>
21
22#include <initializer_list>
23#include <memory>
24#include <string_view>
25
26#include <sal/log.hxx>
27
28#include <cmdid.h>
29#include <unomid.h>
30
31#include <drawdoc.hxx>
32#include <unodraw.hxx>
33#include <unoframe.hxx>
34#include <unoparagraph.hxx>
35#include <unotextrange.hxx>
36#include <svx/svditer.hxx>
37#include <swunohelper.hxx>
38#include <textboxhelper.hxx>
39#include <doc.hxx>
40#include <IDocumentUndoRedo.hxx>
43#include <fmtcntnt.hxx>
44#include <fmtflcnt.hxx>
45#include <txatbase.hxx>
46#include <docsh.hxx>
47#include <unomap.hxx>
48#include <unoport.hxx>
49#include <TextCursorHelper.hxx>
50#include <dflyobj.hxx>
51#include <ndtxt.hxx>
52#include <svx/svdview.hxx>
53#include <svx/unoshape.hxx>
54#include <dcontact.hxx>
55#include <fmtornt.hxx>
56#include <fmtsrnd.hxx>
57#include <fmtfollowtextflow.hxx>
58#include <rootfrm.hxx>
59#include <editeng/lrspitem.hxx>
60#include <editeng/ulspitem.hxx>
61#include <o3tl/any.hxx>
62#include <o3tl/safeint.hxx>
64#include <crstate.hxx>
69#include <svx/scene3d.hxx>
71#include <com/sun/star/beans/PropertyAttribute.hpp>
72#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
73#include <com/sun/star/frame/XModel.hpp>
75#include <com/sun/star/text/TextContentAnchorType.hpp>
77#include <com/sun/star/drawing/PointSequence.hpp>
78#include <com/sun/star/lang/IllegalArgumentException.hpp>
79#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
81
82using namespace ::com::sun::star;
83
85{
87 std::unique_ptr<SwFormatHoriOrient> m_pHOrient;
88 std::unique_ptr<SwFormatVertOrient> m_pVOrient;
89 std::unique_ptr<SwFormatAnchor> m_pAnchor;
90 std::unique_ptr<SwFormatSurround> m_pSurround;
91 std::unique_ptr<SvxULSpaceItem> m_pULSpace;
92 std::unique_ptr<SvxLRSpaceItem> m_pLRSpace;
94 uno::Reference< text::XTextRange > m_xTextRange;
95 // #i26791#
96 std::unique_ptr<SwFormatFollowTextFlow> m_pFollowTextFlow;
97 // #i28701#
98 std::unique_ptr<SwFormatWrapInfluenceOnObjPos> m_pWrapInfluenceOnObjPos;
99 // #i28749#
101
104
105public:
107
108public:
110 : m_isInReading(pDoc && pDoc->IsInReading())
111 // #i32349# - no defaults, in order to determine on
112 // adding a shape, if positioning attributes are set or not.
113 , m_bOpaque(false)
114 // #i26791#
116 // #i28701# #i35017#
118 text::WrapInfluenceOnPosition::ONCE_CONCURRENT) )
119 // #i28749#
120 , mnPositionLayoutDir(text::PositionLayoutDir::PositionInLayoutDirOfAnchor)
122 {}
123
124 SwFormatAnchor* GetAnchor(bool bCreate = false)
125 {
126 if (bCreate && !m_pAnchor)
127 {
128 m_pAnchor.reset(new SwFormatAnchor(RndStdIds::FLY_AS_CHAR));
129 }
130 return m_pAnchor.get();
131 }
132 SwFormatHoriOrient* GetHOrient(bool bCreate = false)
133 {
134 if (bCreate && !m_pHOrient)
135 {
136 // #i26791#
137 m_pHOrient.reset(new SwFormatHoriOrient(0, text::HoriOrientation::NONE, text::RelOrientation::FRAME));
138 }
139 return m_pHOrient.get();
140 }
141 SwFormatVertOrient* GetVOrient(bool bCreate = false)
142 {
143 if (bCreate && !m_pVOrient)
144 {
145 if (m_isInReading && // tdf#113938 extensions might rely on old default
146 (!GetAnchor(true) || m_pAnchor->GetAnchorId() == RndStdIds::FLY_AS_CHAR))
147 { // for as-char, NONE ("from-top") is not a good default
148 m_pVOrient.reset(new SwFormatVertOrient(0, text::VertOrientation::TOP, text::RelOrientation::FRAME));
149 }
150 else
151 { // #i26791#
152 m_pVOrient.reset(new SwFormatVertOrient(0, text::VertOrientation::NONE, text::RelOrientation::FRAME));
153 }
154 }
155 return m_pVOrient.get();
156 }
157
158 SwFormatSurround* GetSurround(bool bCreate = false)
159 {
160 if (bCreate && !m_pSurround)
161 {
162 m_pSurround.reset(new SwFormatSurround());
163 }
164 return m_pSurround.get();
165 }
166 SvxLRSpaceItem* GetLRSpace(bool bCreate = false)
167 {
168 if (bCreate && !m_pLRSpace)
169 {
171 }
172 return m_pLRSpace.get();
173 }
174 SvxULSpaceItem* GetULSpace(bool bCreate = false)
175 {
176 if (bCreate && !m_pULSpace)
177 {
179 }
180 return m_pULSpace.get();
181 }
182 uno::Reference< text::XTextRange > & GetTextRange()
183 {
184 return m_xTextRange;
185 }
186 bool IsOpaque() const
187 {
188 return m_bOpaque;
189 }
190 const bool& GetOpaque() const
191 {
192 return m_bOpaque;
193 }
194 void RemoveHOrient() { m_pHOrient.reset(); }
195 void RemoveVOrient() { m_pVOrient.reset(); }
196 void RemoveAnchor() { m_pAnchor.reset(); }
197 void RemoveSurround() { m_pSurround.reset(); }
198 void RemoveULSpace() { m_pULSpace.reset(); }
199 void RemoveLRSpace() { m_pLRSpace.reset(); }
200 void SetOpaque(bool bSet){m_bOpaque = bSet;}
201
202 // #i26791#
204 {
205 if (_bCreate && !m_pFollowTextFlow)
206 {
208 }
209 return m_pFollowTextFlow.get();
210 }
212 {
213 m_pFollowTextFlow.reset();
214 }
215
216 // #i28749#
217 sal_Int16 GetPositionLayoutDir() const
218 {
219 return mnPositionLayoutDir;
220 }
221 void SetPositionLayoutDir( sal_Int16 _nPositionLayoutDir )
222 {
223 switch ( _nPositionLayoutDir )
224 {
225 case text::PositionLayoutDir::PositionInHoriL2R:
226 case text::PositionLayoutDir::PositionInLayoutDirOfAnchor:
227 {
228 mnPositionLayoutDir = _nPositionLayoutDir;
229 }
230 break;
231 default:
232 {
233 OSL_FAIL( "<SwShapeDescriptor_Impl::SetPositionLayoutDir(..)> - invalid attribute value." );
234 }
235 }
236 }
237
238 // #i28701#
240 const bool _bCreate = false )
241 {
242 if (_bCreate && !m_pWrapInfluenceOnObjPos)
243 {
245 // #i35017#
246 text::WrapInfluenceOnPosition::ONCE_CONCURRENT));
247 }
248 return m_pWrapInfluenceOnObjPos.get();
249 }
251 {
253 }
254};
255
257 : SwFmDrawPage_Base(pPage)
258 , m_pDoc(pDoc)
259 , m_pPageView(nullptr)
260 , m_pPropertySet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_PAGE))
261{
262}
263
265{
266 while (!m_vShapes.empty())
267 m_vShapes.back()->dispose();
269}
270
271const SdrMarkList& SwFmDrawPage::PreGroup(const uno::Reference< drawing::XShapes > & xShapes)
272{
273 SelectObjectsInView( xShapes, GetPageView() );
274 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
275 return rMarkList;
276}
277
278void SwFmDrawPage::PreUnGroup(const uno::Reference< drawing::XShapeGroup >& rShapeGroup)
279{
280 SelectObjectInView( rShapeGroup, GetPageView() );
281}
282
284{
285 if(!m_pPageView)
286 m_pPageView = mpView->ShowSdrPage( mpPage );
287 return m_pPageView;
288}
289
291{
292 if(m_pPageView && mpView)
293 mpView->HideSdrPage();
294 m_pPageView = nullptr;
295}
296
297uno::Reference<drawing::XShape> SwFmDrawPage::GetShape(SdrObject* pObj)
298{
299 if(!pObj)
300 return nullptr;
301 SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
302 // TODO see comment at
303 // <https://gerrit.libreoffice.org/c/core/+/78734/4#message-5ee4e724a8073c5c475f07da0b5d79bc34e61de5>
304 // "make page bookkeep the SwXShapes" [-loplugin:crosscast]:
305 SwFmDrawPage* pPage = dynamic_cast<SwFmDrawPage*>(pFormat);
306 if(!pPage || pPage->m_vShapes.empty())
307 return uno::Reference<drawing::XShape>(pObj->getUnoShape(), uno::UNO_QUERY);
308 for(const auto & pShape : pPage->m_vShapes)
309 {
310 SvxShape* pSvxShape = pShape->GetSvxShape();
311 if (pSvxShape && pSvxShape->GetSdrObject() == pObj)
312 return pShape;
313 }
314 return nullptr;
315}
316
317uno::Reference<drawing::XShapeGroup> SwFmDrawPage::GetShapeGroup(SdrObject* pObj)
318{
319 return uno::Reference<drawing::XShapeGroup>(GetShape(pObj), uno::UNO_QUERY);
320}
321
322uno::Reference< drawing::XShape > SwFmDrawPage::CreateShape( SdrObject *pObj ) const
323{
324 uno::Reference< drawing::XShape > xRet;
325 if(dynamic_cast<const SwVirtFlyDrawObj*>( pObj) != nullptr || pObj->GetObjInventor() == SdrInventor::Swg)
326 {
327 SwFlyDrawContact* pFlyContact = static_cast<SwFlyDrawContact*>(pObj->GetUserCall());
328 if(pFlyContact)
329 {
330 SwFrameFormat* pFlyFormat = pFlyContact->GetFormat();
331 SwDoc* pDoc = pFlyFormat->GetDoc();
332 const SwNodeIndex* pIdx;
333 if( RES_FLYFRMFMT == pFlyFormat->Which()
334 && nullptr != ( pIdx = pFlyFormat->GetContent().GetContentIdx() )
335 && pIdx->GetNodes().IsDocNodes()
336 )
337 {
338 const SwNode* pNd = pDoc->GetNodes()[ pIdx->GetIndex() + 1 ];
339 if(!pNd->IsNoTextNode())
340 {
341 xRet.set(static_cast<cppu::OWeakObject*>(SwXTextFrame::CreateXTextFrame(*pDoc, pFlyFormat).get()),
342 uno::UNO_QUERY);
343 }
344 else if( pNd->IsGrfNode() )
345 {
347 *pDoc, pFlyFormat).get()), uno::UNO_QUERY);
348 }
349 else if( pNd->IsOLENode() )
350 {
352 *pDoc, pFlyFormat).get()), uno::UNO_QUERY);
353 }
354 }
355 else
356 {
357 OSL_FAIL( "<SwFmDrawPage::CreateShape(..)> - could not retrieve type. Thus, no shape created." );
358 return xRet;
359 }
360 }
361 }
362 else
363 {
364 // own block - temporary object has to be destroyed before
365 // the delegator is set #81670#
366 {
367 xRet = SvxFmDrawPage::CreateShape( pObj );
368 }
369 uno::Reference< XUnoTunnel > xShapeTunnel(xRet, uno::UNO_QUERY);
370 //don't create an SwXShape if it already exists
371 rtl::Reference<SwXShape> pShape = comphelper::getFromUnoTunnel<SwXShape>(xShapeTunnel);
372 if(!pShape)
373 {
374 xShapeTunnel = nullptr;
375 uno::Reference< uno::XInterface > xCreate(xRet, uno::UNO_QUERY);
376 xRet = nullptr;
377 if ( pObj->IsGroupObject() && (!pObj->Is3DObj() || DynCastE3dScene(pObj)) )
378 pShape = new SwXGroupShape(xCreate, nullptr);
379 else
380 pShape = new SwXShape(xCreate, nullptr);
381 xRet = pShape;
382 }
383 const_cast<std::vector<rtl::Reference<SwXShape>>*>(&m_vShapes)->push_back(pShape);
384 pShape->m_pPage = this;
385 }
386 return xRet;
387}
388
389uno::Reference<beans::XPropertySetInfo> SwFmDrawPage::getPropertySetInfo()
390{
391 static uno::Reference<beans::XPropertySetInfo> xRet = m_pPropertySet->getPropertySetInfo();
392 return xRet;
393}
394
395void SwFmDrawPage::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
396{
397 SolarMutexGuard aGuard;
398 const SfxItemPropertyMapEntry* pEntry = m_pPropertySet->getPropertyMap().getByName(rPropertyName);
399
400 switch (pEntry ? pEntry->nWID : -1)
401 {
402 case WID_PAGE_THEME:
403 {
404 SdrPage* pPage = GetSdrPage();
405 css::uno::Reference<css::util::XTheme> xTheme;
406 if (aValue >>= xTheme)
407 {
408 auto& rUnoTheme = dynamic_cast<UnoTheme&>(*xTheme);
409 pPage->getSdrPageProperties().SetTheme(rUnoTheme.getTheme());
410 }
411 }
412 break;
413 case WID_PAGE_BOTTOM:
414 case WID_PAGE_LEFT:
415 case WID_PAGE_RIGHT:
416 case WID_PAGE_TOP:
417 case WID_PAGE_WIDTH:
418 case WID_PAGE_HEIGHT:
419 case WID_PAGE_NUMBER:
420 case WID_PAGE_ORIENT:
422 case WID_PAGE_ISDARK:
423 case WID_NAVORDER:
425 break;
426
427 default:
428 throw beans::UnknownPropertyException(rPropertyName, static_cast<cppu::OWeakObject*>(this));
429 }
430}
431
432uno::Any SwFmDrawPage::getPropertyValue(const OUString& rPropertyName)
433{
434 SolarMutexGuard aGuard;
435 const SfxItemPropertyMapEntry* pEntry = m_pPropertySet->getPropertyMap().getByName( rPropertyName);
436
437 uno::Any aAny;
438
439 switch (pEntry ? pEntry->nWID : -1)
440 {
441 case WID_PAGE_THEME:
442 {
443 css::uno::Reference<css::util::XTheme> xTheme;
444
445 auto pTheme = GetSdrPage()->getSdrPageProperties().GetTheme();
446 if (pTheme)
447 xTheme = model::theme::createXTheme(pTheme);
448 aAny <<= xTheme;
449 }
450 break;
451
452 case WID_PAGE_NUMBER:
453 {
454 const sal_uInt16 nPageNumber(GetSdrPage()->GetPageNum());
455 aAny <<= o3tl::narrowing<sal_Int16>(nPageNumber);
456 }
457 break;
458
459 case WID_PAGE_BOTTOM:
460 case WID_PAGE_LEFT:
461 case WID_PAGE_RIGHT:
462 case WID_PAGE_TOP:
463 case WID_PAGE_WIDTH:
464 case WID_PAGE_HEIGHT:
465 case WID_PAGE_ORIENT:
467 case WID_PAGE_ISDARK:
468 case WID_NAVORDER:
470 break;
471
472 default:
473 throw beans::UnknownPropertyException(rPropertyName, static_cast<cppu::OWeakObject*>(this));
474 }
475 return aAny;
476}
477
478void SwFmDrawPage::addPropertyChangeListener(const OUString& /*PropertyName*/,
479 const uno::Reference<beans::XPropertyChangeListener> & /*aListener*/)
480{
481 OSL_FAIL("not implemented");
482}
483
484void SwFmDrawPage::removePropertyChangeListener(const OUString& /*PropertyName*/,
485 const uno::Reference<beans::XPropertyChangeListener> & /*aListener*/)
486{
487 OSL_FAIL("not implemented");
488}
489
490void SwFmDrawPage::addVetoableChangeListener(const OUString& /*PropertyName*/,
491 const uno::Reference<beans::XVetoableChangeListener> & /*aListener*/)
492{
493 OSL_FAIL("not implemented");
494}
495
496void SwFmDrawPage::removeVetoableChangeListener(const OUString& /*PropertyName*/,
497 const uno::Reference<beans::XVetoableChangeListener> & /*aListener*/)
498{
499 OSL_FAIL("not implemented");
500}
501
502namespace
503{
504 class SwXShapesEnumeration
506 {
507 private:
508 std::vector< css::uno::Any > m_aShapes;
509 protected:
510 virtual ~SwXShapesEnumeration() override {};
511 public:
512 explicit SwXShapesEnumeration(SwFmDrawPage* const pDrawPage);
513
514 //XEnumeration
515 virtual sal_Bool SAL_CALL hasMoreElements() override;
516 virtual uno::Any SAL_CALL nextElement() override;
517
518 //XServiceInfo
519 virtual OUString SAL_CALL getImplementationName() override;
520 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
521 virtual uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
522 };
523}
524
525SwXShapesEnumeration::SwXShapesEnumeration(SwFmDrawPage* const pDrawPage)
526{
527 SolarMutexGuard aGuard;
528 sal_Int32 nCount = pDrawPage->getCount();
529 m_aShapes.reserve(nCount);
530 for(sal_Int32 nIdx = 0; nIdx < nCount; nIdx++)
531 {
532 uno::Reference<drawing::XShape> xShape(pDrawPage->getByIndex(nIdx), uno::UNO_QUERY);
533 m_aShapes.push_back(uno::Any(xShape));
534 }
535}
536
537sal_Bool SwXShapesEnumeration::hasMoreElements()
538{
539 SolarMutexGuard aGuard;
540 return !m_aShapes.empty();
541}
542
543uno::Any SwXShapesEnumeration::nextElement()
544{
545 SolarMutexGuard aGuard;
546 if(m_aShapes.empty())
547 throw container::NoSuchElementException();
548 uno::Any aResult = m_aShapes.back();
549 m_aShapes.pop_back();
550 return aResult;
551}
552
553OUString SwXShapesEnumeration::getImplementationName()
554{
555 return "SwXShapeEnumeration";
556}
557
558sal_Bool SwXShapesEnumeration::supportsService(const OUString& ServiceName)
559{
560 return cppu::supportsService(this, ServiceName);
561}
562
563uno::Sequence< OUString > SwXShapesEnumeration::getSupportedServiceNames()
564{
565 return { OUString("com.sun.star.container.XEnumeration") };
566}
567
568uno::Reference< container::XEnumeration > SwFmDrawPage::createEnumeration()
569{
570 SolarMutexGuard aGuard;
571 return uno::Reference< container::XEnumeration >(
572 new SwXShapesEnumeration(this));
573}
574
576{
577 return "SwFmDrawPage";
578}
579
580sal_Bool SwFmDrawPage::supportsService(const OUString& rServiceName)
581{
582 return cppu::supportsService(this, rServiceName);
583}
584
585uno::Sequence< OUString > SwFmDrawPage::getSupportedServiceNames()
586{
587 return { "com.sun.star.drawing.GenericDrawPage" };
588}
589
591{
592 SolarMutexGuard aGuard;
593 if(!m_pDoc)
594 throw uno::RuntimeException();
596 return 0;
597 else
598 return SwTextBoxHelper::getCount(GetSdrPage());
599}
600
602{
603 SolarMutexGuard aGuard;
604 if(!m_pDoc)
605 throw uno::RuntimeException();
607 throw lang::IndexOutOfBoundsException();
608
609 return SwTextBoxHelper::getByIndex(GetSdrPage(), nIndex);
610}
611
613{
615}
616
618{
619 SolarMutexGuard aGuard;
620 if(!m_pDoc)
621 throw uno::RuntimeException();
623 return false;
625}
626
627void SwFmDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
628{
629 SolarMutexGuard aGuard;
630 if(!m_pDoc)
631 throw uno::RuntimeException();
632 uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShape, uno::UNO_QUERY);
633 SwXShape* pShape = comphelper::getFromUnoTunnel<SwXShape>(xShapeTunnel);
634 SvxShape* pSvxShape = comphelper::getFromUnoTunnel<SvxShape>(xShapeTunnel);
635
636 // this is not a writer shape
637 if(!pShape)
638 throw uno::RuntimeException("illegal object",
639 static_cast< cppu::OWeakObject * > ( this ) );
640
641 // we're already registered in the model / SwXDrawPage::add() already called
642 if(pShape->m_pPage || !pShape->m_bDescriptor )
643 return;
644
645 // we're inserted elsewhere already
646 if ( pSvxShape->GetSdrObject() )
647 {
648 if ( pSvxShape->GetSdrObject()->IsInserted() )
649 {
650 return;
651 }
652 }
653 SvxFmDrawPage::add(xShape);
654
655 OSL_ENSURE(pSvxShape, "Why is here no SvxShape?");
656 // this position is definitely in 1/100 mm
657 awt::Point aMM100Pos(pSvxShape->getPosition());
658
659 // now evaluate the properties of SwShapeDescriptor_Impl
660 SwShapeDescriptor_Impl* pDesc = pShape->GetDescImpl();
661
663 SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR );
664 bool bOpaque = false;
665 if( pDesc )
666 {
667 if(pDesc->GetSurround())
668 aSet.Put( *pDesc->GetSurround());
669 // all items are already in Twip
670 if(pDesc->GetLRSpace())
671 {
672 aSet.Put(*pDesc->GetLRSpace());
673 }
674 if(pDesc->GetULSpace())
675 {
676 aSet.Put(*pDesc->GetULSpace());
677 }
678 if(pDesc->GetAnchor())
679 aAnchor = *pDesc->GetAnchor();
680
681 // #i32349# - if no horizontal position exists, create one
682 if ( !pDesc->GetHOrient() )
683 {
684 SwFormatHoriOrient* pHori = pDesc->GetHOrient( true );
685 SwTwips nHoriPos = o3tl::toTwips(aMM100Pos.X, o3tl::Length::mm100);
686 pHori->SetPos( nHoriPos );
687 }
688 {
690 aMM100Pos.X = convertTwipToMm100(pDesc->GetHOrient()->GetPos());
691 aSet.Put( *pDesc->GetHOrient() );
692 }
693 // #i32349# - if no vertical position exists, create one
694 if ( !pDesc->GetVOrient() )
695 {
696 SwFormatVertOrient* pVert = pDesc->GetVOrient( true );
697 SwTwips nVertPos = o3tl::toTwips(aMM100Pos.Y, o3tl::Length::mm100);
698 pVert->SetPos( nVertPos );
699 }
700 {
702 aMM100Pos.Y = convertTwipToMm100(pDesc->GetVOrient()->GetPos());
703 aSet.Put( *pDesc->GetVOrient() );
704 }
705
706 if(pDesc->GetSurround())
707 aSet.Put( *pDesc->GetSurround());
708 bOpaque = pDesc->IsOpaque();
709
710 // #i26791#
711 if ( pDesc->GetFollowTextFlow() )
712 {
713 aSet.Put( *pDesc->GetFollowTextFlow() );
714 }
715
716 // #i28701#
717 if ( pDesc->GetWrapInfluenceOnObjPos() )
718 {
719 aSet.Put( *pDesc->GetWrapInfluenceOnObjPos() );
720 }
721 }
722
723 pSvxShape->setPosition(aMM100Pos);
724 SdrObject* pObj = pSvxShape->GetSdrObject();
725 // #108784# - set layer of new drawing object to corresponding
726 // invisible layer.
727 if(SdrInventor::FmForm != pObj->GetObjInventor())
729 else
731
732 std::optional<SwPaM> pPam(m_pDoc->GetNodes().GetEndOfContent());
733 std::unique_ptr<SwUnoInternalPaM> pInternalPam;
734 uno::Reference< text::XTextRange > xRg;
735 if( pDesc && (xRg = pDesc->GetTextRange()).is() )
736 {
737 pInternalPam.reset(new SwUnoInternalPaM(*m_pDoc));
738 if (!::sw::XTextRangeToSwPaM(*pInternalPam, xRg))
739 throw uno::RuntimeException();
740
741 if(RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId() &&
742 !pInternalPam->GetPointNode().FindFlyStartNode())
743 {
744 aAnchor.SetType(RndStdIds::FLY_AS_CHAR);
745 }
746 else if (RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId()
747 && 0 == aAnchor.GetPageNum())
748 {
749 aAnchor.SetAnchor(pInternalPam->Start());
750 aAnchor.SetType(RndStdIds::FLY_AT_CHAR); // convert invalid at-page
751 }
752
753 }
754 else if ((aAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) && m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout())
755 {
758 m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetModelPositionForViewPoint( pPam->GetPoint(), aTmp, &aState );
759 aAnchor.SetAnchor( pPam->GetPoint() );
760
761 // #i32349# - adjustment of vertical positioning
762 // attributes no longer needed, because it's already got a default.
763 }
764 else
765 {
766 aAnchor.SetType(RndStdIds::FLY_AT_PAGE);
767
768 // #i32349# - adjustment of vertical positioning
769 // attributes no longer needed, because it's already got a default.
770 }
771 aSet.Put(aAnchor);
772 SwPaM* pTemp = pInternalPam.get();
773 if ( !pTemp )
774 pTemp = &*pPam;
775 UnoActionContext aAction(m_pDoc);
776 m_pDoc->getIDocumentContentOperations().InsertDrawObj( *pTemp, *pObj, aSet );
777
778 if (pSvxShape->GetSdrObject()->GetName().isEmpty())
779 {
781 }
782
783 SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
784 if (pFormat)
785 {
786 if (pFormat->GetName().isEmpty())
787 {
788 pFormat->SetFormatName(pSvxShape->GetSdrObject()->GetName(), false);
789 }
790 }
791 pShape->m_bDescriptor = false;
792
793 pPam.reset();
794 pInternalPam.reset();
795}
796
797void SwFmDrawPage::remove(const uno::Reference< drawing::XShape > & xShape)
798{
799 SolarMutexGuard aGuard;
800 if(!m_pDoc)
801 throw uno::RuntimeException();
802 // tdf#41466 remove TextFrame too which is belonged to the actual shape
803 auto xTextFrame = SwTextBoxHelper::getUnoTextFrame(xShape);
804 if (xTextFrame)
805 {
806 uno::Reference<lang::XComponent> xComp(xTextFrame, uno::UNO_QUERY);
807 if (xComp)
808 xComp->dispose();
809 }
810 // remove shape
811 uno::Reference<lang::XComponent> xComp(xShape, uno::UNO_QUERY);
812 xComp->dispose();
813}
814
815uno::Reference< drawing::XShapeGroup > SwFmDrawPage::group(const uno::Reference< drawing::XShapes > & xShapes)
816{
817 SolarMutexGuard aGuard;
818 if(!m_pDoc || !xShapes.is())
819 throw uno::RuntimeException();
820 uno::Reference< drawing::XShapeGroup > xRet;
821 // mark and return MarkList
822 const SdrMarkList& rMarkList = PreGroup(xShapes);
823 if ( rMarkList.GetMarkCount() > 0 )
824 {
825 for (size_t i = 0; i < rMarkList.GetMarkCount(); ++i)
826 {
827 const SdrObject *pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
828 if (RndStdIds::FLY_AS_CHAR == ::FindFrameFormat(const_cast<SdrObject*>(
829 pObj))->GetAnchor().GetAnchorId())
830 {
831 throw lang::IllegalArgumentException(
832 "Shape must not have 'as character' anchor!", nullptr, 0);
833 }
834 }
835
836 UnoActionContext aContext(m_pDoc);
837 m_pDoc->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr );
838
841 GetDrawView()->GetMarkedObjectList(),
842 RndStdIds::FLY_AT_PARA,
843 true, false );
844
846 if(pContact)
847 xRet = SwFmDrawPage::GetShapeGroup( pContact->GetMaster() );
848 m_pDoc->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
849 }
851 return xRet;
852}
853
854void SwFmDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & rShapeGroup)
855{
856 SolarMutexGuard aGuard;
857 if(!m_pDoc)
858 throw uno::RuntimeException();
859
860 PreUnGroup(rShapeGroup);
861 UnoActionContext aContext(m_pDoc);
862 m_pDoc->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr );
863
865 m_pDoc->ChgAnchor( GetDrawView()->GetMarkedObjectList(),
866 RndStdIds::FLY_AT_PARA,
867 true, false );
868 m_pDoc->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
870}
871
876{
877 m_pDoc = nullptr;
878}
879
880const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId()
881{
882 static const comphelper::UnoIdInit theSwXShapeUnoTunnelId;
883 return theSwXShapeUnoTunnelId.getSeq();
884}
885
886sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId )
887{
888 if( comphelper::isUnoTunnelId<SwXShape>(rId) )
889 {
891 }
892
893 if( m_xShapeAgg.is() )
894 {
895 const uno::Type& rTunnelType = cppu::UnoType<lang::XUnoTunnel>::get();
896 uno::Any aAgg = m_xShapeAgg->queryAggregation( rTunnelType );
897 if(auto xAggTunnel = o3tl::tryAccess<uno::Reference<lang::XUnoTunnel>>(
898 aAgg))
899 {
900 if(xAggTunnel->is())
901 return (*xAggTunnel)->getSomething(rId);
902 }
903 }
904 return 0;
905}
906namespace
907{
908 void lcl_addShapePropertyEventFactories( SdrObject& _rObj, SwXShape& _rShape )
909 {
910 auto pProvider = std::make_unique<svx::PropertyValueProvider>( _rShape, "AnchorType" );
912 }
913}
914
916 uno::Reference<uno::XInterface> & xShape,
917 SwDoc const*const pDoc)
918 : m_pPage(nullptr)
919 , m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SHAPE))
920 , m_pPropertyMapEntries(aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_TEXT_SHAPE))
922 , m_bDescriptor(true)
923{
924 if(!xShape.is()) // default Ctor
925 return;
926
928 //aAgg contains a reference of the SvxShape!
929 {
930 uno::Any aAgg = xShape->queryInterface(rAggType);
931 aAgg >>= m_xShapeAgg;
932 // #i31698#
933 if ( m_xShapeAgg.is() )
934 {
936 OSL_ENSURE( mxShape.is(),
937 "<SwXShape::SwXShape(..)> - no XShape found at <xShapeAgg>" );
938 }
939 }
940 xShape = nullptr;
941 osl_atomic_increment(&m_refCount);
942 if( m_xShapeAgg.is() )
943 m_xShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) );
944 osl_atomic_decrement(&m_refCount);
945
947 if(pObj)
948 {
949 lcl_addShapePropertyEventFactories( *pObj, *this );
950 m_pImpl->m_bInitializedPropertyNotifier = true;
951 }
952
953}
954
956{
958 if(pObj)
960 return nullptr;
961}
962
964{
965 SdrObjListIter aIter( _rObj, SdrIterMode::DeepNoGroups );
966 while ( aIter.IsMore() )
967 {
968 SdrObject* pCurrent = aIter.Next();
969 OSL_ENSURE( pCurrent, "SwXShape::AddExistingShapeToFormat: invalid object list element!" );
970 if ( !pCurrent )
971 continue;
972
973 auto pSwShape = comphelper::getFromUnoTunnel<SwXShape>(pCurrent->getWeakUnoShape());
974 if ( pSwShape )
975 {
976 if ( pSwShape->m_bDescriptor )
977 pSwShape->m_bDescriptor = false;
978
979 if ( !pSwShape->m_pImpl->m_bInitializedPropertyNotifier )
980 {
981 lcl_addShapePropertyEventFactories( *pCurrent, *pSwShape );
982 pSwShape->m_pImpl->m_bInitializedPropertyNotifier = true;
983 }
984 }
985 }
986}
987
989{
990 SolarMutexGuard aGuard;
991
992 if (m_xShapeAgg.is())
993 {
994 uno::Reference< uno::XInterface > xRef;
995 m_xShapeAgg->setDelegator(xRef);
996 }
997 m_pImpl.reset();
998 if(m_pPage)
999 const_cast<SwFmDrawPage*>(m_pPage)->RemoveShape(this);
1000}
1001
1003{
1004 uno::Any aRet;
1005 SdrObject* pObj = nullptr;
1006
1007 if ((aType == cppu::UnoType<text::XText>::get())
1010 {
1012
1013 aRet = SwTextBoxHelper::queryInterface(GetFrameFormat(), aType, pObj);
1014 if (aRet.hasValue())
1015 return aRet;
1016 }
1017 aRet = SwXShapeBaseClass::queryInterface(aType);
1018 // #i53320# - follow-up of #i31698#
1019 // interface drawing::XShape is overloaded. Thus, provide
1020 // correct object instance.
1021 if(!aRet.hasValue() && m_xShapeAgg.is())
1022 {
1023 if(aType == cppu::UnoType<XShape>::get())
1024 aRet <<= uno::Reference<XShape>(this);
1025 else
1026 aRet = m_xShapeAgg->queryAggregation(aType);
1027 }
1028 return aRet;
1029}
1030
1031uno::Sequence< uno::Type > SwXShape::getTypes( )
1032{
1033 uno::Sequence< uno::Type > aRet = SwXShapeBaseClass::getTypes();
1034 if(m_xShapeAgg.is())
1035 {
1036 uno::Any aProv = m_xShapeAgg->queryAggregation(cppu::UnoType<XTypeProvider>::get());
1037 if(aProv.hasValue())
1038 {
1039 uno::Reference< XTypeProvider > xAggProv;
1040 aProv >>= xAggProv;
1041 return comphelper::concatSequences(aRet, xAggProv->getTypes());
1042 }
1043 }
1044 return aRet;
1045}
1046
1047uno::Sequence< sal_Int8 > SwXShape::getImplementationId( )
1048{
1049 return css::uno::Sequence<sal_Int8>();
1050}
1051
1052uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo()
1053{
1054 SolarMutexGuard aGuard;
1055 if (!mxPropertySetInfo)
1056 {
1057 if(m_xShapeAgg.is())
1058 {
1059 const uno::Type& rPropSetType = cppu::UnoType<beans::XPropertySet>::get();
1060 uno::Any aPSet = m_xShapeAgg->queryAggregation( rPropSetType );
1061 if(auto xPrSet = o3tl::tryAccess<uno::Reference<beans::XPropertySet>>(
1062 aPSet))
1063 {
1064 uno::Reference< beans::XPropertySetInfo > xInfo = (*xPrSet)->getPropertySetInfo();
1065 // Expand PropertySetInfo!
1066 const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
1068 }
1069 }
1072 }
1073 return mxPropertySetInfo;
1074}
1075
1076void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
1077{
1078 SolarMutexGuard aGuard;
1079 SwFrameFormat* pFormat = GetFrameFormat();
1080 const SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName( rPropertyName );
1081 if(!m_xShapeAgg.is())
1082 return;
1083
1084 if(pEntry)
1085 {
1086 if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
1087 throw beans::PropertyVetoException ("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
1088 // with the layout it is possible to move the anchor without changing the position
1089 if(pFormat)
1090 {
1091 SwAttrSet aSet(pFormat->GetAttrSet());
1092 SwDoc* pDoc = pFormat->GetDoc();
1093 if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORFRAME == pEntry->nMemberId)
1094 {
1095 bool bDone = false;
1096 uno::Reference<text::XTextFrame> xFrame;
1097 if(aValue >>= xFrame)
1098 {
1099 SwXFrame* pFrame = dynamic_cast<SwXFrame*>(xFrame.get());
1100 if(pFrame && pFrame->GetFrameFormat() &&
1101 pFrame->GetFrameFormat()->GetDoc() == pDoc)
1102 {
1103 UnoActionContext aCtx(pDoc);
1105 aItemSet.SetParent(&pFormat->GetAttrSet());
1106 SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aItemSet.Get(pEntry->nWID));
1107 SwPosition aPos(*pFrame->GetFrameFormat()->GetContent().GetContentIdx());
1108 aAnchor.SetAnchor(&aPos);
1109 aAnchor.SetType(RndStdIds::FLY_AT_FLY);
1110 aItemSet.Put(aAnchor);
1111 pFormat->SetFormatAttr(aItemSet);
1112 bDone = true;
1113 }
1114 }
1115 if(!bDone)
1116 throw lang::IllegalArgumentException();
1117 }
1118 else if(RES_OPAQUE == pEntry->nWID)
1119 {
1120 SvxShape* pSvxShape = GetSvxShape();
1121 SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!");
1122 if(pSvxShape)
1123 {
1124 SdrObject* pObj = pSvxShape->GetSdrObject();
1125 // set layer of new drawing
1126 // object to corresponding invisible layer.
1127 bool bIsVisible = pDoc->getIDocumentDrawModelAccess().IsVisibleLayerId( pObj->GetLayer() );
1128 if(SdrInventor::FmForm != pObj->GetObjInventor())
1129 {
1130 pObj->SetLayer( *o3tl::doAccess<bool>(aValue)
1133 }
1134 else
1135 {
1137 }
1138
1139 }
1140
1141 }
1142 // #i26791# - special handling for property FN_TEXT_RANGE
1143 else if ( FN_TEXT_RANGE == pEntry->nWID )
1144 {
1145 SwFormatAnchor aAnchor( aSet.Get( RES_ANCHOR ) );
1146 if (aAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE)
1147 {
1148 // set property <TextRange> not valid for to-page anchored shapes
1149 throw lang::IllegalArgumentException();
1150 }
1151
1152 std::unique_ptr<SwUnoInternalPaM> pInternalPam(
1153 new SwUnoInternalPaM( *(pFormat->GetDoc()) ));
1154 uno::Reference< text::XTextRange > xRg;
1155 aValue >>= xRg;
1156 if (!::sw::XTextRangeToSwPaM(*pInternalPam, xRg) )
1157 {
1158 throw uno::RuntimeException();
1159 }
1160
1161 if (aAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR)
1162 {
1163 //delete old SwFormatFlyCnt
1164 //With AnchorAsCharacter the current TextAttribute has to be deleted.
1165 //Tbis removes the frame format too.
1166 //To prevent this the connection between format and attribute has to be broken before.
1167 SwTextNode *pTextNode = aAnchor.GetAnchorNode()->GetTextNode();
1168 SAL_WARN_IF( !pTextNode->HasHints(), "sw.uno", "Missing FlyInCnt-Hint." );
1169 const sal_Int32 nIdx = aAnchor.GetAnchorContentOffset();
1170 SwTextAttr * const pHint =
1171 pTextNode->GetTextAttrForCharAt(
1172 nIdx, RES_TXTATR_FLYCNT );
1173 assert(pHint && "Missing Hint.");
1174 SAL_WARN_IF( pHint->Which() != RES_TXTATR_FLYCNT,
1175 "sw.uno", "Missing FlyInCnt-Hint." );
1176 SAL_WARN_IF( pHint->GetFlyCnt().GetFrameFormat() != pFormat,
1177 "sw.uno", "Wrong TextFlyCnt-Hint." );
1178 const_cast<SwFormatFlyCnt&>(pHint->GetFlyCnt())
1179 .SetFlyFormat();
1180
1181 //The connection is removed now the attribute can be deleted.
1182 pTextNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx );
1183 //create a new one
1184 SwTextNode *pNd = pInternalPam->GetPointNode().GetTextNode();
1185 SAL_WARN_IF( !pNd, "sw.uno", "Cursor not at TextNode." );
1186 SwFormatFlyCnt aFormat( pFormat );
1187 pNd->InsertItem(aFormat, pInternalPam->GetPoint()
1188 ->GetContentIndex(), 0 );
1189 //Refetch in case SwTextNode::InsertItem causes it to be deleted
1190 pFormat = GetFrameFormat();
1191 }
1192 else
1193 {
1194 aAnchor.SetAnchor( pInternalPam->GetPoint() );
1195 aSet.Put(aAnchor);
1196 pFormat->SetFormatAttr(aSet);
1197 }
1198 }
1199 else if (pEntry->nWID == FN_TEXT_BOX)
1200 {
1202 if (pEntry->nMemberId == MID_TEXT_BOX)
1203 {
1204 bool bValue(false);
1205 aValue >>= bValue;
1206
1207 if (bValue)
1208 SwTextBoxHelper::create(pFormat, pObj);
1209 else
1210 SwTextBoxHelper::destroy(pFormat, pObj);
1211 }
1212 else if (pEntry->nMemberId == MID_TEXT_BOX_CONTENT)
1213 {
1214 if (aValue.getValueType()
1215 == cppu::UnoType<uno::Reference<text::XTextFrame>>::get())
1216 SwTextBoxHelper::set(pFormat, pObj,
1217 aValue.get<uno::Reference<text::XTextFrame>>());
1218 else
1219 SAL_WARN( "sw.uno", "This is not a TextFrame!" );
1220 }
1221 }
1222 else if (pEntry->nWID == RES_CHAIN)
1223 {
1224 if (pEntry->nMemberId == MID_CHAIN_NEXTNAME || pEntry->nMemberId == MID_CHAIN_PREVNAME)
1225 SwTextBoxHelper::syncProperty(pFormat, pEntry->nWID, pEntry->nMemberId, aValue,
1227 }
1228 // #i28749#
1229 else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pEntry->nWID )
1230 {
1231 sal_Int16 nPositionLayoutDir = 0;
1232 aValue >>= nPositionLayoutDir;
1233 pFormat->SetPositionLayoutDir( nPositionLayoutDir );
1234 }
1235 else if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout())
1236 {
1237 UnoActionContext aCtx(pDoc);
1238 if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId)
1239 {
1240 SdrObject* pObj = pFormat->FindSdrObject();
1241 SdrMarkList aList;
1242 SdrMark aMark(pObj);
1243 aList.InsertEntry(aMark);
1244 sal_Int32 nAnchor = 0;
1245 cppu::enum2int( nAnchor, aValue );
1246 pDoc->ChgAnchor( aList, static_cast<RndStdIds>(nAnchor),
1247 false, true );
1248 }
1249 else
1250 {
1251 m_pPropSet->setPropertyValue(*pEntry, aValue, aSet);
1252 pFormat->SetFormatAttr(aSet);
1253 }
1254 }
1255 else if( RES_FRM_SIZE == pEntry->nWID &&
1259 {
1260 SvxShape* pSvxShape = GetSvxShape();
1261 SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!");
1262 if(pSvxShape)
1263 {
1264 SdrObject* pObj = pSvxShape->GetSdrObject();
1265 sal_Int16 nPercent(100);
1266 aValue >>= nPercent;
1267 switch (pEntry->nMemberId)
1268 {
1270 pObj->SetRelativeWidth( nPercent / 100.0 );
1271 break;
1273 pObj->SetRelativeHeight( nPercent / 100.0 );
1274 break;
1276 pObj->SetRelativeWidthRelation(nPercent);
1277 break;
1279 pObj->SetRelativeHeightRelation(nPercent);
1280 break;
1281 }
1282 }
1283 }
1284 else if (pEntry->nWID == RES_HORI_ORIENT
1286 && aSet.Get(RES_ANCHOR).GetAnchorId() == RndStdIds::FLY_AT_PAGE)
1287 {
1288 uno::Any value(aValue);
1289 sal_Int16 nRelOrient(text::RelOrientation::PAGE_FRAME);
1290 aValue >>= nRelOrient;
1291 if (sw::GetAtPageRelOrientation(nRelOrient, true))
1292 {
1293 SAL_WARN("sw.core", "SwXShape: fixing invalid horizontal RelOrientation for at-page anchor");
1294 value <<= nRelOrient;
1295 }
1296 m_pPropSet->setPropertyValue( *pEntry, value, aSet );
1297 pFormat->SetFormatAttr(aSet);
1298 }
1299 else
1300 {
1301 m_pPropSet->setPropertyValue( *pEntry, aValue, aSet );
1302
1303 if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId)
1304 {
1305 bool bSetAttr = true;
1306 text::TextContentAnchorType eNewAnchor = static_cast<text::TextContentAnchorType>(SWUnoHelper::GetEnumAsInt32( aValue ));
1307
1308 //if old anchor was in_cntnt the related text attribute has to be removed
1309 const SwFormatAnchor& rOldAnchor = pFormat->GetAnchor();
1310 RndStdIds eOldAnchorId = rOldAnchor.GetAnchorId();
1311 SdrObject* pObj = pFormat->FindSdrObject();
1312 SwFrameFormat *pFlyFormat = FindFrameFormat( pObj );
1313 pFlyFormat->DelFrames();
1314 if( text::TextContentAnchorType_AS_CHARACTER != eNewAnchor &&
1315 (RndStdIds::FLY_AS_CHAR == eOldAnchorId))
1316 {
1317 //With AnchorAsCharacter the current TextAttribute has to be deleted.
1318 //Tbis removes the frame format too.
1319 //To prevent this the connection between format and attribute has to be broken before.
1320 SwTextNode *pTextNode = rOldAnchor.GetAnchorNode()->GetTextNode();
1321 SAL_WARN_IF( !pTextNode->HasHints(), "sw.uno", "Missing FlyInCnt-Hint." );
1322 const sal_Int32 nIdx = rOldAnchor.GetAnchorContentOffset();
1323 SwTextAttr * const pHint =
1324 pTextNode->GetTextAttrForCharAt(
1325 nIdx, RES_TXTATR_FLYCNT );
1326 assert(pHint && "Missing Hint.");
1327 SAL_WARN_IF( pHint->Which() != RES_TXTATR_FLYCNT,
1328 "sw.uno", "Missing FlyInCnt-Hint." );
1329 SAL_WARN_IF( pHint->GetFlyCnt().GetFrameFormat() != pFlyFormat,
1330 "sw.uno", "Wrong TextFlyCnt-Hint." );
1331 const_cast<SwFormatFlyCnt&>(pHint->GetFlyCnt())
1332 .SetFlyFormat();
1333
1334 //The connection is removed now the attribute can be deleted.
1335 pTextNode->DeleteAttributes(RES_TXTATR_FLYCNT, nIdx);
1336 }
1337 else if( text::TextContentAnchorType_AT_PAGE != eNewAnchor &&
1338 (RndStdIds::FLY_AT_PAGE == eOldAnchorId))
1339 {
1340 SwFormatAnchor aNewAnchor( aSet.Get( RES_ANCHOR ) );
1341 //if the fly has been anchored at page then it needs to be connected
1342 //to the content position
1343 SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
1345 {
1347 Point aTmp( pObj->GetSnapRect().TopLeft() );
1349 }
1350 else
1351 {
1352 //without access to the layout the last node of the body will be used as anchor position
1353 aPam.Move( fnMoveBackward, GoInDoc );
1354 }
1355 //anchor position has to be inserted after the text attribute has been inserted
1356 aNewAnchor.SetAnchor( aPam.GetPoint() );
1357 aSet.Put( aNewAnchor );
1358 pFormat->SetFormatAttr(aSet);
1359 bSetAttr = false;
1360 }
1361 if( text::TextContentAnchorType_AS_CHARACTER == eNewAnchor &&
1362 (RndStdIds::FLY_AS_CHAR != eOldAnchorId))
1363 {
1364 SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
1366 {
1368 Point aTmp( pObj->GetSnapRect().TopLeft() );
1370 }
1371 else
1372 {
1373 //without access to the layout the last node of the body will be used as anchor position
1374 aPam.Move( fnMoveBackward, GoInDoc );
1375 }
1376 //the RES_TXTATR_FLYCNT needs to be added now
1377 SwTextNode *pNd = aPam.GetPointNode().GetTextNode();
1378 SAL_WARN_IF( !pNd, "sw.uno", "Cursor is not in a TextNode." );
1379 SwFormatFlyCnt aFormat( pFlyFormat );
1380 pNd->InsertItem(aFormat,
1381 aPam.GetPoint()->GetContentIndex(), 0 );
1382 aPam.GetPoint()->AdjustContent(-1); // InsertItem moved it
1383 SwFormatAnchor aNewAnchor(
1384 aSet.Get(RES_ANCHOR));
1385 aNewAnchor.SetAnchor( aPam.GetPoint() );
1386 aSet.Put( aNewAnchor );
1387 }
1388 if( bSetAttr )
1389 pFormat->SetFormatAttr(aSet);
1390
1391 // If this property is an anchor change, and there is a group shape with textboxes
1392 // do anchor sync in time unless the anchor sync in the porfly will cause crash during
1393 // layout calculation (When importing an inline shape in docx via dmapper).
1394 if (pFormat->Which() == RES_DRAWFRMFMT && pFormat->GetOtherTextBoxFormats()
1395 && pFormat->GetOtherTextBoxFormats()->GetTextBoxCount()
1400 }
1401 else
1402 pFormat->SetFormatAttr(aSet);
1403 }
1404
1405 // We have a pFormat and a pEntry as well: try to sync TextBox property.
1406 SwTextBoxHelper::syncProperty(pFormat, pEntry->nWID, pEntry->nMemberId, aValue,
1408 }
1409 else
1410 {
1411 SfxPoolItem* pItem = nullptr;
1412 switch(pEntry->nWID)
1413 {
1414 case RES_ANCHOR:
1415 pItem = m_pImpl->GetAnchor(true);
1416 break;
1417 case RES_HORI_ORIENT:
1418 pItem = m_pImpl->GetHOrient(true);
1419 break;
1420 case RES_VERT_ORIENT:
1421 pItem = m_pImpl->GetVOrient(true);
1422 break;
1423 case RES_LR_SPACE:
1424 pItem = m_pImpl->GetLRSpace(true);
1425 break;
1426 case RES_UL_SPACE:
1427 pItem = m_pImpl->GetULSpace(true);
1428 break;
1429 case RES_SURROUND:
1430 pItem = m_pImpl->GetSurround(true);
1431 break;
1432 case FN_TEXT_RANGE:
1433 if(auto tr = o3tl::tryAccess<
1434 uno::Reference<text::XTextRange>>(aValue))
1435 {
1436 uno::Reference< text::XTextRange > & rRange = m_pImpl->GetTextRange();
1437 rRange = *tr;
1438 }
1439 break;
1440 case RES_OPAQUE :
1441 m_pImpl->SetOpaque(*o3tl::doAccess<bool>(aValue));
1442 break;
1443 // #i26791#
1445 {
1446 pItem = m_pImpl->GetFollowTextFlow( true );
1447 }
1448 break;
1449 // #i28701#
1451 {
1452 pItem = m_pImpl->GetWrapInfluenceOnObjPos( true );
1453 }
1454 break;
1455 // #i28749#
1457 {
1458 sal_Int16 nPositionLayoutDir = 0;
1459 aValue >>= nPositionLayoutDir;
1460 m_pImpl->SetPositionLayoutDir( nPositionLayoutDir );
1461 }
1462 break;
1463 }
1464 if(pItem)
1465 pItem->PutValue(aValue, pEntry->nMemberId);
1466 }
1467 }
1468 else
1469 {
1470 const uno::Type& rPSetType =
1472 uno::Any aPSet = m_xShapeAgg->queryAggregation(rPSetType);
1473 auto xPrSet = o3tl::tryAccess<uno::Reference<beans::XPropertySet>>(
1474 aPSet);
1475 if(!xPrSet)
1476 throw uno::RuntimeException();
1477 // #i31698# - setting the caption point of a
1478 // caption object doesn't have to change the object position.
1479 // Thus, keep the position, before the caption point is set and
1480 // restore it afterwards.
1481 awt::Point aKeepedPosition( 0, 0 );
1482 if ( rPropertyName == "CaptionPoint" && getShapeType() == "com.sun.star.drawing.CaptionShape" )
1483 {
1484 aKeepedPosition = getPosition();
1485 }
1486 if( pFormat && pFormat->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() )
1487 {
1488 UnoActionContext aCtx(pFormat->GetDoc());
1489 (*xPrSet)->setPropertyValue(rPropertyName, aValue);
1490 }
1491 else
1492 (*xPrSet)->setPropertyValue(rPropertyName, aValue);
1493
1494 if (pFormat)
1495 {
1496 // We have a pFormat (but no pEntry): try to sync TextBox property.
1497 SwTextBoxHelper::syncProperty(pFormat, rPropertyName, aValue,
1499 }
1500
1501 // #i31698# - restore object position, if caption point is set.
1502 if ( rPropertyName == "CaptionPoint" && getShapeType() == "com.sun.star.drawing.CaptionShape" )
1503 {
1504 setPosition( aKeepedPosition );
1505 }
1506 }
1507}
1508
1509uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
1510{
1511 SolarMutexGuard aGuard;
1512 uno::Any aRet;
1513 SwFrameFormat* pFormat = GetFrameFormat();
1514 if(m_xShapeAgg.is())
1515 {
1516 const SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName( rPropertyName );
1517 if(pEntry)
1518 {
1519 if(pFormat)
1520 {
1521 if(RES_OPAQUE == pEntry->nWID)
1522 {
1523 SvxShape* pSvxShape = GetSvxShape();
1524 OSL_ENSURE(pSvxShape, "No SvxShape found!");
1525 if(pSvxShape)
1526 {
1527 SdrObject* pObj = pSvxShape->GetSdrObject();
1528 // consider invisible layers
1529 aRet <<=
1530 ( pObj->GetLayer() != pFormat->GetDoc()->getIDocumentDrawModelAccess().GetHellId() &&
1532 }
1533 }
1534 else if(FN_ANCHOR_POSITION == pEntry->nWID)
1535 {
1536 SvxShape* pSvxShape = GetSvxShape();
1537 OSL_ENSURE(pSvxShape, "No SvxShape found!");
1538 if(pSvxShape)
1539 {
1540 SdrObject* pObj = pSvxShape->GetSdrObject();
1541 Point aPt = pObj->GetAnchorPos();
1542 awt::Point aPoint( convertTwipToMm100( aPt.X() ),
1543 convertTwipToMm100( aPt.Y() ) );
1544 aRet <<= aPoint;
1545 }
1546 }
1547 // #i26791# - special handling for FN_TEXT_RANGE
1548 else if ( FN_TEXT_RANGE == pEntry->nWID )
1549 {
1550 const SwFormatAnchor aAnchor = pFormat->GetAnchor();
1551 if (aAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE)
1552 {
1553 // return nothing, because property <TextRange> isn't
1554 // valid for to-page anchored shapes
1555 uno::Any aAny;
1556 aRet = aAny;
1557 }
1558 else
1559 {
1560 if ( aAnchor.GetAnchorNode() )
1561 {
1562 const rtl::Reference<SwXTextRange> xTextRange
1564 *pFormat->GetDoc(),
1565 *aAnchor.GetContentAnchor(),
1566 nullptr );
1567 aRet <<= uno::Reference<text::XTextRange>(xTextRange);
1568 }
1569 else
1570 {
1571 // return nothing
1572 uno::Any aAny;
1573 aRet = aAny;
1574 }
1575 }
1576 }
1577 else if (pEntry->nWID == FN_TEXT_BOX)
1578 {
1579 if (pEntry->nMemberId == MID_TEXT_BOX)
1580 {
1581 auto pSvxShape = GetSvxShape();
1582 bool bValue = SwTextBoxHelper::isTextBox(
1583 pFormat, RES_DRAWFRMFMT,
1584 ((pSvxShape && pSvxShape->GetSdrObject()) ? pSvxShape->GetSdrObject()
1585 : pFormat->FindRealSdrObject()));
1586 aRet <<= bValue;
1587 }
1588 else if (pEntry->nMemberId == MID_TEXT_BOX_CONTENT)
1589 {
1591 auto xRange = SwTextBoxHelper::queryInterface(
1593 pObj ? pObj : pFormat->FindRealSdrObject());
1594 uno::Reference<text::XTextFrame> xFrame(xRange, uno::UNO_QUERY);
1595 if (xFrame.is())
1596 aRet <<= xFrame;
1597 }
1598 }
1599 else if (pEntry->nWID == RES_CHAIN)
1600 {
1601 switch (pEntry->nMemberId)
1602 {
1603 case MID_CHAIN_PREVNAME:
1604 case MID_CHAIN_NEXTNAME:
1605 case MID_CHAIN_NAME:
1606 SwTextBoxHelper::getProperty(pFormat, pEntry->nWID, pEntry->nMemberId, aRet);
1607 break;
1608 }
1609 }
1610 // #i28749#
1611 else if ( FN_SHAPE_TRANSFORMATION_IN_HORI_L2R == pEntry->nWID )
1612 {
1613 // get property <::drawing::Shape::Transformation>
1614 // without conversion to layout direction as below
1615 aRet = _getPropAtAggrObj( "Transformation" );
1616 }
1617 else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pEntry->nWID )
1618 {
1619 aRet <<= pFormat->GetPositionLayoutDir();
1620 }
1621 // #i36248#
1622 else if ( FN_SHAPE_STARTPOSITION_IN_HORI_L2R == pEntry->nWID )
1623 {
1624 // get property <::drawing::Shape::StartPosition>
1625 // without conversion to layout direction as below
1626 aRet = _getPropAtAggrObj( "StartPosition" );
1627 }
1628 else if ( FN_SHAPE_ENDPOSITION_IN_HORI_L2R == pEntry->nWID )
1629 {
1630 // get property <::drawing::Shape::EndPosition>
1631 // without conversion to layout direction as below
1632 aRet = _getPropAtAggrObj( "EndPosition" );
1633 }
1634 else if (pEntry->nWID == RES_FRM_SIZE &&
1635 (pEntry->nMemberId == MID_FRMSIZE_REL_HEIGHT ||
1636 pEntry->nMemberId == MID_FRMSIZE_REL_WIDTH ||
1639 {
1640 SvxShape* pSvxShape = GetSvxShape();
1641 SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!");
1642 sal_Int16 nRet = 0;
1643 if (pSvxShape)
1644 {
1645 SdrObject* pObj = pSvxShape->GetSdrObject();
1646 switch (pEntry->nMemberId)
1647 {
1649 if (pObj->GetRelativeWidth())
1650 nRet = *pObj->GetRelativeWidth() * 100;
1651 break;
1653 if (pObj->GetRelativeHeight())
1654 nRet = *pObj->GetRelativeHeight() * 100;
1655 break;
1657 nRet = pObj->GetRelativeWidthRelation();
1658 break;
1660 nRet = pObj->GetRelativeHeightRelation();
1661 break;
1662 }
1663 }
1664 aRet <<= nRet;
1665 }
1666 else
1667 {
1668 const SwAttrSet& rSet = pFormat->GetAttrSet();
1669 m_pPropSet->getPropertyValue(*pEntry, rSet, aRet);
1670 }
1671 }
1672 else
1673 {
1674 SfxPoolItem* pItem = nullptr;
1675 switch(pEntry->nWID)
1676 {
1677 case RES_ANCHOR:
1678 pItem = m_pImpl->GetAnchor();
1679 break;
1680 case RES_HORI_ORIENT:
1681 pItem = m_pImpl->GetHOrient();
1682 break;
1683 case RES_VERT_ORIENT:
1684 pItem = m_pImpl->GetVOrient();
1685 break;
1686 case RES_LR_SPACE:
1687 pItem = m_pImpl->GetLRSpace();
1688 break;
1689 case RES_UL_SPACE:
1690 pItem = m_pImpl->GetULSpace();
1691 break;
1692 case RES_SURROUND:
1693 pItem = m_pImpl->GetSurround();
1694 break;
1695 case FN_TEXT_RANGE :
1696 aRet <<= m_pImpl->GetTextRange();
1697 break;
1698 case RES_OPAQUE :
1699 aRet <<= m_pImpl->GetOpaque();
1700 break;
1701 case FN_ANCHOR_POSITION :
1702 {
1703 aRet <<= awt::Point();
1704 }
1705 break;
1706 // #i26791#
1708 {
1709 pItem = m_pImpl->GetFollowTextFlow();
1710 }
1711 break;
1712 // #i28701#
1714 {
1715 pItem = m_pImpl->GetWrapInfluenceOnObjPos();
1716 }
1717 break;
1718 // #i28749#
1720 {
1721 // get property <::drawing::Shape::Transformation>
1722 // without conversion to layout direction as below
1723 aRet = _getPropAtAggrObj( "Transformation" );
1724 }
1725 break;
1727 {
1728 aRet <<= m_pImpl->GetPositionLayoutDir();
1729 }
1730 break;
1731 // #i36248#
1733 {
1734 // get property <::drawing::Shape::StartPosition>
1735 // without conversion to layout direction as below
1736 aRet = _getPropAtAggrObj( "StartPosition" );
1737 }
1738 break;
1740 {
1741 // get property <::drawing::Shape::StartPosition>
1742 // without conversion to layout direction as below
1743 aRet = _getPropAtAggrObj( "EndPosition" );
1744 }
1745 break;
1746 }
1747 if(pItem)
1748 pItem->QueryValue(aRet, pEntry->nMemberId);
1749 }
1750 }
1751 else
1752 {
1753 aRet = _getPropAtAggrObj( rPropertyName );
1754
1755 // #i31698# - convert the position (translation)
1756 // of the drawing object in the transformation
1757 if ( rPropertyName == "Transformation" )
1758 {
1759 drawing::HomogenMatrix3 aMatrix;
1760 aRet >>= aMatrix;
1761 aRet <<= ConvertTransformationToLayoutDir( aMatrix );
1762 }
1763 // #i36248#
1764 else if ( rPropertyName == "StartPosition" )
1765 {
1766 awt::Point aStartPos;
1767 aRet >>= aStartPos;
1768 // #i59051#
1769 aRet <<= ConvertStartOrEndPosToLayoutDir( aStartPos );
1770 }
1771 else if ( rPropertyName == "EndPosition" )
1772 {
1773 awt::Point aEndPos;
1774 aRet >>= aEndPos;
1775 // #i59051#
1776 aRet <<= ConvertStartOrEndPosToLayoutDir( aEndPos );
1777 }
1778 // #i59051#
1779 else if ( rPropertyName == "PolyPolygonBezier" )
1780 {
1781 drawing::PolyPolygonBezierCoords aPath;
1782 aRet >>= aPath;
1783 aRet <<= ConvertPolyPolygonBezierToLayoutDir( aPath );
1784 }
1785 else if (rPropertyName == "ZOrder")
1786 {
1787 // Convert the real draw page position to the logical one that ignores textboxes.
1788 if (pFormat)
1789 {
1790 const SdrObject* pObj = pFormat->FindRealSdrObject();
1791 if (pObj)
1792 {
1793 bool bConvert = true;
1794 if (SvxShape* pSvxShape = GetSvxShape())
1795 // In case of group shapes, pSvxShape points to the child shape, while pObj points to the outermost group shape.
1796 if (pSvxShape->GetSdrObject() != pObj)
1797 // Textboxes are not expected inside group shapes, so no conversion is necessary there.
1798 bConvert = false;
1799 if (bConvert)
1800 {
1801 aRet <<= SwTextBoxHelper::getOrdNum(pObj);
1802 }
1803 }
1804 }
1805 }
1806 }
1807 }
1808 return aRet;
1809}
1810
1811uno::Any SwXShape::_getPropAtAggrObj( const OUString& _rPropertyName )
1812{
1813 uno::Any aRet;
1814
1815 const uno::Type& rPSetType =
1817 uno::Any aPSet = m_xShapeAgg->queryAggregation(rPSetType);
1818 auto xPrSet = o3tl::tryAccess<uno::Reference<beans::XPropertySet>>(aPSet);
1819 if ( !xPrSet )
1820 {
1821 throw uno::RuntimeException();
1822 }
1823 aRet = (*xPrSet)->getPropertyValue( _rPropertyName );
1824
1825 return aRet;
1826}
1827
1828beans::PropertyState SwXShape::getPropertyState( const OUString& rPropertyName )
1829{
1830 SolarMutexGuard aGuard;
1831 uno::Sequence< OUString > aNames { rPropertyName };
1832 uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aNames);
1833 return aStates.getConstArray()[0];
1834}
1835
1836uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
1837 const uno::Sequence< OUString >& aPropertyNames )
1838{
1839 SolarMutexGuard aGuard;
1840 SwFrameFormat* pFormat = GetFrameFormat();
1841 uno::Sequence< beans::PropertyState > aRet(aPropertyNames.getLength());
1842 if(!m_xShapeAgg.is())
1843 throw uno::RuntimeException();
1844
1845 SvxShape* pSvxShape = GetSvxShape();
1846 bool bGroupMember = false;
1847 bool bFormControl = false;
1848 SdrObject* pObject = pSvxShape ? pSvxShape->GetSdrObject() : nullptr;
1849 if(pObject)
1850 {
1851 bGroupMember = pObject->getParentSdrObjectFromSdrObject() != nullptr;
1852 bFormControl = pObject->GetObjInventor() == SdrInventor::FmForm;
1853 }
1854 const OUString* pNames = aPropertyNames.getConstArray();
1855 beans::PropertyState* pRet = aRet.getArray();
1856 uno::Reference< XPropertyState > xShapePrState;
1857 for(sal_Int32 nProperty = 0; nProperty < aPropertyNames.getLength(); nProperty++)
1858 {
1859 const SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName( pNames[nProperty] );
1860 if(pEntry)
1861 {
1862 if(RES_OPAQUE == pEntry->nWID)
1863 pRet[nProperty] = bFormControl ?
1864 beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
1865 else if(FN_ANCHOR_POSITION == pEntry->nWID)
1866 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1867 else if(FN_TEXT_RANGE == pEntry->nWID)
1868 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1869 else if(bGroupMember)
1870 pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE;
1871 else if (pEntry->nWID == RES_FRM_SIZE &&
1874 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1875 else if (pEntry->nWID == FN_TEXT_BOX)
1876 {
1877 // The TextBox property is set, if we can find a textbox for this shape.
1878 if (pFormat
1881 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1882 else
1883 pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE;
1884 }
1885 else if(pFormat)
1886 {
1887 const SwAttrSet& rSet = pFormat->GetAttrSet();
1888 SfxItemState eItemState = rSet.GetItemState(pEntry->nWID, false);
1889
1890 if(SfxItemState::SET == eItemState)
1891 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1892 else if(SfxItemState::DEFAULT == eItemState)
1893 pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE;
1894 else
1895 pRet[nProperty] = beans::PropertyState_AMBIGUOUS_VALUE;
1896 }
1897 else
1898 {
1899 SfxPoolItem* pItem = nullptr;
1900 switch(pEntry->nWID)
1901 {
1902 case RES_ANCHOR:
1903 pItem = m_pImpl->GetAnchor();
1904 break;
1905 case RES_HORI_ORIENT:
1906 pItem = m_pImpl->GetHOrient();
1907 break;
1908 case RES_VERT_ORIENT:
1909 pItem = m_pImpl->GetVOrient();
1910 break;
1911 case RES_LR_SPACE:
1912 pItem = m_pImpl->GetLRSpace();
1913 break;
1914 case RES_UL_SPACE:
1915 pItem = m_pImpl->GetULSpace();
1916 break;
1917 case RES_SURROUND:
1918 pItem = m_pImpl->GetSurround();
1919 break;
1920 // #i28701#
1922 {
1923 pItem = m_pImpl->GetWrapInfluenceOnObjPos();
1924 }
1925 break;
1926 }
1927 if(pItem)
1928 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1929 else
1930 pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE;
1931 }
1932 }
1933 else
1934 {
1935 if(!xShapePrState.is())
1936 {
1937 const uno::Type& rPStateType = cppu::UnoType<XPropertyState>::get();
1938 uno::Any aPState = m_xShapeAgg->queryAggregation(rPStateType);
1939 auto ps = o3tl::tryAccess<uno::Reference<XPropertyState>>(
1940 aPState);
1941 if(!ps)
1942 throw uno::RuntimeException();
1943 xShapePrState = *ps;
1944 }
1945 pRet[nProperty] = xShapePrState->getPropertyState(pNames[nProperty]);
1946 }
1947 }
1948
1949 return aRet;
1950}
1951
1952void SwXShape::setPropertyToDefault( const OUString& rPropertyName )
1953{
1954 SolarMutexGuard aGuard;
1955 SwFrameFormat* pFormat = GetFrameFormat();
1956 if(!m_xShapeAgg.is())
1957 throw uno::RuntimeException();
1958
1959 const SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName( rPropertyName );
1960 if(pEntry)
1961 {
1962 if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
1963 throw uno::RuntimeException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
1964 if(pFormat)
1965 {
1966 const SfxItemSet& rSet = pFormat->GetAttrSet();
1967 SfxItemSet aSet(pFormat->GetDoc()->GetAttrPool(), pEntry->nWID, pEntry->nWID);
1968 aSet.SetParent(&rSet);
1969 aSet.ClearItem(pEntry->nWID);
1970 pFormat->GetDoc()->SetAttr(aSet, *pFormat);
1971 }
1972 else
1973 {
1974 switch(pEntry->nWID)
1975 {
1976 case RES_ANCHOR: m_pImpl->RemoveAnchor(); break;
1977 case RES_HORI_ORIENT: m_pImpl->RemoveHOrient(); break;
1978 case RES_VERT_ORIENT: m_pImpl->RemoveVOrient(); break;
1979 case RES_LR_SPACE: m_pImpl->RemoveLRSpace(); break;
1980 case RES_UL_SPACE: m_pImpl->RemoveULSpace(); break;
1981 case RES_SURROUND: m_pImpl->RemoveSurround();break;
1982 case RES_OPAQUE : m_pImpl->SetOpaque(false); break;
1983 case FN_TEXT_RANGE :
1984 break;
1985 // #i26791#
1987 {
1988 m_pImpl->RemoveFollowTextFlow();
1989 }
1990 break;
1991 // #i28701#
1993 {
1994 m_pImpl->RemoveWrapInfluenceOnObjPos();
1995 }
1996 break;
1997 }
1998 }
1999 }
2000 else
2001 {
2002 const uno::Type& rPStateType = cppu::UnoType<XPropertyState>::get();
2003 uno::Any aPState = m_xShapeAgg->queryAggregation(rPStateType);
2004 auto xShapePrState = o3tl::tryAccess<uno::Reference<XPropertyState>>(
2005 aPState);
2006 if(!xShapePrState)
2007 throw uno::RuntimeException();
2008 (*xShapePrState)->setPropertyToDefault( rPropertyName );
2009 }
2010
2011}
2012
2013uno::Any SwXShape::getPropertyDefault( const OUString& rPropertyName )
2014{
2015 SolarMutexGuard aGuard;
2016 SwFrameFormat* pFormat = GetFrameFormat();
2017 uno::Any aRet;
2018 if(!m_xShapeAgg.is())
2019 throw uno::RuntimeException();
2020
2021 const SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName( rPropertyName );
2022 if(pEntry)
2023 {
2024 if(!(pEntry->nWID < RES_FRMATR_END && pFormat))
2025 throw uno::RuntimeException();
2026
2027 const SfxPoolItem& rDefItem =
2028 pFormat->GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID);
2029 rDefItem.QueryValue(aRet, pEntry->nMemberId);
2030
2031 }
2032 else
2033 {
2034 const uno::Type& rPStateType = cppu::UnoType<XPropertyState>::get();
2035 uno::Any aPState = m_xShapeAgg->queryAggregation(rPStateType);
2036 auto xShapePrState = o3tl::tryAccess<uno::Reference<XPropertyState>>(
2037 aPState);
2038 if(!xShapePrState)
2039 throw uno::RuntimeException();
2040 (*xShapePrState)->getPropertyDefault( rPropertyName );
2041 }
2042
2043 return aRet;
2044}
2045
2047 const OUString& _propertyName,
2048 const uno::Reference< beans::XPropertyChangeListener > & _listener )
2049{
2050 if ( !m_xShapeAgg.is() )
2051 throw uno::RuntimeException("no shape aggregate", *this );
2052
2053 // must be handled by the aggregate
2054 uno::Reference< beans::XPropertySet > xShapeProps;
2055 if ( m_xShapeAgg->queryAggregation( cppu::UnoType<beans::XPropertySet>::get() ) >>= xShapeProps )
2056 xShapeProps->addPropertyChangeListener( _propertyName, _listener );
2057}
2058
2060 const OUString& _propertyName,
2061 const uno::Reference< beans::XPropertyChangeListener > & _listener)
2062{
2063 if ( !m_xShapeAgg.is() )
2064 throw uno::RuntimeException("no shape aggregate", *this );
2065
2066 // must be handled by the aggregate
2067 uno::Reference< beans::XPropertySet > xShapeProps;
2068 if ( m_xShapeAgg->queryAggregation( cppu::UnoType<beans::XPropertySet>::get() ) >>= xShapeProps )
2069 xShapeProps->removePropertyChangeListener( _propertyName, _listener );
2070}
2071
2073 const OUString& /*PropertyName*/,
2074 const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/ )
2075{
2076 OSL_FAIL("not implemented");
2077}
2078
2080 const OUString& /*PropertyName*/,
2081 const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
2082{
2083 OSL_FAIL("not implemented");
2084}
2085
2086void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
2087{
2088 SolarMutexGuard aGuard;
2089
2090 // get access to SwDoc
2091 // (see also SwXTextRange::XTextRangeToSwPaM)
2092 const SwDoc* pDoc = nullptr;
2093 if (auto pRange = dynamic_cast<SwXTextRange*>(xTextRange.get()))
2094 pDoc = &pRange->GetDoc();
2095 else if (auto pText = dynamic_cast<SwXText*>(xTextRange.get()))
2096 pDoc = pText->GetDoc();
2097 else if (auto pCursor = dynamic_cast<OTextCursorHelper*>(xTextRange.get()))
2098 pDoc = pCursor->GetDoc();
2099 else if (auto pPortion = dynamic_cast<SwXTextPortion*>(xTextRange.get()))
2100 pDoc = &pPortion->GetCursor().GetDoc();
2101 else if (auto pParagraph = dynamic_cast<SwXParagraph*>(xTextRange.get());
2102 pParagraph && pParagraph->GetTextNode())
2103 pDoc = &pParagraph->GetTextNode()->GetDoc();
2104
2105 if(!pDoc)
2106 throw uno::RuntimeException();
2107 const SwDocShell* pDocSh = pDoc->GetDocShell();
2108 if (!pDocSh)
2109 return;
2110
2111 uno::Reference<frame::XModel> xModel = pDocSh->GetModel();
2112 uno::Reference< drawing::XDrawPageSupplier > xDPS(xModel, uno::UNO_QUERY);
2113 if (xDPS.is())
2114 {
2115 uno::Reference< drawing::XDrawPage > xDP( xDPS->getDrawPage() );
2116 if (xDP.is())
2117 {
2118 uno::Any aPos;
2119 aPos <<= xTextRange;
2120 setPropertyValue("TextRange", aPos);
2121 uno::Reference< drawing::XShape > xTemp( static_cast<cppu::OWeakObject*>(this), uno::UNO_QUERY );
2122 xDP->add( xTemp );
2123 }
2124 }
2125}
2126
2127uno::Reference< text::XTextRange > SwXShape::getAnchor()
2128{
2129 SolarMutexGuard aGuard;
2130 uno::Reference< text::XTextRange > aRef;
2131 SwFrameFormat* pFormat = GetFrameFormat();
2132 if(pFormat)
2133 {
2134 const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
2135 // return an anchor for non-page bound frames
2136 // and for page bound frames that have a page no == NULL and a content position
2137 if ((rAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) ||
2138 (rAnchor.GetAnchorNode() && !rAnchor.GetPageNum()))
2139 {
2140 if (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA)
2141 { // ensure that SwXTextRange has SwContentIndex
2142 const SwNode* pAnchorNode = rAnchor.GetAnchorNode();
2143 aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), SwPosition(*pAnchorNode), nullptr);
2144 }
2145 else
2146 {
2147 aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), *rAnchor.GetContentAnchor(), nullptr);
2148 }
2149 }
2150 }
2151 else
2152 aRef = m_pImpl->GetTextRange().get();
2153 return aRef;
2154}
2155
2157{
2158 SolarMutexGuard aGuard;
2159 SwFrameFormat* pFormat = GetFrameFormat();
2160 if(pFormat)
2161 {
2162 // determine correct <SdrObject>
2163 SvxShape* pSvxShape = GetSvxShape();
2164 SdrObject* pObj = pSvxShape ? pSvxShape->GetSdrObject() : nullptr;
2165 // safety assertion:
2166 // <pObj> must be the same as <pFormat->FindSdrObject()>, if <pObj> isn't
2167 // a 'virtual' drawing object.
2168 // correct assertion and refine it for safety reason.
2169 OSL_ENSURE( !pObj ||
2170 dynamic_cast<const SwDrawVirtObj*>( pObj) != nullptr ||
2172 pObj == pFormat->FindSdrObject(),
2173 "<SwXShape::dispose(..) - different 'master' drawing objects!!" );
2174 // perform delete of draw frame format *not*
2175 // for 'virtual' drawing objects.
2176 // no delete of draw format for members
2177 // of a group
2178 if ( pObj &&
2179 dynamic_cast<const SwDrawVirtObj*>( pObj) == nullptr &&
2181 pObj->IsInserted() )
2182 {
2183 const SwFormatAnchor& rFormatAnchor = pFormat->GetAnchor();
2184 if (rFormatAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR)
2185 {
2186 SwTextNode *pTextNode = rFormatAnchor.GetAnchorNode()->GetTextNode();
2187 const sal_Int32 nIdx = rFormatAnchor.GetAnchorContentOffset();
2188 pTextNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx );
2189 }
2190 else
2191 pFormat->GetDoc()->getIDocumentLayoutAccess().DelLayoutFormat( pFormat );
2192 }
2193 }
2194 if(m_xShapeAgg.is())
2195 {
2196 uno::Any aAgg(m_xShapeAgg->queryAggregation( cppu::UnoType<XComponent>::get()));
2197 uno::Reference<XComponent> xComp;
2198 aAgg >>= xComp;
2199 if(xComp.is())
2200 xComp->dispose();
2201 }
2202 if(m_pPage)
2203 {
2204 auto pPage = const_cast<SwFmDrawPage*>(m_pPage);
2205 m_pPage = nullptr;
2206 pPage->RemoveShape(this);
2207 }
2208}
2209
2211 const uno::Reference< lang::XEventListener > & aListener)
2212{
2213 SvxShape* pSvxShape = GetSvxShape();
2214 if(pSvxShape)
2215 pSvxShape->addEventListener(aListener);
2216}
2217
2219 const uno::Reference< lang::XEventListener > & aListener)
2220{
2221 SvxShape* pSvxShape = GetSvxShape();
2222 if(pSvxShape)
2223 pSvxShape->removeEventListener(aListener);
2224}
2225
2227{
2228 return "SwXShape";
2229}
2230
2231sal_Bool SwXShape::supportsService(const OUString& rServiceName)
2232{
2233 return cppu::supportsService(this, rServiceName);
2234}
2235
2236uno::Sequence< OUString > SwXShape::getSupportedServiceNames()
2237{
2238 uno::Sequence< OUString > aSeq;
2239 if (SvxShape* pSvxShape = GetSvxShape())
2240 aSeq = pSvxShape->getSupportedServiceNames();
2242 aSeq, std::initializer_list<std::u16string_view>{ u"com.sun.star.drawing.Shape" });
2243}
2244
2246{
2247 if(m_xShapeAgg.is())
2248 return comphelper::getFromUnoTunnel<SvxShape>(m_xShapeAgg);
2249 return nullptr;
2250}
2251
2252// #i31698#
2253// implementation of virtual methods from drawing::XShape
2254awt::Point SAL_CALL SwXShape::getPosition()
2255{
2256 awt::Point aPos( GetAttrPosition() );
2257
2258 // handle group members
2259 SvxShape* pSvxShape = GetSvxShape();
2260 if ( pSvxShape )
2261 {
2262 SdrObject* pTopGroupObj = GetTopGroupObj( pSvxShape );
2263 if ( pTopGroupObj )
2264 {
2265 // #i34750# - get attribute position of top group
2266 // shape and add offset between top group object and group member
2267 uno::Reference< drawing::XShape > xGroupShape( pTopGroupObj->getUnoShape(), uno::UNO_QUERY );
2268 aPos = xGroupShape->getPosition();
2269 // add offset between top group object and group member
2270 // to the determined attribute position
2271 // #i34750#:
2272 // consider the layout direction
2273 const tools::Rectangle aMemberObjRect = GetSvxShape()->GetSdrObject()->GetSnapRect();
2274 const tools::Rectangle aGroupObjRect = pTopGroupObj->GetSnapRect();
2275 // #i53320# - relative position of group member and
2276 // top group object is always given in horizontal left-to-right layout.
2277 awt::Point aOffset( 0, 0 );
2278 {
2279 aOffset.X = ( aMemberObjRect.Left() - aGroupObjRect.Left() );
2280 aOffset.Y = ( aMemberObjRect.Top() - aGroupObjRect.Top() );
2281 }
2282 aOffset.X = convertTwipToMm100(aOffset.X);
2283 aOffset.Y = convertTwipToMm100(aOffset.Y);
2284 aPos.X += aOffset.X;
2285 aPos.Y += aOffset.Y;
2286 }
2287 }
2288
2289 return aPos;
2290}
2291
2292void SAL_CALL SwXShape::setPosition( const awt::Point& aPosition )
2293{
2294 SdrObject* pTopGroupObj = GetTopGroupObj();
2295 if ( !pTopGroupObj )
2296 {
2297 // #i37877# - no adjustment of position attributes,
2298 // if the position also has to be applied at the drawing object and
2299 // a contact object is already registered at the drawing object.
2300 bool bApplyPosAtDrawObj(false);
2301 bool bNoAdjustOfPosProp(false);
2302 // #i35798# - apply position also to drawing object,
2303 // if drawing object has no anchor position set.
2304 if ( mxShape.is() )
2305 {
2306 SvxShape* pSvxShape = GetSvxShape();
2307 if ( pSvxShape )
2308 {
2309 const SdrObject* pObj = pSvxShape->GetSdrObject();
2310 if ( pObj &&
2311 pObj->GetAnchorPos().X() == 0 &&
2312 pObj->GetAnchorPos().Y() == 0 )
2313 {
2314 bApplyPosAtDrawObj = true;
2315 if ( pObj->GetUserCall() &&
2316 dynamic_cast<const SwDrawContact*>( pObj->GetUserCall()) != nullptr )
2317 {
2318 bNoAdjustOfPosProp = true;
2319 }
2320 }
2321 }
2322 }
2323 // shape isn't a group member. Thus, set positioning attributes
2324 if ( !bNoAdjustOfPosProp )
2325 {
2326 AdjustPositionProperties( aPosition );
2327 }
2328 if ( bApplyPosAtDrawObj )
2329 {
2330 mxShape->setPosition( aPosition );
2331 }
2332 }
2333 else if ( mxShape.is() )
2334 {
2335 // shape is a member of a group. Thus, set its position.
2336 awt::Point aNewPos( aPosition );
2337 // The given position is given in the according layout direction. Thus,
2338 // it has to be converted to a position in horizontal left-to-right
2339 // layout.
2340 // convert given absolute attribute position in layout direction into
2341 // position in horizontal left-to-right layout.
2342 {
2343 aNewPos = ConvertPositionToHoriL2R( aNewPos, getSize() );
2344 }
2345 // Convert given absolute position in horizontal left-to-right
2346 // layout into relative position in horizontal left-to-right layout.
2347 uno::Reference< drawing::XShape > xGroupShape( pTopGroupObj->getUnoShape(), uno::UNO_QUERY );
2348 {
2349 // #i34750#
2350 // use method <xGroupShape->getPosition()> to get the correct
2351 // position of the top group object.
2352 awt::Point aAttrPosInHoriL2R(
2353 ConvertPositionToHoriL2R( xGroupShape->getPosition(),
2354 xGroupShape->getSize() ) );
2355 aNewPos.X = o3tl::saturating_sub(aNewPos.X, aAttrPosInHoriL2R.X);
2356 aNewPos.Y = o3tl::saturating_sub(aNewPos.Y, aAttrPosInHoriL2R.Y);
2357 }
2358 // convert relative position in horizontal left-to-right layout into
2359 // absolute position in horizontal left-to-right layout
2360 {
2361 // #i34750#
2362 // use method <SvxShape->getPosition()> to get the correct
2363 // 'Drawing layer' position of the top group shape.
2364 auto pSvxGroupShape = comphelper::getFromUnoTunnel<SvxShape>(pTopGroupObj->getUnoShape());
2365 const awt::Point aGroupPos = pSvxGroupShape->getPosition();
2366 aNewPos.X = o3tl::saturating_add(aNewPos.X, aGroupPos.X);
2367 aNewPos.Y = o3tl::saturating_add(aNewPos.Y, aGroupPos.Y);
2368 }
2369 // set position
2370 mxShape->setPosition( aNewPos );
2371 }
2372}
2373
2374awt::Size SAL_CALL SwXShape::getSize()
2375{
2376 awt::Size aSize;
2377 if ( mxShape.is() )
2378 {
2379 aSize = mxShape->getSize();
2380 }
2381 return aSize;
2382}
2383
2384void SAL_CALL SwXShape::setSize( const awt::Size& aSize )
2385{
2386 comphelper::ProfileZone aZone("SwXShape::setSize");
2387
2388 if ( mxShape.is() )
2389 {
2390 mxShape->setSize( aSize );
2391 }
2393}
2394// #i31698#
2395// implementation of virtual methods from drawing::XShapeDescriptor
2396OUString SAL_CALL SwXShape::getShapeType()
2397{
2398 if ( mxShape.is() )
2399 {
2400 return mxShape->getShapeType();
2401 }
2402 return OUString();
2403}
2408{
2409 SdrObject* pTopGroupObj( nullptr );
2410
2411 SvxShape* pSvxShape = _pSvxShape ? _pSvxShape : GetSvxShape();
2412 if ( pSvxShape )
2413 {
2414 SdrObject* pSdrObj = pSvxShape->GetSdrObject();
2415 if ( pSdrObj && pSdrObj->getParentSdrObjectFromSdrObject() )
2416 {
2417 pTopGroupObj = pSdrObj->getParentSdrObjectFromSdrObject();
2418 while ( pTopGroupObj->getParentSdrObjectFromSdrObject() )
2419 {
2420 pTopGroupObj = pTopGroupObj->getParentSdrObjectFromSdrObject();
2421 }
2422 }
2423 }
2424
2425 return pTopGroupObj;
2426}
2427
2432{
2433 awt::Point aAttrPos;
2434
2435 uno::Any aHoriPos( getPropertyValue("HoriOrientPosition") );
2436 aHoriPos >>= aAttrPos.X;
2437 uno::Any aVertPos( getPropertyValue("VertOrientPosition") );
2438 aVertPos >>= aAttrPos.Y;
2439 // #i35798# - fallback, if attribute position is (0,0)
2440 // and no anchor position is applied to the drawing object
2441 SvxShape* pSvxShape = GetSvxShape();
2442 if ( pSvxShape )
2443 {
2444 const SdrObject* pObj = pSvxShape->GetSdrObject();
2445 if ( pObj &&
2446 pObj->GetAnchorPos().X() == 0 &&
2447 pObj->GetAnchorPos().Y() == 0 &&
2448 aAttrPos.X == 0 && aAttrPos.Y == 0 )
2449 {
2450 const tools::Rectangle aObjRect = pObj->GetSnapRect();
2451 aAttrPos.X = convertTwipToMm100(aObjRect.Left());
2452 aAttrPos.Y = convertTwipToMm100(aObjRect.Top());
2453 }
2454 }
2455 // #i35007# - If drawing object is anchored as-character,
2456 // it's x-position isn't sensible. Thus, return the x-position as zero in this case.
2457 text::TextContentAnchorType eTextAnchorType =
2458 text::TextContentAnchorType_AT_PARAGRAPH;
2459 {
2460 uno::Any aAny = getPropertyValue( "AnchorType" );
2461 aAny >>= eTextAnchorType;
2462 }
2463 if ( eTextAnchorType == text::TextContentAnchorType_AS_CHARACTER )
2464 {
2465 aAttrPos.X = 0;
2466 }
2467
2468 return aAttrPos;
2469}
2470
2475awt::Point SwXShape::ConvertPositionToHoriL2R( const awt::Point& rObjPos,
2476 const awt::Size& rObjSize )
2477{
2478 awt::Point aObjPosInHoriL2R( rObjPos );
2479
2480 SwFrameFormat* pFrameFormat = GetFrameFormat();
2481 if ( pFrameFormat )
2482 {
2483 SwFrameFormat::tLayoutDir eLayoutDir = pFrameFormat->GetLayoutDir();
2484 switch ( eLayoutDir )
2485 {
2487 {
2488 // nothing to do
2489 }
2490 break;
2492 {
2493 aObjPosInHoriL2R.X = -rObjPos.X - rObjSize.Width;
2494 }
2495 break;
2497 {
2498 aObjPosInHoriL2R.X = -rObjPos.Y - rObjSize.Width;
2499 aObjPosInHoriL2R.Y = rObjPos.X;
2500 }
2501 break;
2502 default:
2503 {
2504 OSL_FAIL( "<SwXShape::ConvertPositionToHoriL2R(..)> - unsupported layout direction" );
2505 }
2506 }
2507 }
2508
2509 return aObjPosInHoriL2R;
2510}
2511
2517 const drawing::HomogenMatrix3& rMatrixInHoriL2R )
2518{
2519 drawing::HomogenMatrix3 aMatrix(rMatrixInHoriL2R);
2520
2521 // #i44334#, #i44681# - direct manipulation of the
2522 // transformation structure isn't valid, if it contains rotation.
2523 SvxShape* pSvxShape = GetSvxShape();
2524 OSL_ENSURE( pSvxShape,
2525 "<SwXShape::ConvertTransformationToLayoutDir(..)> - no SvxShape found!");
2526 if ( pSvxShape )
2527 {
2528 const SdrObject* pObj = pSvxShape->GetSdrObject();
2529 OSL_ENSURE( pObj,
2530 "<SwXShape::ConvertTransformationToLayoutDir(..)> - no SdrObject found!");
2531 if ( pObj )
2532 {
2533 // get position of object in Writer coordinate system.
2534 awt::Point aPos( getPosition() );
2535 // get position of object in Drawing layer coordinate system
2536 const Point aTmpObjPos( pObj->GetSnapRect().TopLeft() );
2537 const awt::Point aObjPos(
2538 convertTwipToMm100( aTmpObjPos.X() - pObj->GetAnchorPos().X() ),
2539 convertTwipToMm100( aTmpObjPos.Y() - pObj->GetAnchorPos().Y() ) );
2540 // determine difference between these positions according to the
2541 // Writer coordinate system
2542 const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
2543 aPos.Y - aObjPos.Y );
2544 // apply translation difference to transformation matrix.
2545 if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
2546 {
2547 // #i73079# - use correct matrix type
2548 ::basegfx::B2DHomMatrix aTempMatrix;
2549
2550 aTempMatrix.set(0, 0, aMatrix.Line1.Column1 );
2551 aTempMatrix.set(0, 1, aMatrix.Line1.Column2 );
2552 aTempMatrix.set(0, 2, aMatrix.Line1.Column3 );
2553 aTempMatrix.set(1, 0, aMatrix.Line2.Column1 );
2554 aTempMatrix.set(1, 1, aMatrix.Line2.Column2 );
2555 aTempMatrix.set(1, 2, aMatrix.Line2.Column3 );
2556 // For this to be a valid 2D transform matrix, the last row must be [0,0,1]
2557 assert( aMatrix.Line3.Column1 == 0 );
2558 assert( aMatrix.Line3.Column2 == 0 );
2559 assert( aMatrix.Line3.Column3 == 1 );
2560 // #i73079#
2561 aTempMatrix.translate( aTranslateDiff.X, aTranslateDiff.Y );
2562 aMatrix.Line1.Column1 = aTempMatrix.get(0, 0);
2563 aMatrix.Line1.Column2 = aTempMatrix.get(0, 1);
2564 aMatrix.Line1.Column3 = aTempMatrix.get(0, 2);
2565 aMatrix.Line2.Column1 = aTempMatrix.get(1, 0);
2566 aMatrix.Line2.Column2 = aTempMatrix.get(1, 1);
2567 aMatrix.Line2.Column3 = aTempMatrix.get(1, 2);
2568 aMatrix.Line3.Column1 = 0;
2569 aMatrix.Line3.Column2 = 0;
2570 aMatrix.Line3.Column3 = 1;
2571 }
2572 }
2573 }
2574
2575 return aMatrix;
2576}
2577
2581void SwXShape::AdjustPositionProperties( const awt::Point& rPosition )
2582{
2583 // handle x-position
2584 // #i35007# - no handling of x-position, if drawing
2585 // object is anchored as-character, because it doesn't make sense.
2586 text::TextContentAnchorType eTextAnchorType =
2587 text::TextContentAnchorType_AT_PARAGRAPH;
2588 {
2589 uno::Any aAny = getPropertyValue( "AnchorType" );
2590 aAny >>= eTextAnchorType;
2591 }
2592 if ( eTextAnchorType != text::TextContentAnchorType_AS_CHARACTER )
2593 {
2594 // determine current x-position
2595 static constexpr OUStringLiteral aHoriPosPropStr(u"HoriOrientPosition");
2596 uno::Any aHoriPos( getPropertyValue( aHoriPosPropStr ) );
2597 sal_Int32 dCurrX = 0;
2598 aHoriPos >>= dCurrX;
2599 // change x-position attribute, if needed
2600 if ( dCurrX != rPosition.X )
2601 {
2602 // adjust x-position orientation to text::HoriOrientation::NONE, if needed
2603 // Note: has to be done before setting x-position attribute
2604 static constexpr OUStringLiteral aHoriOrientPropStr(u"HoriOrient");
2605 uno::Any aHoriOrient( getPropertyValue( aHoriOrientPropStr ) );
2606 sal_Int16 eHoriOrient;
2607 if (aHoriOrient >>= eHoriOrient) // may be void
2608 {
2609 if ( eHoriOrient != text::HoriOrientation::NONE )
2610 {
2611 eHoriOrient = text::HoriOrientation::NONE;
2612 aHoriOrient <<= eHoriOrient;
2613 setPropertyValue( aHoriOrientPropStr, aHoriOrient );
2614 }
2615 }
2616 // set x-position attribute
2617 aHoriPos <<= rPosition.X;
2618 setPropertyValue( aHoriPosPropStr, aHoriPos );
2619 }
2620 }
2621
2622 // handle y-position
2623 {
2624 // determine current y-position
2625 static constexpr OUStringLiteral aVertPosPropStr(u"VertOrientPosition");
2626 uno::Any aVertPos( getPropertyValue( aVertPosPropStr ) );
2627 sal_Int32 dCurrY = 0;
2628 aVertPos >>= dCurrY;
2629 // change y-position attribute, if needed
2630 if ( dCurrY != rPosition.Y )
2631 {
2632 // adjust y-position orientation to text::VertOrientation::NONE, if needed
2633 // Note: has to be done before setting y-position attribute
2634 static constexpr OUStringLiteral aVertOrientPropStr(u"VertOrient");
2635 uno::Any aVertOrient( getPropertyValue( aVertOrientPropStr ) );
2636 sal_Int16 eVertOrient;
2637 if (aVertOrient >>= eVertOrient) // may be void
2638 {
2639 if ( eVertOrient != text::VertOrientation::NONE )
2640 {
2641 eVertOrient = text::VertOrientation::NONE;
2642 aVertOrient <<= eVertOrient;
2643 setPropertyValue( aVertOrientPropStr, aVertOrient );
2644 }
2645 }
2646 // set y-position attribute
2647 aVertPos <<= rPosition.Y;
2648 setPropertyValue( aVertPosPropStr, aVertPos );
2649 }
2650 }
2651}
2652
2658 const css::awt::Point& aStartOrEndPos )
2659{
2660 awt::Point aConvertedPos( aStartOrEndPos );
2661
2662 SvxShape* pSvxShape = GetSvxShape();
2663 OSL_ENSURE( pSvxShape,
2664 "<SwXShape::ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!");
2665 if ( pSvxShape )
2666 {
2667 const SdrObject* pObj = pSvxShape->GetSdrObject();
2668 OSL_ENSURE( pObj,
2669 "<SwXShape::ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!");
2670 if ( pObj )
2671 {
2672 // get position of object in Writer coordinate system.
2673 awt::Point aPos( getPosition() );
2674 // get position of object in Drawing layer coordinate system
2675 const Point aTmpObjPos( pObj->GetSnapRect().TopLeft() );
2676 const awt::Point aObjPos(
2677 convertTwipToMm100( aTmpObjPos.X() - pObj->GetAnchorPos().X() ),
2678 convertTwipToMm100( aTmpObjPos.Y() - pObj->GetAnchorPos().Y() ) );
2679 // determine difference between these positions according to the
2680 // Writer coordinate system
2681 const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
2682 aPos.Y - aObjPos.Y );
2683 // apply translation difference to transformation matrix.
2684 if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
2685 {
2686 aConvertedPos.X = aConvertedPos.X + aTranslateDiff.X;
2687 aConvertedPos.Y = aConvertedPos.Y + aTranslateDiff.Y;
2688 }
2689 }
2690 }
2691
2692 return aConvertedPos;
2693}
2694
2695css::drawing::PolyPolygonBezierCoords SwXShape::ConvertPolyPolygonBezierToLayoutDir(
2696 const css::drawing::PolyPolygonBezierCoords& aPath )
2697{
2698 drawing::PolyPolygonBezierCoords aConvertedPath( aPath );
2699
2700 SvxShape* pSvxShape = GetSvxShape();
2701 OSL_ENSURE( pSvxShape,
2702 "<SwXShape::ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!");
2703 if ( pSvxShape )
2704 {
2705 const SdrObject* pObj = pSvxShape->GetSdrObject();
2706 OSL_ENSURE( pObj,
2707 "<SwXShape::ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!");
2708 if ( pObj )
2709 {
2710 // get position of object in Writer coordinate system.
2711 awt::Point aPos( getPosition() );
2712 // get position of object in Drawing layer coordinate system
2713 const Point aTmpObjPos( pObj->GetSnapRect().TopLeft() );
2714 const awt::Point aObjPos(
2715 convertTwipToMm100( aTmpObjPos.X() - pObj->GetAnchorPos().X() ),
2716 convertTwipToMm100( aTmpObjPos.Y() - pObj->GetAnchorPos().Y() ) );
2717 // determine difference between these positions according to the
2718 // Writer coordinate system
2719 const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
2720 aPos.Y - aObjPos.Y );
2721 // apply translation difference to PolyPolygonBezier.
2722 if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
2723 {
2725 aTranslateDiff.X, aTranslateDiff.Y));
2726
2727 for(drawing::PointSequence& rInnerSequence : asNonConstRange(aConvertedPath.Coordinates))
2728 {
2729 for(awt::Point& rPoint : asNonConstRange(rInnerSequence))
2730 {
2731 basegfx::B2DPoint aNewCoordinatePair(rPoint.X, rPoint.Y);
2732 aNewCoordinatePair *= aMatrix;
2733 rPoint.X = basegfx::fround(aNewCoordinatePair.getX());
2734 rPoint.Y = basegfx::fround(aNewCoordinatePair.getY());
2735 }
2736 }
2737 }
2738 }
2739 }
2740
2741 return aConvertedPath;
2742}
2743
2744SwXGroupShape::SwXGroupShape(uno::Reference<XInterface> & xShape,
2745 SwDoc const*const pDoc)
2746 : SwXShape(xShape, pDoc)
2747{
2748#if OSL_DEBUG_LEVEL > 0
2749 uno::Reference<XShapes> xShapes(m_xShapeAgg, uno::UNO_QUERY);
2750 OSL_ENSURE(xShapes.is(), "no SvxShape found or shape is not a group shape");
2751#endif
2752}
2753
2755{
2756}
2757
2759{
2760 uno::Any aRet;
2761 if(rType == cppu::UnoType<XShapes>::get())
2762 aRet <<= uno::Reference<XShapes>(this);
2763 else
2764 aRet = SwXShape::queryInterface(rType);
2765 return aRet;
2766}
2767
2769{
2770 SwXShape::acquire();
2771}
2772
2774{
2775 SwXShape::release();
2776}
2777
2778void SwXGroupShape::add( const uno::Reference< XShape >& xShape )
2779{
2780 SolarMutexGuard aGuard;
2781 SvxShape* pSvxShape = GetSvxShape();
2782 SwFrameFormat* pFormat = GetFrameFormat();
2783 if(!(pSvxShape && pFormat))
2784 throw uno::RuntimeException();
2785
2786 uno::Reference<XShapes> xShapes;
2787 if( m_xShapeAgg.is() )
2788 {
2789 const uno::Type& rType = cppu::UnoType<XShapes>::get();
2790 uno::Any aAgg = m_xShapeAgg->queryAggregation( rType );
2791 aAgg >>= xShapes;
2792 }
2793 if(!xShapes.is())
2794 throw uno::RuntimeException();
2795
2796 xShapes->add(xShape);
2797
2798
2799 uno::Reference<lang::XUnoTunnel> xTunnel(xShape, uno::UNO_QUERY);
2800 SwXShape* pSwShape = comphelper::getFromUnoTunnel<SwXShape>(xTunnel);
2801 if(!(pSwShape && pSwShape->m_bDescriptor))
2802 return;
2803
2804 SvxShape* pAddShape = comphelper::getFromUnoTunnel<SvxShape>(xTunnel);
2805 if(pAddShape)
2806 {
2807 SdrObject* pObj = pAddShape->GetSdrObject();
2808 if(pObj)
2809 {
2810 SwDoc* pDoc = pFormat->GetDoc();
2811 // set layer of new drawing
2812 // object to corresponding invisible layer.
2813 if( SdrInventor::FmForm != pObj->GetObjInventor())
2814 {
2815 pObj->SetLayer( pSwShape->m_pImpl->GetOpaque()
2818 }
2819 else
2820 {
2822 }
2823 }
2824 }
2825 pSwShape->m_bDescriptor = false;
2826}
2827
2828void SwXGroupShape::remove( const uno::Reference< XShape >& xShape )
2829{
2830 SolarMutexGuard aGuard;
2831 uno::Reference<XShapes> xShapes;
2832 if( m_xShapeAgg.is() )
2833 {
2834 const uno::Type& rType = cppu::UnoType<XShapes>::get();
2835 uno::Any aAgg = m_xShapeAgg->queryAggregation( rType );
2836 aAgg >>= xShapes;
2837 }
2838 if(!xShapes.is())
2839 throw uno::RuntimeException();
2840 xShapes->remove(xShape);
2841}
2842
2844{
2845 SolarMutexGuard aGuard;
2846 uno::Reference<XIndexAccess> xAcc;
2847 if( m_xShapeAgg.is() )
2848 {
2850 uno::Any aAgg = m_xShapeAgg->queryAggregation( rType );
2851 aAgg >>= xAcc;
2852 }
2853 if(!xAcc.is())
2854 throw uno::RuntimeException();
2855 return xAcc->getCount();
2856}
2857
2859{
2860 SolarMutexGuard aGuard;
2861 uno::Reference<XIndexAccess> xAcc;
2862 if( m_xShapeAgg.is() )
2863 {
2865 uno::Any aAgg = m_xShapeAgg->queryAggregation( rType );
2866 aAgg >>= xAcc;
2867 }
2868 if(!xAcc.is())
2869 throw uno::RuntimeException();
2870 return xAcc->getByIndex(nIndex);
2871}
2872
2874{
2875 SolarMutexGuard aGuard;
2876 uno::Reference<XIndexAccess> xAcc;
2877 if( m_xShapeAgg.is() )
2878 {
2880 uno::Any aAgg = m_xShapeAgg->queryAggregation( rType );
2881 aAgg >>= xAcc;
2882 }
2883 if(!xAcc.is())
2884 throw uno::RuntimeException();
2885 return xAcc->getElementType();
2886}
2887
2889{
2890 SolarMutexGuard aGuard;
2891 uno::Reference<XIndexAccess> xAcc;
2892 if( m_xShapeAgg.is() )
2893 {
2895 uno::Any aAgg = m_xShapeAgg->queryAggregation( rType );
2896 aAgg >>= xAcc;
2897 }
2898 if(!xAcc.is())
2899 throw uno::RuntimeException();
2900 return xAcc->hasElements();
2901}
2902
2903/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
FPDF_PAGE mpPage
constexpr auto convertTwipToMm100(N n)
virtual SwDrawFrameFormat * InsertDrawObj(const SwPaM &rRg, SdrObject &rDrawObj, const SfxItemSet &rFlyAttrSet)=0
Insert a DrawObject.
virtual SdrLayerID GetInvisibleControlsId() const =0
virtual SdrLayerID GetHellId() const =0
virtual SdrLayerID GetInvisibleHellId() const =0
virtual SdrLayerID GetHeavenId() const =0
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual SdrLayerID GetControlsId() const =0
virtual SdrLayerID GetInvisibleHeavenId() const =0
virtual bool IsVisibleLayerId(SdrLayerID _nLayerId) const =0
method to determine, if a layer ID belongs to the visible ones.
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
constexpr tools::Long Y() const
constexpr tools::Long X() const
size_t GetMarkCount() const
void InsertEntry(const SdrMark &rMark, bool bChkSort=true)
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
SdrObject * Next()
bool IsMore() const
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
SdrObjUserCall * GetUserCall() const
const css::uno::WeakReference< css::drawing::XShape > & getWeakUnoShape() const
const Point & GetAnchorPos() const
void SetRelativeHeight(double nValue)
void SetRelativeHeightRelation(sal_Int16 eValue)
const double * GetRelativeHeight() const
virtual SdrInventor GetObjInventor() const
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
void SetRelativeWidth(double nValue)
bool Is3DObj() const
const double * GetRelativeWidth() const
virtual const tools::Rectangle & GetSnapRect() const
virtual const OUString & GetName() const
void SetRelativeWidthRelation(sal_Int16 eValue)
bool IsGroupObject() const
sal_Int16 GetRelativeHeightRelation() const
SdrObject * getParentSdrObjectFromSdrObject() const
bool IsInserted() const
virtual SdrLayerID GetLayer() const
virtual void SetLayer(SdrLayerID nLayer)
sal_Int16 GetRelativeWidthRelation() const
void registerProvider(const svx::ShapePropertyProviderId _eProperty, std::unique_ptr< svx::PropertyValueProvider > propProvider)
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
void SetTheme(std::shared_ptr< model::Theme > const &pTheme)
SdrPageProperties & getSdrPageProperties()
void UnmarkAll()
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
void setPropertyValue(const SfxItemPropertyMapEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
const SfxItemPropertyMap & getPropertyMap() const
void getPropertyValue(const SfxItemPropertyMapEntry &rEntry, const SfxItemSet &rSet, css::uno::Any &rAny) const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
void SetParent(const SfxItemSet *pNew)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
virtual void SAL_CALL add(const css::uno::Reference< css::drawing::XShape > &xShape) override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Reference< css::drawing::XShape > CreateShape(SdrObject *pObj) const override
virtual css::awt::Point SAL_CALL getPosition() override
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
SdrObject * GetSdrObject() const
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
Definition: doc.hxx:197
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
Definition: docfmt.cxx:458
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:329
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:158
OUString GetUniqueShapeName() const
Definition: doclay.cxx:1410
SwNodes & GetNodes()
Definition: doc.hxx:422
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
SwDrawContact * GroupSelection(SdrView &)
Definition: docdraw.cxx:182
void UnGroupSelection(SdrView &)
Definition: docdraw.cxx:327
bool ChgAnchor(const SdrMarkList &_rMrkList, RndStdIds _eAnchorType, const bool _bSameOnly, const bool _bPosCorr)
Definition: docfly.cxx:716
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:169
SwDocShell * GetDocShell()
Definition: doc.hxx:1370
ContactObject for connection of formats as representatives of draw objects in SwClient and the object...
Definition: dcontact.hxx:305
virtual const SdrObject * GetMaster() const override
Definition: dcontact.hxx:347
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object.
Definition: dcontact.hxx:212
ContactObject for connection between frames (or their formats respectively) in SwClient and the drawo...
Definition: dcontact.hxx:177
SdrPageView * m_pPageView
Definition: unodraw.hxx:53
virtual sal_Bool SAL_CALL hasElements() override
Definition: unodraw.cxx:617
std::vector< rtl::Reference< SwXShape > > m_vShapes
Definition: unodraw.hxx:54
void InvalidateSwDoc()
Renamed and outlined to detect where it's called.
Definition: unodraw.cxx:875
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unodraw.cxx:568
SwDoc * m_pDoc
Definition: unodraw.hxx:52
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unodraw.cxx:580
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unodraw.cxx:484
static css::uno::Reference< css::drawing::XShapeGroup > GetShapeGroup(SdrObject *pObj)
Definition: unodraw.cxx:317
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unodraw.cxx:585
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unodraw.cxx:432
static css::uno::Reference< css::drawing::XShape > GetShape(SdrObject *pObj)
Definition: unodraw.cxx:297
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unodraw.cxx:612
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unodraw.cxx:389
virtual css::uno::Reference< css::drawing::XShapeGroup > SAL_CALL group(const css::uno::Reference< css::drawing::XShapes > &xShapes) override
Definition: unodraw.cxx:815
virtual ~SwFmDrawPage() noexcept override
Definition: unodraw.cxx:264
virtual OUString SAL_CALL getImplementationName() override
Definition: unodraw.cxx:575
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unodraw.cxx:797
virtual void SAL_CALL ungroup(const css::uno::Reference< css::drawing::XShapeGroup > &aGroup) override
Definition: unodraw.cxx:854
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unodraw.cxx:478
SwFmDrawPage(SwDoc *pDoc, SdrPage *pPage)
Definition: unodraw.cxx:256
virtual css::uno::Reference< css::drawing::XShape > CreateShape(SdrObject *pObj) const override
Definition: unodraw.cxx:322
virtual void SAL_CALL add(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unodraw.cxx:627
void RemoveShape(const SwXShape *pShape)
Definition: unodraw.hxx:74
const SfxItemPropertySet * m_pPropertySet
Definition: unodraw.hxx:55
void PreUnGroup(const css::uno::Reference< css::drawing::XShapeGroup > &rShapeGroup)
Definition: unodraw.cxx:278
SdrView * GetDrawView()
Definition: unodraw.hxx:64
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unodraw.cxx:601
void RemovePageView()
Definition: unodraw.cxx:290
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unodraw.cxx:395
const SdrMarkList & PreGroup(const css::uno::Reference< css::drawing::XShapes > &rShapes)
Definition: unodraw.cxx:271
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unodraw.cxx:490
virtual sal_Int32 SAL_CALL getCount() override
Definition: unodraw.cxx:590
SdrPageView * GetPageView()
Definition: unodraw.cxx:283
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unodraw.cxx:496
FlyAnchors.
Definition: fmtanchr.hxx:37
sal_Int32 GetAnchorContentOffset() const
Definition: atrfrm.cxx:1631
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:70
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1593
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:68
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:74
SwNode * GetAnchorNode() const
Definition: atrfrm.cxx:1614
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
Format of a fly content.
Definition: fmtflcnt.hxx:33
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:100
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:94
SwTwips GetPos() const
Definition: fmtornt.hxx:99
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
SwTwips GetPos() const
Definition: fmtornt.hxx:62
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:63
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:57
Allows positioning of floating screen objects without considering their own wrapping type and the wra...
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const OUString & GetName() const
Definition: format.hxx:131
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
Style of a layout element.
Definition: frmfmt.hxx:72
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2733
virtual void SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir)
Definition: atrfrm.cxx:2882
const std::shared_ptr< SwTextBoxNode > & GetOtherTextBoxFormats() const
Definition: frmfmt.hxx:118
virtual void SetFormatName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2608
virtual sal_Int16 GetPositionLayoutDir() const
Definition: atrfrm.cxx:2878
SdrObject * FindRealSdrObject()
Definition: atrfrm.cxx:2802
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:153
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const
Definition: atrfrm.cxx:2867
Marks a node in the document model.
Definition: ndindex.hxx:31
const SwNodes & GetNodes() const
Definition: ndindex.hxx:119
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:111
Base class of the Writer document model elements.
Definition: node.hxx:98
bool IsGrfNode() const
Definition: node.hxx:195
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:901
bool IsNoTextNode() const
Definition: node.hxx:194
bool IsOLENode() const
Definition: node.hxx:193
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:165
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
Definition: nodes.cxx:2555
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
SwNode & GetPointNode() const
Definition: pam.hxx:275
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:657
const SwPosition * GetPoint() const
Definition: pam.hxx:253
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
Definition: trvlfrm.cxx:425
SwFormatAnchor * GetAnchor(bool bCreate=false)
Definition: unodraw.cxx:124
std::unique_ptr< SwFormatSurround > m_pSurround
Definition: unodraw.cxx:90
std::unique_ptr< SwFormatFollowTextFlow > m_pFollowTextFlow
Definition: unodraw.cxx:96
const bool & GetOpaque() const
Definition: unodraw.cxx:190
SwFormatHoriOrient * GetHOrient(bool bCreate=false)
Definition: unodraw.cxx:132
std::unique_ptr< SwFormatAnchor > m_pAnchor
Definition: unodraw.cxx:89
std::unique_ptr< SvxULSpaceItem > m_pULSpace
Definition: unodraw.cxx:91
bool m_bInitializedPropertyNotifier
Definition: unodraw.cxx:106
SwShapeDescriptor_Impl & operator=(const SwShapeDescriptor_Impl &)=delete
std::unique_ptr< SwFormatHoriOrient > m_pHOrient
Definition: unodraw.cxx:87
SvxLRSpaceItem * GetLRSpace(bool bCreate=false)
Definition: unodraw.cxx:166
SwFormatSurround * GetSurround(bool bCreate=false)
Definition: unodraw.cxx:158
sal_Int16 GetPositionLayoutDir() const
Definition: unodraw.cxx:217
void SetOpaque(bool bSet)
Definition: unodraw.cxx:200
void RemoveWrapInfluenceOnObjPos()
Definition: unodraw.cxx:250
SwFormatFollowTextFlow * GetFollowTextFlow(bool _bCreate=false)
Definition: unodraw.cxx:203
SwFormatWrapInfluenceOnObjPos * GetWrapInfluenceOnObjPos(const bool _bCreate=false)
Definition: unodraw.cxx:239
uno::Reference< text::XTextRange > & GetTextRange()
Definition: unodraw.cxx:182
bool IsOpaque() const
Definition: unodraw.cxx:186
SvxULSpaceItem * GetULSpace(bool bCreate=false)
Definition: unodraw.cxx:174
SwShapeDescriptor_Impl(const SwShapeDescriptor_Impl &)=delete
SwFormatVertOrient * GetVOrient(bool bCreate=false)
Definition: unodraw.cxx:141
SwShapeDescriptor_Impl(SwDoc const *const pDoc)
Definition: unodraw.cxx:109
void SetPositionLayoutDir(sal_Int16 _nPositionLayoutDir)
Definition: unodraw.cxx:221
std::unique_ptr< SvxLRSpaceItem > m_pLRSpace
Definition: unodraw.cxx:92
std::unique_ptr< SwFormatVertOrient > m_pVOrient
Definition: unodraw.cxx:88
std::unique_ptr< SwFormatWrapInfluenceOnObjPos > m_pWrapInfluenceOnObjPos
Definition: unodraw.cxx:98
uno::Reference< text::XTextRange > m_xTextRange
Definition: unodraw.cxx:94
sal_Int16 mnPositionLayoutDir
Definition: unodraw.cxx:100
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
const SwFormatFlyCnt & GetFlyCnt() const
Definition: txatbase.hxx:226
sal_uInt16 Which() const
Definition: txatbase.hxx:116
static css::uno::Any getByIndex(SdrPage const *pPage, sal_Int32 nIndex)
Get a shape by index, excluding TextBoxes.
static css::uno::Reference< css::text::XTextFrame > getUnoTextFrame(css::uno::Reference< css::drawing::XShape > const &xShape)
If we have an associated TextFrame, then return its XTextFrame.
static void set(SwFrameFormat *pShape, SdrObject *pObject, css::uno::Reference< css::text::XTextFrame > xNew)
Sets the given textframe as textbox for the given (group member) shape.
static sal_Int32 getCount(const SwDoc &rDoc)
Count number of shapes in the document, excluding TextBoxes.
static void syncProperty(SwFrameFormat *pShape, sal_uInt16 nWID, sal_uInt8 nMemberID, const css::uno::Any &rValue, SdrObject *pObj=nullptr)
Sync property of TextBox with the one of the shape.
static void create(SwFrameFormat *pShape, SdrObject *pObject, bool bCopyText=false)
Create a TextBox for a shape.
static void getProperty(SwFrameFormat const *pShape, sal_uInt16 nWID, sal_uInt8 nMemberID, css::uno::Any &rValue)
Get a property of the underlying TextFrame.
static bool changeAnchor(SwFrameFormat *pShape, SdrObject *pObj)
Sets the anchor of the associated textframe of the given shape, and returns true on success.
static void synchronizeGroupTextBoxProperty(bool pFunc(SwFrameFormat *, SdrObject *), SwFrameFormat *pFormat, SdrObject *pObj)
Calls the method given by pFunc with every textboxes of the group given by pFormat.
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
Is the frame format a text box?
static void destroy(const SwFrameFormat *pShape, const SdrObject *pObject)
Destroy a TextBox for a shape.
static sal_Int32 getOrdNum(const SdrObject *pObject)
Get the order of the shape, excluding TextBoxes.
static css::uno::Any queryInterface(const SwFrameFormat *pShape, const css::uno::Type &rType, SdrObject *pObj)
Get interface of a shape's TextBox, if there is any.
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
void DeleteAttributes(const sal_uInt16 nWhich, const sal_Int32 nStart, const sal_Int32 nEnd=0)
delete all attributes of type nWhich at nStart (opt. end nEnd)
Definition: thints.cxx:1801
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
Definition: thints.cxx:1305
bool HasHints() const
Definition: ndtxt.hxx:254
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
Definition: ndtxt.cxx:3155
virtual void SAL_CALL acquire() noexcept override
Definition: unodraw.cxx:2768
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unodraw.cxx:2858
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unodraw.cxx:2758
virtual sal_Bool SAL_CALL hasElements() override
Definition: unodraw.cxx:2888
virtual void SAL_CALL add(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unodraw.cxx:2778
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unodraw.cxx:2828
virtual void SAL_CALL release() noexcept override
Definition: unodraw.cxx:2773
virtual sal_Int32 SAL_CALL getCount() override
Definition: unodraw.cxx:2843
virtual ~SwXGroupShape() override
Definition: unodraw.cxx:2754
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unodraw.cxx:2873
const SwTextNode * GetTextNode() const
css::uno::Reference< css::uno::XAggregation > m_xShapeAgg
Definition: unodraw.hxx:136
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unodraw.cxx:2013
css::uno::Any _getPropAtAggrObj(const OUString &_rPropertyName)
method to get property from aggregation object
Definition: unodraw.cxx:1811
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unodraw.cxx:1002
css::awt::Point GetAttrPosition()
method to determine position according to the positioning attributes
Definition: unodraw.cxx:2431
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unodraw.cxx:2072
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unodraw.cxx:1828
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unodraw.cxx:2079
std::unique_ptr< SwShapeDescriptor_Impl > m_pImpl
Definition: unodraw.hxx:145
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unodraw.cxx:2254
o3tl::span< const SfxItemPropertyMapEntry > m_pPropertyMapEntries
Definition: unodraw.hxx:142
SwShapeDescriptor_Impl * GetDescImpl()
Definition: unodraw.hxx:246
static void AddExistingShapeToFormat(SdrObject const &_rObj)
Definition: unodraw.cxx:963
virtual OUString SAL_CALL getShapeType() override
Definition: unodraw.cxx:2396
bool m_bDescriptor
Definition: unodraw.hxx:147
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unodraw.cxx:2086
virtual OUString SAL_CALL getImplementationName() override
Definition: unodraw.cxx:2226
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unodraw.cxx:2059
SdrObject * GetTopGroupObj(SvxShape *_pSvxShape=nullptr)
method to determine top group object
Definition: unodraw.cxx:2407
friend class SwXGroupShape
Definition: unodraw.hxx:132
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: unodraw.cxx:2210
SwXShape(css::uno::Reference< css::uno::XInterface > &xShape, SwDoc const *const pDoc)
Definition: unodraw.cxx:915
SvxShape * GetSvxShape()
Definition: unodraw.cxx:2245
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unodraw.cxx:886
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unodraw.cxx:1052
css::uno::Reference< css::drawing::XShape > mxShape
Definition: unodraw.hxx:139
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unodraw.cxx:880
const SwFmDrawPage * m_pPage
Definition: unodraw.hxx:134
css::drawing::HomogenMatrix3 ConvertTransformationToLayoutDir(const css::drawing::HomogenMatrix3 &rMatrixInHoriL2R)
method to convert the transformation of the drawing object to the layout direction,...
Definition: unodraw.cxx:2516
virtual css::awt::Size SAL_CALL getSize() override
Definition: unodraw.cxx:2374
const SfxItemPropertySet * m_pPropSet
Definition: unodraw.hxx:141
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: unodraw.cxx:1836
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unodraw.cxx:1952
css::uno::Reference< css::beans::XPropertySetInfo > mxPropertySetInfo
Definition: unodraw.hxx:143
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unodraw.cxx:1076
virtual void SAL_CALL dispose() override
Definition: unodraw.cxx:2156
SwFrameFormat * GetFrameFormat() const
Definition: unodraw.cxx:955
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unodraw.cxx:1509
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unodraw.cxx:2384
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unodraw.cxx:1047
css::awt::Point ConvertStartOrEndPosToLayoutDir(const css::awt::Point &aStartOrEndPos)
method to convert start or end position of the drawing object to the Writer specific position,...
Definition: unodraw.cxx:2657
css::drawing::PolyPolygonBezierCoords ConvertPolyPolygonBezierToLayoutDir(const css::drawing::PolyPolygonBezierCoords &aPath)
method to convert PolyPolygonBezier of the drawing object to the Writer specific position,...
Definition: unodraw.cxx:2695
css::awt::Point ConvertPositionToHoriL2R(const css::awt::Point &rObjPos, const css::awt::Size &rObjSize)
method to convert the position (translation) of the drawing object to the layout direction horizontal...
Definition: unodraw.cxx:2475
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unodraw.cxx:2046
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: unodraw.cxx:2218
void AdjustPositionProperties(const css::awt::Point &rPosition)
method to adjust the positioning properties
Definition: unodraw.cxx:2581
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unodraw.cxx:2231
virtual ~SwXShape() override
Definition: unodraw.cxx:988
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unodraw.cxx:2127
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unodraw.cxx:2236
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unodraw.cxx:2292
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unodraw.cxx:1031
static rtl::Reference< SwXTextEmbeddedObject > CreateXTextEmbeddedObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3501
static SW_DLLPUBLIC rtl::Reference< SwXTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3234
static rtl::Reference< SwXTextGraphicObject > CreateXTextGraphicObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3454
static rtl::Reference< SwXTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1221
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
void translate(double fX, double fY)
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
TYPE getX() const
TYPE getY() const
const css::uno::Sequence< sal_Int8 > & getSeq() const
css::uno::Type const & get()
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr tools::Long Left() const
#define FN_TEXT_RANGE
Definition: cmdid.h:840
#define FN_ANCHOR_POSITION
Definition: cmdid.h:848
#define FN_SHAPE_TRANSFORMATION_IN_HORI_L2R
Definition: cmdid.h:854
#define FN_SHAPE_ENDPOSITION_IN_HORI_L2R
Definition: cmdid.h:857
#define FN_SHAPE_STARTPOSITION_IN_HORI_L2R
Definition: cmdid.h:856
#define FN_TEXT_BOX
Definition: cmdid.h:859
#define FN_SHAPE_POSITION_LAYOUT_DIR
Definition: cmdid.h:855
Any value
@ SetOnlyText
stay with the cursor inside text
int nCount
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:121
ULONG m_refCount
float u
EmbeddedObjectRef * pObject
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(105)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(132)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(120)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(130)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
sal_Int32 nIndex
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
def text(shape, orig_st)
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
Definition: swunohelper.cxx:50
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
B2IRange fround(const B2DRange &rRange)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
sal_Int64 getSomething_cast(void *p)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool enum2int(sal_Int32 &rnEnum, const css::uno::Any &rAny)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
uno::Reference< util::XTheme > createXTheme(std::shared_ptr< model::Theme > const &pTheme)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
constexpr auto toTwips(N number, Length from)
constexpr T saturating_add(T a, T b)
constexpr T saturating_sub(T a, T b)
std::enable_if<!(detail::IsDerivedReference< T >::value||detail::IsUnoSequenceType< T >::value||std::is_base_of< css::uno::XInterface, T >::value), typenamedetail::Optional< T >::type >::type tryAccess(css::uno::Any const &any)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange, ::sw::TextRangeMode const eMode)
Definition: unoobj2.cxx:1108
bool GetAtPageRelOrientation(sal_Int16 &rOrientation, bool const isIgnorePrintArea)
Definition: atrfrm.cxx:108
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1182
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:60
SfxItemState
static SfxItemSet & rSet
UnoViewSharedPtr mpView
Marks a position in the document model.
Definition: pam.hxx:38
sal_Int32 GetContentIndex() const
Definition: pam.hxx:85
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.
Definition: pam.cxx:262
bool hasValue()
Reference< XFrame > xFrame
Reference< XModel > xModel
SVXCORE_DLLPUBLIC E3dScene * DynCastE3dScene(SdrObject *)
RndStdIds
tools::Long SwTwips
Definition: swtypes.hxx:51
unsigned char sal_Bool
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::container::XEnumeration > SwSimpleEnumeration_Base
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:88
#define WID_PAGE_BACKFULL
Definition: unomap.hxx:322
#define WID_PAGE_RIGHT
Definition: unomap.hxx:313
#define WID_PAGE_THEME
Definition: unomap.hxx:324
#define WID_PAGE_TOP
Definition: unomap.hxx:314
#define WID_NAVORDER
Definition: unomap.hxx:321
#define PROPERTY_MAP_TEXT_PAGE
Definition: unomap.hxx:131
#define WID_PAGE_USERATTRIBS
Definition: unomap.hxx:319
#define WID_PAGE_WIDTH
Definition: unomap.hxx:315
#define WID_PAGE_HEIGHT
Definition: unomap.hxx:316
#define PROPERTY_MAP_TEXT_SHAPE
Definition: unomap.hxx:41
#define WID_PAGE_LEFT
Definition: unomap.hxx:312
#define WID_PAGE_ORIENT
Definition: unomap.hxx:318
#define WID_PAGE_BOTTOM
Definition: unomap.hxx:311
#define WID_PAGE_NUMBER
Definition: unomap.hxx:317
#define WID_PAGE_ISDARK
Definition: unomap.hxx:320
#define MID_HORIORIENT_RELATION
Definition: unomid.h:39
#define MID_FRMSIZE_REL_WIDTH_RELATION
Definition: unomid.h:87
#define MID_FRMSIZE_REL_HEIGHT_RELATION
Definition: unomid.h:88
#define MID_ANCHOR_ANCHORFRAME
Definition: unomid.h:45
#define MID_FRMSIZE_REL_WIDTH
Definition: unomid.h:72
#define MID_FRMSIZE_REL_HEIGHT
Definition: unomid.h:71
#define MID_ANCHOR_ANCHORTYPE
Definition: unomid.h:43
#define MID_CHAIN_PREVNAME
Definition: unomid.h:56
#define MID_CHAIN_NEXTNAME
Definition: unomid.h:57
#define MID_FRMSIZE_SIZE
Definition: unomid.h:70
#define MID_TEXT_BOX
Definition: unomid.h:154
#define MID_TEXT_BOX_CONTENT
Definition: unomid.h:155
#define MID_CHAIN_NAME
Definition: unomid.h:58