vcl: remove VectorGraphicData string path constructor
Not needing that convenience that is used only once - better to be sure we always take the BinaryDataContainer as a input. This also means every VectorGraphicData still has access to the source format (SVG, PDF, EMF,...). Change-Id: I179f6eafd2fbb18497e433a1c5d3f4dcc551c508 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180787 Tested-by: Jenkins Reviewed-by: David Gilbert <freedesktop@treblig.org>
This commit is contained in:
committed by
David Gilbert
parent
589e523dd9
commit
4e6053bede
@@ -81,7 +81,6 @@ private:
|
|||||||
VectorGraphicData& operator=(const VectorGraphicData&) = delete;
|
VectorGraphicData& operator=(const VectorGraphicData&) = delete;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VectorGraphicData(const OUString& rPath, VectorGraphicDataType eVectorDataType);
|
|
||||||
VectorGraphicData(
|
VectorGraphicData(
|
||||||
BinaryDataContainer aDataContainer,
|
BinaryDataContainer aDataContainer,
|
||||||
VectorGraphicDataType eVectorDataType,
|
VectorGraphicDataType eVectorDataType,
|
||||||
|
@@ -138,7 +138,16 @@ bool SfxApplication::loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWid
|
|||||||
if ( !FileExists(aObj) )
|
if ( !FileExists(aObj) )
|
||||||
return false;
|
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
|
// transform into [0,0,width,width*aspect] std dimensions
|
||||||
|
|
||||||
|
@@ -319,10 +319,7 @@ std::pair<VectorGraphicData::State, size_t> VectorGraphicData::getSizeBytes() co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorGraphicData::VectorGraphicData(
|
VectorGraphicData::VectorGraphicData(BinaryDataContainer aDataContainer, VectorGraphicDataType eVectorDataType, sal_Int32 nPageIndex)
|
||||||
BinaryDataContainer aDataContainer,
|
|
||||||
VectorGraphicDataType eVectorDataType,
|
|
||||||
sal_Int32 nPageIndex)
|
|
||||||
: maDataContainer(std::move(aDataContainer)),
|
: maDataContainer(std::move(aDataContainer)),
|
||||||
mbSequenceCreated(false),
|
mbSequenceCreated(false),
|
||||||
mNestedBitmapSize(0),
|
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()
|
VectorGraphicData::~VectorGraphicData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user