diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-19 09:10:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-19 09:31:06 +0200 |
commit | 0e16b40d8b68f73731b4aa9059d0f98d0489fed0 (patch) | |
tree | 73092889efb0e57cdc180025503e863f26c6ebfe | |
parent | 69f4abe1248f9919f242920b463c4d5f4965211f (diff) |
Drop GetSdrObjectFromXShape and use SdrObject::getSdrObjectFromXShape
Change-Id: I0d233878ee49fcdc1338ec3bd700e5482d558163
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120694
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
41 files changed, 100 insertions, 110 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 8b16be57bab2..240e3146eea3 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -581,7 +581,7 @@ void EscherPropertyContainer::CreateFillProperties( { if ( rXShape.is() ) { - SdrObject* pObj = GetSdrObjectFromXShape( rXShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape); if ( pObj ) { const SfxItemSet& aAttr( pObj->GetMergedItemSet() ); @@ -1338,7 +1338,7 @@ bool EscherPropertyContainer::CreateOLEGraphicProperties(const uno::Reference<dr if ( rXShape.is() ) { - SdrObject* pObject = GetSdrObjectFromXShape(rXShape); // SJ: leaving unoapi, because currently there is + SdrObject* pObject = SdrObject::getSdrObjectFromXShape(rXShape); // SJ: leaving unoapi, because currently there is if (auto pOle2Obj = dynamic_cast<const SdrOle2Obj*>(pObject)) // no access to the native graphic object { const Graphic* pGraphic = pOle2Obj->GetGraphic(); @@ -1388,7 +1388,7 @@ bool EscherPropertyContainer::CreateMediaGraphicProperties(const uno::Reference< bool bRetValue = false; if ( rXShape.is() ) { - SdrObject* pSdrObject(GetSdrObjectFromXShape(rXShape)); // SJ: leaving unoapi, because currently there is + SdrObject* pSdrObject(SdrObject::getSdrObjectFromXShape(rXShape)); // SJ: leaving unoapi, because currently there is if (auto pSdrMediaObj = dynamic_cast<const SdrMediaObj*>(pSdrObject)) // no access to the native graphic object { GraphicObject aGraphicObject(pSdrMediaObj->getSnapshot()); @@ -2582,12 +2582,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT if ( !aXPropSet.is() ) return; - if(nullptr == dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(rXShape))) + if(nullptr == dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(rXShape))) { return; } - SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*GetSdrObjectFromXShape(rXShape))); + SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*SdrObject::getSdrObjectFromXShape(rXShape))); uno::Any aGeoPropSet = aXPropSet->getPropertyValue( "CustomShapeGeometry" ); uno::Sequence< beans::PropertyValue > aGeoPropSeq; if ( !(aGeoPropSet >>= aGeoPropSeq) ) @@ -3747,7 +3747,7 @@ MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawi bool EscherPropertyContainer::CreateBlipPropertiesforOLEControl(const uno::Reference<beans::XPropertySet> & rXPropSet, const uno::Reference<drawing::XShape> & rXShape) { - SdrObject* pShape = GetSdrObjectFromXShape( rXShape ); + SdrObject* pShape = SdrObject::getSdrObjectFromXShape(rXShape); if ( pShape ) { const Graphic aGraphic(SdrExchangeView::GetObjGraphic(*pShape)); @@ -4518,7 +4518,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst ) if (aType == "drawing.Custom") { - if (auto pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(aXShape))) + if (auto pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(aXShape))) { const SdrCustomShapeGeometryItem& rGeometryItem = pSdrObjCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index d5d49f1d2f30..cd4a9529d6e9 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -250,7 +250,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 ); aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 ); // no fill aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 ); // no linestyle - SdrObject* pObj = GetSdrObjectFromXShape( rObj.GetShapeRef() ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rObj.GetShapeRef()); if ( pObj ) { tools::Rectangle aBound = pObj->GetCurrentBoundRect(); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 8deff59fbf4d..aae85106042b 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1911,7 +1911,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( sal_uInt32 nOLEId, PPTConvertOCXControls aPPTConvertOCXControls( this, xModel, m_eCurrentPageKind ); css::uno::Reference< css::drawing::XShape > xShape; if ( aPPTConvertOCXControls.ReadOCXStream( xObjStor, &xShape ) ) - pRet = GetSdrObjectFromXShape( xShape ); + pRet = SdrObject::getSdrObjectFromXShape(xShape); } if ( !pRet ) diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 0f8e751bd9e0..7e5f188e7725 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -2330,7 +2330,7 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< css::drawing::XDraw } else { - SdrObject* pObj = GetSdrObjectFromXShape( rxShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rxShape); if( pObj ) { diff --git a/include/svx/unoapi.hxx b/include/svx/unoapi.hxx index e4886d316350..3c9e04d46af1 100644 --- a/include/svx/unoapi.hxx +++ b/include/svx/unoapi.hxx @@ -46,9 +46,6 @@ SVXCORE_DLLPUBLIC rtl::Reference<SvxShape> CreateSvxShapeByTypeAndInventor(sal_u /** Returns a StarOffice API wrapper for the given SdrObject */ SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) noexcept; -/** Returns the SdrObject from the given StarOffice API wrapper */ -SVXCORE_DLLPUBLIC SdrObject* GetSdrObjectFromXShape( const css::uno::Reference< css::drawing::XShape >& xShape ) noexcept ; - /** Returns a StarOffice API wrapper for the given SdrPage */ SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XDrawPage > GetXDrawPageForSdrPage( SdrPage* pPage ) noexcept; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index b1567e09ef33..b4079c7b6831 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1695,7 +1695,7 @@ void Shape::keepDiagramCompatibilityInfo() if (mpDiagramData) { - if (SdrObject* pObj = GetSdrObjectFromXShape(mxShape)) + if (SdrObject* pObj = SdrObject::getSdrObjectFromXShape(mxShape)) pObj->SetDiagramData(mpDiagramData); } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index ebcc11ceae3a..e9492fde0b48 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1293,7 +1293,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia, void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::drawing::XShape>& xShape) { - SdrMediaObj* pMediaObj = dynamic_cast<SdrMediaObj*>(GetSdrObjectFromXShape(xShape)); + SdrMediaObj* pMediaObj = dynamic_cast<SdrMediaObj*>(SdrObject::getSdrObjectFromXShape(xShape)); if (!pMediaObj) return; @@ -1718,7 +1718,7 @@ namespace { bool IsTopGroupObj(const uno::Reference<drawing::XShape>& xShape) { - SdrObject* pObject = GetSdrObjectFromXShape(xShape); + SdrObject* pObject = SdrObject::getSdrObjectFromXShape(xShape); if (!pObject) return false; @@ -1795,7 +1795,7 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa aSize.Height = 1000; if (!bSuppressRotation) { - SdrObject* pShape = GetSdrObjectFromXShape( rXShape ); + SdrObject* pShape = SdrObject::getSdrObjectFromXShape(rXShape); nRotation = pShape ? pShape->GetRotateAngle() : 0_deg100; if ( GetDocumentType() != DOCUMENT_DOCX ) { @@ -3401,7 +3401,7 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo // tdf#112312: only custom shapes obey the TextAutoGrowHeight option bool bTextAutoGrowHeight = false; uno::Reference<drawing::XShape> xShape(rXIface, uno::UNO_QUERY); - auto pSdrObjCustomShape = xShape.is() ? dynamic_cast<SdrObjCustomShape*>(GetSdrObjectFromXShape(xShape)) : nullptr; + auto pSdrObjCustomShape = xShape.is() ? dynamic_cast<SdrObjCustomShape*>(SdrObject::getSdrObjectFromXShape(xShape)) : nullptr; if (pSdrObjCustomShape && GetProperty(rXPropSet, "TextAutoGrowHeight")) { mAny >>= bTextAutoGrowHeight; @@ -3453,7 +3453,7 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo return; uno::Reference<drawing::XShape> xShape(rXIface, uno::UNO_QUERY); - SdrObject* pSdrObject = xShape.is() ? GetSdrObjectFromXShape(xShape) : nullptr; + SdrObject* pSdrObject = xShape.is() ? SdrObject::getSdrObjectFromXShape(xShape) : nullptr; const SdrTextObj* pTxtObj = dynamic_cast<SdrTextObj*>( pSdrObject ); if (pTxtObj && mpTextExport) { diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index c53cc494b594..3d03af800a13 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -730,8 +730,8 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) ShapeFlag nMirrorFlags = ShapeFlag::NONE; MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType ); - OSL_ENSURE(nullptr != dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(xShape)), "Not a SdrObjCustomShape (!)"); - SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*GetSdrObjectFromXShape(xShape))); + OSL_ENSURE(nullptr != dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(xShape)), "Not a SdrObjCustomShape (!)"); + SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*SdrObject::getSdrObjectFromXShape(xShape))); const bool bIsDefaultObject( EscherPropertyContainer::IsDefaultObject( rSdrObjCustomShape, @@ -2184,7 +2184,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) mpFS->singleElementNS( mnXmlNamespace, XML_embed ); // pic element - SdrObject* pSdrOLE2( GetSdrObjectFromXShape( xShape ) ); + SdrObject* pSdrOLE2(SdrObject::getSdrObjectFromXShape(xShape)); // The spec doesn't allow <p:pic> here, but PowerPoint requires it. bool bEcma = mpFB->getVersion() == oox::core::ECMA_DIALECT; if (bEcma) diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 8da6af119df1..2e2abfd5c32b 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -707,7 +707,7 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes } Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, aShapeRect ); - SdrObject* pShape = GetSdrObjectFromXShape( xShape ); + SdrObject* pShape = SdrObject::getSdrObjectFromXShape(xShape); if( pShape && getShapeType() >= 0 ) { OUString aShapeType = EnhancedCustomShapeTypeNames::Get( static_cast< MSO_SPT >(getShapeType()) ); @@ -1074,7 +1074,7 @@ namespace { if (!rTypeModel.maFlip.isEmpty()) { - if (SdrObject* pShape = GetSdrObjectFromXShape(rxShape)) + if (SdrObject* pShape = SdrObject::getSdrObjectFromXShape(rxShape)) { if (rTypeModel.maFlip.startsWith("x")) doMirrorX(pShape); @@ -1088,7 +1088,7 @@ namespace { if (!rTypeModel.maRotation.isEmpty()) { - if (SdrObject* pShape = GetSdrObjectFromXShape(rxShape)) + if (SdrObject* pShape = SdrObject::getSdrObjectFromXShape(rxShape)) { // The needed factor -1 for opposite direction and factor 100 for Degree100 is // contained in method decodeRotation(). diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 28ddc36e6b2b..3d3d23520e94 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1842,7 +1842,7 @@ XclExpShapeObj::XclExpShapeObj( XclExpObjectManager& rRoot, css::uno::Reference< XclObjAny( rRoot, xShape, pDoc ), XclMacroHelper( rRoot ) { - if( SdrObject* pSdrObj = ::GetSdrObjectFromXShape( xShape ) ) + if (SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape(xShape)) { ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pSdrObj ); if ( pInfo && !pInfo->GetMacro().isEmpty() ) diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index e64e7326d58c..7778944ccfd7 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -194,7 +194,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape } aStack.push( std::make_pair( pCurrXclObj, std::move(pCurrAppData) ) ); pCurrAppData.reset( new XclEscherHostAppData ); - SdrObject* pObj = GetSdrObjectFromXShape( rxShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rxShape); //added for exporting OCX control sal_Int16 nMsCtlType = 0; if ( !pObj ) @@ -548,7 +548,7 @@ void ShapeInteractionHelper::PopulateShapeInteractionInfo(const XclExpObjectMana SvMemoryStream* pMemStrm = nullptr; OUString sHyperLink; OUString sMacro; - SdrObject* pObj = GetSdrObjectFromXShape(xShape); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape); if (pObj) sHyperLink = pObj->getHyperlink(); if (ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo(pObj)) diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index e16c6d9021bf..3a05578f14e2 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1285,7 +1285,7 @@ void XclObjAny::SaveXml( XclExpXmlStream& rStrm ) return; // Do not output any of the detective shapes and validation circles. - SdrObject* pObject = GetSdrObjectFromXShape(mxShape); + SdrObject* pObject = SdrObject::getSdrObjectFromXShape(mxShape); if (pObject) { ScDocument& rDoc = rStrm.GetRoot().GetDoc(); diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 7ec86ddb125b..33030fd22c03 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -839,7 +839,7 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos) if( mxAnnotationData->mxShape.is() && mxAnnotationData->mxShapes.is() ) { OSL_ENSURE( mxAnnotationData->mxShapes.get() == xShapes.get(), "ScXMLTableRowCellContext::SetAnnotation - different drawing pages" ); - SdrObject* pObject = ::GetSdrObjectFromXShape( mxAnnotationData->mxShape ); + SdrObject* pObject = SdrObject::getSdrObjectFromXShape(mxAnnotationData->mxShape); OSL_ENSURE( pObject, "ScXMLTableRowCellContext::SetAnnotation - cannot get SdrObject from shape" ); /* Try to reuse the drawing object already created (but only if the diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index b1310fbe953c..94290b35c895 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3458,7 +3458,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) // needs it as if there were no hidden rows or columns. We manipulate the geometry // accordingly for writing xml markup and restore geometry later. bool bNeedsRestore = false; - SdrObject* pObj = GetSdrObjectFromXShape(rShape.xShape); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rShape.xShape); // Remember original geometry std::unique_ptr<SdrObjGeoData> pGeoData; if (pObj) diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 23f0d58e36b7..ffaa156877ba 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -933,7 +933,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X SdrObject *pFocusedObj = nullptr; if( mnShapesSelected == 1 && aShapesList.size() == 1) { - pFocusedObj = GetSdrObjectFromXShape(aShapesList[0]->xShape); + pFocusedObj = SdrObject::getSdrObjectFromXShape(aShapesList[0]->xShape); } std::sort(aShapesList.begin(), aShapesList.end(), ScShapeDataLess()); SortedShapes vecSelectedShapeAdd; diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 61f45e64f692..1bcbbaf904d4 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -1661,7 +1661,7 @@ void SdExportTest::testColumnsODG() CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(700)), xColProps->getPropertyValue("AutomaticDistance")); - auto pTextObj = dynamic_cast<SdrTextObj*>(GetSdrObjectFromXShape(xShape)); + auto pTextObj = dynamic_cast<SdrTextObj*>(SdrObject::getSdrObjectFromXShape(xShape)); CPPUNIT_ASSERT(pTextObj); CPPUNIT_ASSERT_EQUAL(sal_Int16(2), pTextObj->GetTextColumnsNumber()); @@ -1685,7 +1685,7 @@ void SdExportTest::testColumnsODG() CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(700)), xColProps->getPropertyValue("AutomaticDistance")); - auto pTextObj = dynamic_cast<SdrTextObj*>(GetSdrObjectFromXShape(xShape)); + auto pTextObj = dynamic_cast<SdrTextObj*>(SdrObject::getSdrObjectFromXShape(xShape)); CPPUNIT_ASSERT(pTextObj); CPPUNIT_ASSERT_EQUAL(sal_Int16(2), pTextObj->GetTextColumnsNumber()); diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx index 254fc46f69bb..ba888c280601 100644 --- a/sd/qa/unit/misc-tests.cxx +++ b/sd/qa/unit/misc-tests.cxx @@ -500,7 +500,7 @@ void SdMiscTest::testTextColumns() xShapes->add(xShape); // Set up columns - auto pTextObj = dynamic_cast<SdrTextObj*>(GetSdrObjectFromXShape(xShape)); + auto pTextObj = dynamic_cast<SdrTextObj*>(SdrObject::getSdrObjectFromXShape(xShape)); CPPUNIT_ASSERT(pTextObj); pTextObj->SetMergedItem(SfxInt16Item(SDRATTR_TEXTCOLUMNS_NUMBER, 2)); pTextObj->SetMergedItem(SdrMetricItem(SDRATTR_TEXTCOLUMNS_SPACING, 1000)); @@ -511,7 +511,7 @@ void SdMiscTest::testTextColumns() uno::Reference<container::XIndexAccess> xIndexAccess(xDrawPage, uno::UNO_QUERY_THROW); uno::Reference<drawing::XShape> xShape(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW); - auto pTextObj = dynamic_cast<SdrTextObj*>(GetSdrObjectFromXShape(xShape)); + auto pTextObj = dynamic_cast<SdrTextObj*>(SdrObject::getSdrObjectFromXShape(xShape)); CPPUNIT_ASSERT(pTextObj); CPPUNIT_ASSERT_EQUAL(sal_Int16(2), pTextObj->GetTextColumnsNumber()); diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index ed61bed5cb72..3e7d26ff8065 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -1571,7 +1571,7 @@ void CustomAnimationEffect::updateSdrPathObjFromPath( SdrPathObj& rPathObj ) ::basegfx::B2DPolyPolygon aPolyPoly; if( ::basegfx::utils::importFromSvgD( aPolyPoly, getPath(), true, nullptr ) ) { - SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(getTargetShape()); if( pObj ) { SdrPage* pPage = pObj->getSdrPageFromSdrObject(); @@ -1594,7 +1594,7 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj { ::basegfx::B2DPolyPolygon aPolyPoly( rPathObj.GetPathPoly() ); - SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(getTargetShape()); if( pObj ) { ::tools::Rectangle aBoundRect(0,0,0,0); diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 04a84c3a129e..423a90f3a65a 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1243,7 +1243,7 @@ void PPTWriter::ImplWriteOLE( ) { case NORMAL_OLE_OBJECT : { - SdrObject* pSdrObj = GetSdrObjectFromXShape( pPtr->xShape ); + SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape(pPtr->xShape); if ( auto pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pSdrObj) ) { const ::uno::Reference < embed::XEmbeddedObject >& xObj( pSdrOle2Obj->GetObjRef() ); diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index b5c2bd864a2c..b9d843739029 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1746,7 +1746,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a if ( aPropOpt.CreateGraphicProperties( mXPropSet, "MetaFile", false ) ) { aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 ); - SdrObject* pObj = GetSdrObjectFromXShape( mXShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(mXShape); if ( pObj ) { ::tools::Rectangle aBound = pObj->GetCurrentBoundRect(); @@ -2458,7 +2458,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a { if (ePageType == MASTER ) { - SdrObject* pObj = GetSdrObjectFromXShape( mXShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(mXShape); if (pObj && pObj->IsNotVisibleAsMaster()) continue; } diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx index fb5ddb5d686b..3286fa857fa5 100644 --- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx +++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx @@ -67,8 +67,8 @@ struct XShapePosCompareHelper const uno::Reference<drawing::XShape>& xshape2 ) const { // modify the compare method to return the Z-Order, not layout order - SdrObject* pObj1 = GetSdrObjectFromXShape(xshape1); - SdrObject* pObj2 = GetSdrObjectFromXShape(xshape2); + SdrObject* pObj1 = SdrObject::getSdrObjectFromXShape(xshape1); + SdrObject* pObj2 = SdrObject::getSdrObjectFromXShape(xshape2); if(pObj1 && pObj2) return pObj1->GetOrdNum() < pObj2->GetOrdNum(); else @@ -462,7 +462,7 @@ uno::Sequence< sal_Int32 > SAL_CALL if ( xShape.is() ) { //if the object is visible in the page, we add it into the group list. - SdrObject* pObj = GetSdrObjectFromXShape(xShape); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape); if ( pObj && pPV && pSdView && pSdView->IsObjMarkable( pObj, pPV ) ) { vXShapes.push_back( xShape ); @@ -505,7 +505,7 @@ OUString AccessibleDrawDocumentView::getObjectLink( const uno::Any& rAny ) { return aRet; } - SdrObject* pObj = GetSdrObjectFromXShape(xCurShape); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xCurShape); if (pObj) { SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 4585fd335bdc..05a65c7e6307 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -2454,7 +2454,7 @@ void CustomAnimationPane::onSelect() for( const CustomAnimationEffectPtr& pEffect : maListSelection ) { Reference< XShape > xShape( pEffect->getTargetShape() ); - SdrObject* pObj = GetSdrObjectFromXShape( xShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape); if( pObj ) pView->MarkObj(pObj, pView->GetSdrPageView()); } diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 6e4e30ad7183..37ba68c6baba 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1543,7 +1543,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape ) case ClickAction_VERB: { // todo, better do it async? - SdrObject* pObj = GetSdrObjectFromXShape( xShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape); SdrOle2Obj* pOleObject = dynamic_cast< SdrOle2Obj* >(pObj); if (pOleObject && mpViewShell ) mpViewShell->ActivateObject(pOleObject, pEvent->mnVerb); diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 78bc5cd6b9dd..4e4a07c1389c 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -604,7 +604,7 @@ void SAL_CALL SdXShape::setPropertyValue( const OUString& aPropertyName, const c case WID_ANIMPATH: { uno::Reference< drawing::XShape > xShape( aValue, uno::UNO_QUERY ); - SdrPathObj* pObj2 = xShape.is() ? dynamic_cast< SdrPathObj* >( GetSdrObjectFromXShape( xShape ) ) : nullptr; + SdrPathObj* pObj2 = xShape.is() ? dynamic_cast<SdrPathObj*>(SdrObject::getSdrObjectFromXShape(xShape)) : nullptr; if( pObj2 == nullptr ) throw lang::IllegalArgumentException(); diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index b7b0788c4bba..058ad4a42abd 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -139,7 +139,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf141021ExtrusionNorth) CPPUNIT_ASSERT_MESSAGE("Could not load document", mxComponent.is()); uno::Reference<drawing::XShape> xShape(getShape(0)); SdrObjCustomShape& rSdrCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); // Mark Object SfxViewShell* pViewShell = SfxViewShell::Current(); @@ -174,7 +174,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testResizeRotatedShape) // Change height and mirror vertical { SdrObjCustomShape& rSdrShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); rSdrShape.NbcResize(rSdrShape.GetRelativePos(), Fraction(1.0), Fraction(-0.5)); tools::Rectangle aSnapRect(rSdrShape.GetSnapRect()); tools::Rectangle aBoundRect(rSdrShape.GetCurrentBoundRect()); @@ -184,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testResizeRotatedShape) // Change height { SdrObjCustomShape& rSdrShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); rSdrShape.NbcResize(rSdrShape.GetRelativePos(), Fraction(1.0), Fraction(2.0)); tools::Rectangle aSnapRect(rSdrShape.GetSnapRect()); tools::Rectangle aBoundRect(rSdrShape.GetCurrentBoundRect()); @@ -194,7 +194,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testResizeRotatedShape) // Change width { SdrObjCustomShape& rSdrShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); rSdrShape.NbcResize(rSdrShape.GetRelativePos(), Fraction(2.0), Fraction(1.0)); tools::Rectangle aSnapRect(rSdrShape.GetSnapRect()); tools::Rectangle aBoundRect(rSdrShape.GetCurrentBoundRect()); @@ -204,7 +204,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testResizeRotatedShape) // Change width and mirror horizontal { SdrObjCustomShape& rSdrShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); rSdrShape.NbcResize(rSdrShape.GetRelativePos(), Fraction(-0.5), Fraction(1.0)); tools::Rectangle aSnapRect(rSdrShape.GetSnapRect()); tools::Rectangle aBoundRect(rSdrShape.GetCurrentBoundRect()); @@ -384,7 +384,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf121845_two_commands_U) uno::Reference<drawing::XShape> xShape(getShape(0)); // In case no line is drawn, two polygons are generated; with line only one polygon SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); SdrPathObjUniquePtr pPathObj( static_cast<SdrPathObj*>(aCustomShape2d.CreateLineGeometry().release())); @@ -406,7 +406,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf124212_handle_position) uno::Reference<drawing::XShape> xShape(getShape(0)); // The shape has one, horizontal adjust handle. SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); Point aInitialPosition; aCustomShape2d.GetHandlePosition(0, aInitialPosition); @@ -451,7 +451,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf124740_handle_path_coordsystem) // shape edge, shape is 6cm from left . That results in a position // of 8cm from left page edge, which is 8000 in 1/100 mm unit. SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); Point aPosition; aCustomShape2d.GetHandlePosition(0, aPosition); @@ -479,7 +479,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf115813_OOXML_XY_handle) { uno::Reference<drawing::XShape> xShape(getShape(i)); SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); OUString sShapeType("non-primitive"); // default for ODF const SdrCustomShapeGeometryItem& rGeometryItem( rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)); @@ -558,7 +558,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf126512_OOXML_handle_in_ODP) { uno::Reference<drawing::XShape> xShape(getShape(i)); SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); OUString sShapeType("non-primitive"); // only to initialize, value not used here const SdrCustomShapeGeometryItem& rGeometryItem( rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)); @@ -644,7 +644,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf126060_3D_Z_Rotation) uno::Reference<drawing::XShape> xShape(getShape(0)); SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong text camera Z rotation", 90.0, rSdrObjCustomShape.GetCameraZRotation()); @@ -748,7 +748,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf128413_tbrlOnOff) xShapeProps->getPropertyValue(UNO_NAME_MISC_OBJ_FRAMERECT) >>= aOrigRect; SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); rSdrObjCustomShape.SetVerticalWriting(true); awt::Rectangle aObservedRect; @@ -813,7 +813,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf103474_commandT_CaseZeroHeight) // The end points of the straight line segment should have the same x-coordinate of left // of shape, and different y-coordinates, one top and the other bottom of the shape. SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); SdrPathObjUniquePtr pPathObj( static_cast<SdrPathObj*>(aCustomShape2d.CreateLineGeometry().release())); @@ -844,7 +844,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf103474_commandG_CaseZeroHeight) // The end points of the straight line segment should have the same x-coordinate of left // of shape, and different y-coordinates, one top and the other bottom of the shape. SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); SdrPathObjUniquePtr pPathObj( static_cast<SdrPathObj*>(aCustomShape2d.CreateLineGeometry().release())); @@ -875,7 +875,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf122323_largeSwingAngle) uno::Reference<drawing::XShape> xShape(getShape(0)); uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); SdrPathObjUniquePtr pPathObj( static_cast<SdrPathObj*>(aCustomShape2d.CreateLineGeometry().release())); @@ -895,7 +895,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf141268) CPPUNIT_ASSERT_MESSAGE("Could not load document", mxComponent.is()); uno::Reference<drawing::XShape> xShape(getShape(0)); SdrObjCustomShape& rSdrCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); // Check left/bottom of bound rect. Without fix it would be left=6722, bottom=9483. tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect()); @@ -916,7 +916,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf136176) // get shape uno::Reference<drawing::XShape> xShape(getShape(i)); SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); // apply shearing 20deg const Point aCenter = rSdrObjCustomShape.GetSnapRect().Center(); rSdrObjCustomShape.Shear(aCenter, 2000_deg100, tan(basegfx::deg2rad(20.0)), false); @@ -943,7 +943,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf136176) // Get shape const uno::Reference<drawing::XShape> xShape(getShape(i)); const SdrObjCustomShape& rSdrObjCustomShape( - static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape))); + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); // Create polygon from shape and examine point 4 of the polygon const basegfx::B2DPolyPolygon aLineGeometry = rSdrObjCustomShape.GetLineGeometry(false); const basegfx::B2DPoint aPoint(aLineGeometry.getB2DPolygon(0).getB2DPoint(4)); diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index bcc62011e3d1..3036f90a2301 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -230,7 +230,7 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testTextEditEmptyGrabBag) // When editing the shape text of the 2nd rectangle (insert a char at the start). SfxViewShell* pViewShell = SfxViewShell::Current(); SdrView* pSdrView = pViewShell->GetDrawView(); - SdrObject* pObject = GetSdrObjectFromXShape(xRect2); + SdrObject* pObject = SdrObject::getSdrObjectFromXShape(xRect2); pSdrView->SdrBeginTextEdit(pObject); EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView(); rEditView.InsertText("y"); diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index c23cb16faeca..ef04fcb8625f 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -188,7 +188,7 @@ void AccessibleControlShape::Init() // get the control which belongs to our model (relative to our view) const vcl::Window* pViewWindow = maShapeTreeInfo.GetWindow(); - SdrUnoObj* pUnoObjectImpl = dynamic_cast<SdrUnoObj*>( GetSdrObjectFromXShape(mxShape) ); + SdrUnoObj* pUnoObjectImpl = dynamic_cast<SdrUnoObj*>(SdrObject::getSdrObjectFromXShape(mxShape)); SdrView* pView = maShapeTreeInfo.GetSdrView(); OSL_ENSURE( pView && pViewWindow && pUnoObjectImpl, "AccessibleControlShape::Init: no view, or no view window, no SdrUnoObj!" ); diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 7cad4582b4f6..5fbf4f4ebdec 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -103,7 +103,7 @@ AccessibleShape::AccessibleShape ( m_nIndexInParent(-1), mpParent (rShapeInfo.mpChildrenManager) { - m_pShape = GetSdrObjectFromXShape(mxShape); + m_pShape = SdrObject::getSdrObjectFromXShape(mxShape); UpdateNameAndDescription(); } @@ -149,7 +149,7 @@ void AccessibleShape::Init() return; // #107948# Determine whether shape text is empty - SdrObject* pSdrObject = GetSdrObjectFromXShape(mxShape); + SdrObject* pSdrObject = SdrObject::getSdrObjectFromXShape(mxShape); if( !pSdrObject ) return; @@ -1116,8 +1116,8 @@ struct XShapePosCompareHelper bool operator() ( const uno::Reference<drawing::XShape>& xshape1, const uno::Reference<drawing::XShape>& xshape2 ) const { - SdrObject* pObj1 = GetSdrObjectFromXShape(xshape1); - SdrObject* pObj2 = GetSdrObjectFromXShape(xshape2); + SdrObject* pObj1 = SdrObject::getSdrObjectFromXShape(xshape1); + SdrObject* pObj2 = SdrObject::getSdrObjectFromXShape(xshape2); if(pObj1 && pObj2) return pObj1->GetOrdNum() < pObj2->GetOrdNum(); else @@ -1146,7 +1146,7 @@ AccessibleShape::getGroupPosition( const uno::Any& ) { return aRet; } - SdrObject *pObj = GetSdrObjectFromXShape(mxShape); + SdrObject *pObj = SdrObject::getSdrObjectFromXShape(mxShape); if(pObj == nullptr ) @@ -1227,7 +1227,7 @@ OUString AccessibleShape::getObjectLink( const uno::Any& ) { OUString aRet; - SdrObject *pObj = GetSdrObjectFromXShape(mxShape); + SdrObject *pObj = SdrObject::getSdrObjectFromXShape(mxShape); if(pObj == nullptr ) { return aRet; diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index b66a2c8c6507..86d2f9bfb00b 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -195,13 +195,13 @@ std::unique_ptr<SdrObject, SdrObjectFreeOp> EnhancedCustomShapeEngine::ImplForce // get the text bounds and set at text object tools::Rectangle aTextBounds(rSdrObjCustomShape.GetSnapRect()); - const bool bIsSdrObjCustomShape(nullptr != dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxShape))); + const bool bIsSdrObjCustomShape(nullptr != dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape))); if(bIsSdrObjCustomShape) { SdrObjCustomShape& rSdrObjCustomShape2( static_cast< SdrObjCustomShape& >( - *GetSdrObjectFromXShape(mxShape))); + *SdrObject::getSdrObjectFromXShape(mxShape))); EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape2); aTextBounds = aCustomShape2d.GetTextRect(); } @@ -263,7 +263,7 @@ void SetTemporary( uno::Reference< drawing::XShape > const & xShape ) Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render() { - SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxShape)); + SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape)); if(!pSdrObjCustomShape) { @@ -366,7 +366,7 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render() awt::Rectangle SAL_CALL EnhancedCustomShapeEngine::getTextBounds() { awt::Rectangle aTextRect; - if (SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxShape))) + if (SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape))) { uno::Reference< document::XActionLockable > xLockable( mxShape, uno::UNO_QUERY ); @@ -387,7 +387,7 @@ awt::Rectangle SAL_CALL EnhancedCustomShapeEngine::getTextBounds() drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEngine::getLineGeometry() { drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords; - SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxShape)); + SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape)); if(pSdrObjCustomShape) { @@ -463,7 +463,7 @@ drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEngine::getLineGeom Sequence< Reference< drawing::XCustomShapeHandle > > SAL_CALL EnhancedCustomShapeEngine::getInteraction() { sal_uInt32 i, nHdlCount = 0; - SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxShape)); + SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape)); if(pSdrObjCustomShape) { diff --git a/svx/source/customshapes/EnhancedCustomShapeHandle.cxx b/svx/source/customshapes/EnhancedCustomShapeHandle.cxx index c7b790063d31..2a9fd1f19991 100644 --- a/svx/source/customshapes/EnhancedCustomShapeHandle.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeHandle.cxx @@ -49,14 +49,14 @@ void SAL_CALL EnhancedCustomShapeHandle::release() noexcept // XCustomShapeHandle css::awt::Point SAL_CALL EnhancedCustomShapeHandle::getPosition() { - const bool bIsSdrObjCustomShape(nullptr != dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxCustomShape))); + const bool bIsSdrObjCustomShape(nullptr != dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxCustomShape))); if(!bIsSdrObjCustomShape) { throw css::uno::RuntimeException(); } - SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*GetSdrObjectFromXShape(mxCustomShape))); + SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*SdrObject::getSdrObjectFromXShape(mxCustomShape))); Point aPosition; EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); @@ -70,14 +70,14 @@ css::awt::Point SAL_CALL EnhancedCustomShapeHandle::getPosition() void SAL_CALL EnhancedCustomShapeHandle::setControllerPosition( const css::awt::Point& aPnt ) { - const bool bIsSdrObjCustomShape(nullptr != dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxCustomShape))); + const bool bIsSdrObjCustomShape(nullptr != dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxCustomShape))); if(!bIsSdrObjCustomShape) { throw css::uno::RuntimeException(); } - SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*GetSdrObjectFromXShape(mxCustomShape))); + SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*SdrObject::getSdrObjectFromXShape(mxCustomShape))); EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); if(!aCustomShape2d.SetHandleControllerPosition(mnIndex, aPnt)) diff --git a/svx/source/sdr/primitive2d/primitivefactory2d.cxx b/svx/source/sdr/primitive2d/primitivefactory2d.cxx index 975e7fdaaa0b..fc33fa398b9d 100644 --- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx +++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx @@ -68,7 +68,7 @@ css::uno::Sequence< css::uno::Reference< css::graphic::XPrimitive2D > > SAL_CALL if(xShape.is()) { - SdrObject* pSource = GetSdrObjectFromXShape(xShape); + SdrObject* pSource = SdrObject::getSdrObjectFromXShape(xShape); if(pSource) { diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 7956259d3ab7..eac980c82981 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -411,7 +411,7 @@ const SdrObject* SdrObjCustomShape::GetSdrObjectFromCustomShape() const const_cast<SdrObjCustomShape*>(this)->mXRenderedCustomShape = xCustomShapeEngine->render(); } SdrObject* pRenderedCustomShape = mXRenderedCustomShape.is() - ? GetSdrObjectFromXShape( mXRenderedCustomShape ) + ? SdrObject::getSdrObjectFromXShape( mXRenderedCustomShape ) : nullptr; return pRenderedCustomShape; } @@ -1324,7 +1324,7 @@ void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const if ( !mXRenderedCustomShape.is() ) return; - const SdrObject* pRenderedCustomShape = GetSdrObjectFromXShape( mXRenderedCustomShape ); + const SdrObject* pRenderedCustomShape = SdrObject::getSdrObjectFromXShape( mXRenderedCustomShape ); if ( !pRenderedCustomShape ) return; @@ -1477,7 +1477,7 @@ void SdrObjCustomShape::NbcMove( const Size& rSiz ) SdrTextObj::NbcMove( rSiz ); if ( mXRenderedCustomShape.is() ) { - SdrObject* pRenderedCustomShape = GetSdrObjectFromXShape( mXRenderedCustomShape ); + SdrObject* pRenderedCustomShape = SdrObject::getSdrObjectFromXShape(mXRenderedCustomShape); if ( pRenderedCustomShape ) { // #i97149# the visualisation shape needs to be informed @@ -2813,7 +2813,7 @@ SdrObjectUniquePtr SdrObjCustomShape::DoConvertToPolyObj(bool bBezier, bool bAdd if ( mXRenderedCustomShape.is() ) { - pRenderedCustomShape = GetSdrObjectFromXShape( mXRenderedCustomShape ); + pRenderedCustomShape = SdrObject::getSdrObjectFromXShape(mXRenderedCustomShape); } if ( pRenderedCustomShape ) diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index a7c392a194d2..1aedee6202ec 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -792,7 +792,7 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) { mxShapes->getByIndex( nIndex ) >>= xShape; - SdrObject* pObj = GetSdrObjectFromXShape( xShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape); if( pObj ) aShapes.push_back( pObj ); } @@ -800,7 +800,7 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr else { // only one shape - SdrObject* pObj = GetSdrObjectFromXShape( mxShape ); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(mxShape); if( pObj ) aShapes.push_back( pObj ); } @@ -1128,7 +1128,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon // Step 2: try a shape if( mxShape.is() ) { - if( nullptr == GetSdrObjectFromXShape( mxShape ) ) + if (nullptr == SdrObject::getSdrObjectFromXShape(mxShape)) { // This is not a Draw shape, let's see if it's a Writer one. uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY); @@ -1194,7 +1194,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon for( sal_Int32 nIndex = 1; bOk && ( nIndex < nCount ); nIndex++ ) { mxShapes->getByIndex( nIndex ) >>= xShape; - pObj = GetSdrObjectFromXShape( xShape ); + pObj = SdrObject::getSdrObjectFromXShape(xShape); bOk = pObj && pObj->getSdrPageFromSdrObject() == pPage; } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index ed1865dc5448..c05d7323e43c 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2184,7 +2184,7 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn Reference< drawing::XShape > xShape; if( rValue >>= xShape ) { - SdrObject* pNode = GetSdrObjectFromXShape( xShape ); + SdrObject* pNode = SdrObject::getSdrObjectFromXShape(xShape); if( pNode ) { pEdgeObj->ConnectToNode( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, pNode ); @@ -4016,13 +4016,6 @@ uno::Reference< drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) noexc return xShape; } -/** returns the SdrObject from the given StarOffice API wrapper */ -SdrObject* GetSdrObjectFromXShape( const uno::Reference< drawing::XShape >& xShape ) noexcept -{ - SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape ); - return pShape ? pShape->GetSdrObject() : nullptr; -} - SdrObject* SdrObject::getSdrObjectFromXShape( const css::uno::Reference< css::uno::XInterface >& xInt ) { diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index a8685d8c14a3..21609b3a9c8e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -670,7 +670,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133473_shadowSize, "tdf133473.docx") { uno::Reference<drawing::XShape> xShape = getShape(1); - SdrObject* pObj(GetSdrObjectFromXShape(xShape)); + SdrObject* pObj(SdrObject::getSdrObjectFromXShape(xShape)); const SfxItemSet& rSet = pObj->GetMergedItemSet(); sal_Int32 nSize1 = rSet.Get(SDRATTR_SHADOWSIZEX).GetValue(); diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index a3a029342692..a79863f65047 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1613,7 +1613,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool bInvalidateFocusMode /*=fa ::accessibility::AccessibleShape *pAccShape = rpShape.get(); if (pAccShape) { - SdrObject *pObj = GetSdrObjectFromXShape(pAccShape->GetXShape()); + SdrObject *pObj = SdrObject::getSdrObjectFromXShape(pAccShape->GetXShape()); SwFrameFormat *pFrameFormat = pObj ? FindFrameFormat( pObj ) : nullptr; if (pFrameFormat) { @@ -2084,7 +2084,7 @@ void SwAccessibleMap::AddGroupContext(const SdrObject *pParentObj, uno::Referenc uno::Reference < drawing::XShape > xShape = pAccShape->GetXShape(); if (xShape.is()) { - SdrObject* pObj = GetSdrObjectFromXShape(xShape); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape); AddShapeContext(pObj, xChild); AddGroupContext(pObj,xChild); } diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 0e5d92009d54..c98f7689c4be 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2995,7 +2995,7 @@ sal_uInt32 SwEscherEx::QueryTextID( const uno::Reference< drawing::XShape>& xXShapeRef, sal_uInt32 nShapeId ) { sal_uInt32 nId = 0; - if (SdrObject* pObj = GetSdrObjectFromXShape(xXShapeRef)) + if (SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xXShapeRef)) { pTextBxs->Append( *pObj, nShapeId ); nId = pTextBxs->Count(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 09065cc441c3..a6559a681a8c 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -536,7 +536,7 @@ SdrObject* SwMSDffManager::ImportOLE( sal_uInt32 nOLEId, if ( (!(rReader.m_bIsHeader || rReader.m_bIsFooter)) && rReader.m_xFormImpl->ReadOCXStream(xSrc,&xShape,true)) { - pRet = GetSdrObjectFromXShape(xShape); + pRet = SdrObject::getSdrObjectFromXShape(xShape); } else { diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index e9d33456dd94..99f2647db76b 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -389,7 +389,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, OSL_ENSURE(m_xFormImpl, "Impossible"); if (m_xFormImpl && m_xFormImpl->ReadOCXStream(xSrc1, &xRef)) { - pRet = GetSdrObjectFromXShape(xRef); + pRet = SdrObject::getSdrObjectFromXShape(xRef); OSL_ENSURE(pRet, "Impossible"); if (pRet) pRet->SetLogicRect(aRect); diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index f97fdec0fc68..3fc0b044a392 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -87,7 +87,7 @@ namespace { bool isTopGroupObj(const uno::Reference<drawing::XShape>& xShape) { - SdrObject* pObject = GetSdrObjectFromXShape(xShape); + SdrObject* pObject = SdrObject::getSdrObjectFromXShape(xShape); if (!pObject) return false; @@ -920,7 +920,7 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) const bool bIsGroupOrLine = (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape") && !bIsDiagram && !bIsLockedCanvas) || xServiceInfo->supportsService("com.sun.star.drawing.LineShape"); - SdrObject* pShape = GetSdrObjectFromXShape(m_xShape); + SdrObject* pShape = SdrObject::getSdrObjectFromXShape(m_xShape); if ((bIsGroupOrLine && !lcl_bHasGroupSlantedChild(pShape) && nOOXAngle == 0) || !bIsGroupOrLine) { diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index ec67b056959d..20e9bbdce6b8 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -1041,7 +1041,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap "CustomShapeGeometry", uno::makeAny(aCustomShapeGeometry.getAsConstPropertyValueList())); } - else if (SdrObject* pObject = GetSdrObjectFromXShape(xShape)) + else if (SdrObject* pObject = SdrObject::getSdrObjectFromXShape(xShape)) { Point aRef1 = pObject->GetSnapRect().Center(); Point aRef2(aRef1); |