22 #include <initializer_list>
24 #include <string_view>
31 #include <drawdoc.hxx>
70 #include <com/sun/star/beans/PropertyAttribute.hpp>
71 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
72 #include <com/sun/star/frame/XModel.hpp>
74 #include <com/sun/star/text/TextContentAnchorType.hpp>
76 #include <com/sun/star/drawing/PointSequence.hpp>
77 #include <com/sun/star/lang/IllegalArgumentException.hpp>
78 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
108 : m_isInReading(pDoc && pDoc->IsInReading())
116 text::WrapInfluenceOnPosition::ONCE_CONCURRENT) )
118 , mnPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor)
119 , bInitializedPropertyNotifier(false)
124 if (bCreate && !m_pAnchor)
128 return m_pAnchor.get();
132 if (bCreate && !m_pHOrient)
137 return m_pHOrient.get();
141 if (bCreate && !m_pVOrient)
146 m_pVOrient.reset(
new SwFormatVertOrient(0, text::VertOrientation::TOP, text::RelOrientation::FRAME));
153 return m_pVOrient.get();
158 if (bCreate && !m_pSurround)
162 return m_pSurround.get();
166 if (bCreate && !m_pLRSpace)
170 return m_pLRSpace.get();
174 if (bCreate && !m_pULSpace)
178 return m_pULSpace.get();
203 if (_bCreate && !m_pFollowTextFlow)
207 return m_pFollowTextFlow.get();
211 m_pFollowTextFlow.reset();
221 switch ( _nPositionLayoutDir )
223 case text::PositionLayoutDir::PositionInHoriL2R:
224 case text::PositionLayoutDir::PositionInLayoutDirOfAnchor:
226 mnPositionLayoutDir = _nPositionLayoutDir;
231 OSL_FAIL(
"<SwShapeDescriptor_Impl::SetPositionLayoutDir(..)> - invalid attribute value." );
238 const bool _bCreate =
false )
240 if (_bCreate && !m_pWrapInfluenceOnObjPos)
244 text::WrapInfluenceOnPosition::ONCE_CONCURRENT));
246 return m_pWrapInfluenceOnObjPos.get();
250 m_pWrapInfluenceOnObjPos.reset();
299 return uno::Reference<drawing::XShape>(pObj->
getUnoShape(), uno::UNO_QUERY);
302 SvxShape* pSvxShape = pShape->GetSvxShape();
304 return uno::Reference<drawing::XShape>(static_cast<::cppu::OWeakObject*>(pShape), uno::UNO_QUERY);
311 return uno::Reference<drawing::XShapeGroup>(
GetShape(pObj), uno::UNO_QUERY);
316 uno::Reference< drawing::XShape > xRet;
317 if(dynamic_cast<const SwVirtFlyDrawObj*>( pObj) !=
nullptr || pObj->
GetObjInventor() == SdrInventor::Swg)
339 *pDoc, pFlyFormat), uno::UNO_QUERY);
344 *pDoc, pFlyFormat), uno::UNO_QUERY);
349 OSL_FAIL(
"<SwFmDrawPage::CreateShape(..)> - could not retrieve type. Thus, no shape created." );
361 uno::Reference< XUnoTunnel > xShapeTunnel(xRet, uno::UNO_QUERY);
364 if(xShapeTunnel.is())
365 pShape = reinterpret_cast< SwXShape * >(
369 xShapeTunnel =
nullptr;
370 uno::Reference< uno::XInterface > xCreate(xRet, uno::UNO_QUERY);
375 pShape =
new SwXShape(xCreate,
nullptr);
378 const_cast<std::vector<SwXShape*>*
>(&
m_vShapes)->push_back(pShape.get());
379 pShape->m_pPage =
this;
386 class SwXShapesEnumeration
390 std::vector< css::uno::Any > m_aShapes;
392 virtual ~SwXShapesEnumeration()
override {};
394 explicit SwXShapesEnumeration(
SwXDrawPage*
const pDrawPage);
397 virtual sal_Bool SAL_CALL hasMoreElements()
override;
398 virtual uno::Any SAL_CALL nextElement()
override;
407 SwXShapesEnumeration::SwXShapesEnumeration(
SwXDrawPage*
const pDrawPage)
412 m_aShapes.reserve(nCount);
413 for(sal_Int32 nIdx = 0; nIdx < nCount; nIdx++)
415 uno::Reference<drawing::XShape> xShape(pDrawPage->
getByIndex(nIdx), uno::UNO_QUERY);
416 m_aShapes.push_back(uno::makeAny(xShape));
420 sal_Bool SwXShapesEnumeration::hasMoreElements()
423 return !m_aShapes.empty();
426 uno::Any SwXShapesEnumeration::nextElement()
429 if(m_aShapes.empty())
430 throw container::NoSuchElementException();
431 uno::Any aResult = m_aShapes.back();
432 m_aShapes.pop_back();
436 OUString SwXShapesEnumeration::getImplementationName()
438 return "SwXShapeEnumeration";
441 sal_Bool SwXShapesEnumeration::supportsService(
const OUString& ServiceName)
446 uno::Sequence< OUString > SwXShapesEnumeration::getSupportedServiceNames()
448 return { OUString(
"com.sun.star.container.XEnumeration") };
454 return uno::Reference< container::XEnumeration >(
455 new SwXShapesEnumeration(
this));
460 return "SwXDrawPage";
470 return {
"com.sun.star.drawing.GenericDrawPage" };
482 uno::Reference< uno::XInterface > xInt;
518 throw uno::RuntimeException();
532 throw uno::RuntimeException();
534 throw lang::IndexOutOfBoundsException();
549 throw uno::RuntimeException();
560 throw uno::RuntimeException();
561 uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShape, uno::UNO_QUERY);
564 if(xShapeTunnel.is())
566 pShape =
reinterpret_cast< SwXShape *
>(
568 pSvxShape =
reinterpret_cast< SvxShape *
>(
569 sal::static_int_cast< sal_IntPtr >( xShapeTunnel->getSomething(SvxShape::getUnoTunnelId()) ));
574 throw uno::RuntimeException(
"illegal object",
575 static_cast< cppu::OWeakObject * > (
this ) );
591 OSL_ENSURE(pSvxShape,
"Why is here no SvxShape?");
601 bool bOpaque =
false;
604 if(pDesc->GetSurround())
605 aSet.Put( *pDesc->GetSurround());
607 if(pDesc->GetLRSpace())
609 aSet.Put(*pDesc->GetLRSpace());
611 if(pDesc->GetULSpace())
613 aSet.Put(*pDesc->GetULSpace());
615 if(pDesc->GetAnchor())
616 aAnchor = *pDesc->GetAnchor();
619 if ( !pDesc->GetHOrient() )
623 pHori->
SetPos( nHoriPos );
628 aSet.Put( *pDesc->GetHOrient() );
631 if ( !pDesc->GetVOrient() )
635 pVert->
SetPos( nVertPos );
640 aSet.Put( *pDesc->GetVOrient() );
643 if(pDesc->GetSurround())
644 aSet.Put( *pDesc->GetSurround());
645 bOpaque = pDesc->IsOpaque();
648 if ( pDesc->GetFollowTextFlow() )
650 aSet.Put( *pDesc->GetFollowTextFlow() );
654 if ( pDesc->GetWrapInfluenceOnObjPos() )
656 aSet.Put( *pDesc->GetWrapInfluenceOnObjPos() );
670 std::unique_ptr<SwUnoInternalPaM> pInternalPam;
671 uno::Reference< text::XTextRange > xRg;
672 if( pDesc && (xRg = pDesc->GetTextRange()).is() )
676 throw uno::RuntimeException();
678 if(RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId() &&
679 !pInternalPam->GetNode().FindFlyStartNode())
681 aAnchor.SetType(RndStdIds::FLY_AS_CHAR);
683 else if (RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId())
685 aAnchor.SetAnchor(pInternalPam->Start());
694 aAnchor.SetAnchor( pPam->GetPoint() );
701 aAnchor.SetType(RndStdIds::FLY_AT_PAGE);
707 SwPaM* pTemp = pInternalPam.get();
721 if (pFormat->
GetName().isEmpty())
730 pInternalPam.reset();
737 throw uno::RuntimeException();
742 uno::Reference<lang::XComponent> xComp(xTextFrame, uno::UNO_QUERY);
747 uno::Reference<lang::XComponent> xComp(xShape, uno::UNO_QUERY);
751 uno::Reference< drawing::XShapeGroup >
SwXDrawPage::group(
const uno::Reference< drawing::XShapes > & xShapes)
754 if(!
m_pDoc || !xShapes.is())
755 throw uno::RuntimeException();
756 uno::Reference< drawing::XShapeGroup > xRet;
770 if (RndStdIds::FLY_AS_CHAR == ::
FindFrameFormat(const_cast<SdrObject*>(
771 pObj))->GetAnchor().GetAnchorId())
773 throw lang::IllegalArgumentException(
774 "Shape must not have 'as character' anchor!",
nullptr, 0);
784 RndStdIds::FLY_AT_PARA,
802 throw uno::RuntimeException();
816 RndStdIds::FLY_AT_PARA,
837 m_pDrawPage->setDelegator( static_cast<cppu::OWeakObject*>(
this) );
852 class theSwXShapeUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXShapeUnoTunnelId > {};
862 if( isUnoTunnelId<SwXShape>(rId) )
864 return sal::static_int_cast< sal_Int64 >(
reinterpret_cast< sal_IntPtr
>(
this) );
871 if(
auto xAggTunnel =
o3tl::tryAccess<uno::Reference<lang::XUnoTunnel>>(
875 return (*xAggTunnel)->getSomething(rId);
884 auto pProvider = std::make_shared<svx::PropertyValueProvider>( _rShape,
"AnchorType" );
890 uno::Reference<uno::XInterface> & xShape,
891 SwDoc const*
const pDoc)
897 , m_bDescriptor(true)
905 uno::Any aAgg = xShape->queryInterface(rAggType);
912 "<SwXShape::SwXShape(..)> - no XShape found at <xShapeAgg>" );
918 m_xShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(
this) );
928 lcl_addShapePropertyEventFactories( *pObj, *
this );
929 m_pImpl->bInitializedPropertyNotifier =
true;
940 OSL_ENSURE( pCurrent,
"SwXShape::AddExistingShapeToFormat: invalid object list element!" );
944 auto pSwShape = comphelper::getUnoTunnelImplementation<SwXShape>(pCurrent->
getWeakUnoShape());
947 if ( pSwShape->m_bDescriptor )
951 pSwShape->SetFrameFormat(pFormat);
952 pSwShape->m_bDescriptor =
false;
955 if ( !pSwShape->m_pImpl->bInitializedPropertyNotifier )
957 lcl_addShapePropertyEventFactories( *pCurrent, *pSwShape );
958 pSwShape->m_pImpl->bInitializedPropertyNotifier =
true;
969 uno::Reference< uno::XInterface > xRef;
992 aRet <<= uno::Reference<XShape>(
this);
1007 uno::Reference< XTypeProvider > xAggProv;
1017 return css::uno::Sequence<sal_Int8>();
1023 uno::Reference< beans::XPropertySetInfo > aRet;
1028 if(
auto xPrSet =
o3tl::tryAccess<uno::Reference<beans::XPropertySet>>(
1031 uno::Reference< beans::XPropertySetInfo > xInfo = (*xPrSet)->getPropertySetInfo();
1033 const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
1052 if ( pEntry->
nFlags & beans::PropertyAttribute::READONLY)
1053 throw beans::PropertyVetoException (
"Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
1062 uno::Reference<text::XTextFrame>
xFrame;
1063 if(aValue >>= xFrame)
1065 SwXFrame* pFrame = comphelper::getUnoTunnelImplementation<SwXFrame>(xFrame);
1076 aAnchor.
SetType(RndStdIds::FLY_AT_FLY);
1077 aItemSet.Put(aAnchor);
1083 throw lang::IllegalArgumentException();
1088 SAL_WARN_IF(!pSvxShape,
"sw.uno",
"No SvxShape found!");
1094 bool bIsVisible = pDoc->getIDocumentDrawModelAccess().IsVisibleLayerId( pObj->
GetLayer() );
1097 pObj->
SetLayer( *o3tl::doAccess<bool>(aValue)
1098 ? ( bIsVisible ? pDoc->getIDocumentDrawModelAccess().GetHeavenId() : pDoc->getIDocumentDrawModelAccess().GetInvisibleHeavenId() )
1099 : ( bIsVisible ? pDoc->getIDocumentDrawModelAccess().GetHellId() : pDoc->getIDocumentDrawModelAccess().GetInvisibleHellId() ));
1103 pObj->
SetLayer( bIsVisible ? pDoc->getIDocumentDrawModelAccess().GetControlsId() : pDoc->getIDocumentDrawModelAccess().GetInvisibleControlsId());
1113 if (aAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE)
1116 throw lang::IllegalArgumentException();
1119 std::unique_ptr<SwUnoInternalPaM> pInternalPam(
1121 uno::Reference< text::XTextRange > xRg;
1125 throw uno::RuntimeException();
1128 if (aAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR)
1134 const SwPosition *pPos = aAnchor.GetContentAnchor();
1141 assert(pHint &&
"Missing Hint.");
1143 "sw.uno",
"Missing FlyInCnt-Hint." );
1145 "sw.uno",
"Wrong TextFlyCnt-Hint." );
1153 SAL_WARN_IF( !pNd,
"sw.uno",
"Cursor not at TextNode." );
1155 pNd->
InsertItem(aFormat, pInternalPam->GetPoint()
1156 ->nContent.GetIndex(), 0 );
1160 aAnchor.SetAnchor( pInternalPam->GetPoint() );
1183 sal_Int16 nPositionLayoutDir = 0;
1184 aValue >>= nPositionLayoutDir;
1187 else if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout())
1196 sal_Int32 nAnchor = 0;
1198 pDoc->ChgAnchor( aList, static_cast<RndStdIds>(nAnchor),
1213 SAL_WARN_IF(!pSvxShape,
"sw.uno",
"No SvxShape found!");
1217 sal_Int16 nPercent(100);
1218 aValue >>= nPercent;
1238 && aSet.Get(
RES_ANCHOR).GetAnchorId() == RndStdIds::FLY_AT_PAGE)
1241 sal_Int16 nRelOrient(text::RelOrientation::PAGE_FRAME);
1242 aValue >>= nRelOrient;
1245 SAL_WARN(
"sw.core",
"SwXShape: fixing invalid horizontal RelOrientation for at-page anchor");
1246 value <<= nRelOrient;
1257 bool bSetAttr =
true;
1266 if( text::TextContentAnchorType_AS_CHARACTER != eNewAnchor &&
1267 (RndStdIds::FLY_AS_CHAR == eOldAnchorId))
1279 assert(pHint &&
"Missing Hint.");
1281 "sw.uno",
"Missing FlyInCnt-Hint." );
1283 "sw.uno",
"Wrong TextFlyCnt-Hint." );
1290 else if( text::TextContentAnchorType_AT_PAGE != eNewAnchor &&
1291 (RndStdIds::FLY_AT_PAGE == eOldAnchorId))
1296 SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
1297 if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() )
1301 pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetModelPositionForViewPoint( aPam.GetPoint(), aTmp, &aState );
1309 aNewAnchor.
SetAnchor( aPam.GetPoint() );
1310 aSet.Put( aNewAnchor );
1314 if( text::TextContentAnchorType_AS_CHARACTER == eNewAnchor &&
1315 (RndStdIds::FLY_AS_CHAR != eOldAnchorId))
1317 SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
1318 if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() )
1322 pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetModelPositionForViewPoint( aPam.GetPoint(), aTmp, &aState );
1331 SAL_WARN_IF( !pNd,
"sw.uno",
"Cursor is not in a TextNode." );
1334 aPam.GetPoint()->nContent.GetIndex(), 0 );
1335 --aPam.GetPoint()->nContent;
1337 dynamic_cast<const SwFormatAnchor&>(
1339 aNewAnchor.
SetAnchor( aPam.GetPoint() );
1340 aSet.Put( aNewAnchor );
1354 switch(pEntry->
nWID)
1357 pItem =
m_pImpl->GetAnchor(
true);
1360 pItem =
m_pImpl->GetHOrient(
true);
1363 pItem =
m_pImpl->GetVOrient(
true);
1366 pItem =
m_pImpl->GetLRSpace(
true);
1369 pItem =
m_pImpl->GetULSpace(
true);
1372 pItem =
m_pImpl->GetSurround(
true);
1376 uno::Reference<text::XTextRange>>(aValue))
1378 uno::Reference< text::XTextRange > & rRange =
m_pImpl->GetTextRange();
1383 m_pImpl->SetOpaque(*o3tl::doAccess<bool>(aValue));
1388 pItem =
m_pImpl->GetFollowTextFlow(
true );
1394 pItem =
m_pImpl->GetWrapInfluenceOnObjPos(
true );
1400 sal_Int16 nPositionLayoutDir = 0;
1401 aValue >>= nPositionLayoutDir;
1402 m_pImpl->SetPositionLayoutDir( nPositionLayoutDir );
1415 auto xPrSet = o3tl::tryAccess<uno::Reference<beans::XPropertySet>>(
1418 throw uno::RuntimeException();
1423 awt::Point aKeepedPosition( 0, 0 );
1424 if ( rPropertyName ==
"CaptionPoint" &&
getShapeType() ==
"com.sun.star.drawing.CaptionShape" )
1431 (*xPrSet)->setPropertyValue(rPropertyName, aValue);
1434 (*xPrSet)->setPropertyValue(rPropertyName, aValue);
1443 if ( rPropertyName ==
"CaptionPoint" &&
getShapeType() ==
"com.sun.star.drawing.CaptionShape" )
1465 OSL_ENSURE(pSvxShape,
"No SvxShape found!");
1478 OSL_ENSURE(pSvxShape,
"No SvxShape found!");
1492 if (aAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PAGE)
1503 const uno::Reference< text::XTextRange > xTextRange
1508 aRet <<= xTextRange;
1565 SAL_WARN_IF(!pSvxShape,
"sw.uno",
"No SvxShape found!");
1599 switch(pEntry->
nWID)
1605 pItem =
m_pImpl->GetHOrient();
1608 pItem =
m_pImpl->GetVOrient();
1611 pItem =
m_pImpl->GetLRSpace();
1614 pItem =
m_pImpl->GetULSpace();
1617 pItem =
m_pImpl->GetSurround();
1620 aRet <<=
m_pImpl->GetTextRange();
1623 aRet <<=
m_pImpl->GetOpaque();
1627 aRet <<= awt::Point();
1633 pItem =
m_pImpl->GetFollowTextFlow();
1639 pItem =
m_pImpl->GetWrapInfluenceOnObjPos();
1652 aRet <<=
m_pImpl->GetPositionLayoutDir();
1681 if ( rPropertyName ==
"Transformation" )
1683 drawing::HomogenMatrix3 aMatrix;
1688 else if ( rPropertyName ==
"StartPosition" )
1690 awt::Point aStartPos;
1695 else if ( rPropertyName ==
"EndPosition" )
1703 else if ( rPropertyName ==
"PolyPolygonBezier" )
1705 drawing::PolyPolygonBezierCoords aPath;
1709 else if (rPropertyName ==
"ZOrder")
1717 bool bConvert =
true;
1720 if (pSvxShape->GetSdrObject() != pObj)
1742 auto xPrSet = o3tl::tryAccess<uno::Reference<beans::XPropertySet>>(aPSet);
1745 throw uno::RuntimeException();
1747 aRet = (*xPrSet)->getPropertyValue( _rPropertyName );
1755 uno::Sequence< OUString > aNames { rPropertyName };
1757 return aStates.getConstArray()[0];
1761 const uno::Sequence< OUString >& aPropertyNames )
1765 uno::Sequence< beans::PropertyState > aRet(aPropertyNames.getLength());
1767 throw uno::RuntimeException();
1770 bool bGroupMember =
false;
1771 bool bFormControl =
false;
1778 const OUString* pNames = aPropertyNames.getConstArray();
1779 beans::PropertyState* pRet = aRet.getArray();
1780 uno::Reference< XPropertyState > xShapePrState;
1781 for(sal_Int32 nProperty = 0; nProperty < aPropertyNames.getLength(); nProperty++)
1787 pRet[nProperty] = bFormControl ?
1788 beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
1790 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1792 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1793 else if(bGroupMember)
1794 pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE;
1798 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1803 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1805 pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE;
1812 if(SfxItemState::SET == eItemState)
1813 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1814 else if(SfxItemState::DEFAULT == eItemState)
1815 pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE;
1817 pRet[nProperty] = beans::PropertyState_AMBIGUOUS_VALUE;
1822 switch(pEntry->
nWID)
1828 pItem =
m_pImpl->GetHOrient();
1831 pItem =
m_pImpl->GetVOrient();
1834 pItem =
m_pImpl->GetLRSpace();
1837 pItem =
m_pImpl->GetULSpace();
1840 pItem =
m_pImpl->GetSurround();
1845 pItem =
m_pImpl->GetWrapInfluenceOnObjPos();
1850 pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
1852 pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE;
1857 if(!xShapePrState.is())
1861 auto ps = o3tl::tryAccess<uno::Reference<XPropertyState>>(
1864 throw uno::RuntimeException();
1865 xShapePrState = *ps;
1867 pRet[nProperty] = xShapePrState->getPropertyState(pNames[nProperty]);
1879 throw uno::RuntimeException();
1884 if ( pEntry->
nFlags & beans::PropertyAttribute::READONLY)
1885 throw uno::RuntimeException(
"Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
1890 aSet.SetParent(&rSet);
1891 aSet.ClearItem(pEntry->
nWID);
1896 switch(pEntry->
nWID)
1910 m_pImpl->RemoveFollowTextFlow();
1916 m_pImpl->RemoveWrapInfluenceOnObjPos();
1926 auto xShapePrState = o3tl::tryAccess<uno::Reference<XPropertyState>>(
1929 throw uno::RuntimeException();
1930 (*xShapePrState)->setPropertyToDefault( rPropertyName );
1941 throw uno::RuntimeException();
1947 throw uno::RuntimeException();
1958 auto xShapePrState = o3tl::tryAccess<uno::Reference<XPropertyState>>(
1961 throw uno::RuntimeException();
1962 (*xShapePrState)->getPropertyDefault( rPropertyName );
1969 const OUString& _propertyName,
1970 const uno::Reference< beans::XPropertyChangeListener > & _listener )
1973 throw uno::RuntimeException(
"no shape aggregate", *
this );
1976 uno::Reference< beans::XPropertySet > xShapeProps;
1978 xShapeProps->addPropertyChangeListener( _propertyName, _listener );
1982 const OUString& _propertyName,
1983 const uno::Reference< beans::XPropertyChangeListener > & _listener)
1986 throw uno::RuntimeException(
"no shape aggregate", *
this );
1989 uno::Reference< beans::XPropertySet > xShapeProps;
1991 xShapeProps->removePropertyChangeListener( _propertyName, _listener );
1996 const uno::Reference< beans::XVetoableChangeListener > & )
1998 OSL_FAIL(
"not implemented");
2003 const uno::Reference< beans::XVetoableChangeListener > & )
2005 OSL_FAIL(
"not implemented");
2010 if(rHint.
GetId() == SfxHintId::Dying)
2023 const SwDoc* pDoc =
nullptr;
2024 uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
2025 if(xRangeTunnel.is())
2035 pText =
reinterpret_cast< SwXText *
>(
2045 pDoc = &pRange->
GetDoc();
2049 pDoc = pCursor->
GetDoc();
2058 throw uno::RuntimeException();
2064 uno::Reference< drawing::XDrawPageSupplier > xDPS(xModel, uno::UNO_QUERY);
2067 uno::Reference< drawing::XDrawPage > xDP( xDPS->getDrawPage() );
2071 aPos <<= xTextRange;
2073 uno::Reference< drawing::XShape > xTemp( static_cast<cppu::OWeakObject*>(
this), uno::UNO_QUERY );
2082 uno::Reference< text::XTextRange > aRef;
2089 if ((rAnchor.
GetAnchorId() != RndStdIds::FLY_AT_PAGE) ||
2093 if (rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA)
2104 aRef =
m_pImpl->GetTextRange();
2121 OSL_ENSURE( !pObj ||
2122 dynamic_cast<const SwDrawVirtObj*>( pObj) !=
nullptr ||
2125 "<SwXShape::dispose(..) - different 'master' drawing objects!!" );
2131 dynamic_cast<const SwDrawVirtObj*>( pObj) ==
nullptr &&
2149 uno::Reference<XComponent> xComp;
2160 const uno::Reference< lang::XEventListener > & aListener)
2168 const uno::Reference< lang::XEventListener > & aListener)
2187 uno::Sequence< OUString >
aSeq;
2189 aSeq = pSvxShape->getSupportedServiceNames();
2191 aSeq, std::initializer_list<std::u16string_view>{
u"com.sun.star.drawing.Shape" });
2197 return comphelper::getUnoTunnelImplementation<SvxShape>(
m_xShapeAgg);
2216 uno::Reference< drawing::XShape > xGroupShape( pTopGroupObj->
getUnoShape(), uno::UNO_QUERY );
2217 aPos = xGroupShape->getPosition();
2226 awt::Point aOffset( 0, 0 );
2228 aOffset.X = ( aMemberObjRect.
Left() - aGroupObjRect.
Left() );
2229 aOffset.Y = ( aMemberObjRect.
Top() - aGroupObjRect.
Top() );
2233 aPos.X += aOffset.X;
2234 aPos.Y += aOffset.Y;
2244 if ( !pTopGroupObj )
2249 bool bApplyPosAtDrawObj(
false);
2250 bool bNoAdjustOfPosProp(
false);
2263 bApplyPosAtDrawObj =
true;
2267 bNoAdjustOfPosProp =
true;
2273 if ( !bNoAdjustOfPosProp )
2277 if ( bApplyPosAtDrawObj )
2279 mxShape->setPosition( aPosition );
2285 awt::Point aNewPos( aPosition );
2296 uno::Reference< drawing::XShape > xGroupShape( pTopGroupObj->
getUnoShape(), uno::UNO_QUERY );
2301 awt::Point aAttrPosInHoriL2R(
2303 xGroupShape->getSize() ) );
2313 auto pSvxGroupShape = comphelper::getUnoTunnelImplementation<SvxShape>(pTopGroupObj->
getUnoShape());
2314 const awt::Point aGroupPos = pSvxGroupShape->getPosition();
2319 mxShape->setPosition( aNewPos );
2349 return mxShape->getShapeType();
2374 return pTopGroupObj;
2382 awt::Point aAttrPos;
2385 aHoriPos >>= aAttrPos.X;
2387 aVertPos >>= aAttrPos.Y;
2397 aAttrPos.X == 0 && aAttrPos.Y == 0 )
2406 text::TextContentAnchorType eTextAnchorType =
2407 text::TextContentAnchorType_AT_PARAGRAPH;
2410 aAny >>= eTextAnchorType;
2412 if ( eTextAnchorType == text::TextContentAnchorType_AS_CHARACTER )
2425 const awt::Size& rObjSize )
2427 awt::Point aObjPosInHoriL2R( rObjPos );
2433 switch ( eLayoutDir )
2442 aObjPosInHoriL2R.X = -rObjPos.X - rObjSize.Width;
2447 aObjPosInHoriL2R.X = -rObjPos.Y - rObjSize.Width;
2448 aObjPosInHoriL2R.Y = rObjPos.X;
2453 OSL_FAIL(
"<SwXShape::ConvertPositionToHoriL2R(..)> - unsupported layout direction" );
2458 return aObjPosInHoriL2R;
2466 const drawing::HomogenMatrix3& rMatrixInHoriL2R )
2468 drawing::HomogenMatrix3 aMatrix(rMatrixInHoriL2R);
2473 OSL_ENSURE( pSvxShape,
2474 "<SwXShape::ConvertTransformationToLayoutDir(..)> - no SvxShape found!");
2479 "<SwXShape::ConvertTransformationToLayoutDir(..)> - no SdrObject found!");
2486 const awt::Point aObjPos(
2491 const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
2492 aPos.Y - aObjPos.Y );
2494 if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
2499 aTempMatrix.
set(0, 0, aMatrix.Line1.Column1 );
2500 aTempMatrix.
set(0, 1, aMatrix.Line1.Column2 );
2501 aTempMatrix.
set(0, 2, aMatrix.Line1.Column3 );
2502 aTempMatrix.
set(1, 0, aMatrix.Line2.Column1 );
2503 aTempMatrix.
set(1, 1, aMatrix.Line2.Column2 );
2504 aTempMatrix.
set(1, 2, aMatrix.Line2.Column3 );
2505 aTempMatrix.
set(2, 0, aMatrix.Line3.Column1 );
2506 aTempMatrix.
set(2, 1, aMatrix.Line3.Column2 );
2507 aTempMatrix.
set(2, 2, aMatrix.Line3.Column3 );
2509 aTempMatrix.
translate( aTranslateDiff.X, aTranslateDiff.Y );
2510 aMatrix.Line1.Column1 = aTempMatrix.
get(0, 0);
2511 aMatrix.Line1.Column2 = aTempMatrix.
get(0, 1);
2512 aMatrix.Line1.Column3 = aTempMatrix.
get(0, 2);
2513 aMatrix.Line2.Column1 = aTempMatrix.
get(1, 0);
2514 aMatrix.Line2.Column2 = aTempMatrix.
get(1, 1);
2515 aMatrix.Line2.Column3 = aTempMatrix.
get(1, 2);
2516 aMatrix.Line3.Column1 = aTempMatrix.
get(2, 0);
2517 aMatrix.Line3.Column2 = aTempMatrix.
get(2, 1);
2518 aMatrix.Line3.Column3 = aTempMatrix.
get(2, 2);
2534 text::TextContentAnchorType eTextAnchorType =
2535 text::TextContentAnchorType_AT_PARAGRAPH;
2538 aAny >>= eTextAnchorType;
2540 if ( eTextAnchorType != text::TextContentAnchorType_AS_CHARACTER )
2543 const OUString aHoriPosPropStr(
"HoriOrientPosition");
2545 sal_Int32 dCurrX = 0;
2546 aHoriPos >>= dCurrX;
2548 if ( dCurrX != rPosition.X )
2552 const OUString aHoriOrientPropStr(
"HoriOrient");
2554 sal_Int16 eHoriOrient;
2555 if (aHoriOrient >>= eHoriOrient)
2560 aHoriOrient <<= eHoriOrient;
2565 aHoriPos <<= rPosition.X;
2573 const OUString aVertPosPropStr(
"VertOrientPosition");
2575 sal_Int32 dCurrY = 0;
2576 aVertPos >>= dCurrY;
2578 if ( dCurrY != rPosition.Y )
2582 const OUString aVertOrientPropStr(
"VertOrient");
2584 sal_Int16 eVertOrient;
2585 if (aVertOrient >>= eVertOrient)
2590 aVertOrient <<= eVertOrient;
2595 aVertPos <<= rPosition.Y;
2606 const css::awt::Point& aStartOrEndPos )
2608 awt::Point aConvertedPos( aStartOrEndPos );
2611 OSL_ENSURE( pSvxShape,
2612 "<SwXShape::ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!");
2617 "<SwXShape::ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!");
2624 const awt::Point aObjPos(
2629 const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
2630 aPos.Y - aObjPos.Y );
2632 if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
2634 aConvertedPos.X = aConvertedPos.X + aTranslateDiff.X;
2635 aConvertedPos.Y = aConvertedPos.Y + aTranslateDiff.Y;
2640 return aConvertedPos;
2644 const css::drawing::PolyPolygonBezierCoords& aPath )
2646 drawing::PolyPolygonBezierCoords aConvertedPath( aPath );
2649 OSL_ENSURE( pSvxShape,
2650 "<SwXShape::ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!");
2655 "<SwXShape::ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!");
2662 const awt::Point aObjPos(
2667 const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
2668 aPos.Y - aObjPos.Y );
2670 if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
2673 aTranslateDiff.X, aTranslateDiff.Y));
2675 for(drawing::PointSequence& rInnerSequence : aConvertedPath.Coordinates)
2677 for(awt::Point& rPoint : rInnerSequence)
2680 aNewCoordinatePair *= aMatrix;
2689 return aConvertedPath;
2693 SwDoc const*
const pDoc)
2696 #if OSL_DEBUG_LEVEL > 0
2697 uno::Reference<XShapes> xShapes(
m_xShapeAgg, uno::UNO_QUERY);
2698 OSL_ENSURE(xShapes.is(),
"no SvxShape found or shape is not a group shape");
2710 aRet <<= uno::Reference<XShapes>(
this);
2731 if(!(pSvxShape && pFormat))
2732 throw uno::RuntimeException();
2734 uno::Reference<XShapes> xShapes;
2742 throw uno::RuntimeException();
2744 xShapes->add(xShape);
2747 uno::Reference<lang::XUnoTunnel> xTunnel(xShape, uno::UNO_QUERY);
2750 pSwShape = reinterpret_cast< SwXShape * >(
2756 sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SvxShape::getUnoTunnelId()) ));
2789 uno::Reference<XShapes> xShapes;
2797 throw uno::RuntimeException();
2798 xShapes->remove(xShape);
2804 uno::Reference<XIndexAccess> xAcc;
2812 throw uno::RuntimeException();
2813 return xAcc->getCount();
2819 uno::Reference<XIndexAccess> xAcc;
2827 throw uno::RuntimeException();
2828 return xAcc->getByIndex(nIndex);
2834 uno::Reference<XIndexAccess> xAcc;
2842 throw uno::RuntimeException();
2843 return xAcc->getElementType();
2849 uno::Reference<XIndexAccess> xAcc;
2857 throw uno::RuntimeException();
2858 return xAcc->hasElements();
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
static css::uno::Reference< css::drawing::XShapeGroup > GetShapeGroup(SdrObject *pObj)
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
std::unique_ptr< SwFormatFollowTextFlow > m_pFollowTextFlow
const SfxItemPropertySimpleEntry * getByName(std::u16string_view rName) const
void SetRelativeWidthRelation(sal_Int16 eValue)
void SelectObjectsInView(const css::uno::Reference< css::drawing::XShapes > &aShapes, SdrPageView *pPageView)
const css::uno::WeakReference< css::uno::XInterface > & getWeakUnoShape() const
SwXGroupShape(css::uno::Reference< css::uno::XInterface > &xShape, SwDoc const *pDoc)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
virtual sal_Int32 SAL_CALL getCount() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
static sal_Int32 getCount(const SwDoc &rDoc)
Count number of shapes in the document, excluding TextBoxes.
SvxULSpaceItem * GetULSpace(bool bCreate=false)
virtual const SwDoc * GetDoc() const =0
svx::PropertyChangeNotifier & getShapePropertyChangeNotifier()
static css::uno::Any getByIndex(SdrPage const *pPage, sal_Int32 nIndex)
Get a shape by index, excluding TextBoxes.
size_t GetMarkCount() const
Marks a position in the document model.
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
SwShapeDescriptor_Impl(const SwShapeDescriptor_Impl &)=delete
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
std::unique_ptr< SwFormatWrapInfluenceOnObjPos > m_pWrapInfluenceOnObjPos
virtual const SwRootFrame * GetCurrentLayout() const =0
SwDocShell * GetDocShell()
const bool & GetOpaque() const
void SetName(const OUString &rStr, const bool bSetChanged=true)
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &aType) override
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
static void destroy(SwFrameFormat *pShape)
Destroy a TextBox for a shape.
virtual SdrLayerID GetInvisibleControlsId() const =0
SwFormatSurround * GetSurround(bool bCreate=false)
std::enable_if< std::is_signed< T >::value, T >::type saturating_sub(T a, T b)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
#define MID_FRMSIZE_REL_WIDTH
SwFormatWrapInfluenceOnObjPos * GetWrapInfluenceOnObjPos(const bool _bCreate=false)
const SwFrameFormat * GetFrameFormat() const
Reference< XFrame > xFrame
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
static sal_Int32 getOrdNum(const SdrObject *pObject)
Get the order of the shape, excluding TextBoxes.
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
SdrObject * GetTopGroupObj(SvxShape *_pSvxShape=nullptr)
method to determine top group object
void SetRelativeHeightRelation(sal_Int16 eValue)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
SvxLRSpaceItem * GetLRSpace(bool bCreate=false)
virtual css::uno::Reference< css::drawing::XShape > CreateShape(SdrObject *pObj) const override
virtual void SAL_CALL dispose() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
sal_Int16 GetPositionLayoutDir() const
SdrMark * GetMark(size_t nNum) const
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
SwFormatHoriOrient * GetHOrient(bool bCreate=false)
IDocumentUndoRedo & GetIDocumentUndoRedo()
const SwFmDrawPage * m_pPage
virtual sal_Bool SAL_CALL hasElements() override
css::uno::Reference< css::frame::XModel > GetModel() const
IDocumentContentOperations const & getIDocumentContentOperations() const
virtual void SAL_CALL acquire() SAL_OVERRIDE
EmbeddedObjectRef * pObject
void PreUnGroup(const css::uno::Reference< css::drawing::XShapeGroup > &rShapeGroup)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual css::uno::Reference< css::drawing::XShapeGroup > SAL_CALL group(const css::uno::Reference< css::drawing::XShapes > &xShapes) override
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
rtl::Reference< SwFmDrawPage > m_pDrawPage
SwShapeDescriptor_Impl * GetDescImpl()
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
SwFrameFormat * m_pFormat
static css::uno::Any queryInterface(const SwFrameFormat *pShape, const css::uno::Type &rType)
Get interface of a shape's TextBox, if there is any.
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
virtual const tools::Rectangle & GetSnapRect() const
constexpr auto convertTwipToMm100(N n)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
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...
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.
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
virtual void SAL_CALL acquire() override
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
virtual css::uno::Reference< css::uno::XInterface > getUnoShape()
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
virtual css::awt::Point SAL_CALL getPosition() override
virtual ~SwXGroupShape() override
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history...
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
sal_uLong GetIndex() const
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType)
Is the frame format a text box?
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
SdrPageView * GetPageView()
void SetRelativeHeight(double nValue)
bool enum2int(sal_Int32 &rnEnum, const css::uno::Any &rAny)
std::enable_if< !(detail::IsDerivedReference< T >::value||detail::IsUnoSequenceType< T >::value||std::is_base_of< css::uno::XInterface, T >::value), typename detail::Optional< T >::type >::type tryAccess(css::uno::Any const &any)
const SfxItemPropertyMapEntry * m_pPropertyMapEntries
bool bInitializedPropertyNotifier
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
void getPropertyValue(const SfxItemPropertySimpleEntry &rEntry, const SfxItemSet &rSet, css::uno::Any &rAny) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
void SetRelativeWidth(double nValue)
virtual OUString SAL_CALL getImplementationName() override
#define FN_ANCHOR_POSITION
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Reference< css::drawing::XShape > CreateShape(SdrObject *pObj) const override
SdrPageView * m_pPageView
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(125)
B2IRange fround(const B2DRange &rRange)
void SetPositionLayoutDir(sal_Int16 _nPositionLayoutDir)
std::unique_ptr< SwFormatSurround > m_pSurround
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
void registerProvider(const ShapeProperty _eProperty, const std::shared_ptr< IPropertyValueProvider > &_rProvider)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
virtual SdrLayerID GetInvisibleHellId() const =0
SwDrawContact * GroupSelection(SdrView &)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
bool GetAtPageRelOrientation(sal_Int16 &rOrientation, bool const isIgnorePrintArea)
exports com.sun.star. text
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
css::awt::Point GetAttrPosition()
method to determine position according to the positioning attributes
sal_Int16 mnPositionLayoutDir
SdrObject * GetMarkedSdrObj() const
SwShapeDescriptor_Impl & operator=(const SwShapeDescriptor_Impl &)=delete
#define MID_CHAIN_NEXTNAME
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
PaM is Point and Mark: a selection of the document model.
void RemoveFollowTextFlow()
static void create(SwFrameFormat *pShape, bool bCopyText=false)
Create a TextBox for a shape.
css::drawing::HomogenMatrix3 ConvertTransformationToLayoutDir(const css::drawing::HomogenMatrix3 &rMatrixInHoriL2R)
method to convert the transformation of the drawing object to the layout direction, the drawing object is in
virtual void SetLayer(SdrLayerID nLayer)
virtual sal_Bool SAL_CALL hasElements() override
#define MID_ANCHOR_ANCHORTYPE
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
#define FN_SHAPE_POSITION_LAYOUT_DIR
uno::Reference< text::XTextRange > xTextRange
virtual void SAL_CALL add(const css::uno::Reference< css::drawing::XShape > &xShape) override
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
#define FN_SHAPE_TRANSFORMATION_IN_HORI_L2R
std::unique_ptr< SvxULSpaceItem > m_pULSpace
void SelectObjectInView(const css::uno::Reference< css::drawing::XShape > &xShape, SdrPageView *pPageView)
#define FN_SHAPE_STARTPOSITION_IN_HORI_L2R
uno::Reference< text::XTextRange > & GetTextRange()
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...
std::enable_if< std::is_signed< T >::value, T >::type saturating_add(T a, T b)
const SdrMarkList & GetMarkedObjectList() const
std::unique_ptr< SdrView > mpView
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XShape > &xShape) override
void UnGroupSelection(SdrView &)
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::container::XEnumeration > SwSimpleEnumeration_Base
const SfxItemPropertyMap & getPropertyMap() const
static void getProperty(SwFrameFormat const *pShape, sal_uInt16 nWID, sal_uInt8 nMemberID, css::uno::Any &rValue)
Get a property of the underlying TextFrame.
constexpr auto convertMm100ToTwip(N n)
bool IsNoTextNode() const
bool IsGroupObject() const
SwFmDrawPage * GetSvxPage()
void setPropertyValue(const SfxItemPropertySimpleEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
css::uno::Reference< css::drawing::XShape > mxShape
Marks a node in the document model.
css::uno::Type const & get()
std::vector< SwXShape * > m_vShapes
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwFormatAnchor * GetAnchor(bool bCreate=false)
SwXShape(css::uno::Reference< css::uno::XInterface > &xShape, SwDoc const *const pDoc)
void RemoveWrapInfluenceOnObjPos()
std::unique_ptr< SvxLRSpaceItem > m_pLRSpace
SwShapeDescriptor_Impl(SwDoc const *const pDoc)
virtual sal_Int32 SAL_CALL getCount() override
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
static css::uno::Reference< css::drawing::XShape > GetShape(SdrObject *pObj)
const double * GetRelativeWidth() const
stay with the cursor inside text
sal_Int16 GetRelativeWidthRelation() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
virtual SdrInventor GetObjInventor() const
virtual SdrLayerID GetHellId() const =0
virtual SdrLayerID GetLayer() const
virtual ~SwXDrawPage() override
std::unique_ptr< SwFormatAnchor > m_pAnchor
void SetFrameFormat(SwFrameFormat *pFormat)
OUString GetUniqueShapeName() const
const SwNodeIndex * GetContentIdx() const
static void AddExistingShapeToFormat(SdrObject const &_rObj)
SwFormatVertOrient * GetVOrient(bool bCreate=false)
css::drawing::PolyPolygonBezierCoords ConvertPolyPolygonBezierToLayoutDir(const css::drawing::PolyPolygonBezierCoords &aPath)
method to convert PolyPolygonBezier of the drawing object to the Writer specific position, which is the attribute position in layout direction
virtual void SAL_CALL add(const css::uno::Reference< css::drawing::XShape > &xShape) override
constexpr sal_uInt16 RES_FRMATR_END(131)
SwTextNode is a paragraph in the document model.
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)
#define MID_FRMSIZE_REL_HEIGHT_RELATION
const SwDoc * GetDoc() const
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(114)
#define FN_SHAPE_ENDPOSITION_IN_HORI_L2R
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual void SAL_CALL add(const css::uno::Reference< css::drawing::XShape > &xShape) override
SwFormatFollowTextFlow * GetFollowTextFlow(bool _bCreate=false)
virtual OUString SAL_CALL getImplementationName() override
virtual SwDrawFrameFormat * InsertDrawObj(const SwPaM &rRg, SdrObject &rDrawObj, const SfxItemSet &rFlyAttrSet)=0
Insert a DrawObject.
css::uno::Reference< css::uno::XAggregation > m_xShapeAgg
#define MID_ANCHOR_ANCHORFRAME
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
#define MID_CHAIN_PREVNAME
virtual css::awt::Point SAL_CALL getPosition() override
virtual sal_Bool SAL_CALL hasElements() override
SwFmDrawPage(SdrPage *pPage)
oslInterlockedCount m_refCount
#define SAL_WARN_IF(condition, area, stream)
virtual SdrLayerID GetInvisibleHeavenId() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual ~SwXShape() override
const SwNodes & GetNodes() const
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
#define PROPERTY_MAP_TEXT_SHAPE
#define MID_FRMSIZE_REL_WIDTH_RELATION
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
sal_Int32 GetIndex() const
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
virtual SwDrawModel * GetOrCreateDrawModel()=0
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SwUnoCursor & GetCursor() const
SdrObject * GetSdrObject() const
static SW_DLLPUBLIC css::uno::Reference< css::text::XTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
std::unique_ptr< SwFormatHoriOrient > m_pHOrient
const SwTextNode * GetTextNode() const
SwUnoPropertyMapProvider aSwMapProvider
Sequence< sal_Int8 > aSeq
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XShape > &xShape) override
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
void AdjustPositionProperties(const css::awt::Point &rPosition)
method to adjust the positioning properties
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(157)
std::unique_ptr< SwFormatVertOrient > m_pVOrient
void translate(double fX, double fY)
css::uno::Any _getPropAtAggrObj(const OUString &_rPropertyName)
method to get property from aggregation object
const Point & GetAnchorPos() const
void InvalidateSwDoc()
Renamed and outlined to detect where it's called.
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(154)
SdrObject * getParentSdrObjectFromSdrObject() const
SwMoveFnCollection const & fnMoveBackward
virtual void SAL_CALL release() SAL_OVERRIDE
#define MID_HORIORIENT_RELATION
virtual css::awt::Size SAL_CALL getSize() override
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...
#define MID_FRMSIZE_REL_HEIGHT
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL ungroup(const css::uno::Reference< css::drawing::XShapeGroup > &aGroup) override
sal_Int16 GetRelativeHeightRelation() const
#define SAL_WARN(area, stream)
static void syncProperty(SwFrameFormat *pShape, sal_uInt16 nWID, sal_uInt8 nMemberID, const css::uno::Any &rValue)
Sync property of TextBox with the one of the shape.
Reference< XModel > xModel
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc...
const SfxItemPropertySet * m_pPropSet
std::unique_ptr< SwShapeDescriptor_Impl > m_pImpl
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
static css::uno::Reference< css::text::XTextContent > CreateXTextEmbeddedObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
static css::uno::Reference< css::text::XTextContent > CreateXTextGraphicObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
virtual void SAL_CALL release() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
virtual void Notify(const SfxHint &) override
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(123)
virtual ~SwFmDrawPage() override
const SdrMarkList & PreGroup(const css::uno::Reference< css::drawing::XShapes > &rShapes)
void InsertEntry(const SdrMark &rMark, bool bChkSort=true)
void SetOpaque(bool bSet)
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
SwFrameFormat * GetFrameFormat() const
SdrObjUserCall * GetUserCall() const
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
virtual OUString SAL_CALL getShapeType() override
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
virtual css::uno::Type SAL_CALL getElementType() override
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
bool ChgAnchor(const SdrMarkList &_rMrkList, RndStdIds _eAnchorType, const bool _bSameOnly, const bool _bPosCorr)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
const SwAttrPool & GetAttrPool() const
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
const double * GetRelativeHeight() const
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
const SwFormatFlyCnt & GetFlyCnt() const
Base class of the Writer document model elements.