summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-02-18 13:32:43 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-02-24 13:24:53 +0100
commitad7fdc4e0f8b0777513c10d44026544093b85df4 (patch)
treec0833de75cb798768e67f9dca8e1da017a474cc7 /filter
parentc69ae9f8f80988afd31ec5a936984e131e18db7f (diff)
filter: Code reduction, prevents crash.
Not all shape types have the full com.sun.star. prefix, for example FrameShape. The existing code would crash in that case, but the new code doesn't. Change-Id: I9aa3d0f20f48ab91a6770e8409a8da2028816504
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/eschesdo.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index a7d7e417c5a2..6b742ba34d25 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -1186,14 +1186,10 @@ void ImplEESdrObject::Init( ImplEESdrWriter& rEx )
mXPropSet = Reference< XPropertySet >::query( mXShape );
if( mXPropSet.is() )
{
- static const sal_Char aPrefix[] = "com.sun.star.";
- static const sal_Int32 nPrefix = sizeof(aPrefix)-1;
-
// detect name first to make below test (is group) work
mType = OUString( mXShape->getShapeType() );
- mType = mType.copy( nPrefix ); // strip "com.sun.star."
- sal_Int32 nPos = mType.indexOf( "Shape" );
- mType = mType.replaceAt( nPos, 5, "" );
+ mType.startsWith( "com.sun.star.", &mType ); // strip "com.sun.star."
+ mType.endsWith( "Shape", &mType ); // strip "Shape"
if(GetType() == "drawing.Group")
{