diff options
26 files changed, 148 insertions, 157 deletions
diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx index c257a3925775..f563c51b0ad4 100644 --- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx @@ -135,7 +135,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( bool bIncludeAllTypes = false; for ( sal_Int32 i=0; i<typeFilterCount; ++i, ++typeFilter ) { - if ( typeFilter->startsWith( "%" ) ) + if ( *typeFilter == "%" ) { bIncludeAllTypes = true; break; @@ -163,7 +163,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( aCatalogFilter = m_pConnection->getCatalogRestriction(); // similar for schema Any aSchemaFilter; - if ( schemaPattern.startsWith( "%" ) ) + if ( schemaPattern == "%" ) aSchemaFilter = m_pConnection->getSchemaRestriction(); else aSchemaFilter <<= schemaPattern; diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index dfa656c47ea1..7e5de81e4a84 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -168,7 +168,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto // first, filter for the table names sal_Int32 nTableFilterCount = _tableFilter.getLength(); - sal_Bool dontFilterTableNames = ( ( nTableFilterCount == 1 ) && _tableFilter[0].startsWith( "%" ) ); + sal_Bool dontFilterTableNames = ( ( nTableFilterCount == 1 ) && _tableFilter[0] == "%" ); if( dontFilterTableNames ) { aFilteredTables = _unfilteredTables; @@ -198,7 +198,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto // second, filter for the table types sal_Int32 nTableTypeFilterCount = _tableTypeFilter.getLength(); - sal_Bool dontFilterTableTypes = ( ( nTableTypeFilterCount == 1 ) && _tableTypeFilter[0].startsWith( "%" ) ); + sal_Bool dontFilterTableTypes = ( ( nTableTypeFilterCount == 1 ) && _tableTypeFilter[0] == "%" ); dontFilterTableTypes = dontFilterTableTypes || ( nTableTypeFilterCount == 0 ); // (for TableTypeFilter, unlike TableFilter, "empty" means "do not filter at all") if ( !dontFilterTableTypes ) diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 36f8615ea003..c1fbf55bdab5 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -217,7 +217,7 @@ DBG_NAME(OTableSubscriptionPage) } else { - if ((1 == _rTableFilter.getLength()) && _rTableFilter[0].startsWith("%")) + if ((1 == _rTableFilter.getLength()) && _rTableFilter[0] == "%") { // all tables visible CheckAll(sal_True); } diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 64cf32e23441..974515f3822f 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -1054,7 +1054,7 @@ void MigrationImpl::runServices() { OUString sExtension(sToolbarName.copy(nIndex)); OUString sToolbarResourceName(sToolbarName.copy(0, nIndex)); - if (!sToolbarResourceName.isEmpty() && sExtension.startsWith(".xml")) + if (!sToolbarResourceName.isEmpty() && sExtension == ".xml") aModuleInfo.m_vToolbars.push_back(sToolbarResourceName); } } diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index b6b1374def56..86a8d93fcd34 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -566,7 +566,7 @@ UpdateInformationProvider::getUpdateInformationEnumeration( if( xElement.is() ) { - if( xElement->getNodeName().startsWith("feed") ) + if( xElement->getNodeName() == "feed" ) { OUString aXPathExpression; diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index 9e2003ffb09c..6310d92cef19 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -263,11 +263,11 @@ long ComboboxToolbarController::PreNotify( NotifyEvent& rNEvt ) void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) { - if ( rControlCommand.Command.startsWith( "SetText" )) + if ( rControlCommand.Command == "SetText" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Text")) + if ( rControlCommand.Arguments[i].Name == "Text" ) { OUString aText; rControlCommand.Arguments[i].Value >>= aText; @@ -279,11 +279,11 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "SetList" )) + else if ( rControlCommand.Command == "SetList" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "List" )) + if ( rControlCommand.Arguments[i].Name == "List" ) { Sequence< OUString > aList; m_pComboBox->Clear(); @@ -304,13 +304,13 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "AddEntry" )) + else if ( rControlCommand.Command == "AddEntry" ) { sal_uInt16 nPos( COMBOBOX_APPEND ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Text" )) + if ( rControlCommand.Arguments[i].Name == "Text" ) { if ( rControlCommand.Arguments[i].Value >>= aText ) m_pComboBox->InsertEntry( aText, nPos ); @@ -318,13 +318,13 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "InsertEntry" )) + else if ( rControlCommand.Command == "InsertEntry" ) { sal_uInt16 nPos( COMBOBOX_APPEND ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Pos" )) + if ( rControlCommand.Arguments[i].Name == "Pos" ) { sal_Int32 nTmpPos = 0; if ( rControlCommand.Arguments[i].Value >>= nTmpPos ) @@ -334,17 +334,17 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f nPos = sal_uInt16( nTmpPos ); } } - else if ( rControlCommand.Arguments[i].Name.startsWith( "Text" )) + else if ( rControlCommand.Arguments[i].Name == "Text" ) rControlCommand.Arguments[i].Value >>= aText; } m_pComboBox->InsertEntry( aText, nPos ); } - else if ( rControlCommand.Command.startsWith( "RemoveEntryPos" )) + else if ( rControlCommand.Command == "RemoveEntryPos" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Pos" )) + if ( rControlCommand.Arguments[i].Name == "Pos" ) { sal_Int32 nPos( -1 ); if ( rControlCommand.Arguments[i].Value >>= nPos ) @@ -356,11 +356,11 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "RemoveEntryText" )) + else if ( rControlCommand.Command == "RemoveEntryText" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Text")) + if ( rControlCommand.Arguments[i].Name == "Text") { OUString aText; if ( rControlCommand.Arguments[i].Value >>= aText ) @@ -369,11 +369,11 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "SetDropDownLines" )) + else if ( rControlCommand.Command == "SetDropDownLines" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Lines" )) + if ( rControlCommand.Arguments[i].Name == "Lines" ) { sal_Int32 nValue( 5 ); rControlCommand.Arguments[i].Value >>= nValue; @@ -382,11 +382,11 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "SetBackgroundColor" )) + else if ( rControlCommand.Command == "SetBackgroundColor" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Color" )) + if ( rControlCommand.Arguments[i].Name == "Color" ) { com::sun::star::util::Color aColor(0); if ( rControlCommand.Arguments[i].Value >>= aColor ) @@ -398,11 +398,11 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "SetTextColor" )) + else if ( rControlCommand.Command == "SetTextColor" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Color" )) + if ( rControlCommand.Arguments[i].Name == "Color" ) { com::sun::star::util::Color aColor(0); if ( rControlCommand.Arguments[i].Value >>= aColor ) diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx index 9a5e6e7bb249..2bca0970361a 100644 --- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx +++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx @@ -214,11 +214,11 @@ long DropdownToolbarController::PreNotify( NotifyEvent& /*rNEvt*/ ) void DropdownToolbarController::executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) { - if ( rControlCommand.Command.startsWith( "SetList" )) + if ( rControlCommand.Command == "SetList" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "List" )) + if ( rControlCommand.Arguments[i].Name == "List" ) { Sequence< OUString > aList; m_pListBoxControl->Clear(); @@ -241,13 +241,13 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "AddEntry" )) + else if ( rControlCommand.Command == "AddEntry" ) { sal_uInt16 nPos( LISTBOX_APPEND ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Text" )) + if ( rControlCommand.Arguments[i].Name == "Text" ) { if ( rControlCommand.Arguments[i].Value >>= aText ) m_pListBoxControl->InsertEntry( aText, nPos ); @@ -255,13 +255,13 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "InsertEntry" )) + else if ( rControlCommand.Command == "InsertEntry" ) { sal_uInt16 nPos( LISTBOX_APPEND ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Pos" )) + if ( rControlCommand.Arguments[i].Name == "Pos" ) { sal_Int32 nTmpPos = 0; if ( rControlCommand.Arguments[i].Value >>= nTmpPos ) @@ -271,17 +271,17 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f nPos = sal_uInt16( nTmpPos ); } } - else if ( rControlCommand.Arguments[i].Name.startsWith( "Text" )) + else if ( rControlCommand.Arguments[i].Name == "Text" ) rControlCommand.Arguments[i].Value >>= aText; } m_pListBoxControl->InsertEntry( aText, nPos ); } - else if ( rControlCommand.Command.startsWith( "RemoveEntryPos" )) + else if ( rControlCommand.Command == "RemoveEntryPos" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Pos" )) + if ( rControlCommand.Arguments[i].Name == "Pos" ) { sal_Int32 nPos( -1 ); if ( rControlCommand.Arguments[i].Value >>= nPos ) @@ -293,11 +293,11 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "RemoveEntryText" )) + else if ( rControlCommand.Command == "RemoveEntryText" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Text" )) + if ( rControlCommand.Arguments[i].Name == "Text" ) { OUString aText; if ( rControlCommand.Arguments[i].Value >>= aText ) @@ -306,11 +306,11 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f } } } - else if ( rControlCommand.Command.startsWith( "SetDropDownLines" )) + else if ( rControlCommand.Command == "SetDropDownLines" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Lines" )) + if ( rControlCommand.Arguments[i].Name == "Lines" ) { sal_Int32 nValue( 5 ); rControlCommand.Arguments[i].Value >>= nValue; diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx index 26a39196ee2d..f6f6bdbdf172 100644 --- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx @@ -135,12 +135,12 @@ void ImageButtonToolbarController::executeControlCommand( const ::com::sun::star { SolarMutexGuard aSolarMutexGuard; // i73486 to be downward compatible use old and "wrong" also! - if (( rControlCommand.Command.startsWith( "SetImag" )) || - ( rControlCommand.Command.startsWith( "SetImage" )) ) + if( rControlCommand.Command == "SetImag" || + rControlCommand.Command == "SetImage" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "URL" )) + if ( rControlCommand.Arguments[i].Name == "URL" ) { OUString aURL; rControlCommand.Arguments[i].Value >>= aURL; diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx index 687e2658616f..ad0f09dc4071 100644 --- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx +++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx @@ -346,11 +346,11 @@ void SpinfieldToolbarController::executeControlCommand( const ::com::sun::star:: OUString aStep; bool bFloatValue( false ); - if ( rControlCommand.Command.startsWith( "SetStep" )) + if ( rControlCommand.Command == "SetStep" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Step" )) + if ( rControlCommand.Arguments[i].Name == "Step" ) { sal_Int32 nValue; double fValue; @@ -362,11 +362,11 @@ void SpinfieldToolbarController::executeControlCommand( const ::com::sun::star:: } } } - else if ( rControlCommand.Command.startsWith( "SetValue" )) + else if ( rControlCommand.Command == "SetValue" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Value" )) + if ( rControlCommand.Arguments[i].Name == "Value" ) { sal_Int32 nValue; double fValue; @@ -381,7 +381,7 @@ void SpinfieldToolbarController::executeControlCommand( const ::com::sun::star:: } } } - else if ( rControlCommand.Command.startsWith( "SetValues" )) + else if ( rControlCommand.Command == "SetValues" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { @@ -392,30 +392,30 @@ void SpinfieldToolbarController::executeControlCommand( const ::com::sun::star:: OUString aName = rControlCommand.Arguments[i].Name; if ( impl_getValue( rControlCommand.Arguments[i].Value, nValue, fValue, bFloat )) { - if ( aName.startsWith( "Value" )) + if ( aName == "Value" ) { aValue = bFloat ? OUString::number( fValue ) : OUString::number( nValue ); bFloatValue = bFloat; } - else if ( aName.startsWith( "Step" )) + else if ( aName == "Step" ) aStep = bFloat ? OUString::number( fValue ) : OUString::number( nValue ); - else if ( aName.startsWith( "LowerLimit" )) + else if ( aName == "LowerLimit" ) aMin = bFloat ? OUString::number( fValue ) : OUString::number( nValue ); - else if ( aName.startsWith( "UpperLimit" )) + else if ( aName == "UpperLimit" ) aMax = bFloat ? OUString::number( fValue ) : OUString::number( nValue ); } - else if ( aName.startsWith( "OutputFormat" )) + else if ( aName == "OutputFormat" ) rControlCommand.Arguments[i].Value >>= m_aOutFormat; } } - else if ( rControlCommand.Command.startsWith( "SetLowerLimit" )) + else if ( rControlCommand.Command == "SetLowerLimit" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "LowerLimit" )) + if ( rControlCommand.Arguments[i].Name == "LowerLimit" ) { sal_Int32 nValue; double fValue; @@ -427,11 +427,11 @@ void SpinfieldToolbarController::executeControlCommand( const ::com::sun::star:: } } } - else if ( rControlCommand.Command.startsWith( "SetUpperLimit" )) + else if ( rControlCommand.Command == "SetUpperLimit" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "UpperLimit" )) + if ( rControlCommand.Arguments[i].Name == "UpperLimit" ) { sal_Int32 nValue; double fValue; @@ -443,11 +443,11 @@ void SpinfieldToolbarController::executeControlCommand( const ::com::sun::star:: } } } - else if ( rControlCommand.Command.startsWith( "SetOutputFormat" )) + else if ( rControlCommand.Command == "SetOutputFormat" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "OutputFormat" )) + if ( rControlCommand.Arguments[i].Name == "OutputFormat" ) { rControlCommand.Arguments[i].Value >>= m_aOutFormat; break; diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx index 27ec3940199d..58bddcecfb67 100644 --- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx @@ -142,11 +142,11 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta if (( m_eStyle == STYLE_DROPDOWNBUTTON ) || ( m_eStyle == STYLE_TOGGLE_DROPDOWNBUTTON )) { - if ( rControlCommand.Command.startsWith( "SetList" )) + if ( rControlCommand.Command == "SetList" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "List" )) + if ( rControlCommand.Arguments[i].Name == "List" ) { Sequence< OUString > aList; m_aDropdownMenuList.clear(); @@ -167,11 +167,11 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta } } } - else if ( rControlCommand.Command.startsWith( "CheckItemPos" )) + else if ( rControlCommand.Command == "CheckItemPos" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Pos" )) + if ( rControlCommand.Arguments[i].Name == "Pos" ) { sal_Int32 nPos( -1 ); @@ -194,12 +194,12 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta } } } - else if ( rControlCommand.Command.startsWith( "AddEntry" )) + else if ( rControlCommand.Command == "AddEntry" ) { OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Text" )) + if ( rControlCommand.Arguments[i].Name == "Text" ) { if ( rControlCommand.Arguments[i].Value >>= aText ) m_aDropdownMenuList.push_back( aText ); @@ -207,14 +207,14 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta } } } - else if ( rControlCommand.Command.startsWith( "InsertEntry")) + else if ( rControlCommand.Command == "InsertEntry" ) { sal_Int32 nPos( COMBOBOX_APPEND ); sal_Int32 nSize = sal_Int32( m_aDropdownMenuList.size() ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Pos" )) + if ( rControlCommand.Arguments[i].Name == "Pos" ) { sal_Int32 nTmpPos = 0; if ( rControlCommand.Arguments[i].Value >>= nTmpPos ) @@ -223,7 +223,7 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta nPos = nTmpPos; } } - else if ( rControlCommand.Arguments[i].Name.startsWith( "Text" )) + else if ( rControlCommand.Arguments[i].Name == "Text" ) rControlCommand.Arguments[i].Value >>= aText; } @@ -231,11 +231,11 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta aIter += nPos; m_aDropdownMenuList.insert( aIter, aText ); } - else if ( rControlCommand.Command.startsWith( "RemoveEntryPos" )) + else if ( rControlCommand.Command == "RemoveEntryPos" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Pos" )) + if ( rControlCommand.Arguments[i].Name == "Pos" ) { sal_Int32 nPos( -1 ); if ( rControlCommand.Arguments[i].Value >>= nPos ) @@ -249,11 +249,11 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta } } } - else if ( rControlCommand.Command.startsWith( "RemoveEntryText" )) + else if ( rControlCommand.Command == "RemoveEntryText" ) { for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { - if ( rControlCommand.Arguments[i].Name.startsWith( "Text" )) + if ( rControlCommand.Arguments[i].Name == "Text" ) { OUString aText; if ( rControlCommand.Arguments[i].Value >>= aText ) diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx index dc659100c6cc..5f518f760009 100644 --- a/framework/source/uielement/toolbarwrapper.cxx +++ b/framework/source/uielement/toolbarwrapper.cxx @@ -130,7 +130,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th PropertyValue aPropValue; if ( aArguments[i] >>= aPropValue ) { - if ( aPropValue.Name.startsWith( "PopupMode" )) + if ( aPropValue.Name == "PopupMode" ) { aPropValue.Value >>= bPopupMode; break; diff --git a/framework/source/uifactory/addonstoolboxfactory.cxx b/framework/source/uifactory/addonstoolboxfactory.cxx index 7c7261ed1743..2c51b9d8d425 100644 --- a/framework/source/uifactory/addonstoolboxfactory.cxx +++ b/framework/source/uifactory/addonstoolboxfactory.cxx @@ -113,18 +113,18 @@ sal_Bool AddonsToolBoxFactory::hasButtonsInContext( const Sequence< PropertyValue >& rPropSeq = rPropSeqSeq[i]; for ( sal_uInt32 j = 0; j < (sal_uInt32)rPropSeq.getLength(); j++ ) { - if ( rPropSeq[j].Name.startsWith( "Context" )) + if ( rPropSeq[j].Name == "Context" ) { OUString aContextList; if ( rPropSeq[j].Value >>= aContextList ) bIsCorrectContext = IsCorrectContext( aModuleIdentifier, aContextList ); nPropChecked++; } - else if ( rPropSeq[j].Name.startsWith( "URL" )) + else if ( rPropSeq[j].Name == "URL" ) { OUString aURL; rPropSeq[j].Value >>= aURL; - bIsButton = !aURL.startsWith( "private:separator" ); + bIsButton = aURL != "private:separator" ; nPropChecked++; } diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx index 181f9d696f93..ebeece1086f7 100644 --- a/sc/source/core/tool/formulaopt.cxx +++ b/sc/source/core/tool/formulaopt.cxx @@ -73,7 +73,7 @@ void ScFormulaOptions::GetDefaultFormulaSeparators( const Locale& rLocale = *ScGlobal::GetLocale(); const OUString& rLang = rLocale.Language; - if (rLang.startsWith("ru")) + if (rLang == "ru") // Don't do automatic guess for these languages, and fall back to // the old separator set. return; @@ -97,7 +97,7 @@ void ScFormulaOptions::GetDefaultFormulaSeparators( cListSep = ','; // Special case for de_CH locale. - if (rLocale.Language.startsWith("de") && rLocale.Country.startsWith("CH")) + if (rLocale.Language == "de" && rLocale.Country == "CH") cListSep = ';'; // by default, the parameter separator equals the locale-specific diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index db4b1ee3292f..e2af13224428 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -1816,7 +1816,7 @@ SvXMLImportContext *ScXMLDeletionContext::CreateChildContext( sal_uInt16 nPrefix pContext = new ScXMLDependingsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper); else if (IsXMLToken(rLocalName, XML_DELETIONS)) pContext = new ScXMLDeletionsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper); - else if (IsXMLToken(rLocalName, XML_CUT_OFFS) || rLocalName.startsWith("cut_offs")) + else if (IsXMLToken(rLocalName, XML_CUT_OFFS) || rLocalName == "cut_offs") pContext = new ScXMLCutOffsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper); else { diff --git a/sc/source/filter/xml/xmlcvali.cxx b/sc/source/filter/xml/xmlcvali.cxx index fc127f883242..92a2f8ddb74a 100644 --- a/sc/source/filter/xml/xmlcvali.cxx +++ b/sc/source/filter/xml/xmlcvali.cxx @@ -427,8 +427,8 @@ void ScXMLContentValidationContext::EndElement() for( sal_Int32 i = 0; i < nLength; i++ ) { // #i47525# must allow "MacroName" or "Script" - if ( aValues[i].Name.startsWith( "MacroName" ) || - aValues[i].Name.startsWith( "Script" ) ) + if ( aValues[i].Name == "MacroName" || + aValues[i].Name == "Script" ) { aValues[i].Value >>= sErrorTitle; break; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 8fbeb8ab22ff..eadcd3b97042 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2149,7 +2149,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x if (bGetMerge) bGetMerge = GetMerged(pAddresses, xTable); pCellStyles->AddRangeStyleName(*pAddresses, nIndex, false, nValidationIndex, nNumberFormat); - if (!sStyleName.startsWith("Default") || nValidationIndex != -1) + if( sStyleName != "Default" || nValidationIndex != -1 ) { pSharedData->SetLastColumn(nTable, pAddresses->EndColumn); pSharedData->SetLastRow(nTable, pAddresses->EndRow); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 08996c469175..d0e030ce5786 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2761,36 +2761,28 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode ) if ( pAuto ) { OUString aReplace(pAuto->GetStartDoubleQuote()); - if (aReplace.isEmpty()) + if( aReplace.isEmpty() ) aReplace = ScGlobal::pLocaleData->getDoubleQuotationMarkStart(); - if (!aReplace.startsWith("\"")) - aString = aString.replaceAll( - aReplace, - OUString("\"")); + if( aReplace != "\"" ) + aString = aString.replaceAll( aReplace, "\"" ); aReplace = OUString(pAuto->GetEndDoubleQuote()); - if (aReplace.isEmpty()) + if( aReplace.isEmpty() ) aReplace = ScGlobal::pLocaleData->getDoubleQuotationMarkEnd(); - if (!aReplace.startsWith("\"")) - aString = aString.replaceAll( - aReplace, - OUString("\"")); + if( aReplace != "\"" ) + aString = aString.replaceAll( aReplace, "\"" ); aReplace = OUString(pAuto->GetStartSingleQuote()); - if (aReplace.isEmpty()) + if( aReplace.isEmpty() ) aReplace = ScGlobal::pLocaleData->getQuotationMarkStart(); - if (!aReplace.startsWith("'")) - aString = aString.replaceAll( - aReplace, - OUString("'")); + if( aReplace != "'" ) + aString = aString.replaceAll( aReplace, "'" ); aReplace = OUString(pAuto->GetEndSingleQuote()); - if (aReplace.isEmpty()) + if( aReplace.isEmpty() ) aReplace = ScGlobal::pLocaleData->getQuotationMarkEnd(); - if (!aReplace.startsWith("'")) - aString = aString.replaceAll( - aReplace, - OUString("'")); + if( aReplace != "'" ) + aString = aString.replaceAll( aReplace, "'"); } } diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 146245afcd12..beb36f7a7e21 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -602,8 +602,8 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util if ( pDispatch && ( - (aURL.Protocol.startsWith( ".uno:" ) && aURL.Path == aDispatchURL.Path) || - (aURL.Protocol.startsWith( "slot:" ) && aURL.Path.toInt32() == GetId()) + (aURL.Protocol == ".uno:" && aURL.Path == aDispatchURL.Path) || + (aURL.Protocol == "slot:" && aURL.Path.toInt32() == GetId()) ) ) { @@ -629,17 +629,17 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util for( sal_Int32 n=0; n<nCount; n++ ) { const ::com::sun::star::beans::PropertyValue& rProp = aArgs[n]; - if( rProp.Name.startsWith("SynchronMode")) + if( rProp.Name == "SynchronMode" ) { if( rProp.Value >>=bTemp ) nCall = bTemp ? SFX_CALLMODE_SYNCHRON : SFX_CALLMODE_ASYNCHRON; } - else if( rProp.Name.startsWith("Bookmark")) + else if( rProp.Name == "Bookmark" ) { nMarkArg = n; aAddArgs.push_back( aArgs[n] ); } - else if( rProp.Name.startsWith("KeyModifier")) + else if( rProp.Name == "KeyModifier" ) rProp.Value >>= nModifier; else aAddArgs.push_back( aArgs[n] ); diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 10e950fa0430..06325fe4b568 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -889,9 +889,9 @@ bool XLineDashItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 { for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ ) { - if ( aPropSeq[n].Name.startsWith( "Name" )) + if ( aPropSeq[n].Name == "Name" ) aPropSeq[n].Value >>= aName; - else if ( aPropSeq[n].Name.startsWith( "LineDash" )) + else if ( aPropSeq[n].Name == "LineDash" ) { if ( aPropSeq[n].Value >>= aLineDash ) bLineDash = true; diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 5e0bdb201a6c..163085b26961 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -599,7 +599,7 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i]; Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY ); sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get(); - if ( bOwnModel && rEvt.PropertyName.startsWith( "ImageURL" )) + if ( bOwnModel && rEvt.PropertyName == "ImageURL" ) { OUString aImageURL; Reference< graphic::XGraphic > xGraphic; diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index de9ffde993e3..c6d268db790f 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -269,12 +269,12 @@ void UnoControl::ImplSetPeerProperty( const OUString& rPropName, const Any& rVal { // We now support a mapping for language dependent properties. This is the // central method to implement it. - if (( rPropName.startsWith( "Text" )) || - ( rPropName.startsWith( "Label" )) || - ( rPropName.startsWith( "Title" )) || - ( rPropName.startsWith( "HelpText" )) || - ( rPropName.startsWith( "CurrencySymbol" )) || - ( rPropName.startsWith( "StringItemList" )) ) + if( rPropName == "Text" || + rPropName == "Label" || + rPropName == "Title" || + rPropName == "HelpText" || + rPropName == "CurrencySymbol" || + rPropName == "StringItemList" ) { OUString aValue; uno::Sequence< OUString > aSeqValue; @@ -505,7 +505,7 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent // Detect changes on our resource resolver which invalidates // automatically some language dependent properties. - if ( pEvents->PropertyName.startsWith( "ResourceResolver" )) + if ( pEvents->PropertyName == "ResourceResolver" ) { Reference< resource::XStringResourceResolver > xStrResolver; if ( pEvents->NewValue >>= xStrResolver ) diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index fcd5e25e5985..c3b878df4b37 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -167,7 +167,7 @@ rtl_TextEncoding x11::getTextPlainEncoding( const OUString& rMimeType ) rtl_TextEncoding aEncoding = RTL_TEXTENCODING_DONTKNOW; OUString aMimeType( rMimeType.toAsciiLowerCase() ); sal_Int32 nIndex = 0; - if( aMimeType.getToken( 0, ';', nIndex ).startsWith( "text/plain" ) ) + if( aMimeType.getToken( 0, ';', nIndex ) == "text/plain" ) { if( aMimeType.getLength() == 10 ) // only "text/plain" aEncoding = RTL_TEXTENCODING_ISO_8859_1; @@ -177,7 +177,7 @@ rtl_TextEncoding x11::getTextPlainEncoding( const OUString& rMimeType ) { OUString aToken = aMimeType.getToken( 0, ';', nIndex ); sal_Int32 nPos = 0; - if( aToken.getToken( 0, '=', nPos ).startsWith( "charset" ) ) + if( aToken.getToken( 0, '=', nPos ) == "charset" ) { OString aEncToken = OUStringToOString( aToken.getToken( 0, '=', nPos ), RTL_TEXTENCODING_ISO_8859_1 ); aEncoding = rtl_getTextEncodingFromUnixCharset( aEncToken.getStr() ); @@ -1051,7 +1051,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ OUStringToOString( rType, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif - if( rType.startsWith( "text/plain;charset=utf-16" ) ) + if( rType == "text/plain;charset=utf-16" ) { // lets see if we have UTF16 else try to find something convertible if( it->second->m_aTypes.getLength() && ! it->second->m_bHaveUTF16 ) @@ -1105,7 +1105,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ } } } - else if( rType.startsWith( "image/bmp" ) ) + else if( rType == "image/bmp" ) { // #i83376# try if someone has the data in image/bmp already before // doing the PIXMAP stuff (e.g. the gimp has this) @@ -1350,7 +1350,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor > pFlavors->MimeType = convertTypeFromNative( *pAtoms, selection, nFormat ); pFlavors->DataType = getCppuType( (Sequence< sal_Int8 >*)0 ); sal_Int32 nIndex = 0; - if( pFlavors->MimeType.getToken( 0, ';', nIndex ).startsWith( "text/plain" ) ) + if( pFlavors->MimeType.getToken( 0, ';', nIndex ) == "text/plain" ) { OUString aToken(pFlavors->MimeType.getToken( 0, ';', nIndex )); // omit text/plain;charset=unicode since it is not well defined diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx index 02bc33a7e843..2a0bfbae72fd 100644 --- a/xmloff/source/draw/XMLImageMapExport.cxx +++ b/xmloff/source/draw/XMLImageMapExport.cxx @@ -193,7 +193,7 @@ void XMLImageMapExport::ExportMapEntry( mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, - sTargt.startsWith( "_blank" ) ? XML_NEW : XML_REPLACE ); + sTargt == "_blank" ? XML_NEW : XML_REPLACE ); } // name diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index 4d496a7b5940..6a303e6189ab 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -242,7 +242,7 @@ void XMLEventExport::ExportEvent( } else { - if (! sType.startsWith("None")) + if ( sType != "None" ) { OSL_FAIL("unknown event type returned by API"); // unknown type -> error (ignore) diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index af4e9d2eda73..e52160f9f2e1 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2716,7 +2716,7 @@ void XMLTextFieldExport::ProcessBibliographyData( sal_Int32 nLength = aValues.getLength(); for (sal_Int32 i = 0; i < nLength; i++) { - if (aValues[i].Name.startsWith("BibiliographicType")) + if( aValues[i].Name == "BibiliographicType" ) { sal_Int16 nTypeId = 0; aValues[i].Value >>= nTypeId; @@ -3327,127 +3327,127 @@ enum XMLTokenEnum XMLTextFieldExport::MapBibliographyFieldName(OUString sName) { enum XMLTokenEnum eName = XML_TOKEN_INVALID; - if (sName.startsWith("Identifier")) + if( sName == "Identifier" ) { eName = XML_IDENTIFIER; } - else if (sName.startsWith("BibiliographicType")) + else if( sName == "BibiliographicType" ) { eName = XML_BIBLIOGRAPHY_TYPE; } - else if (sName.startsWith("Address")) + else if( sName == "Address" ) { eName = XML_ADDRESS; } - else if (sName.startsWith("Annote")) + else if( sName == "Annote" ) { eName = XML_ANNOTE; } - else if (sName.startsWith("Author")) + else if( sName == "Author" ) { eName = XML_AUTHOR; } - else if (sName.startsWith("Booktitle")) + else if( sName == "Booktitle" ) { eName = XML_BOOKTITLE; } - else if (sName.startsWith("Chapter")) + else if( sName == "Chapter" ) { eName = XML_CHAPTER; } - else if (sName.startsWith("Edition")) + else if( sName == "Edition" ) { eName = XML_EDITION; } - else if (sName.startsWith("Editor")) + else if( sName == "Editor" ) { eName = XML_EDITOR; } - else if (sName.startsWith("Howpublished")) + else if( sName == "Howpublished" ) { eName = XML_HOWPUBLISHED; } - else if (sName.startsWith("Institution")) + else if( sName == "Institution" ) { eName = XML_INSTITUTION; } - else if (sName.startsWith("Journal")) + else if( sName == "Journal" ) { eName = XML_JOURNAL; } - else if (sName.startsWith("Month")) + else if( sName =="Month" ) { eName = XML_MONTH; } - else if (sName.startsWith("Note")) + else if( sName == "Note" ) { eName = XML_NOTE; } - else if (sName.startsWith("Number")) + else if( sName == "Number" ) { eName = XML_NUMBER; } - else if (sName.startsWith("Organizations")) + else if( sName == "Organizations" ) { eName = XML_ORGANIZATIONS; } - else if (sName.startsWith("Pages")) + else if( sName == "Pages" ) { eName = XML_PAGES; } - else if (sName.startsWith("Publisher")) + else if( sName == "Publisher" ) { eName = XML_PUBLISHER; } - else if (sName.startsWith("School")) + else if( sName == "School" ) { eName = XML_SCHOOL; } - else if (sName.startsWith("Series")) + else if( sName == "Series" ) { eName = XML_SERIES; } - else if (sName.startsWith("Title")) + else if( sName == "Title" ) { eName = XML_TITLE; } - else if (sName.startsWith("Report_Type")) + else if( sName == "Report_Type" ) { eName = XML_REPORT_TYPE; } - else if (sName.startsWith("Volume")) + else if( sName == "Volume" ) { eName = XML_VOLUME; } - else if (sName.startsWith("Year")) + else if( sName == "Year" ) { eName = XML_YEAR; } - else if (sName.startsWith("URL")) + else if( sName == "URL" ) { eName = XML_URL; } - else if (sName.startsWith("Custom1")) + else if( sName == "Custom1" ) { eName = XML_CUSTOM1; } - else if (sName.startsWith("Custom2")) + else if( sName == "Custom2" ) { eName = XML_CUSTOM2; } - else if (sName.startsWith("Custom3")) + else if( sName == "Custom3" ) { eName = XML_CUSTOM3; } - else if (sName.startsWith("Custom4")) + else if( sName == "Custom4" ) { eName = XML_CUSTOM4; } - else if (sName.startsWith("Custom5")) + else if( sName == "Custom5" ) { eName = XML_CUSTOM5; } - else if (sName.startsWith("ISBN")) + else if( sName == "ISBN" ) { eName = XML_ISBN; } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 8ee117da5d49..4b5dead0108d 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3304,8 +3304,7 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( { GetExport().AddAttribute( XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, sTargetFrame ); - enum XMLTokenEnum eTok = - sTargetFrame.startsWith( "_blank" ) ? XML_NEW : XML_REPLACE; + enum XMLTokenEnum eTok = sTargetFrame == "_blank" ? XML_NEW : XML_REPLACE; GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, eTok ); } |