diff options
55 files changed, 221 insertions, 223 deletions
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 56fd92d1a980..7f73de093a97 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -874,7 +874,7 @@ bool isEmbeddedInDatabase( const Reference< XInterface >& _rxComponent, Referenc const PropertyValue* pContextEnd = pContextIter + aDocumentContext.getLength(); for(;pContextIter != pContextEnd;++pContextIter) { - if ( pContextIter->Name.startsWith( "ActiveConnection" ) + if ( pContextIter->Name == "ActiveConnection" && ( pContextIter->Value >>= _rxActualConnection ) ) { diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx index 41a2059e6d38..e380248bf6bb 100644 --- a/cppu/source/uno/lbmap.cxx +++ b/cppu/source/uno/lbmap.cxx @@ -390,7 +390,7 @@ static Mapping loadExternalMapping( OUString aName; uno_ext_getMappingFunc fpGetMapFunc = 0; - if (EnvDcp::getTypeName(rFrom.getTypeName()).startsWith( UNO_LB_UNO )) + if (EnvDcp::getTypeName(rFrom.getTypeName()) == UNO_LB_UNO) { aName = getBridgeName( rTo, rFrom, rAddPurpose ); fpGetMapFunc = selectMapFunc( aName ); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 87414e4249ef..b8e58b149de0 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -411,8 +411,8 @@ SvxConfigPage::CanConfig( const OUString& aModuleId ) OUString GetModuleName( const OUString& aModuleId ) { - if ( aModuleId.startsWith( "com.sun.star.text.TextDocument" ) || - aModuleId.startsWith( "com.sun.star.text.GlobalDocument" ) ) + if ( aModuleId == "com.sun.star.text.TextDocument" || + aModuleId == "com.sun.star.text.GlobalDocument" ) return OUString("Writer"); else if ( aModuleId == "com.sun.star.text.WebDocument" ) return OUString("Writer/Web"); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 04e995b29613..b3089e5e4054 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1613,9 +1613,9 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) { // text document ResStringArray& rTextArray = aDlgResource.GetTextArray(); - if ( aFactory.startsWith( "com.sun.star.text.TextDocument" ) - || aFactory.startsWith( "com.sun.star.text.WebDocument" ) - || aFactory.startsWith( "com.sun.star.text.GlobalDocument" ) ) + if ( aFactory == "com.sun.star.text.TextDocument" + || aFactory == "com.sun.star.text.WebDocument" + || aFactory == "com.sun.star.text.GlobalDocument" ) { SfxModule* pSwMod = (*(SfxModule**) GetAppData(SHL_WRITER)); if ( !lcl_isOptionHidden( SID_SW_EDITOPTIONS, aOptionsDlgOpt ) ) diff --git a/dtrans/source/cnttype/mcnttype.cxx b/dtrans/source/cnttype/mcnttype.cxx index 1e95d92803b6..150668d94895 100644 --- a/dtrans/source/cnttype/mcnttype.cxx +++ b/dtrans/source/cnttype/mcnttype.cxx @@ -170,7 +170,7 @@ void SAL_CALL CMimeContentType::acceptSym( const OUString& pSymTlb ) void SAL_CALL CMimeContentType::skipSpaces( void ) { - while (m_nxtSym.startsWith(SPACE)) + while (m_nxtSym == SPACE) getSym( ); } @@ -353,8 +353,8 @@ OUString SAL_CALL CMimeContentType::quotedPValue( ) while ( !m_nxtSym.isEmpty( ) ) { if ( bAfterQuoteSign && ( - (m_nxtSym.startsWith(SPACE)) || - (m_nxtSym.startsWith(SEMICOLON))) + (m_nxtSym == SPACE) || + (m_nxtSym == SEMICOLON)) ) { break; diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index b05d481cc690..e838c4e38b29 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -652,7 +652,7 @@ sal_Bool EdtAutoCorrDoc::SetAttr(sal_Int32 nStt, sal_Int32 nEnd, { SfxItemPool* pPool = &mpEditEngine->GetEditDoc().GetItemPool(); while ( pPool->GetSecondaryPool() && - !pPool->GetName().startsWith("EditEngineItemPool") ) + pPool->GetName() != "EditEngineItemPool" ) { pPool = pPool->GetSecondaryPool(); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index b5168f6f6944..515565cef199 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -158,13 +158,13 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel ) // The SvRTF parser expects the Which-mapping passed on in the pool, not // dependent on a secondary. SfxItemPool* pPool = &aEditDoc.GetItemPool(); - while (pPool->GetSecondaryPool() && !pPool->GetName().startsWith("EditEngineItemPool")) - { + while (pPool->GetSecondaryPool() && pPool->GetName() != "EditEngineItemPool") + { pPool = pPool->GetSecondaryPool(); } - DBG_ASSERT(pPool && pPool->GetName().startsWith("EditEngineItemPool"), + DBG_ASSERT(pPool && pPool->GetName() == "EditEngineItemPool", "ReadRTF: no EditEnginePool!"); EditRTFParserRef xPrsr = new EditRTFParser(rInput, aSel, *pPool, pEditEngine); diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 8b1e59fa2665..3dab5b0d7cf7 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -1166,7 +1166,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) const SfxItemPool *pPool = SfxItemPool::GetStoringPool(); const bool bStoreDefTabs = pPool - && pPool->GetName().startsWith("SWG") + && pPool->GetName() == "SWG" && ::IsDefaultItem( this ); const short nTabs = Count(); diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx index d28f30b8ed36..6bba050ea12e 100644 --- a/embeddedobj/source/msole/ownview.cxx +++ b/embeddedobj/source/msole/ownview.cxx @@ -242,7 +242,7 @@ OUString OwnView_Impl::GetFilterNameFromExtentionAndInStream( { for ( sal_Int32 nInd = 0; nInd < aTypes.getLength(); nInd++ ) { - if ( aTypes[nInd].Name.startsWith( "PreferredFilter" ) && ( aTypes[nInd].Value >>= aFilterName ) ) + if ( aTypes[nInd].Name == "PreferredFilter" && ( aTypes[nInd].Value >>= aFilterName ) ) { aTypes[nInd].Value >>= aFilterName; break; @@ -589,7 +589,7 @@ void SAL_CALL OwnView_Impl::notifyEvent( const document::EventObject& aEvent ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( aEvent.Source == m_xModel && aEvent.EventName.startsWith( "OnSaveAsDone" ) ) + if ( aEvent.Source == m_xModel && aEvent.EventName == "OnSaveAsDone" ) { // SaveAs operation took place, so just forget the model and deregister listeners xModel = m_xModel; diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx index ae7a49e1725c..fecf12f1695c 100644 --- a/extensions/source/update/check/updatecheckjob.cxx +++ b/extensions/source/update/check/updatecheckjob.cxx @@ -226,7 +226,7 @@ UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues) m_pInitThread.reset( new InitUpdateCheckJobThread( m_xContext, aConfig, - !aEventName.startsWith("onFirstVisibleTask"))); + aEventName != "onFirstVisibleTask")); return uno::Any(); } diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index fa697ee0beae..c5fb1936374a 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -1079,7 +1079,7 @@ basegfx::B2DRange getUnrotatedGroupBoundRange(const Reference< XShape >& rxShape { if(rxShape.is()) { - if(rxShape->getShapeType().startsWith("com.sun.star.drawing.GroupShape")) + if(rxShape->getShapeType() == "com.sun.star.drawing.GroupShape") { // it's a group shape, iterate over children const Reference< XIndexAccess > xXIndexAccess(rxShape, UNO_QUERY); diff --git a/filter/source/placeware/filter.cxx b/filter/source/placeware/filter.cxx index 9077bcb44777..55812d982def 100644 --- a/filter/source/placeware/filter.cxx +++ b/filter/source/placeware/filter.cxx @@ -89,15 +89,15 @@ sal_Bool SAL_CALL PlaceWareExportFilter::filter( const ::com::sun::star::uno::Se Reference < XStatusIndicator > xStatusIndicator; for ( sal_Int32 i = 0 ; i < nLength; i++) { - if ( pValue[i].Name.startsWith( "OutputStream" ) ) + if ( pValue[i].Name == "OutputStream" ) { pValue[i].Value >>= xOutputStream; } - else if( pValue[i].Name.startsWith( "URL" ) ) + else if( pValue[i].Name == "URL" ) { pValue[i].Value >>= sURL; } - else if( pValue[i].Name.startsWith( "InteractionHandler" ) ) + else if( pValue[i].Name == "InteractionHandler" ) { pValue[i].Value >>= xInteractionHandler; } diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 0e13d7b2d859..869f98104938 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1115,7 +1115,7 @@ void XMLFilterSettingsDialog::initFilterList() } // if this is not a XmlFilterAdaptor entry, skip it - if( !aFilterService.startsWith( "com.sun.star.comp.Writer.XmlFilterAdaptor" ) ) + if( aFilterService != "com.sun.star.comp.Writer.XmlFilterAdaptor" ) continue; diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx index b8d7a8bc6ed4..3b81cbad5a9d 100644 --- a/framework/source/fwe/xml/menudocumenthandler.cxx +++ b/framework/source/fwe/xml/menudocumenthandler.cxx @@ -294,7 +294,7 @@ void SAL_CALL OReadMenuDocumentHandler::endElement( const OUString& aName ) m_xReader->endDocument(); m_xReader.clear(); m_bMenuBarMode = sal_False; - if ( !aName.startsWith( ELEMENT_MENUBAR )) + if ( aName != ELEMENT_MENUBAR ) { OUString aErrorMessage = getErrorLineString(); aErrorMessage += "closing element menubar expected!"; @@ -442,7 +442,7 @@ void OReadMenuBarHandler::endElement( const OUString& aName ) m_xReader->endDocument(); m_xReader.clear(); m_bMenuMode = sal_False; - if ( !aName.startsWith( ELEMENT_MENU )) + if ( aName != ELEMENT_MENU ) { OUString aErrorMessage = getErrorLineString(); aErrorMessage += "closing element menu expected!"; @@ -528,7 +528,7 @@ void SAL_CALL OReadMenuHandler::endElement( const OUString& aName ) m_xReader->endDocument(); m_xReader.clear(); m_bMenuPopupMode = sal_False; - if ( !aName.startsWith( ELEMENT_MENUPOPUP )) + if ( aName != ELEMENT_MENUPOPUP ) { OUString aErrorMessage = getErrorLineString(); aErrorMessage += "closing element menupopup expected!"; @@ -732,7 +732,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName ) m_xReader->endDocument(); m_xReader.clear(); m_bMenuMode = sal_False; - if ( !aName.startsWith( ELEMENT_MENU )) + if ( aName != ELEMENT_MENU ) { OUString aErrorMessage = getErrorLineString(); aErrorMessage += "closing element menu expected!"; @@ -746,7 +746,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName ) { if ( m_nNextElementExpected == ELEM_CLOSE_MENUITEM ) { - if ( !aName.startsWith( ELEMENT_MENUITEM )) + if ( aName != ELEMENT_MENUITEM ) { OUString aErrorMessage = getErrorLineString(); aErrorMessage += "closing element menuitem expected!"; @@ -755,7 +755,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName ) } else if ( m_nNextElementExpected == ELEM_CLOSE_MENUSEPARATOR ) { - if ( !aName.startsWith( ELEMENT_MENUSEPARATOR )) + if ( aName != ELEMENT_MENUSEPARATOR ) { OUString aErrorMessage = getErrorLineString(); aErrorMessage += "closing element menuseparator expected!"; @@ -847,8 +847,8 @@ throw ( SAXException, RuntimeException ) ExtractMenuParameters( aProps, aCommandURL, aLabel, aHelpURL, xSubMenu, nType, nItemBits ); if ( xSubMenu.is() ) { - if ( aCommandURL.startsWith(ADDDIRECT_CMD) || - aCommandURL.startsWith(AUTOPILOTMENU_CMD) ) + if ( aCommandURL == ADDDIRECT_CMD || + aCommandURL == AUTOPILOTMENU_CMD ) { WriteMenuItem( aCommandURL, aLabel, aHelpURL, nItemBits ); bSeparator = sal_False; @@ -862,7 +862,7 @@ throw ( SAXException, RuntimeException ) m_aAttributeType, aCommandURL ); - if ( !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL)) ) + if ( aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL ) pListMenu->AddAttribute( OUString( ATTRIBUTE_NS_LABEL ), m_aAttributeType, aLabel ); @@ -921,13 +921,13 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons aHelpURL ); } - if ( !aLabel.isEmpty() && !aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL) ) + if ( !aLabel.isEmpty() && aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL ) { pList->AddAttribute( OUString( ATTRIBUTE_NS_LABEL ), m_aAttributeType, aLabel ); } - if (( nStyle > 0 ) && !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL) )) + if (( nStyle > 0 ) && aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL ) { OUString aValue; MenuStyleItem* pStyle = MenuItemStyles; diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx index e066719e0c90..05a0cfd3a9ac 100644 --- a/framework/source/jobs/jobexecutor.cxx +++ b/framework/source/jobs/jobexecutor.cxx @@ -272,8 +272,8 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent // Special feature: If the events "OnNew" or "OnLoad" occurs - we generate our own event "onDocumentOpened". if ( - (aEvent.EventName.startsWith(EVENT_ON_NEW)) || - (aEvent.EventName.startsWith(EVENT_ON_LOAD)) + (aEvent.EventName == EVENT_ON_NEW) || + (aEvent.EventName == EVENT_ON_LOAD) ) { if (m_lEvents.find(EVENT_ON_DOCUMENT_OPENED) != m_lEvents.end()) @@ -282,8 +282,8 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent // Special feature: If the events "OnCreate" or "OnLoadFinished" occurs - we generate our own event "onDocumentAdded". if ( - (aEvent.EventName.startsWith(EVENT_ON_CREATE)) || - (aEvent.EventName.startsWith(EVENT_ON_LOAD_FINISHED)) + (aEvent.EventName == EVENT_ON_CREATE) || + (aEvent.EventName == EVENT_ON_LOAD_FINISHED) ) { if (m_lEvents.find(EVENT_ON_DOCUMENT_ADDED) != m_lEvents.end()) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index cd9d3493b7e4..badab99a40f3 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1743,8 +1743,8 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent // new document => put it into the internal list if ( - (aEvent.EventName.startsWith(EVENT_ON_NEW)) || - (aEvent.EventName.startsWith(EVENT_ON_LOAD)) + (aEvent.EventName == EVENT_ON_NEW) || + (aEvent.EventName == EVENT_ON_LOAD) ) { implts_registerDocument(xDocument); @@ -1760,17 +1760,17 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent for the moment, till this other save requests will be finished. */ else if ( - (aEvent.EventName.startsWith(EVENT_ON_SAVE)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVEAS)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVETO)) + (aEvent.EventName == EVENT_ON_SAVE) || + (aEvent.EventName == EVENT_ON_SAVEAS) || + (aEvent.EventName == EVENT_ON_SAVETO) ) { implts_updateDocumentUsedForSavingState(xDocument, SAVE_IN_PROGRESS); } // document saved => remove tmp. files - but hold config entries alive! else if ( - (aEvent.EventName.startsWith(EVENT_ON_SAVEDONE)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVEASDONE)) + (aEvent.EventName == EVENT_ON_SAVEDONE) || + (aEvent.EventName == EVENT_ON_SAVEASDONE) ) { implts_markDocumentAsSaved(xDocument); @@ -1790,9 +1790,9 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent // But we can reset the state "used for other save requests". Otherwhise // these documents will never be saved! else if ( - (aEvent.EventName.startsWith(EVENT_ON_SAVEFAILED)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVEASFAILED)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVETOFAILED)) + (aEvent.EventName == EVENT_ON_SAVEFAILED) || + (aEvent.EventName == EVENT_ON_SAVEASFAILED) || + (aEvent.EventName == EVENT_ON_SAVETOFAILED) ) { implts_updateDocumentUsedForSavingState(xDocument, SAVE_FINISHED); @@ -3890,7 +3890,7 @@ css::frame::FeatureStateEvent AutoRecovery::implst_createFeatureStateEvent( aEvent.FeatureURL.Complete = AutoRecovery::implst_getJobDescription(eJob); aEvent.FeatureDescriptor = sEventType; - if (pInfo && sEventType.startsWith(OPERATION_UPDATE)) + if (pInfo && sEventType == OPERATION_UPDATE) { // pack rInfo for transport via UNO ::comphelper::NamedValueCollection aInfo; diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index 9857350998e3..c424aa28c7bb 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -521,7 +521,7 @@ void SAL_CALL NewMenuController::initialize( const Sequence< Any >& aArguments ) const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); m_bShowImages = rSettings.GetUseImagesInMenus(); - m_bNewMenu = m_aCommandURL.startsWith( ".uno:AddDirect" ); + m_bNewMenu = m_aCommandURL == ".uno:AddDirect"; } } } diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 82136bfdd4c0..91340111778d 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -324,7 +324,7 @@ void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s", OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() ); - if ( aCommand.startsWith( CMD_CLEAR_LIST ) ) + if ( aCommand == CMD_CLEAR_LIST ) { SvtHistoryOptions().Clear( ePICKLIST ); dispatchCommand( diff --git a/framework/source/uielement/statusbarmerger.cxx b/framework/source/uielement/statusbarmerger.cxx index 667929f7cfc6..f62af3e51e35 100644 --- a/framework/source/uielement/statusbarmerger.cxx +++ b/framework/source/uielement/statusbarmerger.cxx @@ -61,19 +61,19 @@ static void lcl_ConvertSequenceToValues( for ( sal_Int32 i = 0; i < rSequence.getLength(); i++ ) { aPropVal = rSequence[i]; - if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_URL ) ) + if ( aPropVal.Name == MERGE_STATUSBAR_URL ) aPropVal.Value >>= rItem.aCommandURL; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_TITLE ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_TITLE ) aPropVal.Value >>= rItem.aLabel; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_CONTEXT ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_CONTEXT ) aPropVal.Value >>= rItem.aContext; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_ALIGN ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_ALIGN ) aPropVal.Value >>= sAlignment; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_AUTOSIZE ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_AUTOSIZE ) aPropVal.Value >>= bAutoSize; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_OWNERDRAW ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_OWNERDRAW ) aPropVal.Value >>= bOwnerDraw; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_WIDTH ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_WIDTH ) { sal_Int32 aWidth = 0; aPropVal.Value >>= aWidth; @@ -86,9 +86,9 @@ static void lcl_ConvertSequenceToValues( nItemBits |= SIB_AUTOSIZE; if ( bOwnerDraw ) nItemBits |= SIB_USERDRAW; - if ( sAlignment.startsWith( STATUSBAR_ALIGN_CENTER )) + if ( sAlignment == STATUSBAR_ALIGN_CENTER ) nItemBits |= SIB_CENTER; - else if ( sAlignment.startsWith( STATUSBAR_ALIGN_RIGHT )) + else if ( sAlignment == STATUSBAR_ALIGN_RIGHT ) nItemBits |= SIB_RIGHT; else // if unset, defaults to left alignment @@ -214,13 +214,13 @@ bool StatusbarMerger::ProcessMergeOperation( const ::rtl::OUString& rMergeCommandParameter, const AddonStatusbarItemContainer& rItems ) { - if ( rMergeCommand.startsWith( MERGECOMMAND_ADDAFTER ) ) + if ( rMergeCommand == MERGECOMMAND_ADDAFTER ) return lcl_MergeItems( pStatusbar, nPos, 1, rItemId, rModuleIdentifier, rItems ); - else if ( rMergeCommand.startsWith( MERGECOMMAND_ADDBEFORE ) ) + else if ( rMergeCommand == MERGECOMMAND_ADDBEFORE ) return lcl_MergeItems( pStatusbar, nPos, 0, rItemId, rModuleIdentifier, rItems ); - else if ( rMergeCommand.startsWith( MERGECOMMAND_REPLACE ) ) + else if ( rMergeCommand == MERGECOMMAND_REPLACE ) return lcl_ReplaceItem( pStatusbar, nPos, rItemId, rModuleIdentifier, rItems ); - else if ( rMergeCommand.startsWith( MERGECOMMAND_REMOVE ) ) + else if ( rMergeCommand == MERGECOMMAND_REMOVE ) return lcl_RemoveItems( pStatusbar, nPos, rMergeCommandParameter ); return false; @@ -236,18 +236,18 @@ bool StatusbarMerger::ProcessMergeFallback( const AddonStatusbarItemContainer& rItems ) { // fallback IGNORE or REPLACE/REMOVE item not found - if (( rMergeFallback.startsWith( MERGEFALLBACK_IGNORE )) || - ( rMergeCommand.startsWith( MERGECOMMAND_REPLACE )) || - ( rMergeCommand.startsWith( MERGECOMMAND_REMOVE )) ) + if (( rMergeFallback == MERGEFALLBACK_IGNORE ) || + ( rMergeCommand == MERGECOMMAND_REPLACE ) || + ( rMergeCommand == MERGECOMMAND_REMOVE ) ) { return true; } - else if (( rMergeCommand.startsWith( MERGECOMMAND_ADDBEFORE )) || - ( rMergeCommand.startsWith( MERGECOMMAND_ADDAFTER )) ) + else if (( rMergeCommand == MERGECOMMAND_ADDBEFORE ) || + ( rMergeCommand == MERGECOMMAND_ADDAFTER ) ) { - if ( rMergeFallback.startsWith( MERGEFALLBACK_ADDFIRST )) + if ( rMergeFallback == MERGEFALLBACK_ADDFIRST ) return lcl_MergeItems( pStatusbar, 0, 0, rItemId, rModuleIdentifier, rItems ); - else if ( rMergeFallback.startsWith( MERGEFALLBACK_ADDLAST )) + else if ( rMergeFallback == MERGEFALLBACK_ADDLAST ) return lcl_MergeItems( pStatusbar, STATUSBAR_APPEND, 0, rItemId, rModuleIdentifier, rItems ); } diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx index 48f30a182345..8da25cb34c98 100644 --- a/i18npool/source/collator/collator_unicode.cxx +++ b/i18npool/source/collator/collator_unicode.cxx @@ -141,9 +141,9 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang:: } else { if ( rLocale.Language == "ja" ) { // replace algorithm name to implementation name. - if (rAlgorithm.startsWith("phonetic (alphanumeric first)") ) + if (rAlgorithm == "phonetic (alphanumeric first)") aBuf.appendAscii("phonetic_alphanumeric_first"); - else if (rAlgorithm.startsWith("phonetic (alphanumeric last)")) + else if (rAlgorithm == "phonetic (alphanumeric last)") aBuf.appendAscii("phonetic_alphanumeric_last"); else aBuf.append(rAlgorithm); diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 1136de1e4ea9..9a1cda5fb721 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -195,7 +195,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const { m_bCountColumnHeader = true; } - else if ( m_bCountColumnHeader && _sName.startsWith("table:table-cell") ) + else if ( m_bCountColumnHeader && _sName == "table:table-cell" ) { ++m_nColumnCount; } @@ -207,7 +207,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const m_bTableRowsStarted = true; m_bFirstRowExported = true; } - else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.startsWith("table:table-row") || _sName.startsWith("table:table-cell")) ) + else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName == "table:table-row" || _sName == "table:table-cell") ) bExport = false; else if ( _sName == "chart:plot-area" ) { @@ -224,13 +224,13 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const static OUString s_sCellAddress(lcl_createAttribute(XML_NP_CHART,XML_VALUES_CELL_RANGE_ADDRESS)); lcl_correctCellAddress(s_sCellAddress,xAttribs); } - else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName.startsWith("table:table-cell") ) + else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName == "table:table-cell" ) { SvXMLAttributeList* pList = SvXMLAttributeList::getImplementation(xAttribs); static OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE)); pList->RemoveAttribute(s_sValue); } - else if ( m_bTableRowsStarted && _sName.startsWith("text:p") ) + else if ( m_bTableRowsStarted && _sName == "text:p" ) { bExport = false; } @@ -258,11 +258,11 @@ void SAL_CALL ExportDocumentHandler::endElement(const OUString & _sName) throw ( } else if ( _sName == "table:table-rows" ) m_bTableRowsStarted = false; - else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.startsWith("table:table-row") || _sName.startsWith("table:table-cell")) ) + else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName == "table:table-row" || _sName == "table:table-cell") ) bExport = false; - else if ( m_bTableRowsStarted && _sName.startsWith("table:table-row") ) + else if ( m_bTableRowsStarted && _sName == "table:table-row" ) m_bFirstRowExported = true; - else if ( m_bTableRowsStarted && _sName.startsWith("text:p") ) + else if ( m_bTableRowsStarted && _sName == "text:p" ) { bExport = !m_bFirstRowExported; } diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index 88fe4339e7a3..1763b025b9e6 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -249,11 +249,11 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const } bExport = false; } - else if ( _sName.startsWith("rpt:detail") - || _sName.startsWith("rpt:formatted-text") - || _sName.startsWith("rpt:master-detail-fields") - || _sName.startsWith("rpt:report-component") - || _sName.startsWith("rpt:report-element")) + else if ( _sName == "rpt:detail" + || _sName == "rpt:formatted-text" + || _sName == "rpt:master-detail-fields" + || _sName == "rpt:report-component" + || _sName == "rpt:report-element") bExport = false; else if ( _sName == "chart:plot-area" ) { @@ -274,7 +274,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const if ( sLocalName == "data-source-has-labels" ) { const OUString sValue = _xAttrList->getValueByIndex( i ); - bHasCategories = sValue.startsWith("both"); + bHasCategories = sValue == "both"; break; } } @@ -316,11 +316,11 @@ void SAL_CALL ImportDocumentHandler::endElement(const OUString & _sName) throw ( m_xDatabaseDataProvider->setDetailFields(uno::Sequence< OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size())); bExport = false; } - else if ( _sName.startsWith("rpt:detail") - || _sName.startsWith("rpt:formatted-text") - || _sName.startsWith("rpt:master-detail-field") - || _sName.startsWith("rpt:report-component") - || _sName.startsWith("rpt:report-element")) + else if ( _sName == "rpt:detail" + || _sName == "rpt:formatted-text" + || _sName == "rpt:master-detail-field" + || _sName == "rpt:report-component" + || _sName == "rpt:report-element") bExport = false; if ( bExport ) diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx index a81f390d8a6e..b5af9542cfee 100644 --- a/reportdesign/source/ui/misc/toolboxcontroller.cxx +++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx @@ -180,7 +180,7 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments m_aStates.insert(TCommandState::value_type(OUString(".uno:CharFontName"),sal_True)); m_pToolbarController = TToolbarHelper::createFromQuery(new SvxFontNameToolBoxControl/*SvxStyleToolBoxControl*/(m_nSlotId = SID_ATTR_CHAR_FONT,m_nToolBoxId,*pToolBox)); } - else if ( m_aCommandURL.startsWith(".uno:FontColor") || m_aCommandURL.startsWith(".uno:Color") ) + else if ( m_aCommandURL == ".uno:FontColor" || m_aCommandURL == ".uno:Color" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:FontColor"),sal_True)); m_aStates.insert(TCommandState::value_type(OUString(".uno:Color"),sal_True)); diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index a1ff682de1dc..27d8d52befb6 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -482,9 +482,7 @@ bool Bootstrap_Impl::getValue( LookupMode mode, bool override, ExpandRequestLink const * requestStack) const { - if (mode == LOOKUP_MODE_NORMAL && - key.startsWith("URE_BOOTSTRAP")) - { + if (mode == LOOKUP_MODE_NORMAL && key == "URE_BOOTSTRAP") { mode = LOOKUP_MODE_URE_BOOTSTRAP; } if (override && getDirectValue(key, value, mode, requestStack)) { diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 5d7a3c47628e..357f596ce869 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3451,7 +3451,7 @@ void Test::testCopyPaste() fValue = m_pDoc->GetValue(ScAddress(1,1,1)); ASSERT_DOUBLES_EQUAL_MESSAGE("formula should return 2 after redo", fValue, 2); aString = m_pDoc->GetString(2, 1, 1); - CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString.startsWith("test")); + CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString == "test"); m_pDoc->GetFormula(1,1,1, aString); CPPUNIT_ASSERT_MESSAGE("Formula should be correct again", aString == aFormulaString); @@ -3551,13 +3551,13 @@ void Test::testCopyPasteTranspose() //check cell content after transposed copy/paste OUString aString = m_pDoc->GetString(3, 3, 1); - CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.D4 should contain: test", aString.startsWith("test")); + CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.D4 should contain: test", aString == "test"); double fValue = m_pDoc->GetValue(ScAddress(3,1,1)); ASSERT_DOUBLES_EQUAL_MESSAGE("transposed copied cell should return 1", fValue, 1); fValue = m_pDoc->GetValue(ScAddress(3,2,1)); ASSERT_DOUBLES_EQUAL_MESSAGE("transposed copied formula should return 2", fValue, 2); m_pDoc->GetFormula(3, 2, 1, aString); - CPPUNIT_ASSERT_MESSAGE("transposed formula should point on Sheet2.D2", aString.startsWith("=D2+1")); + CPPUNIT_ASSERT_MESSAGE("transposed formula should point on Sheet2.D2", aString == "=D2+1"); // check notes after transposed copy/paste CPPUNIT_ASSERT_MESSAGE("There should be a note on Sheet2.D2", m_pDoc->HasNote(ScAddress(3, 1, 1))); @@ -3616,9 +3616,9 @@ void Test::testMoveBlock() //check cell content OUString aString = m_pDoc->GetString(3, 0, 0); - CPPUNIT_ASSERT_MESSAGE("Cell D1 should contain: test", aString.startsWith("test")); + CPPUNIT_ASSERT_MESSAGE("Cell D1 should contain: test", aString == "test"); m_pDoc->GetFormula(2, 0, 0, aString); - CPPUNIT_ASSERT_MESSAGE("Cell C1 should contain an updated formula", aString.startsWith("=B1+1")); + CPPUNIT_ASSERT_MESSAGE("Cell C1 should contain an updated formula", aString == "=B1+1"); double fValue = m_pDoc->GetValue(aAddrB1); ASSERT_DOUBLES_EQUAL_MESSAGE("Cell B1 should contain 1", fValue, 1); diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 28012c19c4ee..5c3a060d5d14 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -176,7 +176,7 @@ static void lcl_SetSortList( const Any& rValue ) // if setting is "default", keep default values from ScUserList ctor //! mark "default" in a safe way - sal_Bool bDefault = ( nCount == 1 && pArray[0].startsWith( "NULL" ) ); + sal_Bool bDefault = ( nCount == 1 && pArray[0] == "NULL" ); if (!bDefault) { diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index bdf57025a2d6..3471246db22d 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -159,7 +159,7 @@ void ScFilterOptionsMgr::Init() } } - if ( !theDbName.startsWith(STR_DB_LOCAL_NONAME) ) + if ( theDbName != STR_DB_LOCAL_NONAME ) { theDbArea.append(" ("); theDbArea.append(theDbName).append(')'); diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 13588ff0c523..13f42cabf304 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -199,7 +199,7 @@ bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData ) bool bUndo = pDoc->IsUndoEnabled(); ScDBData* pData = NULL; - if (rNewData.GetName().startsWith(STR_DB_LOCAL_NONAME)) + if (rNewData.GetName() == STR_DB_LOCAL_NONAME) { ScRange aRange; rNewData.GetArea(aRange); diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 40664158cfb3..d5339545d9f2 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1796,7 +1796,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum Reference< beans::XPropertySet > xSeqProp( xLS->getValues(), uno::UNO_QUERY ); OUString aRole; if( xSeqProp.is() && (xSeqProp->getPropertyValue("Role") >>= aRole) && - aRole.startsWith("categories") ) + aRole == "categories" ) bThisIsCategories = bHasCategories = true; } diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index fb0cd202117a..f45b0fa04cb8 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1843,7 +1843,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName ) SolarMutexGuard aGuard; uno::Any aAny; - if ( aPropertyName.startsWith( SC_UNONAME_DISPNAME ) ) // read-only + if ( aPropertyName == SC_UNONAME_DISPNAME ) // read-only { // core always has the display name SfxStyleSheetBase* pStyle = GetStyle_Impl(); diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index 0dbaef67a9cf..db401bd118f2 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -151,7 +151,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException) aArgs[1].Value >>= aFilterName; } - if (aFilterName.startsWith("Text - txt - csv (StarCalc)")) { + if (aFilterName == "Text - txt - csv (StarCalc)") { aFileFormat = excel::XlFileFormat::xlCSV; //xlFileFormat. } @@ -179,7 +179,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException) aFileFormat = excel::XlFileFormat::xlExcel9795; } - if (aFilterName.startsWith("HTML (StarCalc)")) { + if (aFilterName == "HTML (StarCalc)") { aFileFormat = excel::XlFileFormat::xlHtml; } @@ -187,7 +187,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException) aFileFormat = excel::XlFileFormat::xlTemplate; } - if (aFilterName.startsWith("StarOffice XML (Calc)")) { + if (aFilterName == "StarOffice XML (Calc)") { aFileFormat = excel::XlFileFormat::xlWorkbookNormal; } if ( aFilterName == "calc8" ) { diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx index ab49cdbbba06..1327d3e61f30 100644 --- a/sdext/source/pdfimport/filterdet.cxx +++ b/sdext/source/pdfimport/filterdet.cxx @@ -301,13 +301,13 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF osl_removeFile( aURL.pData ); if( !aEmbedMimetype.isEmpty() ) { - if( aEmbedMimetype.startsWith( "application/vnd.oasis.opendocument.text" ) - || aEmbedMimetype.startsWith( "application/vnd.oasis.opendocument.text-master" ) ) + if( aEmbedMimetype == "application/vnd.oasis.opendocument.text" + || aEmbedMimetype == "application/vnd.oasis.opendocument.text-master" ) aOutFilterName = "writer_pdf_addstream_import"; else if ( aEmbedMimetype == "application/vnd.oasis.opendocument.presentation" ) aOutFilterName = "impress_pdf_addstream_import"; - else if( aEmbedMimetype.startsWith( "application/vnd.oasis.opendocument.graphics" ) - || aEmbedMimetype.startsWith( "application/vnd.oasis.opendocument.drawing" ) ) + else if( aEmbedMimetype == "application/vnd.oasis.opendocument.graphics" + || aEmbedMimetype == "application/vnd.oasis.opendocument.drawing" ) aOutFilterName = "draw_pdf_addstream_import"; else if ( aEmbedMimetype == "application/vnd.oasis.opendocument.spreadsheet" ) aOutFilterName = "calc_pdf_addstream_import"; diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 7cf1b210a66e..e7fd583d3a19 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -328,21 +328,21 @@ OUString SfxHelp::GetHelpModuleName_Impl() aFactoryShortName = "schart" ; else if ( aFactoryShortName == "BasicIDE" ) aFactoryShortName = "sbasic"; - else if ( aFactoryShortName.startsWith("sweb") - || aFactoryShortName.startsWith("sglobal") - || aFactoryShortName.startsWith("swxform") ) + else if ( aFactoryShortName == "sweb" + || aFactoryShortName == "sglobal" + || aFactoryShortName == "swxform" ) aFactoryShortName = "swriter" ; - else if ( aFactoryShortName.startsWith("dbquery") - || aFactoryShortName.startsWith("dbbrowser") - || aFactoryShortName.startsWith("dbrelation") - || aFactoryShortName.startsWith("dbtable") - || aFactoryShortName.startsWith("dbapp") - || aFactoryShortName.startsWith("dbreport") - || aFactoryShortName.startsWith("swreport") - || aFactoryShortName.startsWith("swform") ) + else if ( aFactoryShortName == "dbquery" + || aFactoryShortName == "dbbrowser" + || aFactoryShortName == "dbrelation" + || aFactoryShortName == "dbtable" + || aFactoryShortName == "dbapp" + || aFactoryShortName == "dbreport" + || aFactoryShortName == "swreport" + || aFactoryShortName == "swform" ) aFactoryShortName = "sdatabase"; - else if ( aFactoryShortName.startsWith("sbibliography") - || aFactoryShortName.startsWith("StartModule") ) + else if ( aFactoryShortName == "sbibliography" + || aFactoryShortName == "StartModule" ) aFactoryShortName = sDefaultModule; } else diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index 937cabe8de6d..02bde57458a9 100644 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -212,7 +212,7 @@ static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, aEntry[m].Value >>= aDescription; } - if ( aURL.startsWith(BASE_URL) && !aDescription.isEmpty() ) + if ( aURL == BASE_URL && !aDescription.isEmpty() ) { add_item (pMenuShell, pAsciiURL, &aDescription, nResId, pFnCallback); break; diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 8e3e8a692bb1..c74042d487d8 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -498,7 +498,7 @@ sal_uInt16 GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( const OUS { nResult = BMP_128X128_MATH_DOC; } - else if ( aFactoryShortName.startsWith( "swriter" ) ) + else if ( aFactoryShortName == "swriter" || aFactoryShortName.startsWith("swriter/") ) { nResult = BMP_128X128_WRITER_DOC; } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index d76f2e4894f3..33c1ee8e83b9 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -2311,7 +2311,7 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const datatransfer::DataF && aFlavor.DataType == getCppuType( (const sal_uInt64*) 0 ) ) return sal_True; } - else if ( aFlavor.MimeType.startsWith("application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"") ) + else if ( aFlavor.MimeType == "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 56e45f40d4ea..4b25de6ed29b 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -211,13 +211,13 @@ void SfxEvents_Impl::Execute( uno::Any& aEventData, const document::DocumentEven nIndex += 1; } - if (aType.startsWith(STAR_BASIC) && !aScript.isEmpty()) + if (aType == STAR_BASIC && !aScript.isEmpty()) { uno::Any aAny; SfxMacroLoader::loadMacro( aScript, aAny, pDoc ); } - else if (aType.startsWith("Service") || - aType.startsWith("Script")) + else if (aType == "Service" || + aType == "Script") { if ( !aScript.isEmpty() ) { @@ -385,7 +385,7 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const uno::Any& rElement, SfxObjectShe ScriptType eType( STARBASIC ); if ( aType == STAR_BASIC ) eType = STARBASIC; - else if (aType.startsWith("Script") && !aScriptURL.isEmpty()) + else if (aType == "Script" && !aScriptURL.isEmpty()) eType = EXTENDED_STYPE; else if ( aType == SVX_MACRO_LANGUAGE_JAVASCRIPT ) eType = JAVASCRIPT; diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index e54258e24af5..a69475464966 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -850,7 +850,7 @@ Reference< frame::XDispatch > SAL_CALL SfxBaseController::queryDispatch( const } } } - else if( sTargetFrameName.startsWith("_self") || sTargetFrameName.isEmpty() ) + else if( sTargetFrameName == "_self" || sTargetFrameName.isEmpty() ) { // check for already loaded URL ... but with additional jumpmark! Reference< frame::XModel > xModel = getModel(); diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 90d46f7727c8..e8c8cb8f5fc7 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -294,7 +294,7 @@ void acc_CurrentContext::release() Any acc_CurrentContext::getValueByName( OUString const & name ) throw (RuntimeException) { - if (name.startsWith(s_acRestriction)) + if (name == s_acRestriction) { return m_restriction; } diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index ff46844d2ed2..72b14b318e59 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -318,7 +318,7 @@ FilePermission::FilePermission( : Permission( FILE, next ) , m_actions( makeMask( perm.Actions, s_actions ) ) , m_url( perm.URL ) - , m_allFiles( perm.URL.startsWith("<<ALL FILES>>") ) + , m_allFiles( perm.URL == "<<ALL FILES>>" ) { if (! m_allFiles) { diff --git a/stoc/test/testiadapter.cxx b/stoc/test/testiadapter.cxx index e13b486f7e12..1f850cb3917c 100644 --- a/stoc/test/testiadapter.cxx +++ b/stoc/test/testiadapter.cxx @@ -633,36 +633,36 @@ Any XLB_Invocation::getValue( const OUString & rName ) sal_Bool XLB_Invocation::hasMethod( const OUString & rName ) throw(::com::sun::star::uno::RuntimeException) { - return (rName.startsWith( "raiseException" ) || - rName.startsWith( "getValues" ) || - rName.startsWith( "setValues2" ) || - rName.startsWith( "setValues" ) || - rName.startsWith( "acquire" ) || - rName.startsWith( "release" ) || - rName.startsWith( "queryInterface" )); + return (rName == "raiseException" || + rName == "getValues" || + rName == "setValues2" || + rName == "setValues" || + rName == "acquire" || + rName == "release" || + rName == "queryInterface" ); } //__________________________________________________________________________________________________ sal_Bool XLB_Invocation::hasProperty( const OUString & rName ) throw(::com::sun::star::uno::RuntimeException) { - return (rName.startsWith( "Bool" ) || - rName.startsWith( "Byte" ) || - rName.startsWith( "Char" ) || - rName.startsWith( "Short" ) || - rName.startsWith( "UShort" ) || - rName.startsWith( "Long" ) || - rName.startsWith( "ULong" ) || - rName.startsWith( "Hyper" ) || - rName.startsWith( "UHyper" ) || - rName.startsWith( "Float" ) || - rName.startsWith( "Double" ) || - rName.startsWith( "Enum" ) || - rName.startsWith( "String" ) || - rName.startsWith( "Interface" ) || - rName.startsWith( "Any" ) || - rName.startsWith( "Sequence" ) || - rName.startsWith( "Struct" ) || - rName.startsWith( "RuntimeException" ) ); + return (rName == "Bool" || + rName == "Byte" || + rName == "Char" || + rName == "Short" || + rName == "UShort" || + rName == "Long" || + rName == "ULong" || + rName == "Hyper" || + rName == "UHyper" || + rName == "Float" || + rName == "Double" || + rName == "Enum" || + rName == "String" || + rName == "Interface" || + rName == "Any" || + rName == "Sequence" || + rName == "Struct" || + rName == "RuntimeException" ); } //################################################################################################## @@ -895,7 +895,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT ) catch (const IllegalArgumentException &aExc) { OSL_ENSURE( aExc.ArgumentPosition == 5 && - aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."), + aExc.Message == "dum dum dum ich tanz im kreis herum...", "### unexpected exception content!" ); Reference<XLanguageBindingTest > xLBT2( @@ -910,7 +910,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT ) } catch (const RuntimeException & rExc) { - OSL_ENSURE( rExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."), + OSL_ENSURE( rExc.Message == "dum dum dum ich tanz im kreis herum...", "### unexpected exception content!" ); Reference<XLanguageBindingTest > xLBT2( @@ -925,9 +925,9 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT ) } catch (const Exception & aExc) { - OSL_ENSURE( aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."), + OSL_ENSURE( aExc.Message == "dum dum dum ich tanz im kreis herum...", "### unexpected exception content!" ); - return aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."); + return aExc.Message == "dum dum dum ich tanz im kreis herum..."; } return sal_False; } diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx index 8c936425f980..3c63cbcb2c3d 100644 --- a/svtools/source/uno/unogridcolumnfacade.cxx +++ b/svtools/source/uno/unogridcolumnfacade.cxx @@ -146,12 +146,12 @@ namespace svt { namespace table if ( i_event.AttributeName == "HorizontalAlign" ) nChangedAttributes |= COL_ATTRS_APPEARANCE; - if ( i_event.AttributeName.startsWith("ColumnWidth") - || i_event.AttributeName.startsWith("MaxWidth") - || i_event.AttributeName.startsWith("MinWidth") - || i_event.AttributeName.startsWith("PreferredWidth") - || i_event.AttributeName.startsWith("Resizeable") - || i_event.AttributeName.startsWith("Flexibility") + if ( i_event.AttributeName == "ColumnWidth" + || i_event.AttributeName == "MaxWidth" + || i_event.AttributeName == "MinWidth" + || i_event.AttributeName == "PreferredWidth" + || i_event.AttributeName == "Resizeable" + || i_event.AttributeName == "Flexibility" ) nChangedAttributes |= COL_ATTRS_WIDTH; diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx index db03d581c88f..70ff3e985407 100644 --- a/svx/source/form/fmdpage.cxx +++ b/svx/source/form/fmdpage.cxx @@ -85,8 +85,8 @@ SdrObject *SvxFmDrawPage::_CreateSdrObject( const ::com::sun::star::uno::Referen { OUString aShapeType( xDescr->getShapeType() ); - if ( aShapeType.startsWith( "com.sun.star.drawing.ShapeControl" ) // compatibility - || aShapeType.startsWith( "com.sun.star.drawing.ControlShape" ) + if ( aShapeType == "com.sun.star.drawing.ShapeControl" // compatibility + || aShapeType == "com.sun.star.drawing.ControlShape" ) return new FmFormObj(); else diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 810838a4e265..900c6ba38e63 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -4115,7 +4115,7 @@ FormController::interceptedQueryDispatch( const URL& aURL, Reference< XDispatch > xReturn; // dispatches handled by ourself if ( ( aURL.Complete == FMURL_CONFIRM_DELETION ) - || ( ( aURL.Complete.startsWith( "private:/InteractionHandler" ) ) + || ( ( aURL.Complete == "private:/InteractionHandler" ) && ensureInteractionHandler() ) ) diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 3574b7a1164e..ed1ec44e2da5 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -178,14 +178,14 @@ void SAL_CALL GalleryThemePopup::statusChanged( throw ( css::uno::RuntimeException ) { const OUString &rURL = rEvent.FeatureURL.Complete; - if ( rURL.startsWith( CMD_SID_GALLERY_ENABLE_ADDCOPY ) ) + if ( rURL == CMD_SID_GALLERY_ENABLE_ADDCOPY ) { if ( !rEvent.IsEnabled ) { maPopupMenu.EnableItem( MN_ADD, sal_False ); } } - else if ( rURL.startsWith( CMD_SID_GALLERY_BG_BRUSH ) ) + else if ( rURL == CMD_SID_GALLERY_BG_BRUSH ) { maBackgroundPopup.Clear(); if ( rEvent.IsEnabled ) diff --git a/svx/source/items/galleryitem.cxx b/svx/source/items/galleryitem.cxx index 3b94645e4a4f..ace2edd4af85 100644 --- a/svx/source/items/galleryitem.cxx +++ b/svx/source/items/galleryitem.cxx @@ -87,27 +87,27 @@ bool SvxGalleryItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /* nMemberId const css::beans::PropertyValue *pEnd = pProp + aSeq.getLength(); for ( ; pProp != pEnd; pProp++ ) { - if ( pProp->Name.startsWith( SVXGALLERYITEM_TYPE ) ) + if ( pProp->Name == SVXGALLERYITEM_TYPE ) { bAllConverted &= bIsSetType = ( pProp->Value >>= nType ); ++nConverted; } - else if ( pProp->Name.startsWith( SVXGALLERYITEM_URL ) ) + else if ( pProp->Name == SVXGALLERYITEM_URL ) { bAllConverted &= ( pProp->Value >>= aURL ); ++nConverted; } - else if ( pProp->Name.startsWith( SVXGALLERYITEM_FILTER ) ) + else if ( pProp->Name == SVXGALLERYITEM_FILTER ) { bAllConverted &= ( pProp->Value >>= aFilterName ); ++nConverted; } - else if ( pProp->Name.startsWith( SVXGALLERYITEM_DRAWING ) ) + else if ( pProp->Name == SVXGALLERYITEM_DRAWING ) { bAllConverted &= ( pProp->Value >>= xDrawing ); ++nConverted; } - else if ( pProp->Name.startsWith( SVXGALLERYITEM_GRAPHIC ) ) + else if ( pProp->Name == SVXGALLERYITEM_GRAPHIC ) { bAllConverted &= ( pProp->Value >>= xGraphic ); ++nConverted; diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 159c295dcea9..9a0ca1a3a2d0 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -114,17 +114,17 @@ NumSettings_ImplPtr lcl_CreateNumberingSettingsPtr(const Sequence<PropertyValue> NumSettings_ImplPtr pNew = new NumSettings_Impl; for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++) { - if(pValues[j].Name.startsWith(sNumberingType)) + if(pValues[j].Name == sNumberingType) pValues[j].Value >>= pNew->nNumberType; - else if(pValues[j].Name.startsWith(sPrefix)) + else if(pValues[j].Name == sPrefix) pValues[j].Value >>= pNew->sPrefix; - else if(pValues[j].Name.startsWith(sSuffix)) + else if(pValues[j].Name == sSuffix) pValues[j].Value >>= pNew->sSuffix; - else if(pValues[j].Name.startsWith(sParentNumbering)) + else if(pValues[j].Name == sParentNumbering) pValues[j].Value >>= pNew->nParentNumbering; - else if(pValues[j].Name.startsWith(sBulletChar)) + else if(pValues[j].Name == sBulletChar) pValues[j].Value >>= pNew->sBulletChar; - else if(pValues[j].Name.startsWith(sBulletFontName)) + else if(pValues[j].Name == sBulletFontName) pValues[j].Value >>= pNew->sBulletFont; } const sal_Unicode cLocalPrefix = pNew->sPrefix.getLength() ? pNew->sPrefix[0] : 0; diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index 3fbce727ff2e..afd9b6a47fd7 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -128,7 +128,7 @@ ImplGrafMetricField::ImplGrafMetricField( Window* pParent, const OUString& rCmd, } else { - const long nMinVal = maCommand.startsWith( ".uno:GrafTransparence" ) ? 0 : -100; + const long nMinVal = maCommand == ".uno:GrafTransparence" ? 0 : -100; SetUnit(FUNIT_PERCENT); SetDecimalDigits( 0 ); @@ -159,14 +159,14 @@ IMPL_LINK_NOARG(ImplGrafMetricField, ImplModifyHdl) // Convert value to an any to be usable with dispatch API Any a; - if ( maCommand.startsWith( ".uno:GrafRed" ) || - maCommand.startsWith( ".uno:GrafGreen" ) || - maCommand.startsWith( ".uno:GrafBlue" ) || - maCommand.startsWith( ".uno:GrafLuminance" ) || - maCommand.startsWith( ".uno:GrafContrast" )) + if ( maCommand == ".uno:GrafRed" || + maCommand == ".uno:GrafGreen" || + maCommand == ".uno:GrafBlue" || + maCommand == ".uno:GrafLuminance" || + maCommand == ".uno:GrafContrast" ) a = makeAny( sal_Int16( nVal )); - else if ( maCommand.startsWith( ".uno:GrafGamma" ) || - maCommand.startsWith( ".uno:GrafTransparence" )) + else if ( maCommand == ".uno:GrafGamma" || + maCommand == ".uno:GrafTransparence" ) a = makeAny( sal_Int32( nVal )); if ( a.hasValue() ) diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index ace45e8466f0..dc7c7f1fe698 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -495,15 +495,15 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto { pValues->Value >>= rSettings.mxInteractionHandler; } - else if( pValues->Name.startsWith( "Width" ) ) // for compatibility reasons, deprecated + else if( pValues->Name == "Width" ) // for compatibility reasons, deprecated { pValues->Value >>= rSettings.mnWidth; } - else if( pValues->Name.startsWith( "Height" ) ) // for compatibility reasons, deprecated + else if( pValues->Name == "Height" ) // for compatibility reasons, deprecated { pValues->Value >>= rSettings.mnHeight; } - else if( pValues->Name.startsWith( "ExportOnlyBackground" ) ) // for compatibility reasons, deprecated + else if( pValues->Name == "ExportOnlyBackground" ) // for compatibility reasons, deprecated { pValues->Value >>= rSettings.mbExportOnlyBackground; } @@ -532,12 +532,12 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto { pDataValues->Value >>= rSettings.mnHeight; } - else if( pDataValues->Name.startsWith( "Width" ) ) // for compatibility reasons, deprecated + else if( pDataValues->Name == "Width" ) // for compatibility reasons, deprecated { pDataValues->Value >>= rSettings.mnWidth; pDataValues->Name = "PixelWidth"; } - else if( pDataValues->Name.startsWith( "Height" ) ) // for compatibility reasons, deprecated + else if( pDataValues->Name == "Height" ) // for compatibility reasons, deprecated { pDataValues->Value >>= rSettings.mnHeight; pDataValues->Name = "PixelHeight"; diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index fbda90a097a7..c8926b06d2e5 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -532,8 +532,8 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor, if( nTempType == UHASHMAP_NOTFOUND ) { - if( aName.startsWith("com.sun.star.drawing.TableShape") || - aName.startsWith("com.sun.star.presentation.TableShape") ) + if( aName == "com.sun.star.drawing.TableShape" || + aName == "com.sun.star.presentation.TableShape" ) { rInventor = SdrInventor; rType = OBJ_TABLE; diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index a3c42bdebca3..bf3f86cd4de5 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1924,7 +1924,7 @@ void SAL_CALL SvxCustomShape::setPropertyValue( const OUString& aPropertyName, c ::SolarMutexGuard aGuard; SdrObject* pObject = mpObj.get(); - bool bCustomShapeGeometry = pObject && aPropertyName.startsWith( "CustomShapeGeometry" ); + bool bCustomShapeGeometry = pObject && aPropertyName == "CustomShapeGeometry"; sal_Bool bMirroredX = sal_False; sal_Bool bMirroredY = sal_False; diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 6dac4baba735..0ed76030bc58 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1108,7 +1108,7 @@ const char aInvalidStyle[] = "__XXX___invalid"; bool SwXNumberingRules::isInvalidStyle(const OUString &rName) { - return rName.startsWith(aInvalidStyle); + return rName == aInvalidStyle; } namespace diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 8e1f9da8e6c8..9cf1151f3b02 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1692,7 +1692,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, sal_uInt16 nBin = USHRT_MAX; if ( !( rValue >>= sTmp ) ) throw lang::IllegalArgumentException(); - if ( sTmp.startsWith ( "[From printer settings]" ) ) + if ( sTmp == "[From printer settings]" ) nBin = USHRT_MAX-1; else if ( pPrinter ) { diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 52fdc1fd64d6..aea2a5a49c51 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -97,7 +97,7 @@ static void lcl_sendPartialGETRequest( bool &bError, for ( std::vector< rtl::OUString >::const_iterator it = aHeaderNames.begin(); it != aHeaderNames.end(); ++it ) { - if ( it->startsWith( "Content-Length" ) ) + if ( *it == "Content-Length" ) { bIsRequestSize = true; break; @@ -129,11 +129,11 @@ static void lcl_sendPartialGETRequest( bool &bError, for ( std::vector< DAVPropertyValue >::const_iterator it = aResponseProps.begin(); it != aResponseProps.end(); ++it ) { - if ( it->Name.startsWith( "Accept-Ranges" ) ) + if ( it->Name == "Accept-Ranges" ) it->Value >>= aAcceptRanges; - else if ( it->Name.startsWith( "Content-Range" ) ) + else if ( it->Name == "Content-Range" ) it->Value >>= aContentRange; - else if ( it->Name.startsWith( "Content-Length" ) ) + else if ( it->Name == "Content-Length" ) it->Value >>= aContentLength; } @@ -148,7 +148,7 @@ static void lcl_sendPartialGETRequest( bool &bError, // MAY ignore ranges specified using other units. if ( nSize == 1 && aContentRange.getLength() && - aAcceptRanges.startsWith( "bytes" ) ) + aAcceptRanges == "bytes" ) { // Parse the Content-Range to get the size // vid. http://tools.ietf.org/html/rfc2616#section-14.16 @@ -158,12 +158,12 @@ static void lcl_sendPartialGETRequest( bool &bError, { rtl::OUString aSize = aContentRange.copy( nSlash + 1 ); // "*" means that the instance-length is unknown at the time when the response was generated - if ( !aSize.startsWith( "*" )) + if ( aSize != "*" ) { for ( std::vector< DAVPropertyValue >::iterator it = aResponseProps.begin(); it != aResponseProps.end(); ++it ) { - if ( it->Name.startsWith( "Content-Length" ) ) + if ( it->Name != "Content-Length" ) { it->Value <<= aSize; break; @@ -734,7 +734,7 @@ uno::Any SAL_CALL Content::execute( aRet = uno::makeAny( createNewContent( aArg ) ); } - else if ( aCommand.Name.startsWith( "addProperty" )) + else if ( aCommand.Name == "addProperty" ) { ucb::PropertyCommandArgument aPropArg; if ( !( aCommand.Argument >>= aPropArg )) @@ -766,7 +766,7 @@ uno::Any SAL_CALL Content::execute( ucbhelper::cancelCommandExecution( uno::makeAny( e ), Environment ); } } - else if ( aCommand.Name.startsWith( "removeProperty" )) + else if ( aCommand.Name == "removeProperty" ) { rtl::OUString sPropName; if ( !( aCommand.Argument >>= sPropName ) ) @@ -1870,7 +1870,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( OUString( "Property is read-only!" ), static_cast< cppu::OWeakObject * >( this ) ); } - if ( rName.startsWith( "CreatableContentsInfo" ) ) + if ( rName == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx index 655dfd9d3c8a..60ccdc3d2ff7 100644 --- a/vcl/unx/gtk/gdi/salprn-gtk.cxx +++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx @@ -557,7 +557,7 @@ GtkPrintDialog::impl_initCustomTab() if ( aPropertyName == "PrintContent" ) bGtkInternal = true; - if (aCtrlType.startsWith("Group") || !pCurParent) + if (aCtrlType == "Group" || !pCurParent) { pCurTabPage = gtk_vbox_new(FALSE, 12); gtk_container_set_border_width(GTK_CONTAINER(pCurTabPage), 6); @@ -566,7 +566,7 @@ GtkPrintDialog::impl_initCustomTab() pCurParent = pCurTabPage; aCustomTabs.push_back(std::make_pair(pCurTabPage, aText)); } - else if (aCtrlType.startsWith("Subgroup") && (pCurParent /*|| bOnJobPageValue*/)) + else if (aCtrlType == "Subgroup" && (pCurParent /*|| bOnJobPageValue*/)) { bIgnoreSubgroup = bIgnore; if (bIgnore) @@ -600,7 +600,7 @@ GtkPrintDialog::impl_initCustomTab() GtkWidget* pWidget = NULL; beans::PropertyValue* pVal = NULL; - if (aCtrlType.startsWith("Bool") && pCurParent) + if (aCtrlType == "Bool" && pCurParent) { pWidget = gtk_check_button_new_with_mnemonic( OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); @@ -616,7 +616,7 @@ GtkPrintDialog::impl_initCustomTab() m_rController.isUIOptionEnabled(aPropertyName) && pVal != NULL); g_signal_connect(pWidget, "toggled", G_CALLBACK(GtkPrintDialog::UIOption_CheckHdl), this); } - else if (aCtrlType.startsWith("Radio") && pCurParent) + else if (aCtrlType == "Radio" && pCurParent) { GtkWidget* const pVbox = gtk_vbox_new(FALSE, 12); gtk_container_set_border_width(GTK_CONTAINER(pVbox), 0); @@ -653,9 +653,9 @@ GtkPrintDialog::impl_initCustomTab() else pWidget = pVbox; } - else if ((aCtrlType.startsWith("List") || - aCtrlType.startsWith("Range") || - aCtrlType.startsWith("Edit") + else if ((aCtrlType == "List" || + aCtrlType == "Range" || + aCtrlType == "Edit" ) && pCurParent) { GtkWidget* const pHbox = gtk_hbox_new(FALSE, 12); @@ -678,7 +678,7 @@ GtkPrintDialog::impl_initCustomTab() gtk_combo_box_set_active(GTK_COMBO_BOX(pWidget), nSelectVal); g_signal_connect(pWidget, "changed", G_CALLBACK(GtkPrintDialog::UIOption_SelectHdl), this); } - else if (aCtrlType.startsWith("Edit") && pCurParent) + else if (aCtrlType == "Edit" && pCurParent) { pWidget = gtk_entry_new(); @@ -689,7 +689,7 @@ GtkPrintDialog::impl_initCustomTab() gtk_entry_set_text(GTK_ENTRY(pWidget), OUStringToOString(aCurVal, RTL_TEXTENCODING_UTF8).getStr()); } - else if (aCtrlType.startsWith("Range") && pCurParent) + else if (aCtrlType == "Range" && pCurParent) { pWidget = gtk_spin_button_new_with_range(nMinValue, nMaxValue, 1.0); |