filter/source/svg/svgfilter.cxx | 2 +- include/vcl/graph.hxx | 4 ++-- include/vcl/vectorgraphicdata.hxx | 2 -- svx/source/core/graphichelper.cxx | 6 +++--- svx/source/svdraw/svdograf.cxx | 16 ++++++++-------- svx/source/xoutdev/_xoutbmp.cxx | 15 +++++++-------- sw/source/core/graphic/ndgrf.cxx | 8 ++++---- vcl/inc/graphic/Manager.hxx | 3 ++- vcl/inc/impgraph.hxx | 6 +++--- vcl/source/filter/graphicfilter.cxx | 36 ++++++++++++++++++------------------ vcl/source/filter/wmf/wmf.cxx | 2 +- vcl/source/gdi/graph.cxx | 4 ++-- vcl/source/gdi/impgraph.cxx | 6 +++--- vcl/source/graphic/GraphicID.cxx | 4 ++-- vcl/source/graphic/Manager.cxx | 3 ++- 15 files changed, 58 insertions(+), 59 deletions(-)
New commits: commit d7a201ee95ffa10416290d8a1e0a2905664fb4ed Author: Tomaž Vajngerl <[email protected]> AuthorDate: Sat Apr 11 12:02:47 2020 +0200 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Sun Apr 12 11:34:07 2020 +0200 replace and remove VectorGraphicDataPtr typedef for the real type There is no need to hide std::shared_ptr<VectorGraphicData> type under an alias name. It doesn't make the code more understandble and it usually is the exact opposite because we know with what type we are dealing with. Change-Id: Iec80ee99697ff2fe3a8275fc2787b5370510ebe6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92069 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]> diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index b7e6bcb66e53..0440ac94e1c9 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -254,7 +254,7 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto // tdf#118232 Get the sequence of primitives and check if geometry is completely // hidden. If so, there is no need to add a SdrObject at all - const VectorGraphicDataPtr& rVectorGraphicData(aGraphic.getVectorGraphicData()); + auto const & rVectorGraphicData(aGraphic.getVectorGraphicData()); bool bContainsNoGeometry(false); if(bool(rVectorGraphicData) && VectorGraphicDataType::Svg == rVectorGraphicData->getVectorGraphicDataType()) diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index 6e70f66731ac..b304cfb7ac97 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -99,7 +99,7 @@ public: Graphic( const Bitmap& rBmp ); Graphic( const Image& rImage ); Graphic( const BitmapEx& rBmpEx ); - Graphic( const VectorGraphicDataPtr& rVectorGraphicDataPtr ); + Graphic( const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr ); Graphic( const Animation& rAnimation ); Graphic( const GDIMetaFile& rMtf ); Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic ); @@ -202,7 +202,7 @@ public: public: - const VectorGraphicDataPtr& getVectorGraphicData() const; + const std::shared_ptr<VectorGraphicData>& getVectorGraphicData() const; /// Get the page number of the multi-page source this Graphic is rendered from. sal_Int32 getPageNumber() const; diff --git a/include/vcl/vectorgraphicdata.hxx b/include/vcl/vectorgraphicdata.hxx index 7e272602f67f..f982537da67d 100644 --- a/include/vcl/vectorgraphicdata.hxx +++ b/include/vcl/vectorgraphicdata.hxx @@ -115,8 +115,6 @@ public: bool isPrimitiveSequenceCreated() const { return mbSequenceCreated; } }; -typedef std::shared_ptr< VectorGraphicData > VectorGraphicDataPtr; - #endif // INCLUDED_VCL_VECTORGRAPHICDATA_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx index ab2b85786be9..e1278da3b5ab 100644 --- a/svx/source/core/graphichelper.cxx +++ b/svx/source/core/graphichelper.cxx @@ -67,11 +67,11 @@ namespace drawing = com::sun::star::drawing; void GraphicHelper::GetPreferredExtension( OUString& rExtension, const Graphic& rGraphic ) { OUString aExtension = "png"; - const VectorGraphicDataPtr& aVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); + auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); - if (aVectorGraphicDataPtr.get() && aVectorGraphicDataPtr->getVectorGraphicDataArrayLength()) + if (rVectorGraphicDataPtr && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()) { - switch (aVectorGraphicDataPtr->getVectorGraphicDataType()) + switch (rVectorGraphicDataPtr->getVectorGraphicDataType()) { case VectorGraphicDataType::Wmf: aExtension = "wmf"; diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 49c4c3175dd6..fc70e8bc1984 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -133,9 +133,9 @@ void SdrGrafObj::onGraphicChanged() if (!mpGraphicObject || !mpGraphicObject->GetGraphic().isAvailable()) return; - const VectorGraphicDataPtr& rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); + auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); - if (!rVectorGraphicDataPtr.get()) + if (!rVectorGraphicDataPtr) return; // Skip for PDF as it is only a bitmap primitive in a sequence and @@ -282,9 +282,9 @@ const GraphicObject* SdrGrafObj::GetReplacementGraphicObject() const { if (!mpReplacementGraphicObject && mpGraphicObject) { - const VectorGraphicDataPtr& rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); + auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); - if (rVectorGraphicDataPtr.get()) + if (rVectorGraphicDataPtr) { const_cast< SdrGrafObj* >(this)->mpReplacementGraphicObject.reset(new GraphicObject(rVectorGraphicDataPtr->getReplacement())); } @@ -552,11 +552,11 @@ OUString SdrGrafObj::TakeObjNameSingul() const if (!mpGraphicObject) return OUString(); - const VectorGraphicDataPtr& rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); + auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); OUStringBuffer sName; - if(rVectorGraphicDataPtr.get()) + if (rVectorGraphicDataPtr) { switch (rVectorGraphicDataPtr->getVectorGraphicDataType()) { @@ -622,11 +622,11 @@ OUString SdrGrafObj::TakeObjNamePlural() const if (!mpGraphicObject) return OUString(); - const VectorGraphicDataPtr& rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); + auto const & rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); OUStringBuffer sName; - if(rVectorGraphicDataPtr.get()) + if (rVectorGraphicDataPtr) { switch (rVectorGraphicDataPtr->getVectorGraphicDataType()) { diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 7eadfe7cacc4..500a30375c62 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -130,15 +130,14 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, } // #i121128# use shortcut to write Vector Graphic Data data in original form (if possible) - const VectorGraphicDataPtr& aVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); + auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); - if(aVectorGraphicDataPtr.get() - && aVectorGraphicDataPtr->getVectorGraphicDataArrayLength()) + if (rVectorGraphicDataPtr && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()) { - const bool bIsSvg(rFilterName.equalsIgnoreAsciiCase("svg") && VectorGraphicDataType::Svg == aVectorGraphicDataPtr->getVectorGraphicDataType()); - const bool bIsWmf(rFilterName.equalsIgnoreAsciiCase("wmf") && VectorGraphicDataType::Wmf == aVectorGraphicDataPtr->getVectorGraphicDataType()); - const bool bIsEmf(rFilterName.equalsIgnoreAsciiCase("emf") && VectorGraphicDataType::Emf == aVectorGraphicDataPtr->getVectorGraphicDataType()); - const bool bIsPdf(rFilterName.equalsIgnoreAsciiCase("pdf") && VectorGraphicDataType::Pdf == aVectorGraphicDataPtr->getVectorGraphicDataType()); + const bool bIsSvg(rFilterName.equalsIgnoreAsciiCase("svg") && VectorGraphicDataType::Svg == rVectorGraphicDataPtr->getVectorGraphicDataType()); + const bool bIsWmf(rFilterName.equalsIgnoreAsciiCase("wmf") && VectorGraphicDataType::Wmf == rVectorGraphicDataPtr->getVectorGraphicDataType()); + const bool bIsEmf(rFilterName.equalsIgnoreAsciiCase("emf") && VectorGraphicDataType::Emf == rVectorGraphicDataPtr->getVectorGraphicDataType()); + const bool bIsPdf(rFilterName.equalsIgnoreAsciiCase("pdf") && VectorGraphicDataType::Pdf == rVectorGraphicDataPtr->getVectorGraphicDataType()); if (bIsSvg || bIsWmf || bIsEmf || bIsPdf) { @@ -153,7 +152,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, if (pOStm) { - pOStm->WriteBytes(aVectorGraphicDataPtr->getVectorGraphicDataArray().getConstArray(), aVectorGraphicDataPtr->getVectorGraphicDataArrayLength()); + pOStm->WriteBytes(rVectorGraphicDataPtr->getVectorGraphicDataArray().getConstArray(), rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()); aMedium.Commit(); if (!aMedium.GetError()) diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 6e042765ab7c..bb39141cc49a 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -313,9 +313,9 @@ void SwGrfNode::onGraphicChanged() OUString aName; OUString aTitle; OUString aDesc; - const VectorGraphicDataPtr& rVectorGraphicDataPtr = GetGrf().getVectorGraphicData(); + auto const & rVectorGraphicDataPtr = GetGrf().getVectorGraphicData(); - if(rVectorGraphicDataPtr.get()) + if (rVectorGraphicDataPtr) { const drawinglayer::primitive2d::Primitive2DContainer aSequence(rVectorGraphicDataPtr->getPrimitive2DSequence()); @@ -375,9 +375,9 @@ const GraphicObject* SwGrfNode::GetReplacementGrfObj() const { if(!mpReplacementGraphic) { - const VectorGraphicDataPtr& rVectorGraphicDataPtr = GetGrfObj().GetGraphic().getVectorGraphicData(); + auto const & rVectorGraphicDataPtr = GetGrfObj().GetGraphic().getVectorGraphicData(); - if(rVectorGraphicDataPtr.get()) + if (rVectorGraphicDataPtr) { const_cast< SwGrfNode* >(this)->mpReplacementGraphic.reset( new GraphicObject(rVectorGraphicDataPtr->getReplacement()) ); } diff --git a/vcl/inc/graphic/Manager.hxx b/vcl/inc/graphic/Manager.hxx index d127201266f5..bb52a0cfcf8f 100644 --- a/vcl/inc/graphic/Manager.hxx +++ b/vcl/inc/graphic/Manager.hxx @@ -62,7 +62,8 @@ public: std::shared_ptr<ImpGraphic> newInstance(); std::shared_ptr<ImpGraphic> newInstance(const Bitmap& rBitmap); std::shared_ptr<ImpGraphic> newInstance(const BitmapEx& rBitmapEx); - std::shared_ptr<ImpGraphic> newInstance(const VectorGraphicDataPtr& rVectorGraphicDataPtr); + std::shared_ptr<ImpGraphic> + newInstance(const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr); std::shared_ptr<ImpGraphic> newInstance(const Animation& rAnimation); std::shared_ptr<ImpGraphic> newInstance(const GDIMetaFile& rMtf); std::shared_ptr<ImpGraphic> newInstance(const GraphicExternalLink& rGraphicLink); diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index a5435ee73b39..eaf691c10f1b 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -65,7 +65,7 @@ private: mutable sal_uLong mnSizeBytes; bool mbSwapOut; bool mbDummyContext; - VectorGraphicDataPtr maVectorGraphicData; + std::shared_ptr<VectorGraphicData> maVectorGraphicData; // cache checksum computation mutable BitmapChecksum mnChecksum = 0; @@ -82,7 +82,7 @@ public: ImpGraphic( const GraphicExternalLink& rExternalLink); ImpGraphic( const Bitmap& rBmp ); ImpGraphic( const BitmapEx& rBmpEx ); - ImpGraphic(const VectorGraphicDataPtr& rVectorGraphicDataPtr); + ImpGraphic(const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr); ImpGraphic( const Animation& rAnimation ); ImpGraphic( const GDIMetaFile& rMtf ); ~ImpGraphic(); @@ -193,7 +193,7 @@ private: friend void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& rImpGraphic); friend void ReadImpGraphic(SvStream& rIStm, ImpGraphic& rImpGraphic); - const VectorGraphicDataPtr& getVectorGraphicData() const; + const std::shared_ptr<VectorGraphicData>& getVectorGraphicData() const; bool ensureAvailable () const; diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index edd02257ad70..e69686a3d99e 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1573,7 +1573,7 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, if(!aMemStream.GetError() ) { - VectorGraphicDataPtr aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, rPath, VectorGraphicDataType::Svg); + auto aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, rPath, VectorGraphicDataType::Svg); rGraphic = Graphic(aVectorGraphicDataPtr); bOkay = true; } @@ -1586,7 +1586,7 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, if(!rIStream.GetError()) { - VectorGraphicDataPtr aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, rPath, VectorGraphicDataType::Svg); + auto aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, rPath, VectorGraphicDataType::Svg); rGraphic = Graphic(aVectorGraphicDataPtr); bOkay = true; } @@ -1656,7 +1656,7 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, { const bool bIsWmf(aFilterName.equalsIgnoreAsciiCase(IMP_WMF)); const VectorGraphicDataType aDataType(bIsWmf ? VectorGraphicDataType::Wmf : VectorGraphicDataType::Emf); - VectorGraphicDataPtr aVectorGraphicDataPtr = + auto aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>( aNewData, rPath, @@ -1924,13 +1924,13 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r bool bDone(false); // do we have a native Vector Graphic Data RenderGraphic, whose data can be written directly? - const VectorGraphicDataPtr& aVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); + auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); - if (aVectorGraphicDataPtr.get() - && aVectorGraphicDataPtr->getVectorGraphicDataArrayLength() - && VectorGraphicDataType::Wmf == aVectorGraphicDataPtr->getVectorGraphicDataType()) + if (rVectorGraphicDataPtr + && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength() + && VectorGraphicDataType::Wmf == rVectorGraphicDataPtr->getVectorGraphicDataType()) { - rOStm.WriteBytes(aVectorGraphicDataPtr->getVectorGraphicDataArray().getConstArray(), aVectorGraphicDataPtr->getVectorGraphicDataArrayLength()); + rOStm.WriteBytes(rVectorGraphicDataPtr->getVectorGraphicDataArray().getConstArray(), rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()); if (rOStm.GetError()) { @@ -1957,13 +1957,13 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r bool bDone(false); // do we have a native Vector Graphic Data RenderGraphic, whose data can be written directly? - const VectorGraphicDataPtr& aVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); + auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); - if (aVectorGraphicDataPtr.get() - && aVectorGraphicDataPtr->getVectorGraphicDataArrayLength() - && VectorGraphicDataType::Emf == aVectorGraphicDataPtr->getVectorGraphicDataType()) + if (rVectorGraphicDataPtr + && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength() + && VectorGraphicDataType::Emf == rVectorGraphicDataPtr->getVectorGraphicDataType()) { - rOStm.WriteBytes(aVectorGraphicDataPtr->getVectorGraphicDataArray().getConstArray(), aVectorGraphicDataPtr->getVectorGraphicDataArrayLength()); + rOStm.WriteBytes(rVectorGraphicDataPtr->getVectorGraphicDataArray().getConstArray(), rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()); if (rOStm.GetError()) { @@ -2051,13 +2051,13 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r bool bDone(false); // do we have a native Vector Graphic Data RenderGraphic, whose data can be written directly? - const VectorGraphicDataPtr& aVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); + auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData()); - if (aVectorGraphicDataPtr.get() - && aVectorGraphicDataPtr->getVectorGraphicDataArrayLength() - && VectorGraphicDataType::Svg == aVectorGraphicDataPtr->getVectorGraphicDataType()) + if (rVectorGraphicDataPtr + && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength() + && VectorGraphicDataType::Svg == rVectorGraphicDataPtr->getVectorGraphicDataType()) { - rOStm.WriteBytes(aVectorGraphicDataPtr->getVectorGraphicDataArray().getConstArray(), aVectorGraphicDataPtr->getVectorGraphicDataArrayLength()); + rOStm.WriteBytes(rVectorGraphicDataPtr->getVectorGraphicDataArray().getConstArray(), rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()); if( rOStm.GetError() ) { diff --git a/vcl/source/filter/wmf/wmf.cxx b/vcl/source/filter/wmf/wmf.cxx index 3b9156ac84a1..7818309ed6d1 100644 --- a/vcl/source/filter/wmf/wmf.cxx +++ b/vcl/source/filter/wmf/wmf.cxx @@ -49,7 +49,7 @@ bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF ) // Throw into VectorGraphicData to get the import. Do not care // too much for type, this will be checked there. Also no path // needed, it is a temporary object - VectorGraphicDataPtr aVectorGraphicDataPtr = + auto aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>( aNewData, OUString(), diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 96414b43ad3a..ee7a8797cde9 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -222,7 +222,7 @@ Graphic::Graphic(const Image& rImage) mxImpGraphic->setOriginURL("private:graphicrepository/" + aStock); } -Graphic::Graphic(const VectorGraphicDataPtr& rVectorGraphicDataPtr) +Graphic::Graphic(const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr) : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rVectorGraphicDataPtr)) { } @@ -555,7 +555,7 @@ void WriteGraphic( SvStream& rOStream, const Graphic& rGraphic ) WriteImpGraphic(rOStream, *rGraphic.mxImpGraphic); } -const VectorGraphicDataPtr& Graphic::getVectorGraphicData() const +const std::shared_ptr<VectorGraphicData>& Graphic::getVectorGraphicData() const { return mxImpGraphic->getVectorGraphicData(); } diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index c6f08ec2130f..292c0bc6d1f9 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -151,7 +151,7 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) : { } -ImpGraphic::ImpGraphic(const VectorGraphicDataPtr& rVectorGraphicDataPtr) +ImpGraphic::ImpGraphic(const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr) : meType( rVectorGraphicDataPtr.get() ? GraphicType::Bitmap : GraphicType::NONE ), mnSizeBytes( 0 ), mbSwapOut( false ), @@ -320,7 +320,7 @@ bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const return bRet; } -const VectorGraphicDataPtr& ImpGraphic::getVectorGraphicData() const +const std::shared_ptr<VectorGraphicData>& ImpGraphic::getVectorGraphicData() const { ensureAvailable(); @@ -1716,7 +1716,7 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic ) aDataType = VectorGraphicDataType::Pdf; } - VectorGraphicDataPtr aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, aPath, aDataType); + auto aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, aPath, aDataType); rImpGraphic = aVectorGraphicDataPtr; } } diff --git a/vcl/source/graphic/GraphicID.cxx b/vcl/source/graphic/GraphicID.cxx index 15de2a0d6f0f..96f256cf45da 100644 --- a/vcl/source/graphic/GraphicID.cxx +++ b/vcl/source/graphic/GraphicID.cxx @@ -30,9 +30,9 @@ GraphicID::GraphicID(ImpGraphic const& rGraphic) if (rGraphic.ImplGetType() == GraphicType::Bitmap) { - if (rGraphic.getVectorGraphicData().get()) + auto const& rVectorGraphicDataPtr = rGraphic.getVectorGraphicData(); + if (rVectorGraphicDataPtr) { - const VectorGraphicDataPtr& rVectorGraphicDataPtr = rGraphic.getVectorGraphicData(); const basegfx::B2DRange& rRange = rVectorGraphicDataPtr->getRange(); mnID1 |= rVectorGraphicDataPtr->getVectorGraphicDataArrayLength(); diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx index 783ff21f64e9..b019d5adceaa 100644 --- a/vcl/source/graphic/Manager.cxx +++ b/vcl/source/graphic/Manager.cxx @@ -199,7 +199,8 @@ std::shared_ptr<ImpGraphic> Manager::newInstance(const Animation& rAnimation) return pReturn; } -std::shared_ptr<ImpGraphic> Manager::newInstance(const VectorGraphicDataPtr& rVectorGraphicDataPtr) +std::shared_ptr<ImpGraphic> +Manager::newInstance(const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr) { auto pReturn = std::make_shared<ImpGraphic>(rVectorGraphicDataPtr); registerGraphic(pReturn, "VectorGraphic"); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
