diff options
author | Muthu Subramanian <sumuthu@suse.com> | 2012-04-26 19:19:03 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2012-04-26 19:21:09 +0530 |
commit | eb5f2df4d6f6c215429130b4c27d076f6777e5da (patch) | |
tree | 9f2d6b8bf4553d8603ddba12b987f8a535db1cd9 /oox/inc | |
parent | a3b8ddf3b7519b9112fdc7ba05b44209113be47b (diff) |
n758565: Wrong master slide shape being used.
* Changed <ph> idx to OptValue.
* Duplicate code removal.
Diffstat (limited to 'oox/inc')
-rw-r--r-- | oox/inc/oox/drawingml/shape.hxx | 6 | ||||
-rw-r--r-- | oox/inc/oox/helper/helper.hxx | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx index b360098c6d6f..6989edeb95be 100644 --- a/oox/inc/oox/drawingml/shape.hxx +++ b/oox/inc/oox/drawingml/shape.hxx @@ -130,8 +130,8 @@ public: void setHiddenMasterShape( sal_Bool bHiddenMasterShape ) { mbHiddenMasterShape = bHiddenMasterShape; } void setSubType( sal_Int32 nSubType ) { mnSubType = nSubType; } sal_Int32 getSubType() const { return mnSubType; } - void setSubTypeIndex( sal_uInt32 nSubTypeIndex ) { mnSubTypeIndex = nSubTypeIndex; } - sal_Int32 getSubTypeIndex() const { return mnSubTypeIndex; } + void setSubTypeIndex( sal_Int32 nSubTypeIndex ) { moSubTypeIndex = nSubTypeIndex; } + const OptValue< sal_Int32 >& getSubTypeIndex() const { return moSubTypeIndex; } // setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value) void setDefaults(); @@ -232,7 +232,7 @@ protected: rtl::OUString msName; rtl::OUString msId; sal_Int32 mnSubType; // if this type is not zero, then the shape is a placeholder - sal_Int32 mnSubTypeIndex; + OptValue< sal_Int32 > moSubTypeIndex; ShapeStyleRefMap maShapeStyleRefs; diff --git a/oox/inc/oox/helper/helper.hxx b/oox/inc/oox/helper/helper.hxx index 9af1008531fc..2ef7ce6c746d 100644 --- a/oox/inc/oox/helper/helper.hxx +++ b/oox/inc/oox/helper/helper.hxx @@ -219,6 +219,10 @@ public: inline Type& use() { mbHasValue = true; return maValue; } inline OptValue& operator=( const Type& rValue ) { set( rValue ); return *this; } + inline bool operator==( const OptValue& rValue ) const { + return ( ( mbHasValue == false && rValue.mbHasValue == false ) || + ( mbHasValue == rValue.mbHasValue && maValue == rValue.maValue ) ); + } inline void assignIfUsed( const OptValue& rValue ) { if( rValue.mbHasValue ) set( rValue.maValue ); } private: |