summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-03-20 13:02:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-03-20 13:05:35 +0100
commit2d9ce9191da681e4fd9f1d08933ca5117c56601b (patch)
treeeecfa2690dcaffca064cc5712d7a5c9662a32b87 /svx/source
parentdc06576d8809760b79f771831bed3122878e0505 (diff)
Remove uses of rtl::OUString::compareToAscii(asciiStr, maxLength)
...which is a confusing overload with unexpectedly different semantics from the one-parameter form. In preparation of marking it as deprecated. Change-Id: I4f176995546ae583fc570d770647ffc315eecc75
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/unodraw/unoshap2.cxx6
-rw-r--r--svx/source/xml/xmleohlp.cxx7
2 files changed, 5 insertions, 8 deletions
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 6a5b80064766..f974e51247a7 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1505,7 +1505,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
OUString aURL;
if( rValue >>= aURL )
{
- if( aURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) == 0 )
+ if( aURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
{
// graphic manager url
aURL = aURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 );
@@ -1522,7 +1522,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
static_cast<SdrGrafObj*>(mpObj.get())->SetGraphicObject( aGrafObj );
}
}
- else if( aURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPKGPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) ) != 0 )
+ else if( !aURL.startsWith( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) )
{
// normal link
String aFilterName;
@@ -1570,7 +1570,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
if( rValue >>= aStreamURL )
{
- if( aStreamURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPKGPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) ) != 0 )
+ if( !aStreamURL.startsWith( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) )
aStreamURL = OUString();
if( mpObj.is() )
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx
index b351b6595893..64482f87a354 100644
--- a/svx/source/xml/xmleohlp.cxx
+++ b/svx/source/xml/xmleohlp.cxx
@@ -282,12 +282,9 @@ sal_Bool SvXMLEmbeddedObjectHelper::ImplGetStorageNames(
nPos = aURLNoPar.indexOf( ':' );
if( -1 == nPos )
return sal_False;
- sal_Bool bObjUrl =
- 0 == aURLNoPar.compareToAscii( XML_EMBEDDEDOBJECT_URL_BASE,
- sizeof( XML_EMBEDDEDOBJECT_URL_BASE ) -1 );
+ sal_Bool bObjUrl = aURLNoPar.startsWith( XML_EMBEDDEDOBJECT_URL_BASE );
sal_Bool bGrUrl = !bObjUrl &&
- 0 == aURLNoPar.compareToAscii( XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE,
- sizeof( XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE ) -1 );
+ aURLNoPar.startsWith( XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE );
if( !(bObjUrl || bGrUrl) )
return sal_False;