summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-07 11:44:23 +0100
committerMichael Stahl <mstahl@redhat.com>2014-07-08 12:16:33 +0000
commitf03ae69617b37e7e55511d8eb4979390a0469968 (patch)
tree94f9d1f3da20d5c93da7ed3af3e1322c81be172a
parent6f063c3b0d58f27187948e013fbd759767324f5c (diff)
fix crash loading ooo100546-1.xls
regressions around inserted extra enum values into ShapePropertyId (cherry picked from commit aacfd5038d05a02f8b1eade3a5896d3d7e959f3d) Conflicts: oox/source/drawingml/chart/objectformatter.cxx Change-Id: I06696c8cfe4acc3836723c31d5e714bd7d8439b3 Reviewed-on: https://gerrit.libreoffice.org/10108 Reviewed-by: Matúš Kukan <matus.kukan@collabora.com> Tested-by: Matúš Kukan <matus.kukan@collabora.com> (cherry picked from commit 9afdc6c3b4eb077b3e4279c5eec1e3dd9a4a8512) Reviewed-on: https://gerrit.libreoffice.org/10111 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--include/oox/drawingml/shapepropertymap.hxx8
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx5
2 files changed, 7 insertions, 6 deletions
diff --git a/include/oox/drawingml/shapepropertymap.hxx b/include/oox/drawingml/shapepropertymap.hxx
index f451cc0507e1..13e8e507a7a9 100644
--- a/include/oox/drawingml/shapepropertymap.hxx
+++ b/include/oox/drawingml/shapepropertymap.hxx
@@ -30,12 +30,14 @@ namespace oox { class ModelObjectHelper; }
namespace oox {
namespace drawingml {
-
-
/** Enumeration for various properties related to drawing shape formatting.
This is an abstraction for shape formatting properties that have different
names in various implementations, e.g. drawing shapes vs. chart objects.
+
+ If you *insert* ids into this list, then update spnCommonPropIds, spnLinearPropIds
+ and spnFilledPropIds of oox/source/drawingml/chart/objectformatter.cxx if
+ the newly inserted enum is inside the range they cover
*/
enum ShapePropertyId
{
@@ -69,8 +71,6 @@ enum ShapePropertyId
SHAPEPROP_END
};
-
-
struct OOX_DLLPUBLIC ShapePropertyInfo
{
std::vector<sal_Int32> maPropertyIds;
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index adcc3f3eb648..54ef18a7f0cd 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -460,7 +460,7 @@ const AutoTextEntry* lclGetAutoTextEntry( const AutoTextEntry* pEntries, sal_Int
return 0;
}
-
+// These PropIds arrays will be indexed into using a ShapePropertyId enum (include/oox/drawingml/shapepropertymap.hxx)
/** Property identifiers for common chart objects, to be used in ShapePropertyInfo. */
static const sal_Int32 spnCommonPropIds[] =
@@ -478,7 +478,7 @@ static const sal_Int32 spnLinearPropIds[] =
{
PROP_LineStyle, PROP_LineWidth, PROP_Color, PROP_Transparency, PROP_LineDashName,
PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID,
- PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID,
+ PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID,
PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID,
PROP_INVALID, PROP_INVALID, PROP_INVALID,
PROP_END_LIST
@@ -502,6 +502,7 @@ static const sal_Int32 spnFilledPropIds[] =
PROP_FillStyle,
PROP_Color,
PROP_Transparency,
+ PROP_INVALID,
PROP_GradientName,
PROP_FillBitmapName,
PROP_FillBitmapMode,