Kaydet (Commit) ab9813ea authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Don't litter pCustomShapeTypeTranslationHashMap with dangling keys

...that are char* into temporary OString at the GetOOXMLPresetGeometry call site
in oox/source/export/shapes.cxx.

Change-Id: Ifd6533f9bd869b740a6b483f4a1f6e4860007b9c
üst 55c832d8
...@@ -1302,8 +1302,6 @@ static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = N ...@@ -1302,8 +1302,6 @@ static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = N
const char* GetOOXMLPresetGeometry( const char* sShapeType ) const char* GetOOXMLPresetGeometry( const char* sShapeType )
{ {
const char* sPresetGeo;
if( pCustomShapeTypeTranslationHashMap == NULL ) if( pCustomShapeTypeTranslationHashMap == NULL )
{ {
pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap (); pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap ();
...@@ -1312,13 +1310,9 @@ const char* GetOOXMLPresetGeometry( const char* sShapeType ) ...@@ -1312,13 +1310,9 @@ const char* GetOOXMLPresetGeometry( const char* sShapeType )
(*pCustomShapeTypeTranslationHashMap)[ pCustomShapeTypeTranslationTable[ i ].sOOo ] = pCustomShapeTypeTranslationTable[ i ].sMSO; (*pCustomShapeTypeTranslationHashMap)[ pCustomShapeTypeTranslationTable[ i ].sOOo ] = pCustomShapeTypeTranslationTable[ i ].sMSO;
} }
} }
CustomShapeTypeTranslationHashMap::iterator i(
sPresetGeo = (*pCustomShapeTypeTranslationHashMap)[ sShapeType ]; pCustomShapeTypeTranslationHashMap->find(sShapeType));
return i == pCustomShapeTypeTranslationHashMap->end() ? "rect" : i->second;
if( sPresetGeo == NULL )
sPresetGeo = "rect";
return sPresetGeo;
} }
typedef boost::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> DMLToVMLTranslationHashMap; typedef boost::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> DMLToVMLTranslationHashMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment