diff --git a/include/vcl/vectorgraphicdata.hxx b/include/vcl/vectorgraphicdata.hxx index c10b068e384a..a7f484c7e7bf 100644 --- a/include/vcl/vectorgraphicdata.hxx +++ b/include/vcl/vectorgraphicdata.hxx @@ -81,7 +81,6 @@ private: VectorGraphicData& operator=(const VectorGraphicData&) = delete; public: - VectorGraphicData(const OUString& rPath, VectorGraphicDataType eVectorDataType); VectorGraphicData( BinaryDataContainer aDataContainer, VectorGraphicDataType eVectorDataType, diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 0e84d5d1e90d..d96568b825a5 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -138,7 +138,16 @@ bool SfxApplication::loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWid if ( !FileExists(aObj) ) return false; - VectorGraphicData aVectorGraphicData(aObj.PathToFileName(), VectorGraphicDataType::Svg); + // Read the SVG file + SvFileStream aStream(aObj.PathToFileName(), StreamMode::STD_READ); + if (aStream.GetError()) + return false; + + BinaryDataContainer aDataContainer(aStream, aStream.remainingSize()); + if (aStream.GetError()) + return false; + + VectorGraphicData aVectorGraphicData(aDataContainer, VectorGraphicDataType::Svg); // transform into [0,0,width,width*aspect] std dimensions diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx index 953c0b66c822..68245fe25acd 100644 --- a/vcl/source/gdi/vectorgraphicdata.cxx +++ b/vcl/source/gdi/vectorgraphicdata.cxx @@ -319,10 +319,7 @@ std::pair VectorGraphicData::getSizeBytes() co } } -VectorGraphicData::VectorGraphicData( - BinaryDataContainer aDataContainer, - VectorGraphicDataType eVectorDataType, - sal_Int32 nPageIndex) +VectorGraphicData::VectorGraphicData(BinaryDataContainer aDataContainer, VectorGraphicDataType eVectorDataType, sal_Int32 nPageIndex) : maDataContainer(std::move(aDataContainer)), mbSequenceCreated(false), mNestedBitmapSize(0), @@ -331,29 +328,6 @@ VectorGraphicData::VectorGraphicData( { } -VectorGraphicData::VectorGraphicData( - const OUString& rPath, - VectorGraphicDataType eVectorDataType) -: mbSequenceCreated(false), - mNestedBitmapSize(0), - meType(eVectorDataType), - mnPageIndex(-1) -{ - SvFileStream rIStm(rPath, StreamMode::STD_READ); - if(rIStm.GetError()) - return; - const sal_uInt32 nStmLen(rIStm.remainingSize()); - if (nStmLen) - { - BinaryDataContainer aData(rIStm, nStmLen); - - if (!rIStm.GetError()) - { - maDataContainer = std::move(aData); - } - } -} - VectorGraphicData::~VectorGraphicData() { }