summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-19 15:58:58 +0200
committerNoel Grandin <noel@peralex.com>2013-11-20 10:07:31 +0200
commit3af99e4d59d89c343965a928681a30f36b1007d2 (patch)
tree2389765131bdb92817e98bc922ffecbf0184d69b /svx
parentd665e058246631c8a838c3a731bdd0c56be27903 (diff)
convert equalsAsciiL calls to startsWith calls
Convert code like: aStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ActiveConnection" ) ) to aStr.startsWith( "ActiveConnection" ) which compiles down to the same machine code. Change-Id: Id4b0c5e0f9afe716a468d3afc70374699848dc33
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/fmdpage.cxx4
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/gallery2/galbrws2.cxx4
-rw-r--r--svx/source/items/galleryitem.cxx10
-rw-r--r--svx/source/sidebar/nbdtmg.cxx12
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx16
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx10
-rw-r--r--svx/source/unodraw/unopage.cxx4
-rw-r--r--svx/source/unodraw/unoshap2.cxx2
9 files changed, 32 insertions, 32 deletions
diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx
index 76d1c97f930f..db03d581c88f 100644
--- a/svx/source/form/fmdpage.cxx
+++ b/svx/source/form/fmdpage.cxx
@@ -85,8 +85,8 @@ SdrObject *SvxFmDrawPage::_CreateSdrObject( const ::com::sun::star::uno::Referen
{
OUString aShapeType( xDescr->getShapeType() );
- if ( aShapeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.ShapeControl" ) ) // compatibility
- || aShapeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.ControlShape" ) )
+ if ( aShapeType.startsWith( "com.sun.star.drawing.ShapeControl" ) // compatibility
+ || aShapeType.startsWith( "com.sun.star.drawing.ControlShape" )
)
return new FmFormObj();
else
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index ed1516077759..972822aef10c 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -4115,7 +4115,7 @@ FormController::interceptedQueryDispatch( const URL& aURL,
Reference< XDispatch > xReturn;
// dispatches handled by ourself
if ( ( aURL.Complete == FMURL_CONFIRM_DELETION )
- || ( ( aURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "private:/InteractionHandler" ) ) )
+ || ( ( aURL.Complete.startsWith( "private:/InteractionHandler" ) )
&& ensureInteractionHandler()
)
)
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index a8dafac8533d..2767816cfd42 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -178,14 +178,14 @@ void SAL_CALL GalleryThemePopup::statusChanged(
throw ( css::uno::RuntimeException )
{
const OUString &rURL = rEvent.FeatureURL.Complete;
- if ( rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_SID_GALLERY_ENABLE_ADDCOPY ) ) )
+ if ( rURL.startsWith( CMD_SID_GALLERY_ENABLE_ADDCOPY ) )
{
if ( !rEvent.IsEnabled )
{
maPopupMenu.EnableItem( MN_ADD, sal_False );
}
}
- else if ( rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_SID_GALLERY_BG_BRUSH ) ) )
+ else if ( rURL.startsWith( CMD_SID_GALLERY_BG_BRUSH ) )
{
maBackgroundPopup.Clear();
if ( rEvent.IsEnabled )
diff --git a/svx/source/items/galleryitem.cxx b/svx/source/items/galleryitem.cxx
index 1a88cf5de476..c07ed06c17dc 100644
--- a/svx/source/items/galleryitem.cxx
+++ b/svx/source/items/galleryitem.cxx
@@ -87,27 +87,27 @@ bool SvxGalleryItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /* nMemberId
const css::beans::PropertyValue *pEnd = pProp + aSeq.getLength();
for ( ; pProp != pEnd; pProp++ )
{
- if ( pProp->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SVXGALLERYITEM_TYPE ) ) )
+ if ( pProp->Name.startsWith( SVXGALLERYITEM_TYPE ) )
{
bAllConverted &= bIsSetType = ( pProp->Value >>= nType );
++nConverted;
}
- else if ( pProp->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SVXGALLERYITEM_URL ) ) )
+ else if ( pProp->Name.startsWith( SVXGALLERYITEM_URL ) )
{
bAllConverted &= ( pProp->Value >>= aURL );
++nConverted;
}
- else if ( pProp->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SVXGALLERYITEM_FILTER ) ) )
+ else if ( pProp->Name.startsWith( SVXGALLERYITEM_FILTER ) )
{
bAllConverted &= ( pProp->Value >>= aFilterName );
++nConverted;
}
- else if ( pProp->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SVXGALLERYITEM_DRAWING ) ) )
+ else if ( pProp->Name.startsWith( SVXGALLERYITEM_DRAWING ) )
{
bAllConverted &= ( pProp->Value >>= xDrawing );
++nConverted;
}
- else if ( pProp->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SVXGALLERYITEM_GRAPHIC ) ) )
+ else if ( pProp->Name.startsWith( SVXGALLERYITEM_GRAPHIC ) )
{
bAllConverted &= ( pProp->Value >>= xGraphic );
++nConverted;
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index dbda6ecaf055..4a14f4663fdc 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -114,17 +114,17 @@ NumSettings_ImplPtr lcl_CreateNumberingSettingsPtr(const Sequence<PropertyValue>
NumSettings_ImplPtr pNew = new NumSettings_Impl;
for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++)
{
- if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sNumberingType)))
+ if(pValues[j].Name.startsWith(sNumberingType))
pValues[j].Value >>= pNew->nNumberType;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sPrefix)))
+ else if(pValues[j].Name.startsWith(sPrefix))
pValues[j].Value >>= pNew->sPrefix;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuffix)))
+ else if(pValues[j].Name.startsWith(sSuffix))
pValues[j].Value >>= pNew->sSuffix;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sParentNumbering)))
+ else if(pValues[j].Name.startsWith(sParentNumbering))
pValues[j].Value >>= pNew->nParentNumbering;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sBulletChar)))
+ else if(pValues[j].Name.startsWith(sBulletChar))
pValues[j].Value >>= pNew->sBulletChar;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sBulletFontName)))
+ else if(pValues[j].Name.startsWith(sBulletFontName))
pValues[j].Value >>= pNew->sBulletFont;
}
const sal_Unicode cLocalPrefix = pNew->sPrefix.getLength() ? pNew->sPrefix[0] : 0;
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 4eea7bddce37..59b7a31eb6f7 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -128,7 +128,7 @@ ImplGrafMetricField::ImplGrafMetricField( Window* pParent, const OUString& rCmd,
}
else
{
- const long nMinVal = ( maCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GrafTransparence" ) )) ? 0 : -100;
+ const long nMinVal = maCommand.startsWith( ".uno:GrafTransparence" ) ? 0 : -100;
SetUnit( FUNIT_CUSTOM );
SetCustomUnitText( OUString(" %") );
@@ -160,14 +160,14 @@ IMPL_LINK_NOARG(ImplGrafMetricField, ImplModifyHdl)
// Convert value to an any to be usable with dispatch API
Any a;
- if ( maCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GrafRed" ) ) ||
- maCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GrafGreen" ) ) ||
- maCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GrafBlue" ) ) ||
- maCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GrafLuminance" ) ) ||
- maCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GrafContrast" ) ))
+ if ( maCommand.startsWith( ".uno:GrafRed" ) ||
+ maCommand.startsWith( ".uno:GrafGreen" ) ||
+ maCommand.startsWith( ".uno:GrafBlue" ) ||
+ maCommand.startsWith( ".uno:GrafLuminance" ) ||
+ maCommand.startsWith( ".uno:GrafContrast" ))
a = makeAny( sal_Int16( nVal ));
- else if ( maCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GrafGamma" ) ) ||
- maCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GrafTransparence" ) ))
+ else if ( maCommand.startsWith( ".uno:GrafGamma" ) ||
+ maCommand.startsWith( ".uno:GrafTransparence" ))
a = makeAny( sal_Int32( nVal ));
if ( a.hasValue() )
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 71d013cfb035..0c83a677b248 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -521,15 +521,15 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto
{
pValues->Value >>= rSettings.mxInteractionHandler;
}
- else if( pValues->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Width" ) ) ) // for compatibility reasons, deprecated
+ else if( pValues->Name.startsWith( "Width" ) ) // for compatibility reasons, deprecated
{
pValues->Value >>= rSettings.mnWidth;
}
- else if( pValues->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Height" ) ) ) // for compatibility reasons, deprecated
+ else if( pValues->Name.startsWith( "Height" ) ) // for compatibility reasons, deprecated
{
pValues->Value >>= rSettings.mnHeight;
}
- else if( pValues->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExportOnlyBackground" ) ) ) // for compatibility reasons, deprecated
+ else if( pValues->Name.startsWith( "ExportOnlyBackground" ) ) // for compatibility reasons, deprecated
{
pValues->Value >>= rSettings.mbExportOnlyBackground;
}
@@ -558,12 +558,12 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto
{
pDataValues->Value >>= rSettings.mnHeight;
}
- else if( pDataValues->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Width" ) ) ) // for compatibility reasons, deprecated
+ else if( pDataValues->Name.startsWith( "Width" ) ) // for compatibility reasons, deprecated
{
pDataValues->Value >>= rSettings.mnWidth;
pDataValues->Name = "PixelWidth";
}
- else if( pDataValues->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Height" ) ) ) // for compatibility reasons, deprecated
+ else if( pDataValues->Name.startsWith( "Height" ) ) // for compatibility reasons, deprecated
{
pDataValues->Value >>= rSettings.mnHeight;
pDataValues->Name = "PixelHeight";
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index acf0ce864dd7..4af2f5253b1f 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -532,8 +532,8 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor,
if( nTempType == UHASHMAP_NOTFOUND )
{
- if( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TableShape")) ||
- aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.TableShape")) )
+ if( aName.startsWith("com.sun.star.drawing.TableShape") ||
+ aName.startsWith("com.sun.star.presentation.TableShape") )
{
rInventor = SdrInventor;
rType = OBJ_TABLE;
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index cc6ee03089b7..3d8370fabb0e 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1901,7 +1901,7 @@ void SAL_CALL SvxCustomShape::setPropertyValue( const OUString& aPropertyName, c
::SolarMutexGuard aGuard;
SdrObject* pObject = mpObj.get();
- bool bCustomShapeGeometry = pObject && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CustomShapeGeometry" ) );
+ bool bCustomShapeGeometry = pObject && aPropertyName.startsWith( "CustomShapeGeometry" );
sal_Bool bMirroredX = sal_False;
sal_Bool bMirroredY = sal_False;