diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-14 09:25:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-14 10:19:27 +0200 |
commit | 6af025501db1f25397bdbf1fdd6b71da4debcac4 (patch) | |
tree | 19f627e7ed7da45efa4c5bbf6bad8ed148fd6551 /sfx2 | |
parent | 8e39ef66928a3e37c618d3a70a631e71266db274 (diff) |
use more OUString::operator== in sfx2..svtools
Change-Id: I859b77319f551eabd19dae54bd69c212221112a8
Reviewed-on: https://gerrit.libreoffice.org/39938
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/sidebar/Context.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/sidebar/Panel.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/PanelTitleBar.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/sidebar/TabBar.cxx | 2 |
14 files changed, 43 insertions, 42 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 14140b6b8b51..3cd8ef520f64 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2679,7 +2679,8 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, if ( bMSType ) { // the empty password has 0 as Hash - sal_Int32 nHash = SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), OUString( "com.sun.star.text.TextDocument" ).equals( pCurrentFilter->GetServiceName() ) ); + sal_Int32 nHash = SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), + pCurrentFilter->GetServiceName() == "com.sun.star.text.TextDocument" ); if ( nHash ) pSet->Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, uno::makeAny( nHash ) ) ); } diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index f39eec6f5a56..3b7ec61abf87 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -527,7 +527,7 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ ) else m_pBaseLb->SelectEntry( aParent ); - if ( SfxResId(STR_STANDARD).equals(aName) ) + if ( SfxResId(STR_STANDARD) == aName ) { // the default template can not be linked m_pBaseFt->Disable(); @@ -640,7 +640,7 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) { OUString aParentEntry( m_pBaseLb->GetSelectEntry() ); - if ( SfxResId(STR_NONE).equals(aParentEntry) || aParentEntry == pStyle->GetName() ) + if ( SfxResId(STR_NONE) == aParentEntry || aParentEntry == pStyle->GetName() ) aParentEntry.clear(); if ( pStyle->GetParent() != aParentEntry ) diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index b222b8639161..f7337558c76e 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -656,7 +656,7 @@ SfxDocumentMetaData::setMetaText(const char* i_name, c.is(); c = c->getNextSibling()) { if (c->getNodeType() == css::xml::dom::NodeType_TEXT_NODE) { - if (!c->getNodeValue().equals(i_rValue)) { + if (c->getNodeValue() != i_rValue) { c->setNodeValue(i_rValue); return true; } else { @@ -753,7 +753,7 @@ SfxDocumentMetaData::setMetaList(const char* i_name, css::uno::Reference<css::xml::dom::XNode> xNode(vec.at(i)); if (xNode.is()) { OUString val = getNodeText(xNode); - if (!val.equals(i_rValue[i])) { + if (val != i_rValue[i]) { isEqual = false; break; } diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index e8fbc812e5e9..20ab8416b02c 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1249,11 +1249,11 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI ) if (!bHandleSysLocked) { LockFileEntry aOwnData = svt::LockFileCommon::GenerateOwnEntry(); - bOwnLock = aOwnData[LockFileComponent::SYSUSERNAME].equals(aData[LockFileComponent::SYSUSERNAME]); + bOwnLock = aOwnData[LockFileComponent::SYSUSERNAME] == aData[LockFileComponent::SYSUSERNAME]; if (bOwnLock - && aOwnData[LockFileComponent::LOCALHOST].equals(aData[LockFileComponent::LOCALHOST]) - && aOwnData[LockFileComponent::USERURL].equals(aData[LockFileComponent::USERURL])) + && aOwnData[LockFileComponent::LOCALHOST] == aData[LockFileComponent::LOCALHOST] + && aOwnData[LockFileComponent::USERURL] == aData[LockFileComponent::USERURL]) { // this is own lock from the same installation, it could remain because of crash bResult = true; diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 2f287f70e1cf..919fc06936d3 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -408,7 +408,7 @@ void SfxDocTplService_Impl::init_Impl() OUString aPropValue; if ( getProperty( maRootContent, aTemplVersPropName, aValue ) && ( aValue >>= aPropValue ) - && aPropValue.equals( aTemplVers ) ) + && aPropValue == aTemplVers ) { bIsInitialized = true; } @@ -1236,7 +1236,7 @@ bool SfxDocTplService_Impl::UpdateUINamesForTemplateDir_Impl( const OUString& aU // it is possible that the name is used already, but it should be checked before for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) - if ( aUINames[nInd].First.equals( aNewFolderName ) ) + if ( aUINames[nInd].First == aNewFolderName ) return false; aUINames.resize( ++nLen ); @@ -1257,7 +1257,7 @@ bool SfxDocTplService_Impl::ReplaceUINamesForTemplateDir_Impl( const OUString& a bool bChanged = false; for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) - if ( aUINames[nInd].Second.equals( aOldGroupName ) ) + if ( aUINames[nInd].Second == aOldGroupName ) { aUINames[nInd].Second = aNewGroupName; bChanged = true; @@ -1283,7 +1283,7 @@ void SfxDocTplService_Impl::RemoveUINamesForTemplateDir_Impl( const OUString& aU bool bChanged = false; for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) - if ( aUINames[nInd].Second.equals( aGroupName ) ) + if ( aUINames[nInd].Second == aGroupName ) bChanged = true; else { @@ -1907,7 +1907,7 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, return false; INetURLObject aSourceObj( rSourceURL ); - if ( rTemplateName.equals( aTitle ) ) + if ( rTemplateName == aTitle ) { // addTemplate will sometimes be called just to add an entry in the // hierarchy; the target URL and the source URL will be the same in @@ -1977,14 +1977,14 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, // either the document has title and it is the same as requested, or we have to set it - bool bCorrectTitle = ( bDocHasTitle && aTitle.equals( rTemplateName ) ); + bool bCorrectTitle = ( bDocHasTitle && aTitle == rTemplateName ); if ( !bCorrectTitle ) { if ( !bDocHasTitle ) { INetURLObject aNewTmpObj( aNewTemplateTargetObj ); aNewTmpObj.CutExtension(); - bCorrectTitle = ( aNewTmpObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ).equals( rTemplateName ) ); + bCorrectTitle = ( aNewTmpObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ) == rTemplateName ); } if ( !bCorrectTitle ) @@ -2518,7 +2518,7 @@ void SfxDocTplService_Impl::createFromContent( GroupList_Impl& rList, { OUString aUITitle; for (beans::StringPair & rUIName : aUINames) - if ( rUIName.First.equals( aTitle ) ) + if ( rUIName.First == aTitle ) { aUITitle = rUIName.Second; break; diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 4d5bceef239b..e27863804976 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -740,7 +740,7 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString& aFilterName ) const OUString aDefType = aDefFiltPropsHM.getUnpackedValueOrDefault( "Type", OUString() ); const OUString aDefExtension = GetRecommendedExtension( aDefType ); - if ( !aPreusedFilterName.equals( aFilterName ) && !aUIName.equals( aDefUIName ) ) + if ( aPreusedFilterName != aFilterName && aUIName != aDefUIName ) { if ( !SfxStoringHelper::WarnUnacceptableFormat( GetModel(), aUIName, aDefExtension, (bool)( nDefFiltFlags & SfxFilterFlags::ALIEN ) ) ) @@ -990,13 +990,13 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, const OUString sFilterOptionsString(aFilterOptionsString); const OUString sFilterDataString(aFilterDataString); - if ( aFilterName.equals( aFilterFromMediaDescr ) ) + if ( aFilterName == aFilterFromMediaDescr ) { // preserve current settings if any // if there no current settings and the name is the same // as old filter name use old filter settings - if ( aFilterFromMediaDescr.equals( aOldFilterName ) ) + if ( aFilterFromMediaDescr == aOldFilterName ) { ::comphelper::SequenceAsHashMap::const_iterator aIter = GetDocProps().find( sFilterOptionsString ); @@ -1015,7 +1015,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, GetMediaDescr().erase( sFilterDataString ); GetMediaDescr().erase( sFilterOptionsString ); - if ( aFilterName.equals( aOldFilterName ) ) + if ( aFilterName == aOldFilterName ) { // merge filter option of the document filter @@ -1496,7 +1496,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo { // the target file name is provided so check if new filter options // are provided or old options can be used - if ( aFilterFromMediaDescr.equals( aOldFilterName ) ) + if ( aFilterFromMediaDescr == aOldFilterName ) { ::comphelper::SequenceAsHashMap::const_iterator aIter = aModelData.GetDocProps().find( sFilterOptionsString ); diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 9b83ffe426af..ff4534e11159 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -190,11 +190,11 @@ void SfxObjectShell::UpdateDocInfoForSave() if ( !IsUseUserData() ) { // remove all data pointing to the current user - if (xDocProps->getAuthor().equals(aUserName)) { + if (xDocProps->getAuthor() == aUserName) { xDocProps->setAuthor( OUString() ); } xDocProps->setModifiedBy( OUString() ); - if (xDocProps->getPrintedBy().equals(aUserName)) { + if (xDocProps->getPrintedBy() == aUserName) { xDocProps->setPrintedBy( OUString() ); } } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index cefd4db1cb70..87fb58704ff1 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1001,7 +1001,7 @@ Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() sal_Int32 nOldInd = 0; while ( nOldInd < nOldLength ) { - if ( m_pData->m_seqArguments[nOrg].Name.equals( seqArgsOld[nOldInd].Name ) ) + if ( m_pData->m_seqArguments[nOrg].Name == seqArgsOld[nOldInd].Name ) break; nOldInd++; } @@ -2857,7 +2857,7 @@ void SfxBaseModel::impl_store( const OUString& sURL if ( pMedium ) { std::shared_ptr<const SfxFilter> pFilter = pMedium->GetFilter(); - if ( pFilter && aFilterName.equals( pFilter->GetFilterName() ) ) + if ( pFilter && aFilterName == pFilter->GetFilterName() ) { // #i119366# - If the former file saving with password, do not trying in StoreSelf anyway... bool bFormerPassword = false; diff --git a/sfx2/source/sidebar/Context.cxx b/sfx2/source/sidebar/Context.cxx index 9baf30b07777..b263f3e0bfcf 100644 --- a/sfx2/source/sidebar/Context.cxx +++ b/sfx2/source/sidebar/Context.cxx @@ -54,11 +54,11 @@ sal_Int32 Context::EvaluateMatch ( bApplicationNameIsAny = false; } - if (rOther.msApplication.equals(msApplication) || bApplicationNameIsAny) + if (rOther.msApplication == msApplication || bApplicationNameIsAny) { // Application name matches. const bool bContextNameIsAny (rOther.msContext == AnyContextName); - if (rOther.msContext.equals(msContext) || bContextNameIsAny) + if (rOther.msContext == msContext || bContextNameIsAny) { // Context name matches. return (bApplicationNameIsAny ? ApplicationWildcardMatch : 0) @@ -70,14 +70,14 @@ sal_Int32 Context::EvaluateMatch ( bool Context::operator== (const Context& rOther) const { - return msApplication.equals(rOther.msApplication) - && msContext.equals(rOther.msContext); + return msApplication == rOther.msApplication + && msContext == rOther.msContext; } bool Context::operator!= (const Context& rOther) const { - return ( ! msApplication.equals(rOther.msApplication)) - || ( ! msContext.equals(rOther.msContext)); + return ( msApplication != rOther.msApplication) + || ( msContext != rOther.msContext); } } } // end of namespace sfx2::sidebar diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx index 63b156c696df..be3da21b4ca9 100644 --- a/sfx2/source/sidebar/Panel.cxx +++ b/sfx2/source/sidebar/Panel.cxx @@ -135,7 +135,7 @@ void Panel::SetExpanded (const bool bIsExpanded) bool Panel::HasIdPredicate (const OUString& rsId) const { - return msPanelId.equals(rsId); + return msPanelId == rsId; } void Panel::Resize() diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx index 4646fa6c544f..5d449e03e496 100644 --- a/sfx2/source/sidebar/PanelTitleBar.cxx +++ b/sfx2/source/sidebar/PanelTitleBar.cxx @@ -71,7 +71,7 @@ void PanelTitleBar::SetMoreOptionsCommand(const OUString& rsCommandName, const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XController>& rxController) { - if (!rsCommandName.equals(msMoreOptionsCommand)) + if (rsCommandName != msMoreOptionsCommand) { if (msMoreOptionsCommand.getLength() > 0) maToolBox->RemoveItem(maToolBox->GetItemPos(mnMenuItemIndex)); diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 140190228f01..83ff5337dd6e 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -133,7 +133,7 @@ std::shared_ptr<DeckDescriptor> ResourceManager::ImplGetDeckDescriptor(const OUS if (rDeck->mbExperimental && !maMiscOptions.IsExperimentalMode()) continue; - if (rDeck->msId.equals(rsDeckId)) + if (rDeck->msId == rsDeckId) return rDeck; } return nullptr; @@ -151,7 +151,7 @@ std::shared_ptr<PanelDescriptor> ResourceManager::ImplGetPanelDescriptor(const O { const std::shared_ptr<PanelDescriptor>& rPanel = *iPanel; - if (rPanel->msId.equals(rsPanelId)) + if (rPanel->msId == rsPanelId) return rPanel; } return nullptr; @@ -221,7 +221,7 @@ const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatc const PanelDescriptor& rPanelDescriptor (*rPanel); if (rPanelDescriptor.mbExperimental && !maMiscOptions.IsExperimentalMode()) continue; - if ( ! rPanelDescriptor.msDeckId.equals(sDeckId)) + if ( rPanelDescriptor.msDeckId != sDeckId ) continue; const ContextList::Entry* pEntry = rPanelDescriptor.maContextList.GetMatch(rContext); @@ -470,7 +470,7 @@ void ResourceManager::ReadContextList ( vcl::EnumContext::Application eApplication (vcl::EnumContext::GetApplicationEnum(sApplicationName)); if (eApplication == vcl::EnumContext::Application::NONE - && !sApplicationName.equals(vcl::EnumContext::GetApplicationName(vcl::EnumContext::Application::NONE))) + && sApplicationName != vcl::EnumContext::GetApplicationName(vcl::EnumContext::Application::NONE)) { // Handle some special names: abbreviations that make // context descriptions more readable. @@ -636,7 +636,7 @@ void ResourceManager::StorePanelExpansionState ( { const std::shared_ptr<PanelDescriptor>& rPanel = *iPanel; - if (rPanel->msId.equals(rsPanelId)) + if (rPanel->msId == rsPanelId) { ContextList::Entry* pEntry(rPanel->maContextList.GetMatch(rContext)); if (pEntry != nullptr) diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index a52f5f22040a..ed2004473bf0 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -468,7 +468,7 @@ void SidebarController::UpdateConfigurations() { if (iDeck->mbIsEnabled) { - if (iDeck->msId.equals(msCurrentDeckId)) + if (iDeck->msId == msCurrentDeckId) { sNewDeckId = msCurrentDeckId; break; @@ -542,7 +542,7 @@ void SidebarController::SwitchToDefaultDeck() void SidebarController::SwitchToDeck ( const ::rtl::OUString& rsDeckId) { - if ( ! msCurrentDeckId.equals(rsDeckId) + if ( msCurrentDeckId != rsDeckId || ! mbIsDeckOpen || mnRequestedForceFlags!=SwitchFlag_NoForce) { @@ -662,7 +662,7 @@ void SidebarController::SwitchToDeck ( const bool bForceNewPanels ((mnRequestedForceFlags&SwitchFlag_ForceNewPanels)!=0); mnRequestedForceFlags = SwitchFlag_NoForce; - if ( ! msCurrentDeckId.equals(rDeckDescriptor.msId) + if ( msCurrentDeckId != rDeckDescriptor.msId || bForceNewDeck) { if (mpCurrentDeck) diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index 3b969727667e..024ce6b17397 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -215,7 +215,7 @@ void TabBar::HighlightDeck (const OUString& rsDeckId) { for (ItemContainer::iterator iItem(maItems.begin()); iItem != maItems.end(); ++iItem) { - if (iItem->msDeckId.equals(rsDeckId)) + if (iItem->msDeckId == rsDeckId) iItem->mpButton->Check(); else iItem->mpButton->Check(false); |