diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-04-22 15:06:58 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-04-22 15:09:48 +0200 |
commit | ab9813eaea32b3456a37a283b74ee7be39c69a0c (patch) | |
tree | c797b149d1e8c893791458be0fe81f2458b78713 | |
parent | 55c832d86e6cb06e9d6423ce5e6245189bc80da1 (diff) |
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
-rw-r--r-- | filter/source/msfilter/util.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 807061f69233..3eb230930291 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -1302,8 +1302,6 @@ static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = N const char* GetOOXMLPresetGeometry( const char* sShapeType ) { - const char* sPresetGeo; - if( pCustomShapeTypeTranslationHashMap == NULL ) { pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap (); @@ -1312,13 +1310,9 @@ const char* GetOOXMLPresetGeometry( const char* sShapeType ) (*pCustomShapeTypeTranslationHashMap)[ pCustomShapeTypeTranslationTable[ i ].sOOo ] = pCustomShapeTypeTranslationTable[ i ].sMSO; } } - - sPresetGeo = (*pCustomShapeTypeTranslationHashMap)[ sShapeType ]; - - if( sPresetGeo == NULL ) - sPresetGeo = "rect"; - - return sPresetGeo; + CustomShapeTypeTranslationHashMap::iterator i( + pCustomShapeTypeTranslationHashMap->find(sShapeType)); + return i == pCustomShapeTypeTranslationHashMap->end() ? "rect" : i->second; } typedef boost::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> DMLToVMLTranslationHashMap; |