[Libreoffice-commits] core.git: 6 commits - connectivity/source cppuhelper/source editeng/source extensions/source filter/source forms/source framework/source sal/inc sal/qa sd/source sfx2/source stoc/source svtools/source svx/source sw/source toolkit/source ucb/source xmlhelp/source xmlscript/source
Stephan Bergmann
sbergman at redhat.com
Wed Mar 20 05:06:00 PDT 2013
connectivity/source/commontools/dbmetadata.cxx | 4 +-
connectivity/source/drivers/postgresql/pq_databasemetadata.cxx | 8 ++--
cppuhelper/source/shlib.cxx | 2 -
editeng/source/items/frmitems.cxx | 6 +--
extensions/source/propctrlr/formcomponenthandler.cxx | 2 -
filter/source/xsltdialog/typedetectionexport.cxx | 8 ++--
filter/source/xsltdialog/xmlfilterdialogcomponent.cxx | 2 -
filter/source/xsltdialog/xmlfilterjar.cxx | 8 ++--
filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 2 -
filter/source/xsltdialog/xmlfiltertestdialog.cxx | 3 -
forms/source/component/Button.cxx | 5 +-
forms/source/inc/frm_strings.hxx | 2 -
framework/source/dispatch/mailtodispatcher.cxx | 5 --
framework/source/dispatch/popupmenudispatcher.cxx | 5 --
framework/source/dispatch/servicehandler.cxx | 2 -
framework/source/dispatch/systemexec.cxx | 2 -
framework/source/fwe/classes/addonsoptions.cxx | 2 -
framework/source/uielement/imagebuttontoolbarcontroller.cxx | 2 -
framework/source/uielement/toolbarmanager.cxx | 2 -
sal/inc/rtl/ustring.hxx | 7 +++
sal/qa/rtl/strings/test_oustring_compare.cxx | 13 ------
sd/source/core/CustomAnimationPreset.cxx | 2 -
sd/source/core/TransitionPreset.cxx | 2 -
sd/source/filter/ppt/pptinanimations.cxx | 2 -
sd/source/ui/unoidl/unopage.cxx | 4 +-
sfx2/source/dialog/taskpane.cxx | 4 +-
sfx2/source/view/frmload.cxx | 2 -
stoc/source/security/permissions.cxx | 2 -
svtools/source/graphic/grfmgr.cxx | 2 -
svtools/source/graphic/provider.cxx | 2 -
svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx | 2 -
svx/source/unodraw/unoshap2.cxx | 6 +--
svx/source/xml/xmleohlp.cxx | 7 +--
sw/source/core/unocore/unoport.cxx | 4 +-
sw/source/ui/uno/unodispatch.cxx | 3 -
toolkit/source/controls/dialogcontrol.cxx | 4 +-
toolkit/source/controls/unocontrols.cxx | 2 -
ucb/source/ucp/expand/ucpexpand.cxx | 3 -
ucb/source/ucp/hierarchy/hierarchycontent.cxx | 5 --
ucb/source/ucp/webdav-neon/DAVProperties.cxx | 20 +++-------
xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 2 -
xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 2 -
42 files changed, 71 insertions(+), 103 deletions(-)
New commits:
commit 77c87c18697e19cb4606717af0e4b0e5ab2139bc
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 20 13:04:28 2013 +0100
Deprecate confusing rtl::OUString::compareToAscii(asciiStr, maxLength)
Change-Id: I3a41036ec03cdaefea94b19dbedf59e5a5e37dc8
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index ae0af9e..4d9650e 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -732,12 +732,19 @@ public:
127. The ASCII string must be NULL-terminated.
This function can't be used for language specific sorting.
+ @deprecated This is a confusing overload with unexpectedly different
+ semantics from the one-parameter form, so it is marked as deprecated.
+ Practically all uses compare the return value against zero and can thus
+ be replaced with uses of startsWith.
+
@param asciiStr the 8-Bit ASCII character string to be compared.
@param maxLength the maximum count of characters to be compared.
@return 0 - if both strings are equal
< 0 - if this string is less than the string argument
> 0 - if this string is greater than the string argument
*/
+ SAL_DEPRECATED(
+ "replace s1.compareToAscii(s2, strlen(s2)) == 0 with s1.startsWith(s2)")
sal_Int32 compareToAscii( const sal_Char * asciiStr, sal_Int32 maxLength ) const SAL_THROW(())
{
return rtl_ustr_ascii_shortenedCompare_WithLength( pData->buffer, pData->length,
diff --git a/sal/qa/rtl/strings/test_oustring_compare.cxx b/sal/qa/rtl/strings/test_oustring_compare.cxx
index e3ad8dd..7f56546 100644
--- a/sal/qa/rtl/strings/test_oustring_compare.cxx
+++ b/sal/qa/rtl/strings/test_oustring_compare.cxx
@@ -30,13 +30,10 @@ class Compare: public CppUnit::TestFixture
private:
void equalsIgnoreAsciiCaseAscii();
- void compareToAscii();
-
void compareToIgnoreAsciiCase();
CPPUNIT_TEST_SUITE(Compare);
CPPUNIT_TEST(equalsIgnoreAsciiCaseAscii);
-CPPUNIT_TEST(compareToAscii);
CPPUNIT_TEST(compareToIgnoreAsciiCase);
CPPUNIT_TEST_SUITE_END();
};
@@ -63,16 +60,6 @@ void test::oustring::Compare::equalsIgnoreAsciiCaseAscii()
equalsIgnoreAsciiCaseAscii("abcd"));
}
-void test::oustring::Compare::compareToAscii()
-{
- // The different overloads of compareToAscii exhibit potentially confusing
- // behavior:
- rtl::OUString abc("abc");
- CPPUNIT_ASSERT(abc.compareToAscii("a") > 0);
- CPPUNIT_ASSERT_EQUAL(
- sal_Int32(0), abc.compareToAscii(RTL_CONSTASCII_STRINGPARAM("a")));
-}
-
void test::oustring::Compare::compareToIgnoreAsciiCase()
{
CPPUNIT_ASSERT_EQUAL(
commit 2d9ce9191da681e4fd9f1d08933ca5117c56601b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 20 13:02:46 2013 +0100
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
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
index 70dd057..6ec14fb 100644
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ b/connectivity/source/commontools/dbmetadata.cxx
@@ -406,7 +406,7 @@ namespace dbtools
{
Reference< XDatabaseMetaData > xMeta( m_pImpl->xConnectionMetaData, UNO_SET_THROW );
::rtl::OUString sConnectionURL( xMeta->getURL() );
- doDisplay = sConnectionURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc" ) ) == 0;
+ doDisplay = sConnectionURL.startsWith( "sdbc:mysql:mysqlc" );
}
catch( const Exception& )
{
@@ -423,7 +423,7 @@ namespace dbtools
{
Reference< XDatabaseMetaData > xMeta( m_pImpl->xConnectionMetaData, UNO_SET_THROW );
::rtl::OUString sConnectionURL( xMeta->getURL() );
- bSupported = sConnectionURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc" ) ) != 0;
+ bSupported = !sConnectionURL.startsWith( "sdbc:mysql:mysqlc" );
}
catch( const Exception& )
{
diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
index df01210..a7b63df 100644
--- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
@@ -1263,11 +1263,11 @@ struct SortInternalSchemasLastAndPublicFirst
a[0] >>= valueA;
b[0] >>= valueB;
bool ret = false;
- if( valueA.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "public" ) ) == 0 )
+ if( valueA.startsWith( "public" ) )
{
ret = true;
}
- else if( valueB.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "public" ) ) == 0 )
+ else if( valueB.startsWith( "public" ) )
{
ret = false;
}
@@ -2202,9 +2202,9 @@ struct TypeInfoByDataTypeSorter
OUString nameB;
a[0 /*TYPE_NAME*/] >>= nameA;
b[0 /*TYPE_NAME*/] >>= nameB;
- if( nameA.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "int4" ) ) == 0 )
+ if( nameA.startsWith( "int4" ) )
return 1;
- if( nameB.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "int4" ) ) == 0 )
+ if( nameB.startsWith( "int4" ) )
return 0;
return nameA.compareTo( nameB ) < 0;
}
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index 180a054..6678e25 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -136,7 +136,7 @@ static bool checkAccessPath( OUString * pComp ) throw ()
if (pPath)
{
- sal_Bool bAbsolute = (pComp->compareToAscii( "file://" , 7 ) == 0);
+ sal_Bool bAbsolute = pComp->startsWith( "file://" );
for ( ::std::vector< OUString >::const_iterator iPos( pPath->begin() );
iPos != pPath->end(); ++iPos )
{
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 1a23a68..869f3a1 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3703,13 +3703,11 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
OUString sLink;
rVal >>= sLink;
- if( 0 == sLink.compareToAscii( UNO_NAME_GRAPHOBJ_URLPKGPREFIX,
- sizeof(UNO_NAME_GRAPHOBJ_URLPKGPREFIX)-1 ) )
+ if( sLink.startsWith( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) )
{
OSL_FAIL( "package urls aren't implemented" );
}
- else if( 0 == sLink.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX,
- sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX)-1 ) )
+ else if( sLink.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
{
DELETEZ( pStrLink );
String sTmp( sLink );
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index eff0c8e..008b4b59 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2792,7 +2792,7 @@ namespace pcr
OUString sCurValue;
OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_IMAGE_URL ) >>= sCurValue );
- if ( !sCurValue.isEmpty() && sCurValue.compareToAscii(GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH(GRAPHOBJ_URLPREFIX) ) != 0 )
+ if ( !sCurValue.isEmpty() && !sCurValue.startsWith(GRAPHOBJ_URLPREFIX) )
{
aFileDlg.SetDisplayDirectory( sCurValue );
// TODO: need to set the display directory _and_ the default name
diff --git a/filter/source/xsltdialog/typedetectionexport.cxx b/filter/source/xsltdialog/typedetectionexport.cxx
index 9fa3b3d..4a66506 100644
--- a/filter/source/xsltdialog/typedetectionexport.cxx
+++ b/filter/source/xsltdialog/typedetectionexport.cxx
@@ -45,10 +45,10 @@ TypeDetectionExporter::TypeDetectionExporter( Reference< XComponentContext >& xC
static OUString createRelativeURL( const OUString& rFilterName, const OUString& rURL )
{
if( !rURL.isEmpty() &&
- (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("http:") ) != 0) &&
- (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("https:") ) != 0) &&
- (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("jar:") ) != 0) &&
- (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("ftp:") ) != 0))
+ !rURL.startsWith("http:") &&
+ !rURL.startsWith("https:") &&
+ !rURL.startsWith("jar:") &&
+ !rURL.startsWith("ftp:") )
{
INetURLObject aURL( rURL );
OUString aName( aURL.GetName() );
diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx
index f99bd73..66f7198 100644
--- a/filter/source/xsltdialog/xmlfilterjar.cxx
+++ b/filter/source/xsltdialog/xmlfilterjar.cxx
@@ -128,10 +128,10 @@ static void _addFile( Reference< XInterface >& xRootFolder, Reference< XSingleSe
void XMLFilterJarHelper::addFile( Reference< XInterface > xRootFolder, Reference< XSingleServiceFactory > xFactory, const OUString& rSourceFile ) throw( Exception )
{
if( !rSourceFile.isEmpty() &&
- (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("http:") ) != 0) &&
- (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("https:") ) != 0) &&
- (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("jar:") ) != 0) &&
- (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("ftp:") ) != 0))
+ !rSourceFile.startsWith("http:") &&
+ !rSourceFile.startsWith("https:") &&
+ !rSourceFile.startsWith("jar:") &&
+ !rSourceFile.startsWith("ftp:") )
{
OUString aFileURL( rSourceFile );
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 60e5188..0791c3f 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -1661,7 +1661,7 @@ OUString string_decode( const OUString & rText )
bool isFileURL( const ::rtl::OUString & rURL )
{
- return rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("file:") ) == 0;
+ return rURL.startsWith("file:");
}
// -----------------------------------------------------------------------
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx
index df76b7a..8526cc3 100644
--- a/forms/source/component/Button.cxx
+++ b/forms/source/component/Button.cxx
@@ -654,9 +654,8 @@ namespace
{
bool isFormControllerURL( const ::rtl::OUString& _rURL )
{
- const sal_Int32 nPrefixLen = URL_CONTROLLER_PREFIX.length;
- return ( _rURL.getLength() > nPrefixLen )
- && ( _rURL.compareToAscii( URL_CONTROLLER_PREFIX.ascii, nPrefixLen ) == 0 );
+ return ( _rURL.getLength() > RTL_CONSTASCII_LENGTH( ".uno:FormController/" ) )
+ && ( _rURL.startsWith( ".uno:FormController/" ) );
}
}
diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx
index ad01b92..3e10031 100644
--- a/forms/source/inc/frm_strings.hxx
+++ b/forms/source/inc/frm_strings.hxx
@@ -286,8 +286,6 @@ namespace frm
//--------------------------------------------------------------------------
//- URLs
//--------------------------------------------------------------------------
- FORMS_CONSTASCII_STRING( URL_CONTROLLER_PREFIX, ".uno:FormController/" );
-
FORMS_CONSTASCII_STRING( URL_FORM_POSITION, ".uno:FormController/positionForm" );
FORMS_CONSTASCII_STRING( URL_FORM_RECORDCOUNT, ".uno:FormController/RecordCount" );
FORMS_CONSTASCII_STRING( URL_RECORD_FIRST, ".uno:FormController/moveToFirst" );
diff --git a/framework/source/dispatch/mailtodispatcher.cxx b/framework/source/dispatch/mailtodispatcher.cxx
index 331243b..40f6a91 100644
--- a/framework/source/dispatch/mailtodispatcher.cxx
+++ b/framework/source/dispatch/mailtodispatcher.cxx
@@ -30,9 +30,6 @@
namespace framework{
-#define PROTOCOL_VALUE "mailto:"
-#define PROTOCOL_LENGTH 7
-
//_________________________________________________________________________________________________________________
// XInterface, XTypeProvider, XServiceInfo
@@ -111,7 +108,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL MailToDispatcher::queryDis
sal_Int32 /*nFlags*/ ) throw( css::uno::RuntimeException )
{
css::uno::Reference< css::frame::XDispatch > xDispatcher;
- if (aURL.Complete.compareToAscii(PROTOCOL_VALUE,PROTOCOL_LENGTH)==0)
+ if (aURL.Complete.startsWith("mailto:"))
xDispatcher = this;
return xDispatcher;
}
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index 30b271f..f4d60b3 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -55,9 +55,6 @@ using namespace ::cppu ;
using namespace ::osl ;
using namespace ::rtl ;
-const char* PROTOCOL_VALUE = "vnd.sun.star.popup:";
-const sal_Int32 PROTOCOL_LENGTH = 19;
-
//*****************************************************************************************************************
// constructor
//*****************************************************************************************************************
@@ -216,7 +213,7 @@ throw( css::uno::RuntimeException )
{
css::uno::Reference< css::frame::XDispatch > xDispatch;
- if ( rURL.Complete.compareToAscii( PROTOCOL_VALUE, PROTOCOL_LENGTH ) == 0 )
+ if ( rURL.Complete.startsWith( "vnd.sun.star.popup:" ) )
{
// --- SAFE ---
ResetableGuard aGuard( m_aLock );
diff --git a/framework/source/dispatch/servicehandler.cxx b/framework/source/dispatch/servicehandler.cxx
index ddeac81..ddd6c68 100644
--- a/framework/source/dispatch/servicehandler.cxx
+++ b/framework/source/dispatch/servicehandler.cxx
@@ -110,7 +110,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL ServiceHandler::queryDispa
sal_Int32 /*nFlags*/ ) throw( css::uno::RuntimeException )
{
css::uno::Reference< css::frame::XDispatch > xDispatcher;
- if (aURL.Complete.compareToAscii(PROTOCOL_VALUE,PROTOCOL_LENGTH)==0)
+ if (aURL.Complete.startsWith(PROTOCOL_VALUE))
xDispatcher = this;
return xDispatcher;
}
diff --git a/framework/source/dispatch/systemexec.cxx b/framework/source/dispatch/systemexec.cxx
index 16d1fa8..b06b764 100644
--- a/framework/source/dispatch/systemexec.cxx
+++ b/framework/source/dispatch/systemexec.cxx
@@ -94,7 +94,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL SystemExec::queryDispatch(
sal_Int32 ) throw( css::uno::RuntimeException )
{
css::uno::Reference< css::frame::XDispatch > xDispatcher;
- if (aURL.Complete.compareToAscii(PROTOCOL_VALUE,PROTOCOL_LENGTH)==0)
+ if (aURL.Complete.startsWith(PROTOCOL_VALUE))
xDispatcher = this;
return xDispatcher;
}
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index 47c4efb..6b9aefa 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -1277,7 +1277,7 @@ sal_Bool AddonsOptions_Impl::HasAssociatedImages( const OUString& aURL )
//*****************************************************************************************************************
void AddonsOptions_Impl::SubstituteVariables( OUString& aURL )
{
- if (( aURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( EXPAND_PROTOCOL )) == 0 ) )
+ if ( aURL.startsWith( EXPAND_PROTOCOL ) )
{
// cut protocol
OUString macro( aURL.copy( sizeof ( EXPAND_PROTOCOL ) -1 ) );
diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
index 9390838..e790afd 100644
--- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
@@ -83,7 +83,7 @@ uno::Reference< util::XMacroExpander > GetMacroExpander()
static void SubstituteVariables( OUString& aURL )
{
- if ( aURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( EXPAND_PROTOCOL )) == 0 )
+ if ( aURL.startsWith( EXPAND_PROTOCOL ) )
{
uno::Reference< util::XMacroExpander > xMacroExpander = GetMacroExpander();
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index b47ee8f..661942c 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1256,7 +1256,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
if ( aProp[i].Name == ITEM_DESCRIPTOR_COMMANDURL )
{
aProp[i].Value >>= aCommandURL;
- if ( aCommandURL.compareToAscii(MENUPREFIX, RTL_CONSTASCII_LENGTH(MENUPREFIX) ) == 0 )
+ if ( aCommandURL.startsWith(MENUPREFIX) )
{
try
{
diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx
index 3cc4598..9ac81d6 100644
--- a/sd/source/core/CustomAnimationPreset.cxx
+++ b/sd/source/core/CustomAnimationPreset.cxx
@@ -326,7 +326,7 @@ void CustomAnimationPresets::importEffects()
for( sal_Int32 i=0; i<aFiles.getLength(); ++i )
{
rtl::OUString aURL = aFiles[i];
- if( aURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( EXPAND_PROTOCOL )) == 0 )
+ if( aURL.startsWith( EXPAND_PROTOCOL ) )
{
// cut protocol
rtl::OUString aMacro( aURL.copy( sizeof ( EXPAND_PROTOCOL ) -1 ) );
diff --git a/sd/source/core/TransitionPreset.cxx b/sd/source/core/TransitionPreset.cxx
index 3c9f408..127b302 100644
--- a/sd/source/core/TransitionPreset.cxx
+++ b/sd/source/core/TransitionPreset.cxx
@@ -176,7 +176,7 @@ bool TransitionPreset::importTransitionPresetList( TransitionPresetList& rList )
for( sal_Int32 i=0; i<aFiles.getLength(); ++i )
{
rtl::OUString aURL = aFiles[i];
- if( aURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( EXPAND_PROTOCOL )) == 0 )
+ if( aURL.startsWith( EXPAND_PROTOCOL ) )
{
// cut protocol
rtl::OUString aMacro( aURL.copy( sizeof ( EXPAND_PROTOCOL ) -1 ) );
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 2ed65bf..192169d 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -2246,7 +2246,7 @@ void AnimationImporter::importCommandContainer( const Atom* pAtom, const Referen
{
nCommand = EffectCommands::PLAY;
}
- else if( aParam.compareToAscii( RTL_CONSTASCII_STRINGPARAM("playFrom") ) == 0 )
+ else if( aParam.startsWith( "playFrom" ) )
{
const OUString aMediaTime( aParam.copy( 9, aParam.getLength() - 10 ) );
rtl_math_ConversionStatus eStatus;
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 5625097..03b11bd 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -110,7 +110,7 @@ enum WID_PAGE
#endif
#endif
-static sal_Char sEmptyPageName[sizeof("page")] = "page";
+static sal_Char const sEmptyPageName[sizeof("page")] = "page";
/** this function stores the property maps for draw pages in impress and draw */
const SvxItemPropertySet* ImplGetDrawPagePropertySet( sal_Bool bImpress, PageKind ePageKind )
@@ -2256,7 +2256,7 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName )
if(GetPage() && GetPage()->GetPageKind() != PK_NOTES)
{
// check if this is the default 'page1234' name
- if(aName.compareToAscii( sEmptyPageName, sizeof( sEmptyPageName ) - 1 ) == 0)
+ if(aName.startsWith( sEmptyPageName ))
{
// ok, it maybe is, first get the number part after 'page'
OUString aNumber( aName.copy( sizeof( sEmptyPageName ) - 1 ) );
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index 4f44b69..1ac035d 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -169,9 +169,9 @@ namespace sfx2
aMediaProperties.put( "URL", sImageURL );
// special handling: if the ImageURL denotes a CommandName, then retrieve the image for that command
- const sal_Char* pCommandImagePrefix = "private:commandimage/";
+ static const sal_Char pCommandImagePrefix[] = "private:commandimage/";
const sal_Int32 nCommandImagePrefixLen = strlen( pCommandImagePrefix );
- if ( sImageURL.compareToAscii( pCommandImagePrefix, nCommandImagePrefixLen ) == 0 )
+ if ( sImageURL.startsWith( pCommandImagePrefix ) )
{
::rtl::OUStringBuffer aCommandName;
aCommandName.appendAscii(RTL_CONSTASCII_STRINGPARAM(".uno:"));
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 7fb1538..afbc1fd 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -531,7 +531,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
// check for factory URLs to create a new doc, instead of loading one
const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() );
- const bool bIsFactoryURL = ( sURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "private:factory/" ) ) == 0 );
+ const bool bIsFactoryURL = sURL.startsWith( "private:factory/" );
bool bInitNewModel = bIsFactoryURL;
if ( bIsFactoryURL && !bExternalModel )
{
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index e97e379..c6edcf2 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -339,7 +339,7 @@ FilePermission::FilePermission(
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/-") );
m_url = buf.makeStringAndClear();
}
- else if (0 != m_url.compareToAscii( RTL_CONSTASCII_STRINGPARAM("file:///") ))
+ else if (!m_url.startsWith("file:///"))
{
// relative path
OUString out;
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index cba5786..3d21da0 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1157,7 +1157,7 @@ GraphicObject::InspectForGraphicObjectImageURL( const Reference< XInterface >& x
{
rtl::OUString sURL;
xProps->getPropertyValue( sImageURL ) >>= sURL;
- if ( !sURL.isEmpty() && sURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) == 0 )
+ if ( !sURL.isEmpty() && sURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
rvEmbedImgUrls.push_back( sURL );
}
}
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index 07817c8..c8e98e2 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -147,7 +147,7 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicProvider::getImplementationId()
uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadGraphicObject( const ::rtl::OUString& rResourceURL ) const
{
uno::Reference< ::graphic::XGraphic > xRet;
- if( rResourceURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) == 0 )
+ if( rResourceURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
{
// graphic manager url
String aTmpStr( rResourceURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 ) );
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 6a5b800..f974e51 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 b351b65..64482f87 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;
diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx
index dd2089f..21fe116 100644
--- a/sw/source/ui/uno/unodispatch.cxx
+++ b/sw/source/ui/uno/unodispatch.cxx
@@ -35,7 +35,6 @@ using namespace ::com::sun::star;
using ::rtl::OUString;
-static const char* cURLStart = ".uno:DataSourceBrowser/";
static const char* cURLFormLetter = ".uno:DataSourceBrowser/FormLetter";
static const char* cURLInsertContent = ".uno:DataSourceBrowser/InsertContent";//data into fields
static const char* cURLInsertColumns = ".uno:DataSourceBrowser/InsertColumns";//data into text
@@ -71,7 +70,7 @@ uno::Reference< frame::XDispatch > SwXDispatchProviderInterceptor::queryDispatch
DispatchMutexLock_Impl aLock(*this);
uno::Reference< frame::XDispatch> xResult;
// create some dispatch ...
- if(m_pView && !aURL.Complete.compareToAscii(cURLStart, 23))
+ if(m_pView && aURL.Complete.startsWith(".uno:DataSourceBrowser/"))
{
if(!aURL.Complete.compareToAscii(cURLFormLetter) ||
!aURL.Complete.compareToAscii(cURLInsertContent) ||
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 40499e9..4dc2628 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -379,7 +379,7 @@ void UnoDialogControl::PrepareWindowDescriptor( ::com::sun::star::awt::WindowDes
( !aImageURL.isEmpty() ))
{
::rtl::OUString absoluteUrl = aImageURL;
- if ( aImageURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 )
+ if ( !aImageURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
absoluteUrl = getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
uno::makeAny( aImageURL ) );
@@ -608,7 +608,7 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang
( !aImageURL.isEmpty() ))
{
::rtl::OUString absoluteUrl = aImageURL;
- if ( aImageURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 )
+ if ( !aImageURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
absoluteUrl = getPhysicalLocation( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL )),
uno::makeAny(aImageURL));
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index e98c678..92d49df 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -81,7 +81,7 @@ using namespace ::toolkit;
uno::Reference< graphic::XGraphic >
ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& xOutGraphicObj, const OUString& _rURL )
{
- if( ( _rURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) == 0 ) )
+ if ( _rURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
{
// graphic manager uniqueid
rtl::OUString sID = _rURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 );
diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx
index 9dd95fa..b823a2d 100644
--- a/ucb/source/ucp/expand/ucpexpand.cxx
+++ b/ucb/source/ucp/expand/ucpexpand.cxx
@@ -177,8 +177,7 @@ OUString ExpandContentProviderImpl::expandUri(
uno::Reference< ucb::XContentIdentifier > const & xIdentifier ) const
{
OUString uri( xIdentifier->getContentIdentifier() );
- if (uri.compareToAscii(
- RTL_CONSTASCII_STRINGPARAM(EXPAND_PROTOCOL ":") ) != 0)
+ if (!uri.startsWith(EXPAND_PROTOCOL ":"))
{
throw ucb::IllegalIdentifierException(
"expected protocol " EXPAND_PROTOCOL "!",
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index 3676019..92313ca 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -1602,10 +1602,7 @@ void HierarchyContent::transfer(
}
// Is source a hierarchy content?
- if ( ( rInfo.SourceURL.getLength() < HIERARCHY_URL_SCHEME_LENGTH + 2 ) ||
- ( rInfo.SourceURL.compareToAscii( HIERARCHY_URL_SCHEME ":/",
- HIERARCHY_URL_SCHEME_LENGTH + 2 )
- != 0 ) )
+ if ( !rInfo.SourceURL.startsWith( HIERARCHY_URL_SCHEME ":/" ) )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( ucb::InteractiveBadTransferURLException(
diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
index 4b89cef..576f87b 100644
--- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
@@ -51,7 +51,7 @@ const ::rtl::OUString DAVProperties::EXECUTABLE("http://apache.org/dav/props/exe
void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
NeonPropName & rName )
{
- if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "DAV:" ) ) == 0 )
+ if ( rFullName.startsWith( "DAV:" ) )
{
rName.nspace = "DAV:";
rName.name
@@ -59,8 +59,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
rFullName.copy( RTL_CONSTASCII_LENGTH( "DAV:" ) ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "http://apache.org/dav/props/" ) ) == 0 )
+ else if ( rFullName.startsWith( "http://apache.org/dav/props/" ) )
{
rName.nspace = "http://apache.org/dav/props/";
rName.name
@@ -70,8 +69,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
"http://apache.org/dav/props/" ) ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "http://ucb.openoffice.org/dav/props/" ) ) == 0 )
+ else if ( rFullName.startsWith( "http://ucb.openoffice.org/dav/props/" ) )
{
rName.nspace = "http://ucb.openoffice.org/dav/props/";
rName.name
@@ -81,8 +79,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
"http://ucb.openoffice.org/dav/props/" ) ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "<prop:" ) ) == 0 )
+ else if ( rFullName.startsWith( "<prop:" ) )
{
// Support for 3rd party namespaces/props
@@ -145,18 +142,15 @@ void DAVProperties::createUCBPropName( const char * nspace,
rFullName = aNameSpace;
rFullName += aName;
- if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "DAV:" ) ) == 0 )
+ if ( rFullName.startsWith( "DAV:" ) )
{
// Okay, Just concat strings.
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "http://apache.org/dav/props/" ) ) == 0 )
+ else if ( rFullName.startsWith( "http://apache.org/dav/props/" ) )
{
// Okay, Just concat strings.
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "http://ucb.openoffice.org/dav/props/" ) ) == 0 )
+ else if ( rFullName.startsWith( "http://ucb.openoffice.org/dav/props/" ) )
{
// Remove namespace from our own properties.
rFullName = rFullName.copy(
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index f82117d..2f968f6 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -537,7 +537,7 @@ bool URLParameter::scheme()
for( sal_Int32 nPrefixLen = 20 ; nPrefixLen >= 18 ; --nPrefixLen )
{
- if( m_aExpr.compareToAscii( "vnd.sun.star.help://", nPrefixLen ) == 0 )
+ if( m_aExpr.matchAsciiL( "vnd.sun.star.help://", nPrefixLen ) )
{
m_aExpr = m_aExpr.copy( nPrefixLen );
return true;
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 3ac5fa1..7b855d8 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -695,7 +695,7 @@ void ElementDescriptor::readImageURLAttr( OUString const & rPropName, OUString c
OUString sURL;
_xProps->getPropertyValue( rPropName ) >>= sURL;
- if ( !sURL.isEmpty() && sURL.compareToAscii( XMLSCRIPT_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( XMLSCRIPT_GRAPHOBJ_URLPREFIX ) ) == 0 )
+ if ( sURL.startsWith( XMLSCRIPT_GRAPHOBJ_URLPREFIX ) )
{
Reference< document::XStorageBasedDocument > xDocStorage( _xDocument, UNO_QUERY );
if ( xDocStorage.is() )
commit dc06576d8809760b79f771831bed3122878e0505
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 20 12:54:59 2013 +0100
TODO: Unclear whether comparisons against "Ruby" shall use == or startsWith
...as the use of compareToAscii(RTL_CONSTASCII_STRINGPARAM(...)) would imply.
Change-Id: I46f2f0c5e66e5ced4dfea00c2a7e87a316748a0b
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 4d66549..89f40f6 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -763,7 +763,7 @@ beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyN
throw uno::RuntimeException();
if (GetTextPortionType() == PORTION_RUBY_START &&
- !rPropertyName.compareToAscii( RTL_CONSTASCII_STRINGPARAM("Ruby") ))
+ rPropertyName.startsWith("Ruby")) //TODO: startsWith or ==?
{
eRet = beans::PropertyState_DIRECT_VALUE;
}
@@ -794,7 +794,7 @@ uno::Sequence< beans::PropertyState > SwXTextPortion::getPropertyStates(
beans::PropertyState* pStates = aRet.getArray();
for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength();nProp++)
{
- if(!pNames[nProp].compareToAscii( RTL_CONSTASCII_STRINGPARAM("Ruby") ))
+ if (pNames[nProp].startsWith("Ruby")) //TODO: startsWith or ==?
pStates[nProp] = beans::PropertyState_DIRECT_VALUE;
}
}
commit d11c93b025c87dce5ceabc688419739e35baa535
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 20 12:54:12 2013 +0100
Assume that this shall check full string equality
...instead of prefix match as the use of
compareToAscii(RTL_CONSTASCII_STRINGPARAM(...)) would imply.
Change-Id: I0b0939ac7d753f1972007c479d4231d45ffecd13
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index ee3c9c0..1e21a7a 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -380,7 +380,7 @@ void SAL_CALL XMLFilterDialogComponent::initialize( const Sequence< Any >& aArgu
PropertyValue aProperty;
if(*pArguments >>= aProperty)
{
- if( aProperty.Name.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "ParentWindow" ) ) == 0 )
+ if( aProperty.Name == "ParentWindow" )
{
aProperty.Value >>= mxParent;
}
commit 29c26f911422c318f277ebf31abb57ed6ad5fd16
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 20 12:53:38 2013 +0100
Assume that this shall check full string equality
...instead of prefix match as the use of
compareToAscii(RTL_CONSTASCII_STRINGPARAM(...)) would imply.
Change-Id: If46b3b5f0675b2a6f32d3300c5fef80d5d20956b
diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
index ef3db9d..74c08da 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
@@ -91,8 +91,7 @@ GlobalEventListenerImpl::GlobalEventListenerImpl( XMLFilterTestDialog* pDialog )
void SAL_CALL GlobalEventListenerImpl::notifyEvent( const com::sun::star::document::EventObject& Event ) throw (RuntimeException)
{
::SolarMutexGuard aGuard;
- if( (Event.EventName.compareToAscii( RTL_CONSTASCII_STRINGPARAM("OnFocus") ) == 0) ||
- (Event.EventName.compareToAscii( RTL_CONSTASCII_STRINGPARAM("OnUnload") ) == 0) )
+ if( Event.EventName == "OnFocus" || Event.EventName == "OnUnload" )
{
Reference< XComponent > xComp( Event.Source, UNO_QUERY );
mpDialog->updateCurrentDocumentButtonState( &xComp );
commit 0555481e50d7d8c1b59fb608a4e3eea1e39aeac9
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 20 12:51:12 2013 +0100
Assume that this shall check full string equality
...instead of prefix match as the use of
compareToAscii(RTL_CONSTASCII_STRINGPARAM(...)) would imply.
Change-Id: Iea78d873bf226665998d7ff67e3cdbbae97d9b38
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
index 9284d4c..fa27c4c 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
@@ -128,7 +128,7 @@ void SAL_CALL ChineseTranslation_UnoDialog::initialize( const uno::Sequence< uno
beans::PropertyValue aProperty;
if(*pArguments >>= aProperty)
{
- if( aProperty.Name.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "ParentWindow" ) ) == 0 )
+ if( aProperty.Name == "ParentWindow" )
{
aProperty.Value >>= m_xParentWindow;
}
More information about the Libreoffice-commits
mailing list