diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-07-06 15:16:06 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-07-10 16:29:27 +0200 |
commit | b9bc45705bc3204c968fd6c902a1d5003c008023 (patch) | |
tree | f52d59bd42e3f0663bc3fb4a8bd0ec59b8a715a0 /include/filter | |
parent | 3bc3ddc11fd94877d9c5d2b8313ab53150818236 (diff) |
Make EscherPropertyContainer::CreatePolygonProperties safer
Additionally adapted EscherPropertyContainer's AddOpt
methods to be more safe and flexible. Added support for
SvMemoryStream. Changed Data handling in EscherPropSortStruct
to use std::vector<sal_uInt8>, adapted all usages and
converions throgh all modules. This makes memorty handling
for these parts much safer (no more local new-ops, no
longer delete[] there).
Currently there are quite some usages of nProp.size() and
&nProp[0] to access the data. but the base for further
changes to work more on std::vector is done.
Change-Id: I982225c5bfc06fdd9e195d18cd3c550d15f1d48d
Reviewed-on: https://gerrit.libreoffice.org/57061
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'include/filter')
-rw-r--r-- | include/filter/msfilter/escherex.hxx | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index 58d492402ac2..e31116562d75 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -656,8 +656,7 @@ class SdrObjCustomShape; struct EscherPropSortStruct { - sal_uInt8* pBuf; - sal_uInt32 nPropSize; + std::vector<sal_uInt8> nProp; sal_uInt32 nPropValue; sal_uInt16 nPropId; }; @@ -703,21 +702,26 @@ public: // GraphicObjects are saved to PowerPoint ~EscherPropertyContainer(); - void AddOpt( sal_uInt16 nPropertyID, const OUString& rString ); - - void AddOpt( - sal_uInt16 nPropertyID, - sal_uInt32 nPropValue, - bool bBlib = false - ); - - void AddOpt( - sal_uInt16 nPropertyID, - bool bBlib, - sal_uInt32 nPropValue, - sal_uInt8* pProp, - sal_uInt32 nPropSize - ); + void AddOpt( + sal_uInt16 nPropID, + bool bBlib, + sal_uInt32 nSizeReduction, + SvMemoryStream& rStream); + + void AddOpt( + sal_uInt16 nPropertyID, + const OUString& rString); + + void AddOpt( + sal_uInt16 nPropertyID, + sal_uInt32 nPropValue, + bool bBlib = false); + + void AddOpt( + sal_uInt16 nPropertyID, + bool bBlib, + sal_uInt32 nPropValue, + const std::vector<sal_uInt8>& rProp); bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const; |