connectivity/qa/connectivity/mork/DriverTest.cxx | 8 - connectivity/source/drivers/file/FConnection.cxx | 8 - connectivity/source/drivers/flat/EConnection.cxx | 12 +- connectivity/source/drivers/hsqldb/HConnection.cxx | 2 connectivity/source/drivers/hsqldb/HTable.cxx | 4 connectivity/source/drivers/mork/MDriver.cxx | 8 - connectivity/source/drivers/mork/MResultSet.cxx | 3 connectivity/source/drivers/odbc/OConnection.cxx | 2 connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx | 4 connectivity/source/drivers/postgresql/pq_databasemetadata.cxx | 12 +- desktop/source/app/appinit.cxx | 12 +- desktop/source/app/cmdlinehelp.cxx | 10 +- desktop/source/deployment/inc/dp_ucb.h | 3 desktop/source/deployment/manager/dp_manager.cxx | 9 - desktop/source/offacc/acceptor.cxx | 6 - desktop/source/splash/unxsplash.cxx | 6 - extensions/source/bibliography/datman.cxx | 5 - extensions/source/bibliography/general.cxx | 2 extensions/source/propctrlr/MasterDetailLinkDialog.cxx | 10 +- extensions/source/propctrlr/eformspropertyhandler.cxx | 12 +- extensions/source/propctrlr/eventhandler.cxx | 2 extensions/source/propctrlr/formcomponenthandler.cxx | 35 +++---- extensions/source/propctrlr/genericpropertyhandler.cxx | 2 extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx | 4 extensions/source/update/check/updatecheckconfig.cxx | 2 extensions/source/update/check/updatehdl.cxx | 20 ++-- framework/inc/jobs/joburl.hxx | 3 framework/source/fwe/classes/actiontriggercontainer.cxx | 6 - framework/source/fwe/classes/addonmenu.cxx | 4 framework/source/fwe/classes/rootactiontriggercontainer.cxx | 6 - framework/source/fwe/xml/statusbardocumenthandler.cxx | 10 +- framework/source/fwe/xml/toolboxdocumenthandler.cxx | 17 +-- framework/source/jobs/joburl.cxx | 8 + framework/source/services/desktop.cxx | 4 framework/source/services/frame.cxx | 4 framework/source/services/sessionlistener.cxx | 4 framework/source/uielement/generictoolbarcontroller.cxx | 6 - framework/source/uielement/menubarmanager.cxx | 48 ++-------- include/connectivity/CommonTools.hxx | 4 include/connectivity/sqlnode.hxx | 2 sax/source/expatwrap/saxwriter.cxx | 2 sfx2/source/appl/helpdispatch.cxx | 2 sfx2/source/control/unoctitm.cxx | 2 sfx2/source/doc/DocumentMetadataAccess.cxx | 40 +++----- sfx2/source/doc/doctemplates.cxx | 6 - sfx2/source/doc/printhelper.cxx | 25 ++--- sfx2/source/doc/sfxbasemodel.cxx | 2 sfx2/source/doc/zoomitem.cxx | 6 - sfx2/source/sidebar/CommandInfoProvider.cxx | 2 sfx2/source/sidebar/Context.cxx | 4 sfx2/source/sidebar/ResourceManager.cxx | 18 +-- svx/source/accessibility/AccessibleOLEShape.cxx | 6 - svx/source/accessibility/AccessibleShape.cxx | 2 svx/source/form/fmscriptingenv.cxx | 4 svx/source/form/fmshimp.cxx | 2 svx/source/items/viewlayoutitem.cxx | 4 svx/source/items/zoomslideritem.cxx | 8 - svx/source/svdraw/svdoashp.cxx | 3 ucb/source/core/ucbcmds.cxx | 4 ucb/source/sorter/sortresult.cxx | 15 +-- ucb/source/ucp/file/filrset.cxx | 2 ucb/source/ucp/file/prov.cxx | 14 +- ucb/source/ucp/ftp/ftpcontent.cxx | 32 +++--- ucb/source/ucp/ftp/ftpresultsetI.cxx | 16 +-- ucb/source/ucp/webdav-neon/DateTimeHelper.cxx | 24 ++--- 65 files changed, 258 insertions(+), 316 deletions(-)
New commits: commit fbcb2556be11225d14e62fb1849930f5953588dc Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Dec 12 17:53:23 2014 +0100 ucb: Use appropriate OUString functions on string constants Change-Id: I6839e032c981fcff472f29c51c84503d6370fd1c diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 3fcff96..5c309af 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -820,7 +820,7 @@ void transferProperties( uno::Any aValue; - if ( rCurrProp.Name.equalsAscii( "Title" ) ) + if ( rCurrProp.Name == "Title" ) { // Supply new title, if given. if ( !bHasTitle ) @@ -829,7 +829,7 @@ void transferProperties( aValue <<= rContext.aArg.NewTitle; } } - else if ( rCurrProp.Name.equalsAscii( "TargetURL" ) ) + else if ( rCurrProp.Name == "TargetURL" ) { // Supply source URL as link target for the new link to create. if ( !bHasTargetURL ) diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index 5bef237..daadc8b 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -859,8 +859,7 @@ void SAL_CALL SortedResultSet::setPropertyValue( { osl::Guard< osl::Mutex > aGuard( maMutex ); - if ( PropertyName.equalsAscii( "RowCount" ) || - PropertyName.equalsAscii( "IsRowCountFinal" ) ) + if ( PropertyName == "RowCount" || PropertyName == "IsRowCountFinal" ) throw IllegalArgumentException(); else throw UnknownPropertyException(); @@ -876,11 +875,11 @@ Any SAL_CALL SortedResultSet::getPropertyValue( const OUString& PropertyName ) Any aRet; - if ( PropertyName.equalsAscii( "RowCount" ) ) + if ( PropertyName == "RowCount" ) { aRet <<= maS2O.Count(); } - else if ( PropertyName.equalsAscii( "IsRowCountFinal" ) ) + else if ( PropertyName == "IsRowCountFinal" ) { bool bOrgFinal = false; Any aOrgRet; @@ -1981,9 +1980,9 @@ Property SAL_CALL SRSPropertySetInfo::getPropertyByName( const OUString& Name ) throw( UnknownPropertyException, RuntimeException, std::exception ) { - if ( Name.equalsAscii( "RowCount" ) ) + if ( Name == "RowCount" ) return maProps[0]; - else if ( Name.equalsAscii( "IsRowCountFinal" ) ) + else if ( Name == "IsRowCountFinal" ) return maProps[1]; else throw UnknownPropertyException(); @@ -1994,9 +1993,9 @@ sal_Bool SAL_CALL SRSPropertySetInfo::hasPropertyByName( const OUString& Name ) throw( RuntimeException, std::exception ) { - if ( Name.equalsAscii( "RowCount" ) ) + if ( Name == "RowCount" ) return sal_True; - else if ( Name.equalsAscii( "IsRowCountFinal" ) ) + else if ( Name == "IsRowCountFinal" ) return sal_True; else return sal_False; diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx index 3862182..5413b08 100644 --- a/ucb/source/ucp/file/filrset.cxx +++ b/ucb/source/ucp/file/filrset.cxx @@ -700,7 +700,7 @@ XResultSet_impl::getMetaData( { for ( sal_Int32 n = 0; n < m_sProperty.getLength(); ++n ) { - if ( m_sProperty.getConstArray()[ n ].Name.equalsAscii( "Title" ) ) + if ( m_sProperty.getConstArray()[ n ].Name == "Title" ) { // @@@ #82177# - Determine correct value! bool bCaseSensitiveChildren = false; diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index 95400bd..526c19a 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -114,7 +114,7 @@ FileProvider::initialize( OUString config; if( aArguments.getLength() > 0 && (aArguments[0] >>= config) && - config.equalsAscii("NoConfig") ) + config == "NoConfig" ) m_pMyShell = new shell( m_xContext, this, false ); else m_pMyShell = new shell( m_xContext, this, true ); @@ -473,9 +473,9 @@ FileProvider::setPropertyValue( const OUString& aPropertyName, WrappedTargetException, RuntimeException, std::exception ) { - if( aPropertyName.equalsAscii( "FileSystemNotation" ) || - aPropertyName.equalsAscii( "HomeDirectory" ) || - aPropertyName.equalsAscii( "HostName" ) ) + if( aPropertyName == "FileSystemNotation" || + aPropertyName == "HomeDirectory" || + aPropertyName == "HostName" ) return; else throw UnknownPropertyException( THROW_WHERE ); @@ -491,19 +491,19 @@ FileProvider::getPropertyValue( RuntimeException, std::exception ) { initProperties(); - if( aPropertyName.equalsAscii( "FileSystemNotation" ) ) + if( aPropertyName == "FileSystemNotation" ) { Any aAny; aAny <<= m_FileSystemNotation; return aAny; } - else if( aPropertyName.equalsAscii( "HomeDirectory" ) ) + else if( aPropertyName == "HomeDirectory" ) { Any aAny; aAny <<= m_HomeDirectory; return aAny; } - else if( aPropertyName.equalsAscii( "HostName" ) ) + else if( aPropertyName == "HostName" ) { Any aAny; aAny <<= m_HostName; diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index d903516..04f3bf7 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -435,7 +435,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, break; } - if(aCommand.Name.equalsAscii("getPropertyValues")) { + if(aCommand.Name == "getPropertyValues") { Sequence<Property> Properties; if(!(aCommand.Argument >>= Properties)) { @@ -448,7 +448,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, aRet <<= getPropertyValues(Properties,Environment); } - else if(aCommand.Name.equalsAscii("setPropertyValues") ) + else if(aCommand.Name == "setPropertyValues") { Sequence<PropertyValue> propertyValues; @@ -462,15 +462,15 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, aRet <<= setPropertyValues(propertyValues); } - else if(aCommand.Name.equalsAscii("getCommandInfo")) { + else if(aCommand.Name == "getCommandInfo") { // Note: Implemented by base class. aRet <<= getCommandInfo(Environment); } - else if(aCommand.Name.equalsAscii("getPropertySetInfo")) { + else if(aCommand.Name == "getPropertySetInfo") { // Note: Implemented by base class. aRet <<= getPropertySetInfo(Environment); } - else if(aCommand.Name.equalsAscii( "insert" )) + else if(aCommand.Name == "insert") { InsertCommandArgument aInsertArgument; if ( ! ( aCommand.Argument >>= aInsertArgument ) ) { @@ -482,11 +482,11 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, } insert(aInsertArgument,Environment); } - else if(aCommand.Name.equalsAscii("delete")) { + else if(aCommand.Name == "delete") { m_aFTPURL.del(); deleted(); } - else if(aCommand.Name.equalsAscii( "open" )) { + else if(aCommand.Name == "open") { OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { aRet <<= IllegalArgumentException( @@ -590,7 +590,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, ucbhelper::cancelCommandExecution(aRet,Environment); } - } else if(aCommand.Name.equalsAscii("createNewContent")) { + } else if(aCommand.Name == "createNewContent") { ContentInfo aArg; if (!(aCommand.Argument >>= aArg)) { ucbhelper::cancelCommandExecution( @@ -837,35 +837,35 @@ Reference< XRow > FTPContent::getPropertyValues( for(sal_Int32 i = 0; i < seqProp.getLength(); ++i) { const OUString& Name = seqProp[i].Name; - if(Name.equalsAscii("Title")) + if(Name == "Title") xRow->appendString(seqProp[i],aDirEntry.m_aName); - else if(Name.equalsAscii("CreatableContentsInfo")) + else if(Name == "CreatableContentsInfo") xRow->appendObject(seqProp[i], makeAny(queryCreatableContentsInfo())); else if(aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) { - if(Name.equalsAscii("ContentType")) + if(Name == "ContentType") xRow->appendString(seqProp[i], aDirEntry.m_nMode&INETCOREFTP_FILEMODE_ISDIR ? FTP_FOLDER : FTP_FILE ); - else if(Name.equalsAscii("IsReadOnly")) + else if(Name == "IsReadOnly") xRow->appendBoolean(seqProp[i], aDirEntry.m_nMode & INETCOREFTP_FILEMODE_WRITE ? 0 : 1 ); - else if(Name.equalsAscii("IsDocument")) + else if(Name == "IsDocument") xRow->appendBoolean(seqProp[i], (aDirEntry.m_nMode & INETCOREFTP_FILEMODE_ISDIR) != INETCOREFTP_FILEMODE_ISDIR); - else if(Name.equalsAscii("IsFolder")) + else if(Name == "IsFolder") xRow->appendBoolean(seqProp[i], (aDirEntry.m_nMode & INETCOREFTP_FILEMODE_ISDIR) == INETCOREFTP_FILEMODE_ISDIR); - else if(Name.equalsAscii("Size")) + else if(Name == "Size") xRow->appendLong(seqProp[i], aDirEntry.m_nSize); - else if(Name.equalsAscii("DateCreated")) + else if(Name == "DateCreated") xRow->appendTimestamp(seqProp[i], aDirEntry.m_aDate); else diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx index 7e6dc37..1bfcddc 100644 --- a/ucb/source/ucp/ftp/ftpresultsetI.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx @@ -60,30 +60,30 @@ ResultSetI::ResultSetI(const Reference<XComponentContext>& rxContext, for( int i = 0; i < seqProp.getLength(); ++i) { const OUString& Name = seqProp[i].Name; - if(Name.equalsAscii("ContentType") ) + if(Name == "ContentType") xRow->appendString(seqProp[i], OUString( "application/ftp" )); - else if(Name.equalsAscii("Title")) + else if(Name == "Title") xRow->appendString(seqProp[i],dirvec[n].m_aName); - else if(Name.equalsAscii("IsReadOnly")) + else if(Name == "IsReadOnly") xRow->appendBoolean(seqProp[i], (dirvec[n].m_nMode & INETCOREFTP_FILEMODE_WRITE) == INETCOREFTP_FILEMODE_WRITE); - else if(Name.equalsAscii("IsDocument")) + else if(Name == "IsDocument") xRow->appendBoolean(seqProp[i], (dirvec[n].m_nMode & INETCOREFTP_FILEMODE_ISDIR) != INETCOREFTP_FILEMODE_ISDIR); - else if(Name.equalsAscii("IsFolder")) + else if(Name == "IsFolder") xRow->appendBoolean(seqProp[i], ( dirvec[n].m_nMode & INETCOREFTP_FILEMODE_ISDIR) == INETCOREFTP_FILEMODE_ISDIR); - else if(Name.equalsAscii("Size")) + else if(Name == "Size") xRow->appendLong(seqProp[i], dirvec[n].m_nSize); - else if(Name.equalsAscii("DateCreated")) + else if(Name == "DateCreated") xRow->appendTimestamp(seqProp[i], dirvec[n].m_aDate); - else if(Name.equalsAscii("CreatableContentsInfo")) + else if(Name == "CreatableContentsInfo") xRow->appendObject( seqProp[i], makeAny(FTPContent::queryCreatableContentsInfo_Static())); diff --git a/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx b/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx index 41adf1a..af39ae9 100644 --- a/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx +++ b/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx @@ -117,29 +117,29 @@ bool DateTimeHelper::ISO8601_To_DateTime (const OUString& s, sal_Int32 DateTimeHelper::convertMonthToInt (const OUString& month) { - if (month.equalsAscii("Jan")) + if (month == "Jan") return 1; - else if (month.equalsAscii("Feb")) + else if (month == "Feb") return 2; - else if (month.equalsAscii("Mar")) + else if (month == "Mar") return 3; - else if (month.equalsAscii("Apr")) + else if (month == "Apr") return 4; - else if (month.equalsAscii("May")) + else if (month == "May") return 5; - else if (month.equalsAscii("Jun")) + else if (month == "Jun") return 6; - else if (month.equalsAscii("Jul")) + else if (month == "Jul") return 7; - else if (month.equalsAscii("Aug")) + else if (month == "Aug") return 8; - else if (month.equalsAscii("Sep")) + else if (month == "Sep") return 9; - else if (month.equalsAscii("Oct")) + else if (month == "Oct") return 10; - else if (month.equalsAscii("Nov")) + else if (month == "Nov") return 11; - else if (month.equalsAscii("Dec")) + else if (month == "Dec") return 12; else return 0; commit 34a903796c97601c4f686c8f4fc0bfca1426d8ce Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Dec 12 17:53:03 2014 +0100 svx: Use appropriate OUString functions on string constants Change-Id: Ia012f2bec767cd7e7d2be9502062bea0b085fea0 diff --git a/svx/source/accessibility/AccessibleOLEShape.cxx b/svx/source/accessibility/AccessibleOLEShape.cxx index 7f0051d..9e5c27f 100644 --- a/svx/source/accessibility/AccessibleOLEShape.cxx +++ b/svx/source/accessibility/AccessibleOLEShape.cxx @@ -164,11 +164,9 @@ uno::Any SAL_CALL AccessibleOLEShape::getExtendedAttributes() ::rtl::OUString style; if( m_pShape ) { - //style = ::rtl::OUString::createFromAscii("style="); - style = ::rtl::OUString::createFromAscii("style:"); - style += static_cast<SdrOle2Obj*>(m_pShape)->GetStyleString(); + style = "style:" + static_cast<SdrOle2Obj*>(m_pShape)->GetStyleString(); } - style += ::rtl::OUString::createFromAscii(";"); + style += ";"; strRet <<= style; return strRet; } diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 3b0c496..838556b 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -755,7 +755,7 @@ sal_Int32 SAL_CALL AccessibleShape::getBackground (void) uno::Any aColor; aColor = aSet->getPropertyValue ("FillColor"); aColor >>= nColor; - aColor = aSet->getPropertyValue (OUString::createFromAscii ("FillTransparence")); + aColor = aSet->getPropertyValue ("FillTransparence"); short nTrans=0; aColor >>= nTrans; Color crBk(nColor); diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx index e69d997..fb352bc 100644 --- a/svx/source/form/fmscriptingenv.cxx +++ b/svx/source/form/fmscriptingenv.cxx @@ -936,8 +936,8 @@ namespace svxform { // and it has such a prefix sMacroLocation = sScriptCode.copy( 0, nPrefixLen ); - DBG_ASSERT( sMacroLocation.equalsAscii( "document" ) - || sMacroLocation.equalsAscii( "application" ), + DBG_ASSERT( sMacroLocation == "document" + || sMacroLocation == "application", "FormScriptingEnvironment::doFireScriptEvent: invalid (unknown) prefix!" ); // strip the prefix: the SfxObjectShell::CallScript knows nothing about such prefixes diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index b12779c..e3fdac5 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -3569,7 +3569,7 @@ void FmXFormShell::Notify( const com::sun::star::uno::Sequence< OUString >& _rPr const OUString* pSearch = _rPropertyNames.getConstArray(); const OUString* pSearchTil = pSearch + _rPropertyNames.getLength(); for (;pSearch < pSearchTil; ++pSearch) - if (pSearch->equalsAscii("FormControlPilotsEnabled")) + if (*pSearch == "FormControlPilotsEnabled") { implAdjustConfigCache(); InvalidateSlot( SID_FM_USE_WIZARDS, true ); diff --git a/svx/source/items/viewlayoutitem.cxx b/svx/source/items/viewlayoutitem.cxx index c8e2f05..304d48f 100644 --- a/svx/source/items/viewlayoutitem.cxx +++ b/svx/source/items/viewlayoutitem.cxx @@ -134,12 +134,12 @@ bool SvxViewLayoutItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt sal_Int16 nConvertedCount( 0 ); for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ ) { - if ( aSeq[i].Name.equalsAscii( VIEWLAYOUT_PARAM_COLUMNS )) + if ( aSeq[i].Name == VIEWLAYOUT_PARAM_COLUMNS ) { bAllConverted &= ( aSeq[i].Value >>= nColumns ); ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( VIEWLAYOUT_PARAM_BOOKMODE )) + else if ( aSeq[i].Name == VIEWLAYOUT_PARAM_BOOKMODE ) { bAllConverted &= ( aSeq[i].Value >>= bBookMode ); ++nConvertedCount; diff --git a/svx/source/items/zoomslideritem.cxx b/svx/source/items/zoomslideritem.cxx index 285a464..a26a30b 100644 --- a/svx/source/items/zoomslideritem.cxx +++ b/svx/source/items/zoomslideritem.cxx @@ -157,22 +157,22 @@ bool SvxZoomSliderItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ ) { - if ( aSeq[i].Name.equalsAscii( ZOOMSLIDER_PARAM_CURRENTZOOM )) + if ( aSeq[i].Name == ZOOMSLIDER_PARAM_CURRENTZOOM ) { bAllConverted &= ( aSeq[i].Value >>= nCurrentZoom ); ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( ZOOMSLIDER_PARAM_SNAPPINGPOINTS )) + else if ( aSeq[i].Name == ZOOMSLIDER_PARAM_SNAPPINGPOINTS ) { bAllConverted &= ( aSeq[i].Value >>= aValues ); ++nConvertedCount; } - else if( aSeq[i].Name.equalsAscii( ZOOMSLIDER_PARAM_MINZOOM ) ) + else if( aSeq[i].Name == ZOOMSLIDER_PARAM_MINZOOM ) { bAllConverted &= ( aSeq[i].Value >>= nMinZoom ); ++nConvertedCount; } - else if( aSeq[i].Name.equalsAscii( ZOOMSLIDER_PARAM_MAXZOOM ) ) + else if( aSeq[i].Name == ZOOMSLIDER_PARAM_MAXZOOM ) { bAllConverted &= ( aSeq[i].Value >>= nMaxZoom ); ++nConvertedCount; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index c92aa09..8ae2768 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -3254,7 +3254,8 @@ OUString SdrObjCustomShape::GetCustomShapeName() { OUString sShapeName; OUString aEngine( static_cast<const SdrCustomShapeEngineItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue() ); - if ( aEngine.isEmpty() || aEngine.equalsAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ) + if ( aEngine.isEmpty() + || aEngine == "com.sun.star.drawing.EnhancedCustomShapeEngine" ) { OUString sShapeType; const OUString sType("Type"); commit d2177cded64d92a8c6f068192d1c4b023d49edf3 Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Dec 12 17:52:47 2014 +0100 sfx2: Use appropriate OUString functions on string constants Change-Id: I28ca30da980b81dbf3328495291916afca654999 diff --git a/sfx2/source/appl/helpdispatch.cxx b/sfx2/source/appl/helpdispatch.cxx index 5173c4e..8ae6135 100644 --- a/sfx2/source/appl/helpdispatch.cxx +++ b/sfx2/source/appl/helpdispatch.cxx @@ -64,7 +64,7 @@ void SAL_CALL HelpDispatch_Impl::dispatch( const PropertyValue* pEnd = pBegin + aArgs.getLength(); for ( ; pBegin != pEnd; ++pBegin ) { - if ( pBegin->Name.equalsAscii( "HelpKeyword" ) ) + if ( pBegin->Name == "HelpKeyword" ) { OUString sHelpKeyword; if ( ( pBegin->Value >>= sHelpKeyword ) && !sHelpKeyword.isEmpty() ) diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index ba0ea7c..fd35601 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -290,7 +290,7 @@ SfxStatusDispatcher::SfxStatusDispatcher() void SAL_CALL SfxStatusDispatcher::addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw ( ::com::sun::star::uno::RuntimeException, std::exception ) { aListeners.addInterface( aURL.Complete, aListener ); - if ( aURL.Complete.equalsAscii(".uno:LifeTime") ) + if ( aURL.Complete == ".uno:LifeTime" ) { ::com::sun::star::frame::FeatureStateEvent aEvent; aEvent.FeatureURL = aURL; diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index cff6c8c..cb6799f 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -161,7 +161,7 @@ uno::Reference<rdf::XURI> createBaseURI( xBaseURI.set( xPkgURI, uno::UNO_SET_THROW ); } OUStringBuffer buf; - if (!xBaseURI->getUriReference().endsWithAsciiL("/", 1)) + if (!xBaseURI->getUriReference().endsWith("/")) { const sal_Int32 count( xBaseURI->getPathSegmentCount() ); if (count > 0) @@ -552,8 +552,7 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl, xDirProps->getPropertyValue( utl::MediaDescriptor::PROP_MEDIATYPE() ) >>= mimeType; - if (mimeType.matchAsciiL(s_odfmime, sizeof(s_odfmime) - 1)) - { + if (mimeType.startsWith(s_odfmime)) { OSL_TRACE("readStream: " "refusing to recurse into embedded document"); return; @@ -655,7 +654,7 @@ writeStream(struct DocumentMetadataAccess_Impl & i_rImpl, xDirProps->getPropertyValue( utl::MediaDescriptor::PROP_MEDIATYPE() ) >>= mimeType; - if (mimeType.matchAsciiL(s_odfmime, sizeof(s_odfmime) - 1)) { + if (mimeType.startsWith(s_odfmime)) { OSL_TRACE("writeStream: " "refusing to recurse into embedded document"); return; @@ -695,8 +694,6 @@ retry: i_rImpl.m_xRepository.set(rdf::Repository::create(i_rImpl.m_xContext), uno::UNO_SET_THROW); - const OUString manifest ( - OUString::createFromAscii(s_manifest)); const OUString baseURI( i_xBaseURI->getStringValue() ); // try to delay raising errors until after initialization is done uno::Any rterr; @@ -704,9 +701,9 @@ retry: bool err(false); const uno::Reference <rdf::XURI> xManifest( - getURIForStream(i_rImpl, manifest)); + getURIForStream(i_rImpl, s_manifest)); try { - readStream(i_rImpl, i_xStorage, manifest, baseURI); + readStream(i_rImpl, i_xStorage, s_manifest, baseURI); } catch (const ucb::InteractiveAugmentedIOException & e) { // no manifest.rdf: this is not an error in ODF < 1.2 if (!(ucb::IOErrorCode_NOT_EXISTING_PATH == e.Code)) { @@ -754,8 +751,7 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl) try { i_rImpl.m_xManifest.set(i_rImpl.m_xRepository->createGraph( - getURIForStream(i_rImpl, - OUString::createFromAscii(s_manifest))), + getURIForStream(i_rImpl, s_manifest)), uno::UNO_SET_THROW); // insert the document statement @@ -769,12 +765,10 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl) } // add top-level content files - if (!addContentOrStylesFileImpl(i_rImpl, - OUString::createFromAscii(s_content))) { + if (!addContentOrStylesFileImpl(i_rImpl, s_content)) { throw uno::RuntimeException(); } - if (!addContentOrStylesFileImpl(i_rImpl, - OUString::createFromAscii(s_styles))) { + if (!addContentOrStylesFileImpl(i_rImpl, s_styles)) { throw uno::RuntimeException(); } } @@ -796,8 +790,8 @@ DocumentMetadataAccess::DocumentMetadataAccess( : m_pImpl(new DocumentMetadataAccess_Impl(i_xContext, i_rRegistrySupplier)) { OSL_ENSURE(!i_rURI.isEmpty(), "DMA::DMA: no URI given!"); - OSL_ENSURE(i_rURI.endsWithAsciiL("/", 1), "DMA::DMA: URI without / given!"); - if (!i_rURI.endsWithAsciiL("/", 1)) throw uno::RuntimeException(); + OSL_ENSURE(i_rURI.endsWith("/"), "DMA::DMA: URI without / given!"); + if (!i_rURI.endsWith("/")) throw uno::RuntimeException(); m_pImpl->m_xBaseURI.set(rdf::URI::create(m_pImpl->m_xContext, i_rURI)); m_pImpl->m_xRepository.set(rdf::Repository::create(m_pImpl->m_xContext), uno::UNO_SET_THROW); @@ -1092,7 +1086,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, "DocumentMetadataAccess::loadMetadataFromStorage: " "base URI not absolute", *this, 1); } - if (baseURI.isEmpty() || !baseURI.endsWithAsciiL("/", 1)) { + if (!baseURI.endsWith("/")) { throw lang::IllegalArgumentException( "DocumentMetadataAccess::loadMetadataFromStorage: " "base URI does not end with slash", *this, 1); @@ -1116,8 +1110,6 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XURI> xMetadataFile( getURI<rdf::URIs::PKG_METADATAFILE>(m_pImpl->m_xContext)); const sal_Int32 len( baseURI.getLength() ); - const OUString manifest ( - OUString::createFromAscii(s_manifest)); for (::std::vector< uno::Reference< rdf::XURI > >::const_iterator it = parts.begin(); it != parts.end(); ++it) { @@ -1129,7 +1121,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, continue; } const OUString relName( name.copy(len) ); - if (relName == manifest) { + if (relName == s_manifest) { OSL_TRACE("loadMetadataFromStorage: " "found ourselves a recursive manifest!"); continue; @@ -1193,13 +1185,11 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } // export manifest - const OUString manifest ( - OUString::createFromAscii(s_manifest)); const uno::Reference <rdf::XURI> xManifest( - getURIForStream(*m_pImpl, manifest) ); + getURIForStream(*m_pImpl, s_manifest) ); const OUString baseURI( m_pImpl->m_xBaseURI->getStringValue() ); try { - writeStream(*m_pImpl, i_xStorage, xManifest, manifest, baseURI); + writeStream(*m_pImpl, i_xStorage, xManifest, s_manifest, baseURI); } catch (const uno::RuntimeException &) { throw; } catch (const io::IOException & e) { @@ -1225,7 +1215,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, continue; } const OUString relName( name.copy(len) ); - if (relName == manifest) { + if (relName == s_manifest) { continue; } if (!isFileNameValid(relName) || isReservedFile(relName)) { diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 3b8a9b6..a51fdaa 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -2542,9 +2542,9 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, if ( rUITitle.isEmpty() ) { // reserved FS names that should not be used - if ( rTitle.equalsAscii( "wizard" ) ) + if ( rTitle == "wizard" ) return; - else if ( rTitle.equalsAscii( "internal" ) ) + else if ( rTitle == "internal" ) return; aTitle = getLongName( rTitle ); @@ -2607,7 +2607,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, OUString aType; OUString aHierURL; - if ( aChildTitle.equalsAscii( "sfx.tlx" ) || aChildTitle == "groupuinames.xml" ) + if ( aChildTitle == "sfx.tlx" || aChildTitle == "groupuinames.xml" ) continue; bool bDocHasTitle = false; diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 56a64a5..27f2e62 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -335,7 +335,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > const beans::PropertyValue &rProp = rPrinter.getConstArray()[n]; // Name-Property? - if ( rProp.Name.equalsAscii( "Name" ) ) + if ( rProp.Name == "Name" ) { OUString aPrinterName; if ( ! ( rProp.Value >>= aPrinterName ) ) @@ -360,7 +360,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > const beans::PropertyValue &rProp = rPrinter.getConstArray()[i]; // PaperOrientation-Property? - if ( rProp.Name.equalsAscii( "PaperOrientation" ) ) + if ( rProp.Name == "PaperOrientation" ) { view::PaperOrientation eOrient; if ( !( rProp.Value >>= eOrient ) ) @@ -378,7 +378,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PaperFormat-Property? - else if ( rProp.Name.equalsAscii( "PaperFormat" ) ) + else if ( rProp.Name == "PaperFormat" ) { if ( !( rProp.Value >>= nPaperFormat ) ) { @@ -395,7 +395,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PaperSize-Property? - else if ( rProp.Name.equalsAscii( "PaperSize" ) ) + else if ( rProp.Name == "PaperSize" ) { awt::Size aTempSize ; if ( !( rProp.Value >>= aTempSize ) ) @@ -409,7 +409,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PrinterTray-Property - else if ( rProp.Name.equalsAscii( "PrinterPaperTray" ) ) + else if ( rProp.Name == "PrinterPaperTray" ) { OUString aTmp; if ( !( rProp.Value >>= aTmp ) ) @@ -620,7 +620,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& const beans::PropertyValue &rProp = rOptions.getConstArray()[n]; // FileName-Property? - if ( rProp.Name.equalsAscii( "FileName" ) ) + if ( rProp.Name == "FileName" ) { // unpack th URL and check for a valid and well known protocol OUString sTemp; @@ -695,7 +695,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // CopyCount-Property - else if ( rProp.Name.equalsAscii( "CopyCount" ) ) + else if ( rProp.Name == "CopyCount" ) { sal_Int32 nCopies = 0; if ( !( rProp.Value >>= nCopies ) ) @@ -707,8 +707,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& // Collate-Property // Sort-Property (deprecated) - else if ( rProp.Name.equalsAscii( "Collate" ) || - rProp.Name.equalsAscii( "Sort" ) ) + else if ( rProp.Name == "Collate" || rProp.Name == "Sort" ) { bool bTemp; if ( rProp.Value >>= bTemp ) @@ -721,7 +720,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // Pages-Property - else if ( rProp.Name.equalsAscii( "Pages" ) ) + else if ( rProp.Name == "Pages" ) { OUString sTemp; if( rProp.Value >>= sTemp ) @@ -734,7 +733,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // MonitorVisible - else if ( rProp.Name.equalsAscii( "MonitorVisible" ) ) + else if ( rProp.Name == "MonitorVisible" ) { if( !(rProp.Value >>= bMonitor) ) throw ::com::sun::star::lang::IllegalArgumentException(); @@ -743,7 +742,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // Wait - else if ( rProp.Name.equalsAscii( "Wait" ) ) + else if ( rProp.Name == "Wait" ) { if ( !(rProp.Value >>= bWaitUntilEnd) ) throw ::com::sun::star::lang::IllegalArgumentException(); @@ -751,7 +750,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& aCheckedArgs[nProps++].Value <<= bWaitUntilEnd; } - else if ( rProp.Name.equalsAscii( "DuplexMode" ) ) + else if ( rProp.Name == "DuplexMode" ) { if ( !(rProp.Value >>= nDuplexMode ) ) throw ::com::sun::star::lang::IllegalArgumentException(); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 090a455..ebb924b 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -289,7 +289,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument } uri = xContent->getIdentifier()->getContentIdentifier(); OSL_ENSURE(!uri.isEmpty(), "GetDMA: empty uri?"); - if (!uri.isEmpty() && !uri.endsWithAsciiL("/", 1)) + if (!uri.isEmpty() && !uri.endsWith("/")) { uri = uri + "/"; } diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx index 0b9d11c..20c93d8 100644 --- a/sfx2/source/doc/zoomitem.cxx +++ b/sfx2/source/doc/zoomitem.cxx @@ -152,17 +152,17 @@ bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMem sal_Int16 nConvertedCount( 0 ); for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ ) { - if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUE )) + if ( aSeq[i].Name == ZOOM_PARAM_VALUE ) { bAllConverted &= ( aSeq[i].Value >>= nValueTmp ); ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUESET )) + else if ( aSeq[i].Name == ZOOM_PARAM_VALUESET ) { bAllConverted &= ( aSeq[i].Value >>= nValueSetTmp ); ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_TYPE )) + else if ( aSeq[i].Name == ZOOM_PARAM_TYPE ) { bAllConverted &= ( aSeq[i].Value >>= nTypeTmp ); ++nConvertedCount; diff --git a/sfx2/source/sidebar/CommandInfoProvider.cxx b/sfx2/source/sidebar/CommandInfoProvider.cxx index 5e9fb2a..0f0d957 100644 --- a/sfx2/source/sidebar/CommandInfoProvider.cxx +++ b/sfx2/source/sidebar/CommandInfoProvider.cxx @@ -325,7 +325,7 @@ OUString CommandInfoProvider::GetCommandLabel (const OUString& rsCommandName) const Sequence<beans::PropertyValue> aProperties (GetCommandProperties(rsCommandName)); for (sal_Int32 nIndex=0; nIndex<aProperties.getLength(); ++nIndex) { - if (aProperties[nIndex].Name.equalsAscii("Name")) + if (aProperties[nIndex].Name == "Name") { OUString sLabel; aProperties[nIndex].Value >>= sLabel; diff --git a/sfx2/source/sidebar/Context.cxx b/sfx2/source/sidebar/Context.cxx index df0d43c..ab6dadf 100644 --- a/sfx2/source/sidebar/Context.cxx +++ b/sfx2/source/sidebar/Context.cxx @@ -51,11 +51,11 @@ Context::Context ( sal_Int32 Context::EvaluateMatch ( const Context& rOther) const { - const bool bApplicationNameIsAny (rOther.msApplication.equalsAscii(AnyApplicationName)); + const bool bApplicationNameIsAny (rOther.msApplication == AnyApplicationName); if (rOther.msApplication.equals(msApplication) || bApplicationNameIsAny) { // Application name matches. - const bool bContextNameIsAny (rOther.msContext.equalsAscii(AnyContextName)); + const bool bContextNameIsAny (rOther.msContext == AnyContextName); if (rOther.msContext.equals(msContext) || bContextNameIsAny) { // Context name matches. diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 3220762..966c0dd 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -382,7 +382,7 @@ void ResourceManager::ReadContextList ( : sValue.getToken(0, ',', nCharacterIndex).trim()); const OUString sMenuCommand ( sMenuCommandOverride.getLength()>0 - ? (sMenuCommandOverride.equalsAscii("none") + ? (sMenuCommandOverride == "none" ? OUString() : sMenuCommandOverride) : rsDefaultMenuCommand); @@ -398,15 +398,15 @@ void ResourceManager::ReadContextList ( { // Handle some special names: abbreviations that make // context descriptions more readable. - if (sApplicationName.equalsAscii("Writer")) + if (sApplicationName == "Writer") aApplications.push_back(EnumContext::Application_Writer); - else if (sApplicationName.equalsAscii("Calc")) + else if (sApplicationName == "Calc") aApplications.push_back(EnumContext::Application_Calc); - else if (sApplicationName.equalsAscii("Draw")) + else if (sApplicationName == "Draw") aApplications.push_back(EnumContext::Application_Draw); - else if (sApplicationName.equalsAscii("Impress")) + else if (sApplicationName == "Impress") aApplications.push_back(EnumContext::Application_Impress); - else if (sApplicationName.equalsAscii("DrawImpress")) + else if (sApplicationName == "DrawImpress") { // A special case among the special names: it is // common to use the same context descriptions for @@ -415,7 +415,7 @@ void ResourceManager::ReadContextList ( aApplications.push_back(EnumContext::Application_Draw); aApplications.push_back(EnumContext::Application_Impress); } - else if (sApplicationName.equalsAscii("WriterVariants")) + else if (sApplicationName == "WriterVariants") { // Another special case for all Writer variants. aApplications.push_back(EnumContext::Application_Writer); @@ -448,9 +448,9 @@ void ResourceManager::ReadContextList ( // Setup the flag that controls whether a deck/pane is // initially visible/expanded. bool bIsInitiallyVisible; - if (sInitialState.equalsAscii("visible")) + if (sInitialState == "visible") bIsInitiallyVisible = true; - else if (sInitialState.equalsAscii("hidden")) + else if (sInitialState == "hidden") bIsInitiallyVisible = false; else { commit 58138d117dae2a2778e5e62ca20066744d42804d Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Dec 12 17:52:31 2014 +0100 sax: Use appropriate OUString functions on string constants Change-Id: Ic0750322439f15e6c9b99dac9dbb3b8c060ad8e0 diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index b08970e..0e8250b 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -1359,7 +1359,7 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc throw SAXException(); } - if( sString.matchAsciiL( "<?xml", 5 ) ) + if( sString.startsWith( "<?xml" ) ) return; sal_Int32 nLength(0); commit b733f5c4f4b3f92f5ba0f36575093bb3bc7fc7ec Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Dec 12 17:52:18 2014 +0100 framework: Use appropriate OUString functions on string constants Change-Id: I72bb5ff2ab8a55061072fde567fcc1c4a8e20a2f diff --git a/framework/inc/jobs/joburl.hxx b/framework/inc/jobs/joburl.hxx index afbd15e..ac816c3 100644 --- a/framework/inc/jobs/joburl.hxx +++ b/framework/inc/jobs/joburl.hxx @@ -27,9 +27,6 @@ namespace framework{ -#define JOBURL_PROTOCOL_STR "vnd.sun.star.job:" -#define JOBURL_PROTOCOL_LEN 17 - #define JOBURL_EVENT_STR "event=" #define JOBURL_EVENT_LEN 6 diff --git a/framework/source/fwe/classes/actiontriggercontainer.cxx b/framework/source/fwe/classes/actiontriggercontainer.cxx index 27acc50..1ba4a54 100644 --- a/framework/source/fwe/classes/actiontriggercontainer.cxx +++ b/framework/source/fwe/classes/actiontriggercontainer.cxx @@ -73,11 +73,11 @@ void ActionTriggerContainer::release() throw() Reference< XInterface > SAL_CALL ActionTriggerContainer::createInstance( const OUString& aServiceSpecifier ) throw ( ::com::sun::star::uno::Exception, RuntimeException, std::exception) { - if ( aServiceSpecifier.equalsAscii( SERVICENAME_ACTIONTRIGGER )) + if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGER ) return (OWeakObject *)( new ActionTriggerPropertySet()); - else if ( aServiceSpecifier.equalsAscii( SERVICENAME_ACTIONTRIGGERCONTAINER )) + else if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGERCONTAINER ) return (OWeakObject *)( new ActionTriggerContainer()); - else if ( aServiceSpecifier.equalsAscii( SERVICENAME_ACTIONTRIGGERSEPARATOR )) + else if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGERSEPARATOR ) return (OWeakObject *)( new ActionTriggerSeparatorPropertySet()); else throw com::sun::star::uno::RuntimeException("Unknown service specifier!", (OWeakObject *)this ); diff --git a/framework/source/fwe/classes/addonmenu.cxx b/framework/source/fwe/classes/addonmenu.cxx index 836caa8..4638d0a 100644 --- a/framework/source/fwe/classes/addonmenu.cxx +++ b/framework/source/fwe/classes/addonmenu.cxx @@ -70,9 +70,7 @@ AddonMenu::~AddonMenu() // Check if command URL string has the unique prefix to identify addon popup menus bool AddonPopupMenu::IsCommandURLPrefix( const OUString& aCmdURL ) { - const char aPrefixCharBuf[] = ADDONSPOPUPMENU_URL_PREFIX_STR; - - return aCmdURL.matchAsciiL( aPrefixCharBuf, sizeof( aPrefixCharBuf )-1, 0 ); + return aCmdURL.startsWith( ADDONSPOPUPMENU_URL_PREFIX_STR ); } AddonPopupMenu::AddonPopupMenu( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame ) : diff --git a/framework/source/fwe/classes/rootactiontriggercontainer.cxx b/framework/source/fwe/classes/rootactiontriggercontainer.cxx index fe5196b..152699c 100644 --- a/framework/source/fwe/classes/rootactiontriggercontainer.cxx +++ b/framework/source/fwe/classes/rootactiontriggercontainer.cxx @@ -92,11 +92,11 @@ void SAL_CALL RootActionTriggerContainer::release() throw () Reference< XInterface > SAL_CALL RootActionTriggerContainer::createInstance( const OUString& aServiceSpecifier ) throw ( Exception, RuntimeException, std::exception ) { - if ( aServiceSpecifier.equalsAscii( SERVICENAME_ACTIONTRIGGER )) + if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGER ) return (OWeakObject *)( new ActionTriggerPropertySet()); - else if ( aServiceSpecifier.equalsAscii( SERVICENAME_ACTIONTRIGGERCONTAINER )) + else if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGERCONTAINER ) return (OWeakObject *)( new ActionTriggerContainer()); - else if ( aServiceSpecifier.equalsAscii( SERVICENAME_ACTIONTRIGGERSEPARATOR )) + else if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGERSEPARATOR ) return (OWeakObject *)( new ActionTriggerSeparatorPropertySet()); else throw com::sun::star::uno::RuntimeException("Unknown service specifier!", (OWeakObject *)this ); diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx index ca170df..a3bd46b 100644 --- a/framework/source/fwe/xml/statusbardocumenthandler.cxx +++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx @@ -98,24 +98,24 @@ static void ExtractStatusbarItemParameters( { for ( sal_Int32 i = 0; i < rProp.getLength(); i++ ) { - if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL )) + if ( rProp[i].Name == ITEM_DESCRIPTOR_COMMANDURL ) { rProp[i].Value >>= rCommandURL; rCommandURL = rCommandURL.intern(); } - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_HELPURL ) { rProp[i].Value >>= rHelpURL; } - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_OFFSET )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_OFFSET ) { rProp[i].Value >>= rOffset; } - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_STYLE )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_STYLE ) { rProp[i].Value >>= rStyle; } - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_WIDTH )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_WIDTH ) { rProp[i].Value >>= rWidth; } diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx index 265581e..e6065a1 100644 --- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx +++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx @@ -54,7 +54,6 @@ static const char ITEM_DESCRIPTOR_LABEL[] = "Label"; static const char ITEM_DESCRIPTOR_TYPE[] = "Type"; static const char ITEM_DESCRIPTOR_STYLE[] = "Style"; static const char ITEM_DESCRIPTOR_VISIBLE[] = "IsVisible"; -static const char ITEM_DESCRIPTOR_WIDTH[] = "Width"; static void ExtractToolbarParameters( const Sequence< PropertyValue >& rProp, OUString& rCommandURL, @@ -68,24 +67,24 @@ static void ExtractToolbarParameters( const Sequence< PropertyValue >& rProp, { for ( sal_Int32 i = 0; i < rProp.getLength(); i++ ) { - if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL )) + if ( rProp[i].Name == ITEM_DESCRIPTOR_COMMANDURL ) { rProp[i].Value >>= rCommandURL; rCommandURL = rCommandURL.intern(); } - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_HELPURL ) rProp[i].Value >>= rHelpURL; - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_TOOLTIP )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_TOOLTIP ) rProp[i].Value >>= rTooltip; - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_LABEL ) rProp[i].Value >>= rLabel; - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_TYPE )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_TYPE ) rProp[i].Value >>= rType; - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_VISIBLE )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_VISIBLE ) rProp[i].Value >>= rVisible; - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_WIDTH )) + else if ( rProp[i].Name == "Width" ) rProp[i].Value >>= rWidth; - else if ( rProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_STYLE )) + else if ( rProp[i].Name == ITEM_DESCRIPTOR_STYLE ) rProp[i].Value >>= rStyle; } } diff --git a/framework/source/jobs/joburl.cxx b/framework/source/jobs/joburl.cxx index 2dacc37..3078d03 100644 --- a/framework/source/jobs/joburl.cxx +++ b/framework/source/jobs/joburl.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstring> + #include <jobs/joburl.hxx> #include <general.h> @@ -47,9 +51,9 @@ JobURL::JobURL( /*IN*/ const OUString& sURL ) // syntax: vnd.sun.star.job:{[event=<name>],[alias=<name>],[service=<name>]} // check for "vnd.sun.star.job:" - if (sURL.matchIgnoreAsciiCaseAsciiL(JOBURL_PROTOCOL_STR,JOBURL_PROTOCOL_LEN,0)) + if (sURL.startsWithIgnoreAsciiCase("vnd.sun.star.job:")) { - sal_Int32 t = JOBURL_PROTOCOL_LEN; + sal_Int32 t = std::strlen("vnd.sun.star.job:"); do { // separate all token of "{[event=<name>],[alias=<name>],[service=<name>]}" diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 2896cb6..43f73fb 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -637,8 +637,6 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL Desktop::queryDispatch( co const OUString& sTargetFrameName , sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException, std::exception ) { - const char UNO_PROTOCOL[] = ".uno:"; - /* UNSAFE AREA --------------------------------------------------------------------------------------------- */ // Register transaction and reject wrong calls. TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); @@ -646,7 +644,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL Desktop::queryDispatch( co // Remove uno and cmd protocol part as we want to support both of them. We store only the command part // in our hash map. All other protocols are stored with the protocol part. OUString aCommand( aURL.Main ); - if ( aURL.Protocol.equalsIgnoreAsciiCaseAsciiL( UNO_PROTOCOL, sizeof( UNO_PROTOCOL )-1 )) + if ( aURL.Protocol.equalsIgnoreAsciiCase(".uno:") ) aCommand = aURL.Path; // Make boost::unordered_map lookup if the current URL is in the disabled list diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 1138184..2890392 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -2205,8 +2205,6 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL Frame::queryDispatch( cons const OUString& sTargetFrameName, sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException, std::exception ) { - const char UNO_PROTOCOL[] = ".uno:"; - // Don't check incoming parameter here! Our helper do it for us and it is not a good idea to do it more than ones! // But look for rejected calls! TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); @@ -2214,7 +2212,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL Frame::queryDispatch( cons // Remove uno and cmd protocol part as we want to support both of them. We store only the command part // in our hash map. All other protocols are stored with the protocol part. OUString aCommand( aURL.Main ); - if ( aURL.Protocol.equalsIgnoreAsciiCaseAsciiL( UNO_PROTOCOL, sizeof( UNO_PROTOCOL )-1 )) + if ( aURL.Protocol.equalsIgnoreAsciiCase(".uno:") ) aCommand = aURL.Path; // Make boost::unordered_map lookup if the current URL is in the disabled list diff --git a/framework/source/services/sessionlistener.cxx b/framework/source/services/sessionlistener.cxx index 5820f21..ecf0e49 100644 --- a/framework/source/services/sessionlistener.cxx +++ b/framework/source/services/sessionlistener.cxx @@ -277,13 +277,13 @@ void SAL_CALL SessionListener::statusChanged(const frame::FeatureStateEvent& eve SAL_INFO("fwk.session", "SessionListener::statusChanged"); if ( event.FeatureURL.Complete == "vnd.sun.star.autorecovery:/doSessionRestore" ) { - if (event.FeatureDescriptor.equalsAscii("update")) + if (event.FeatureDescriptor == "update") m_bRestored = true; // a document was restored } else if ( event.FeatureURL.Complete == "vnd.sun.star.autorecovery:/doSessionSave" ) { - if (event.FeatureDescriptor.equalsAscii("stop")) + if (event.FeatureDescriptor == "stop") { if (m_rSessionManager.is()) m_rSessionManager->saveDone(this); // done with save diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index bdd48d8..c7a5a86 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -224,20 +224,20 @@ throw ( RuntimeException, std::exception ) else { // Replacement for place holders - if ( aStrValue.matchAsciiL( "($1)", 4 )) + if ( aStrValue.startsWith("($1)") ) { OUString aTmp(FwkResId(STR_UPDATEDOC)); aTmp += " "; aTmp += aStrValue.copy( 4 ); aStrValue = aTmp; } - else if ( aStrValue.matchAsciiL( "($2)", 4 )) + else if ( aStrValue.startsWith("($2)") ) { OUString aTmp(FWK_RESSTR(STR_CLOSEDOC_ANDRETURN)); aTmp += aStrValue.copy( 4 ); aStrValue = aTmp; } - else if ( aStrValue.matchAsciiL( "($3)", 4 )) + else if ( aStrValue.startsWith("($3)") ) { OUString aTmp(FWK_RESSTR(STR_SAVECOPYDOC)); aTmp += aStrValue.copy( 4 ); diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 72c7ff0..23e0c27 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -97,28 +97,6 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::ui; -static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; -static const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL"; -static const char ITEM_DESCRIPTOR_CONTAINER[] = "ItemDescriptorContainer"; -static const char ITEM_DESCRIPTOR_LABEL[] = "Label"; -static const char ITEM_DESCRIPTOR_TYPE[] = "Type"; -static const char ITEM_DESCRIPTOR_MODULEIDENTIFIER[] = "ModuleIdentifier"; -static const char ITEM_DESCRIPTOR_DISPATCHPROVIDER[] = "DispatchProvider"; -static const char ITEM_DESCRIPTOR_STYLE[] = "Style"; -static const char ITEM_DESCRIPTOR_ISVISIBLE[] = "IsVisible"; -static const char ITEM_DESCRIPTOR_ENABLED[] = "Enabled"; - -static const sal_Int32 LEN_DESCRIPTOR_COMMANDURL = 10; -static const sal_Int32 LEN_DESCRIPTOR_HELPURL = 7; -static const sal_Int32 LEN_DESCRIPTOR_CONTAINER = 23; -static const sal_Int32 LEN_DESCRIPTOR_LABEL = 5; -static const sal_Int32 LEN_DESCRIPTOR_TYPE = 4; -static const sal_Int32 LEN_DESCRIPTOR_MODULEIDENTIFIER = 16; -static const sal_Int32 LEN_DESCRIPTOR_DISPATCHPROVIDER = 16; -static const sal_Int32 LEN_DESCRIPTOR_STYLE = 5; -static const sal_Int32 LEN_DESCRIPTOR_ISVISIBLE = 9; -static const sal_Int32 LEN_DESCRIPTOR_ENABLED = 7; - const sal_uInt16 ADDONMENU_MERGE_ITEMID_START = 1500; namespace framework @@ -479,20 +457,20 @@ throw ( RuntimeException, std::exception ) else if ( Event.State >>= aItemText ) { // Replacement for place holders - if ( aItemText.matchAsciiL( "($1)", 4 )) + if ( aItemText.startsWith("($1)") ) { OUString aTmp(FWK_RESSTR(STR_UPDATEDOC)); aTmp += " "; aTmp += aItemText.copy( 4 ); aItemText = aTmp; } - else if ( aItemText.matchAsciiL( "($2)", 4 )) + else if ( aItemText.startsWith("($2)") ) { OUString aTmp(FWK_RESSTR(STR_CLOSEDOC_ANDRETURN)); aTmp += aItemText.copy( 4 ); aItemText = aTmp; } - else if ( aItemText.matchAsciiL( "($3)", 4 )) + else if ( aItemText.startsWith("($3)") ) { OUString aTmp(FWK_RESSTR(STR_SAVECOPYDOC)); aTmp += aItemText.copy( 4 ); @@ -1655,25 +1633,25 @@ void MenuBarManager::FillMenu( for ( int i = 0; i < aProp.getLength(); i++ ) { OUString aPropName = aProp[i].Name; - if ( aPropName.equalsAsciiL( ITEM_DESCRIPTOR_COMMANDURL, LEN_DESCRIPTOR_COMMANDURL )) + if ( aPropName == "CommandURL" ) aProp[i].Value >>= aCommandURL; - else if ( aPropName.equalsAsciiL( ITEM_DESCRIPTOR_HELPURL, LEN_DESCRIPTOR_HELPURL )) + else if ( aPropName == "HelpURL" ) aProp[i].Value >>= aHelpURL; - else if ( aPropName.equalsAsciiL( ITEM_DESCRIPTOR_CONTAINER, LEN_DESCRIPTOR_CONTAINER )) + else if ( aPropName == "ItemDescriptorContainer" ) aProp[i].Value >>= xIndexContainer; - else if ( aPropName.equalsAsciiL( ITEM_DESCRIPTOR_LABEL, LEN_DESCRIPTOR_LABEL )) + else if ( aPropName == "Label" ) aProp[i].Value >>= aLabel; - else if ( aPropName.equalsAsciiL( ITEM_DESCRIPTOR_TYPE, LEN_DESCRIPTOR_TYPE )) + else if ( aPropName == "Type" ) aProp[i].Value >>= nType; - else if ( aPropName.equalsAsciiL( ITEM_DESCRIPTOR_MODULEIDENTIFIER, LEN_DESCRIPTOR_MODULEIDENTIFIER )) + else if ( aPropName == "ModuleIdentifier" ) aProp[i].Value >>= aModuleIdentifier; - else if ( aPropName.equalsAsciiL( ITEM_DESCRIPTOR_DISPATCHPROVIDER, LEN_DESCRIPTOR_DISPATCHPROVIDER )) + else if ( aPropName == "DispatchProvider" ) aProp[i].Value >>= xDispatchProvider; - else if ( aProp[i].Name.equalsAsciiL( ITEM_DESCRIPTOR_STYLE, LEN_DESCRIPTOR_STYLE )) + else if ( aPropName == "Style" ) aProp[i].Value >>= nStyle; - else if ( aProp[i].Name.equalsAsciiL( ITEM_DESCRIPTOR_ISVISIBLE, LEN_DESCRIPTOR_ISVISIBLE )) + else if ( aPropName == "IsVisible" ) aProp[i].Value >>= bShow; - else if ( aProp[i].Name.equalsAsciiL( ITEM_DESCRIPTOR_ENABLED, LEN_DESCRIPTOR_ENABLED )) + else if ( aPropName == "Enabled" ) aProp[i].Value >>= bEnabled; } commit 4fbdcb8c051ce9a3a32fc93a9e5df0a76ea63595 Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Dec 12 17:51:56 2014 +0100 extensions: Use appropriate OUString functions on string constants Change-Id: I2476f409604d69e8e8ea1a132cd0a9169b5d435e diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index cc2e1ed..dd54d57 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -1177,9 +1177,8 @@ Reference< awt::XControlModel > BibDataManager::createGridModel(const OUString& Reference< XPropertySetInfo > xPropInfo = xPropSet->getPropertySetInfo(); if (xPropInfo->hasPropertyByName(uProp)) { - OUString sId( INET_HID_SCHEME ); - sId += OUString::createFromAscii( HID_BIB_DB_GRIDCTRL ); - xPropSet->setPropertyValue( uProp, makeAny( sId ) ); + xPropSet->setPropertyValue( + uProp, makeAny<OUString>(INET_HID_SCHEME HID_BIB_DB_GRIDCTRL)); } } catch (const Exception&) diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index a08caf9..3d2d1bd 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -447,7 +447,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( OUString uProp("HelpURL"); if(xPropInfo->hasPropertyByName(uProp)) { - OUString sId = OUString::createFromAscii( INET_HID_SCHEME ); + OUString sId( INET_HID_SCHEME ); DBG_ASSERT( INetURLObject( OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); sId += OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ); xPropSet->setPropertyValue( uProp, makeAny( sId ) ); diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx index 1b94ac7..351669a 100644 --- a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx +++ b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx @@ -114,27 +114,27 @@ namespace pcr PropertyValue aProperty; if (_rValue >>= aProperty) { - if (aProperty.Name.equalsAscii("Detail")) + if (aProperty.Name == "Detail") { OSL_VERIFY( aProperty.Value >>= m_xDetail ); return; } - else if (aProperty.Name.equalsAscii("Master")) + else if (aProperty.Name == "Master") { OSL_VERIFY( aProperty.Value >>= m_xMaster ); return; } - else if (aProperty.Name.equalsAscii("Explanation")) + else if (aProperty.Name == "Explanation") { OSL_VERIFY( aProperty.Value >>= m_sExplanation ); return; } - else if (aProperty.Name.equalsAscii("DetailLabel")) + else if (aProperty.Name == "DetailLabel") { OSL_VERIFY( aProperty.Value >>= m_sDetailLabel ); return; } - else if (aProperty.Name.equalsAscii("MasterLabel")) + else if (aProperty.Name == "MasterLabel") { OSL_VERIFY( aProperty.Value >>= m_sMasterLabel ); return; diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx index 5af990f..c52fe33 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.cxx +++ b/extensions/source/propctrlr/eformspropertyhandler.cxx @@ -440,12 +440,12 @@ namespace pcr } break; - case PROPERTY_ID_BIND_EXPRESSION: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_BIND_EXPRESSION); break; - case PROPERTY_ID_XSD_REQUIRED: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_REQUIRED); break; - case PROPERTY_ID_XSD_RELEVANT: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_RELEVANT); break; - case PROPERTY_ID_XSD_READONLY: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_READONLY); break; - case PROPERTY_ID_XSD_CONSTRAINT: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_CONSTRAINT); break; - case PROPERTY_ID_XSD_CALCULATION: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_CALCULATION); break; + case PROPERTY_ID_BIND_EXPRESSION: aDescriptor.PrimaryButtonId = UID_PROP_DLG_BIND_EXPRESSION; break; + case PROPERTY_ID_XSD_REQUIRED: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_REQUIRED; break; + case PROPERTY_ID_XSD_RELEVANT: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_RELEVANT; break; + case PROPERTY_ID_XSD_READONLY: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_READONLY; break; + case PROPERTY_ID_XSD_CONSTRAINT: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_CONSTRAINT; break; + case PROPERTY_ID_XSD_CALCULATION: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_CALCULATION; break; default: OSL_FAIL( "EFormsPropertyHandler::describePropertyLine: cannot handle this property!" ); diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 34a2dd0..7a6cd34 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -157,7 +157,7 @@ namespace pcr { #define DESCRIBE_EVENT( asciinamespace, asciilistener, asciimethod, id_postfix ) \ s_aKnownEvents.insert( EventMap::value_type( \ - OUString::createFromAscii( asciimethod ), \ + asciimethod, \ EventDescription( ++nEventId, asciinamespace, asciilistener, asciimethod, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix ) ) ) bool lcl_getEventDescriptionForMethod( const OUString& _rMethodName, EventDescription& _out_rDescription ) diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 41c955d..ca270ce 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -1014,39 +1014,39 @@ namespace pcr { case PROPERTY_ID_DEFAULT_SELECT_SEQ: case PROPERTY_ID_SELECTEDITEMS: - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_SELECTION); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_SELECTION; break; case PROPERTY_ID_FILTER: - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_FILTER); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_FILTER; break; case PROPERTY_ID_SORT: - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_ORDER); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_ORDER; break; case PROPERTY_ID_MASTERFIELDS: case PROPERTY_ID_DETAILFIELDS: nControlType = PropertyControlType::StringListField; - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_FORMLINKFIELDS); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_FORMLINKFIELDS; break; case PROPERTY_ID_COMMAND: - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_SQLCOMMAND); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_SQLCOMMAND; break; case PROPERTY_ID_TABINDEX: { Reference< XControlContainer > xControlContext( impl_getContextControlContainer_nothrow() ); if ( xControlContext.is() ) - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_TABINDEX); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_TABINDEX; nControlType = PropertyControlType::NumericField; }; break; case PROPERTY_ID_FONT: bReadOnly = true; - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_FONT_TYPE); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_FONT_TYPE; break; case PROPERTY_ID_TARGET_URL: @@ -1054,8 +1054,9 @@ namespace pcr { aDescriptor.Control = new OFileUrlControl( impl_getDefaultDialogParent_nothrow(), WB_TABSTOP | WB_BORDER ); - aDescriptor.PrimaryButtonId = OUString::createFromAscii(( PROPERTY_ID_TARGET_URL == nPropId ) - ? UID_PROP_DLG_ATTR_TARGET_URL : UID_PROP_DLG_IMAGE_URL); + aDescriptor.PrimaryButtonId = PROPERTY_ID_TARGET_URL == nPropId + ? OUString(UID_PROP_DLG_ATTR_TARGET_URL) + : OUString(UID_PROP_DLG_IMAGE_URL); } break; @@ -1072,13 +1073,13 @@ namespace pcr switch( nPropId ) { case PROPERTY_ID_BACKGROUNDCOLOR: - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_BACKGROUNDCOLOR); break; + aDescriptor.PrimaryButtonId = UID_PROP_DLG_BACKGROUNDCOLOR; break; case PROPERTY_ID_FILLCOLOR: - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_FILLCOLOR); break; + aDescriptor.PrimaryButtonId = UID_PROP_DLG_FILLCOLOR; break; case PROPERTY_ID_SYMBOLCOLOR: - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_SYMBOLCOLOR); break; + aDescriptor.PrimaryButtonId = UID_PROP_DLG_SYMBOLCOLOR; break; case PROPERTY_ID_BORDERCOLOR: - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_BORDERCOLOR); break; + aDescriptor.PrimaryButtonId = UID_PROP_DLG_BORDERCOLOR; break; } break; @@ -1102,7 +1103,7 @@ namespace pcr case PROPERTY_ID_CONTROLLABEL: bReadOnly = true; - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_CONTROLLABEL); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_CONTROLLABEL; break; case PROPERTY_ID_FORMATKEY: @@ -1132,7 +1133,7 @@ namespace pcr aDescriptor.Control = pControl; pControl->SetFormatSupplier( pSupplier ); - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_NUMBER_FORMAT); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_NUMBER_FORMAT; } else { @@ -1357,7 +1358,7 @@ namespace pcr // DataSource case PROPERTY_ID_DATASOURCE: { - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_ATTR_DATASOURCE); + aDescriptor.PrimaryButtonId = UID_PROP_DLG_ATTR_DATASOURCE; ::std::vector< OUString > aListEntries; @@ -2455,7 +2456,7 @@ namespace pcr _out_rProperty.DisplayName = m_pInfoService->getPropertyTranslation( PROPERTY_ID_COMMAND ); _out_rProperty.HelpURL = HelpIdUrl::getHelpURL( m_pInfoService->getPropertyHelpId( PROPERTY_ID_COMMAND ) ); - _out_rProperty.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_SQLCOMMAND); + _out_rProperty.PrimaryButtonId = UID_PROP_DLG_SQLCOMMAND; sal_Int32 nCommandType = CommandType::COMMAND; diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx index 1d15275..0aaa2cc 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.cxx +++ b/extensions/source/propctrlr/genericpropertyhandler.cxx @@ -576,7 +576,7 @@ namespace pcr case TypeClass_STRING: { // some special handling for URL properties - bool bIsURLProperty = _rPropertyName.endsWithAsciiL( "URL", 3 ); + bool bIsURLProperty = _rPropertyName.endsWith( "URL" ); if ( bIsURLProperty ) { aDescriptor.Control = _rxControlFactory->createPropertyControl( diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx index 9ac5f57..99df014 100644 --- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx +++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx @@ -319,8 +319,8 @@ namespace pcr implGetAvailableDataTypeNames( aListEntries ); - aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_ADD_DATA_TYPE); - aDescriptor.SecondaryButtonId = OUString::createFromAscii(UID_PROP_REMOVE_DATA_TYPE);; + aDescriptor.PrimaryButtonId = UID_PROP_ADD_DATA_TYPE; + aDescriptor.SecondaryButtonId = UID_PROP_REMOVE_DATA_TYPE; aDescriptor.HasPrimaryButton = aDescriptor.HasSecondaryButton = sal_True; aDescriptor.PrimaryButtonImageURL = "private:graphicrepository/extensions/res/buttonplus.png"; aDescriptor.SecondaryButtonImageURL = "private:graphicrepository/extensions/res/buttonminus.png"; diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index 0b84438..6ef8392 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -533,7 +533,7 @@ UpdateCheckConfig::getByName( const OUString& aName ) uno::Any aValue = m_xContainer->getByName( aName ); // Provide dynamic default value - if( aName.equalsAscii(DOWNLOAD_DESTINATION) ) + if( aName == DOWNLOAD_DESTINATION ) { OUString aStr; aValue >>= aStr; diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 28dd1d2..7be1b3a 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -146,7 +146,7 @@ void UpdateHandler::setDownloadBtnLabel( bool bAppendDots ) aLabel += "..."; setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "Label", uno::Any( aLabel ) ); - setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD2 ) ) ); + setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DOWNLOAD2 ) ); mbDownloadBtnHasDots = bAppendDots; } @@ -1085,7 +1085,7 @@ void UpdateHandler::createDialog() xPropSet->setPropertyValue( "PositionY", uno::Any(sal_Int32( 100 )) ); xPropSet->setPropertyValue( "Width", uno::Any(sal_Int32( DIALOG_WIDTH )) ); xPropSet->setPropertyValue( "Height", uno::Any(sal_Int32( DIALOG_HEIGHT )) ); - xPropSet->setPropertyValue( "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) ) ); + xPropSet->setPropertyValue( "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DLG ) ); } { // Label (fixed text) <status> uno::Sequence< beans::NamedValue > aProps(1); @@ -1112,7 +1112,7 @@ void UpdateHandler::createDialog() setProperty( aProps, 3, "MultiLine", uno::Any( true ) ); setProperty( aProps, 4, "ReadOnly", uno::Any( true ) ); setProperty( aProps, 5, "AutoVScroll", uno::Any( true ) ); - setProperty( aProps, 6, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_STATUS ) ) ); + setProperty( aProps, 6, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_STATUS ) ); insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_STATUS, awt::Rectangle( DIALOG_BORDER + TEXT_OFFSET, @@ -1143,7 +1143,7 @@ void UpdateHandler::createDialog() setProperty( aProps, 1, "Enabled", uno::Any( true ) ); setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); setProperty( aProps, 3, "Label", uno::Any( msPauseBtn ) ); - setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_PAUSE ) ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_PAUSE ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[PAUSE_BUTTON], awt::Rectangle( BOX1_BTN_X, BOX1_BTN_Y, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1156,7 +1156,7 @@ void UpdateHandler::createDialog() setProperty( aProps, 1, "Enabled", uno::Any( true ) ); setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); setProperty( aProps, 3, "Label", uno::Any( msResumeBtn ) ); - setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_RESUME ) ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_RESUME ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[RESUME_BUTTON], awt::Rectangle( BOX1_BTN_X, @@ -1172,7 +1172,7 @@ void UpdateHandler::createDialog() setProperty( aProps, 1, "Enabled", uno::Any( true ) ); setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); setProperty( aProps, 3, "Label", uno::Any( msCancelBtn ) ); - setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_CANCEL ) ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_CANCEL ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[CANCEL_BUTTON], awt::Rectangle( BOX1_BTN_X, @@ -1206,7 +1206,7 @@ void UpdateHandler::createDialog() setProperty( aProps, 3, "MultiLine", uno::Any( true ) ); setProperty( aProps, 4, "ReadOnly", uno::Any( true ) ); setProperty( aProps, 5, "AutoVScroll", uno::Any( true ) ); - setProperty( aProps, 6, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DESCRIPTION ) ) ); + setProperty( aProps, 6, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DESCRIPTION ) ); insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_DESCRIPTION, awt::Rectangle( DIALOG_BORDER + TEXT_OFFSET, @@ -1236,7 +1236,7 @@ void UpdateHandler::createDialog() // setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_CANCEL) ) ); // [property] string Label // only if PushButtonType_STANDARD setProperty( aProps, 3, "Label", uno::Any( msClose ) ); - setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_CLOSE ) ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_CLOSE ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[ CLOSE_BUTTON ], awt::Rectangle( CLOSE_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1249,7 +1249,7 @@ void UpdateHandler::createDialog() setProperty( aProps, 1, "Enabled", uno::Any( true ) ); setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); setProperty( aProps, 3, "Label", uno::Any( msInstall ) ); - setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_INSTALL ) ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_INSTALL ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[INSTALL_BUTTON], awt::Rectangle( INSTALL_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1262,7 +1262,7 @@ void UpdateHandler::createDialog() setProperty( aProps, 1, "Enabled", uno::Any( true ) ); setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); setProperty( aProps, 3, "Label", uno::Any( msDownload ) ); - setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD ) ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DOWNLOAD ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[DOWNLOAD_BUTTON], awt::Rectangle( DOWNLOAD_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), commit 9d94148b0429acf77880742c0569bbebddd794f9 Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Dec 12 17:51:36 2014 +0100 desktop: Use appropriate OUString functions on string constants Change-Id: I5791c212a103fe9c2a5376545944a70454b28bdd diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 02478a4..797ea9c 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -234,7 +234,7 @@ void Desktop::destroyAcceptor(const OUString& aAcceptString) { // special case stop all acceptors AcceptorMap &rMap = acceptorMap::get(); - if (aAcceptString.equalsAscii("all")) { + if (aAcceptString == "all") { rMap.clear(); } else { @@ -283,9 +283,8 @@ void Desktop::CreateTemporaryDirectory() } // set temp base directory - sal_Int32 nLength = aTempBaseURL.getLength(); - if ( aTempBaseURL.matchAsciiL( "/", 1, nLength-1 ) ) - aTempBaseURL = aTempBaseURL.copy( 0, nLength - 1 ); + if ( aTempBaseURL.endsWith( "/" ) ) + aTempBaseURL = aTempBaseURL.copy( 0, aTempBaseURL.getLength() - 1 ); OUString aRet; OUString aTempPath( aTempBaseURL ); @@ -298,9 +297,8 @@ void Desktop::CreateTemporaryDirectory() { ::osl::File::getTempDirURL( aTempBaseURL ); - nLength = aTempBaseURL.getLength(); - if ( aTempBaseURL.matchAsciiL( "/", 1, nLength-1 ) ) - aTempBaseURL = aTempBaseURL.copy( 0, nLength - 1 ); + if ( aTempBaseURL.endsWith( "/" ) ) + aTempBaseURL = aTempBaseURL.copy( 0, aTempBaseURL.getLength() - 1 ); aTempPath = aTempBaseURL; ::osl::FileBase::getFileURLFromSystemPath( aRet, aTempPath ); diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index dbec4e9..614fa5a 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -139,11 +139,11 @@ namespace desktop { // if you put variables in other chunks don't forget to call the replace routines // for those chunks... - OUString aHelpMessage_version = OUString::createFromAscii(aCmdLineHelp_version); - OUString aHelpMessage_head = OUString::createFromAscii(aCmdLineHelp_head); - OUString aHelpMessage_left = OUString::createFromAscii(aCmdLineHelp_left); - OUString aHelpMessage_right = OUString::createFromAscii(aCmdLineHelp_right); - OUString aHelpMessage_bottom = OUString::createFromAscii(aCmdLineHelp_bottom); + OUString aHelpMessage_version(aCmdLineHelp_version); + OUString aHelpMessage_head(aCmdLineHelp_head); + OUString aHelpMessage_left(aCmdLineHelp_left); + OUString aHelpMessage_right(aCmdLineHelp_right); + OUString aHelpMessage_bottom(aCmdLineHelp_bottom); aHelpMessage_version = ReplaceStringHookProc(aHelpMessage_version); aHelpMessage_head = aHelpMessage_head.replaceFirst( "%CMDNAME", "soffice" ); if (!unknown.isEmpty()) diff --git a/desktop/source/deployment/inc/dp_ucb.h b/desktop/source/deployment/inc/dp_ucb.h index 2b26705..ee68c63 100644 --- a/desktop/source/deployment/inc/dp_ucb.h +++ b/desktop/source/deployment/inc/dp_ucb.h @@ -45,8 +45,7 @@ struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle } static OUString getTitle( ::ucbhelper::Content &rContent ) { - return OUString( rContent.getPropertyValue( - OUString::createFromAscii( "Title" ) ).get<OUString>() ); + return rContent.getPropertyValue("Title").get<OUString>(); } // just return titles - the ucbhelper should have a simpler API for this [!] static css::uno::Reference< css::sdbc::XResultSet > diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index a4eb6c6..8d90501 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -192,16 +192,11 @@ void PackageManagerImpl::initActivationLayer( Reference<sdbc::XRow>( xResultSet, UNO_QUERY_THROW )->getString( 1 /* Title */ ) ); - - const char extensionRemoved[] = "removed"; - if (title.endsWith( extensionRemoved )) + if (title.endsWith("removed", &title)) { //save the file name withouth the "removed" part - sal_Int32 index = title.lastIndexOfAsciiL( - extensionRemoved, sizeof(extensionRemoved) - 1); - OUString remFile = title.copy(0, index); removedEntries.push_back(::rtl::Uri::encode( - remFile, rtl_UriCharClassPchar, + title, rtl_UriCharClassPchar, rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8 ) ); } diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index ef64f9f..85b729c 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -232,15 +232,15 @@ Reference<XInterface> AccInstanceProvider::getInstance (const OUString& aName ) Reference<XInterface> rInstance; - if ( aName.equalsAscii( "StarOffice.ServiceManager" ) ) + if ( aName == "StarOffice.ServiceManager" ) { rInstance = Reference< XInterface >( m_rContext->getServiceManager() ); } - else if(aName.equalsAscii( "StarOffice.ComponentContext" ) ) + else if ( aName == "StarOffice.ComponentContext" ) { rInstance = m_rContext; } - else if ( aName.equalsAscii("StarOffice.NamingService" ) ) + else if ( aName == "StarOffice.NamingService" ) { Reference< XNamingService > rNamingService( m_rContext->getServiceManager()->createInstanceWithContext("com.sun.star.uno.NamingService", m_rContext), diff --git a/desktop/source/splash/unxsplash.cxx b/desktop/source/splash/unxsplash.cxx index 9f34c41..c41f233 100644 --- a/desktop/source/splash/unxsplash.cxx +++ b/desktop/source/splash/unxsplash.cxx @@ -25,8 +25,6 @@ #include <rtl/ustrbuf.hxx> #include <rtl/math.hxx> -#define PIPE_ARG "--splash-pipe=" - namespace desktop { UnxSplashScreen::UnxSplashScreen( const Reference< uno::XComponentContext >& xCtx ) @@ -104,9 +102,9 @@ UnxSplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun:: { OUString aArg; osl_getCommandArg( i, &aArg.pData ); - if ( aArg.matchIgnoreAsciiCaseAsciiL( PIPE_ARG, sizeof( PIPE_ARG ) - 1, 0 ) ) + OUString aNum; + if ( aArg.startsWithIgnoreAsciiCase("--splash-pipe=", &aNum) ) { - OUString aNum = aArg.copy( sizeof( PIPE_ARG ) - 1 ); int fd = aNum.toInt32(); m_pOutFd = fdopen( fd, "w" ); #if OSL_DEBUG_LEVEL > 1 commit bca00da68640bb052c1628270ce3924b7228d7b8 Author: Stephan Bergmann <sberg...@redhat.com> Date: Fri Dec 12 17:51:11 2014 +0100 connectivity: Use appropriate OUString functions on string constants Change-Id: I10b2ddf9dcc83219fea8eb55783507eed52702e8 diff --git a/connectivity/qa/connectivity/mork/DriverTest.cxx b/connectivity/qa/connectivity/mork/DriverTest.cxx index b1c9d9f..ca5ffdc 100644 --- a/connectivity/qa/connectivity/mork/DriverTest.cxx +++ b/connectivity/qa/connectivity/mork/DriverTest.cxx @@ -149,17 +149,17 @@ void MorkDriverTest::test_select_default_all() bool result = xResultSet->first(); CPPUNIT_ASSERT_MESSAGE("fetch first row failed!", result); OUString mail = xDelegatorRow->getString(1); - CPPUNIT_ASSERT_MESSAGE("first row is not j...@doe.org!", mail.equalsAscii("j...@doe.org")); + CPPUNIT_ASSERT_MESSAGE("first row is not j...@doe.org!", mail == "j...@doe.org"); result = xResultSet->next(); CPPUNIT_ASSERT_MESSAGE("fetch second row failed!", result); mail = xDelegatorRow->getString(1); - CPPUNIT_ASSERT_MESSAGE("second row is not j...@doe10.org!", mail.equalsAscii("j...@doe10.org")); + CPPUNIT_ASSERT_MESSAGE("second row is not j...@doe10.org!", mail == "j...@doe10.org"); result = xResultSet->last(); CPPUNIT_ASSERT_MESSAGE("fetch last row failed!", result); mail = xDelegatorRow->getString(1); - CPPUNIT_ASSERT_MESSAGE("last row is not j...@doe9.org!", mail.equalsAscii("j...@doe9.org")); + CPPUNIT_ASSERT_MESSAGE("last row is not j...@doe9.org!", mail == "j...@doe9.org"); css::uno::Reference<css::sdbc::XCloseable>( xStatement, css::uno::UNO_QUERY_THROW)->close(); @@ -189,7 +189,7 @@ void MorkDriverTest::test_select_list_table_joe_doe_5() bool result = xResultSet->first(); CPPUNIT_ASSERT_MESSAGE("fetch first row failed!", result); OUString mail = xDelegatorRow->getString(1); - CPPUNIT_ASSERT_MESSAGE("last row is not j...@doe5.org!", mail.equalsAscii("j...@doe5.org")); + CPPUNIT_ASSERT_MESSAGE("last row is not j...@doe5.org!", mail == "j...@doe5.org"); css::uno::Reference<css::sdbc::XCloseable>( xStatement, css::uno::UNO_QUERY_THROW)->close(); diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index dbb3c67..4e15516 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -105,9 +105,9 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& const PropertyValue *pEnd = pIter + info.getLength(); for(;pIter != pEnd;++pIter) { - if( pIter->Name.equalsAscii("Extension")) + if( pIter->Name == "Extension" ) OSL_VERIFY( pIter->Value >>= aExt ); - else if( pIter->Name.equalsAscii("CharSet")) + else if( pIter->Name == "CharSet" ) { OUString sIanaName; OSL_VERIFY( pIter->Value >>= sIanaName ); @@ -119,11 +119,11 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& else m_nTextEncoding = RTL_TEXTENCODING_DONTKNOW; } - else if( pIter->Name.equalsAscii("ShowDeleted")) + else if( pIter->Name == "ShowDeleted" ) { OSL_VERIFY( pIter->Value >>= m_bShowDeleted ); } - else if( pIter->Name.equalsAscii("EnableSQL92Check")) + else if( pIter->Name == "EnableSQL92Check" ) { pIter->Value >>= m_bCheckSQL92; } diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx index 37d1d78..e3518e7 100644 --- a/connectivity/source/drivers/flat/EConnection.cxx +++ b/connectivity/source/drivers/flat/EConnection.cxx @@ -68,33 +68,33 @@ void OFlatConnection::construct(const OUString& url,const Sequence< PropertyValu const PropertyValue *pEnd = pBegin + info.getLength(); for(;pBegin != pEnd;++pBegin) { - if(pBegin->Name.equalsAscii("HeaderLine")) + if(pBegin->Name == "HeaderLine") OSL_VERIFY( pBegin->Value >>= m_bHeaderLine ); - else if(pBegin->Name.equalsAscii("FieldDelimiter")) + else if(pBegin->Name == "FieldDelimiter") { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cFieldDelimiter = aVal.toChar(); } - else if(pBegin->Name.equalsAscii("StringDelimiter")) + else if(pBegin->Name == "StringDelimiter") { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cStringDelimiter = aVal.toChar(); } - else if(pBegin->Name.equalsAscii("DecimalDelimiter")) + else if(pBegin->Name == "DecimalDelimiter") { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cDecimalDelimiter = aVal.toChar(); } - else if(pBegin->Name.equalsAscii("ThousandDelimiter")) + else if(pBegin->Name == "ThousandDelimiter") { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cThousandDelimiter = aVal.toChar(); } - else if ( pBegin->Name.equalsAscii("MaxRowScan") ) + else if ( pBegin->Name == "MaxRowScan" ) { pBegin->Value >>= m_nMaxRowsToScan; } diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx index 70fc252..836a20d 100644 --- a/connectivity/source/drivers/hsqldb/HConnection.cxx +++ b/connectivity/source/drivers/hsqldb/HConnection.cxx @@ -146,7 +146,7 @@ namespace connectivity { namespace hsqldb const PropertyValue* pEnd = pIter + aInfo.getLength(); for(;pIter != pEnd;++pIter) { - if ( pIter->Name.equalsAscii("readonly") ) + if ( pIter->Name == "readonly" ) m_bReadOnly = true; } } diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx index 2ff063c..31923db 100644 --- a/connectivity/source/drivers/hsqldb/HTable.cxx +++ b/connectivity/source/drivers/hsqldb/HTable.cxx @@ -342,7 +342,7 @@ void OHSQLTable::executeStatement(const OUString& _rStatement ) Sequence< Type > SAL_CALL OHSQLTable::getTypes( ) throw(RuntimeException, std::exception) { - if ( m_Type.equalsAscii("VIEW") ) + if ( m_Type == "VIEW" ) { Sequence< Type > aTypes = OTableHelper::getTypes(); ::std::vector<Type> aOwnTypes; @@ -401,7 +401,7 @@ void SAL_CALL OHSQLTable::rename( const OUString& newName ) throw(SQLException, Any SAL_CALL OHSQLTable::queryInterface( const Type & rType ) throw(RuntimeException, std::exception) { - if( m_Type.equalsAscii("VIEW") && rType == cppu::UnoType<XRename>::get()) + if( m_Type == "VIEW" && rType == cppu::UnoType<XRename>::get()) return Any(); return OTableHelper::queryInterface(rType); diff --git a/connectivity/source/drivers/mork/MDriver.cxx b/connectivity/source/drivers/mork/MDriver.cxx index a9ee710..48fd9a8 100644 --- a/connectivity/source/drivers/mork/MDriver.cxx +++ b/connectivity/source/drivers/mork/MDriver.cxx @@ -118,13 +118,7 @@ sal_Bool MorkDriver::acceptsURL(OUString const & url) aAddrbookScheme = aAddrbookURI.copy(0, nLen); } - if (aAddrbookScheme.equalsAscii( "thunderbird" ) || - aAddrbookScheme.equalsAscii( "mozilla" ) ) - { - return true; - } - - return false; + return aAddrbookScheme == "thunderbird" || aAddrbookScheme == "mozilla"; } css::uno::Sequence< css::sdbc::DriverPropertyInfo > MorkDriver::getPropertyInfo( diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index da81055..0021fe3 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -880,8 +880,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT matchString = parseTree->getChild(2)->getTokenValue(); } - if ( columnName.equalsAscii("0") && op == MQueryOp::Is && - matchString.equalsAscii("1") ) { + if ( columnName == "0" && op == MQueryOp::Is && matchString == "1" ) { OSL_TRACE("Query always evaluates to FALSE"); m_bIsAlwaysFalseQuery = true; } diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index 3c524ae..27d870b 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -152,7 +152,7 @@ SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTi { OUString aVal; OTools::GetInfo(this,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aVal,*this,getTextEncoding()); - m_bReadOnly = aVal.equalsAscii("Y"); + m_bReadOnly = aVal == "Y"; } catch(Exception&) { diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx index 6762ecd..420aa3e 100644 --- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx @@ -1210,13 +1210,13 @@ void ODatabaseMetaDataResultSet::openImportedKeys(const Any& catalog, const OUSt const OUString& table) throw(SQLException, RuntimeException) { ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits