summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2011-12-12 15:00:25 +0100
committerRadek Doulik <rodo@novell.com>2011-12-12 15:05:57 +0100
commitcc65d9fe56dbbf77ed48d5dacd9d1a11a450e5a6 (patch)
tree24d91998c97aa57c2e855d0d2db49cd1102fbadd /oox
parentf2f31cbd245b19b18d044cec6f6df5d4d7a71348 (diff)
pptx: fix custom shape equations import
- guide names can be reused and in that case current one used in following equations is the last one
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 77eb2967f169..c433d7630774 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -84,14 +84,16 @@ sal_Int32 CustomShapeProperties::SetCustomShapeGuideValue( std::vector< CustomSh
// if the return value is < 0 then the guide value could not be found
sal_Int32 CustomShapeProperties::GetCustomShapeGuideValue( const std::vector< CustomShapeGuide >& rGuideList, const rtl::OUString& rFormulaName )
{
- sal_Int32 nIndex = 0;
- for( ; nIndex < static_cast< sal_Int32 >( rGuideList.size() ); nIndex++ )
+ // traverse the list from the end, because guide names can be reused
+ // and current is the last one
+ // see a1 guide in gear6 custom shape preset as example
+ sal_Int32 nIndex = static_cast< sal_Int32 >( rGuideList.size() ) - 1;
+ for( ; nIndex >= 0; nIndex-- )
{
if ( rGuideList[ nIndex ].maName == rFormulaName )
break;
}
- if ( nIndex == static_cast< sal_Int32 >( rGuideList.size() ) )
- nIndex = -1;
+
return nIndex;
}