summaryrefslogtreecommitdiff
path: root/include/oox/drawingml/shapepropertymap.hxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-03-04 21:10:10 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-03-04 21:17:40 +0100
commit20a7a705b572f02049ebe76b2e8cc84c4f4b3d05 (patch)
treed8df168107b21511d4c994e8a8f265fd85060b5b /include/oox/drawingml/shapepropertymap.hxx
parentbbaad88a5c5643365afc438fc53e864e4233a628 (diff)
in the old design all lists needed to be the same size, fdo75200
We did not crash in the invalid memory access because the lists were continuous in memory and we would just pick the next id. However it crashed when trying to map some of the ids to non existant strings. This commit also removes the need for the earlier fix for this bug that just hit the problem behind some checks much later in the call chain. Change-Id: Ic6658987815c4e84ed2449934c310e30dcd0ed4c
Diffstat (limited to 'include/oox/drawingml/shapepropertymap.hxx')
-rw-r--r--include/oox/drawingml/shapepropertymap.hxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/oox/drawingml/shapepropertymap.hxx b/include/oox/drawingml/shapepropertymap.hxx
index c2c6896b9f61..29b0ba2979bf 100644
--- a/include/oox/drawingml/shapepropertymap.hxx
+++ b/include/oox/drawingml/shapepropertymap.hxx
@@ -23,6 +23,8 @@
#include <oox/helper/propertymap.hxx>
#include <oox/dllapi.h>
+#include <vector>
+
namespace oox { class ModelObjectHelper; }
namespace oox {
@@ -70,7 +72,7 @@ enum ShapePropertyId
struct OOX_DLLPUBLIC ShapePropertyInfo
{
- const sal_Int32* mpnPropertyIds; /// Pointer to array of property identifiers for all SHAPEPROP properties.
+ std::vector<sal_Int32> maPropertyIds;
bool mbNamedLineMarker; /// True = use named line marker instead of explicit line marker.
bool mbNamedLineDash; /// True = use named line dash instead of explicit line dash.
bool mbNamedFillGradient; /// True = use named fill gradient instead of explicit fill gradient.
@@ -85,8 +87,8 @@ struct OOX_DLLPUBLIC ShapePropertyInfo
bool bNamedFillGradient,
bool bNamedFillBitmapUrl );
- bool has( ShapePropertyId ePropId ) const { return mpnPropertyIds[ ePropId ] >= 0; }
- sal_Int32 operator[]( ShapePropertyId ePropId ) const { return mpnPropertyIds[ ePropId ]; }
+ bool has( ShapePropertyId ePropId ) const { return maPropertyIds.size() > size_t(ePropId) && maPropertyIds[ ePropId ] >= 0; }
+ sal_Int32 operator[]( ShapePropertyId ePropId ) const { return maPropertyIds[ ePropId ]; }
};