Kaydet (Commit) 6af02550 authored tarafından Noel Grandin's avatar Noel Grandin

use more OUString::operator== in sfx2..svtools

Change-Id: I859b77319f551eabd19dae54bd69c212221112a8
Reviewed-on: https://gerrit.libreoffice.org/39938Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 8e39ef66
......@@ -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 ) ) );
}
......
......@@ -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 )
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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() );
}
}
......
......@@ -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;
......
......@@ -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
......
......@@ -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()
......
......@@ -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));
......
......@@ -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)
......
......@@ -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)
......
......@@ -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);
......
......@@ -1944,7 +1944,7 @@ void SmSymDefineDialog::UpdateButtons()
//! (Font-, Style- and SymbolSet name comparison is not case sensitive)
bool bEqual = pOrigSymbol
&& aTmpSymbolSetName.equalsIgnoreAsciiCase(pOldSymbolSetName->GetText())
&& aTmpSymbolName.equals(pOrigSymbol->GetName())
&& aTmpSymbolName == pOrigSymbol->GetName()
&& pFonts->GetSelectEntry().equalsIgnoreAsciiCase(
pOrigSymbol->GetFace().GetFamilyName())
&& pStyles->GetText().equalsIgnoreAsciiCase(
......
......@@ -623,10 +623,10 @@ void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference<
switch(rAttrTokenMap.Get(nPrefix,aLocalName))
{
case XML_TOK_FONTWEIGHT:
nIsBold = sal_Int8(sValue.equals(GetXMLToken(XML_BOLD)));
nIsBold = sal_Int8(sValue == GetXMLToken(XML_BOLD));
break;
case XML_TOK_FONTSTYLE:
nIsItalic = sal_Int8(sValue.equals(GetXMLToken(XML_ITALIC)));
nIsItalic = sal_Int8(sValue == GetXMLToken(XML_ITALIC));
break;
case XML_TOK_FONTSIZE:
::sax::Converter::convertDouble(nFontSize, sValue);
......@@ -1464,8 +1464,7 @@ void SmXMLOperatorContext_Impl::StartElement(const uno::Reference<
switch(rAttrTokenMap.Get(nPrefix,aLocalName))
{
case XML_TOK_STRETCHY:
bIsStretchy = sValue.equals(
GetXMLToken(XML_TRUE));
bIsStretchy = sValue == GetXMLToken(XML_TRUE);
break;
default:
break;
......
......@@ -67,7 +67,7 @@ const OUString SmLocalizedSymbolData::GetUiSymbolName( const OUString &rExportNa
sal_uInt32 nCount = rExportNames.Count();
for (sal_uInt32 i = 0; i < nCount; ++i)
{
if (rExportNames.GetString(i).equals(rExportName))
if (rExportNames.GetString(i) == rExportName)
{
aRes = rUiNames.GetString(i);
break;
......@@ -87,7 +87,7 @@ const OUString SmLocalizedSymbolData::GetExportSymbolName( const OUString &rUiNa
sal_uInt32 nCount = rUiNames.Count();
for (sal_uInt32 i = 0; i < nCount; ++i)
{
if (rUiNames.GetString(i).equals(rUiName))
if (rUiNames.GetString(i) == rUiName)
{
aRes = rExportNames.GetString(i);
break;
......@@ -107,7 +107,7 @@ const OUString SmLocalizedSymbolData::GetUiSymbolSetName( const OUString &rExpor
sal_uInt32 nCount = rExportNames.Count();
for (sal_uInt32 i = 0; i < nCount; ++i)
{
if (rExportNames.GetString(i).equals(rExportName))
if (rExportNames.GetString(i) == rExportName)
{
aRes = rUiNames.GetString(i);
break;
......@@ -127,7 +127,7 @@ const OUString SmLocalizedSymbolData::GetExportSymbolSetName( const OUString &rU
sal_uInt32 nCount = rUiNames.Count();
for (sal_uInt32 i = 0; i < nCount; ++i)
{
if (rUiNames.GetString(i).equals(rUiName))
if (rUiNames.GetString(i) == rUiName)
{
aRes = rExportNames.GetString(i);
break;
......
......@@ -778,7 +778,7 @@ void delete_all_singleton_entries(
::std::list< OUString >::const_iterator const iEnd( impl_names.end() );
for ( ; iPos != iEnd; ++iPos )
{
if (iPos->equals( registered_implname ))
if (*iPos == registered_implname)
{
registered_implnames[ n ] = p[ nNewLength -1 ];
--nNewLength;
......@@ -891,7 +891,7 @@ bool is_supported_service(
OUString const & service_name,
Reference< reflection::XServiceTypeDescription > const & xService_td )
{
if (xService_td->getName().equals( service_name ))
if (xService_td->getName() == service_name)
return true;
Sequence< Reference< reflection::XServiceTypeDescription > > seq(
xService_td->getMandatoryServices() );
......@@ -934,7 +934,7 @@ void insert_singletons(
try
{
OUString existing_name( xKey2->getStringValue() );
if (! existing_name.equals( service_name ))
if ( existing_name != service_name )
{
Reference< container::XHierarchicalNameAccess > xTDMgr;
OUString the_tdmgr =
......@@ -1003,7 +1003,7 @@ void insert_singletons(
OUString const * pImplnames = implnames.getConstArray();
while (nPos_implnames--)
{
if (implname.equals( pImplnames[ nPos_implnames ] ))
if (implname == pImplnames[ nPos_implnames ])
break;
}
if (nPos_implnames < 0)
......
......@@ -1417,42 +1417,42 @@ void JavaVirtualMachine::setINetSettingsInVM(bool set_reset)
OUString propName= prop.copy( 0, index);
OUString propValue= prop.copy( index + 1);
if( propName.equals( sFtpProxyHost))
if( propName == sFtpProxyHost)
{
jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength());
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr);
pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsFtpProxyHost, jsVal);
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr);
}
else if( propName.equals( sFtpProxyPort))
else if( propName == sFtpProxyPort)
{
jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength());
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr);
pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsFtpProxyPort, jsVal);
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr);
}
else if( propName.equals( sFtpNonProxyHosts))
else if( propName == sFtpNonProxyHosts)
{
jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength());
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr);
pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsFtpNonProxyHosts, jsVal);
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr);
}
else if( propName.equals( sHttpProxyHost))
else if( propName == sHttpProxyHost)
{
jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength());
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr);
pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsHttpProxyHost, jsVal);
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr);
}
else if( propName.equals( sHttpProxyPort))
else if( propName == sHttpProxyPort)
{
jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength());
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr);
pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsHttpProxyPort, jsVal);
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr);
}
else if( propName.equals( sHttpNonProxyHosts))
else if( propName == sHttpNonProxyHosts)
{
jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength());
if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr);
......
......@@ -505,7 +505,7 @@ void AccessController::checkAndClearPostPoned()
OSL_ASSERT( m_singleUser_init );
for (const auto & p : vec)
{
OSL_ASSERT( m_singleUserId.equals( p.first ) );
OSL_ASSERT( m_singleUserId == p.first );
m_singleUserPermissions.checkPermission( p.second );
}
break;
......
......@@ -228,7 +228,7 @@ bool SocketPermission::implies( Permission const & perm ) const
return false;
if (! demanded.resolveHost())
return false;
return m_ip.equals( demanded.m_ip );
return m_ip == demanded.m_ip;
}
OUString SocketPermission::toString() const
......@@ -365,7 +365,7 @@ bool FilePermission::implies( Permission const & perm ) const
if (m_url.equalsIgnoreAsciiCase( demanded.m_url ))
return true;
#else
if (m_url.equals( demanded.m_url ))
if (m_url == demanded.m_url )
return true;
#endif
if (m_url.getLength() > demanded.m_url.getLength())
......@@ -438,7 +438,7 @@ bool RuntimePermission::implies( Permission const & perm ) const
RuntimePermission const & demanded = static_cast< RuntimePermission const & >( perm );
// check name
return m_name.equals( demanded.m_name );
return m_name == demanded.m_name;
}
OUString RuntimePermission::toString() const
......
......@@ -214,7 +214,7 @@ beans::Property PropertySetInfo_Impl::getPropertyByName( OUString const & name )
beans::Property const * p = m_properties.getConstArray();
for ( sal_Int32 nPos = m_properties.getLength(); nPos--; )
{
if (p[ nPos ].Name.equals( name ))
if (p[ nPos ].Name == name)
return p[ nPos ];
}
throw beans::UnknownPropertyException(
......@@ -226,7 +226,7 @@ sal_Bool PropertySetInfo_Impl::hasPropertyByName( OUString const & name )
beans::Property const * p = m_properties.getConstArray();
for ( sal_Int32 nPos = m_properties.getLength(); nPos--; )
{
if (p[ nPos ].Name.equals( name ))
if (p[ nPos ].Name == name)
return true;
}
return false;
......
......@@ -241,7 +241,7 @@ namespace svgio
<< e.getMessage() << "\"");
}
if (!aAbsUrl.isEmpty() && !rPath.equals(aAbsUrl))
if (!aAbsUrl.isEmpty() && rPath != aAbsUrl)
{
SvFileStream aStream(aAbsUrl, StreamMode::STD_READ);
Graphic aGraphic;
......
......@@ -38,7 +38,7 @@ struct equalOUString
{
bool operator()(const OUString& r1, const OUString& r2) const
{
return r1.equals( r2 );
return r1 == r2;
}
};
......
......@@ -202,9 +202,9 @@ void DocumentLockFile::RemoveFile()
LockFileEntry aNewEntry = GenerateOwnEntry();
LockFileEntry aFileData = GetLockData();
if ( !aFileData[LockFileComponent::SYSUSERNAME].equals( aNewEntry[LockFileComponent::SYSUSERNAME] )
|| !aFileData[LockFileComponent::LOCALHOST].equals( aNewEntry[LockFileComponent::LOCALHOST] )
|| !aFileData[LockFileComponent::USERURL].equals( aNewEntry[LockFileComponent::USERURL] ) )
if ( aFileData[LockFileComponent::SYSUSERNAME] != aNewEntry[LockFileComponent::SYSUSERNAME]
|| aFileData[LockFileComponent::LOCALHOST] != aNewEntry[LockFileComponent::LOCALHOST]
|| aFileData[LockFileComponent::USERURL] != aNewEntry[LockFileComponent::USERURL] )
throw io::IOException(); // not the owner, access denied
RemoveFileDirectly();
......
......@@ -1283,7 +1283,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
eNewType = css::util::NumberFormat::TEXT;
break;
default:
if (pLoc->getTime100SecSep().equals(sStrArray[i]))
if (pLoc->getTime100SecSep() == sStrArray[i])
{
bDecSep = true; // for SS,0
}
......@@ -1338,7 +1338,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
{
eScannedType = css::util::NumberFormat::UNDEFINED;
}
else if (!pLoc->getTimeSep().equals(sStrArray[i]))
else if (pLoc->getTimeSep() != sStrArray[i])
{
return nPos;
}
......@@ -1359,7 +1359,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
eScannedType = css::util::NumberFormat::UNDEFINED;
}
else if ( pFormatter->GetDateSep() != sStrArray[i] &&
!pLoc->getTimeSep().equals(sStrArray[i]) )
pLoc->getTimeSep() != sStrArray[i] )
{
return nPos;
}
......
......@@ -548,7 +548,7 @@ OUString PasswordContainer::EncodePasswords(const vector< OUString >& lines, con
void PasswordContainer::UpdateVector( const OUString& aURL, list< NamePassRecord >& toUpdate, NamePassRecord& aRecord, bool writeFile )
{
for( list< NamePassRecord >::iterator aNPIter = toUpdate.begin(); aNPIter != toUpdate.end(); ++aNPIter )
if( aNPIter->GetUserName().equals( aRecord.GetUserName() ) )
if( aNPIter->GetUserName() == aRecord.GetUserName() )
{
if( aRecord.HasPasswords( MEMORY_RECORD ) )
aNPIter->SetMemPasswords( aRecord.GetMemPasswords() );
......@@ -689,7 +689,7 @@ Sequence< UserRecord > PasswordContainer::FindUsr( const list< NamePassRecord >&
aNPIter != userlist.end();
++aNPIter, ++nInd )
{
if( aNPIter->GetUserName().equals( aName ) )
if( aNPIter->GetUserName() == aName )
{
Sequence< UserRecord > aResult(1);
bool bTryToDecode = true;
......@@ -853,7 +853,7 @@ OUString const & PasswordContainer::GetMasterPassword( const Reference< XInterac
else
{
vector< OUString > aRM( DecodePasswords( aEncodedMP, aPass ) );
if( aRM.empty() || !aPass.equals( aRM[0] ) )
if( aRM.empty() || aPass != aRM[0] )
{
bAskAgain = true;
aRMode = PasswordRequestMode_PASSWORD_REENTER;
......@@ -896,7 +896,7 @@ void SAL_CALL PasswordContainer::remove( const OUString& aURL, const OUString& a
if( aIter != m_aContainer.end() )
{
for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); ++aNPIter )
if( aNPIter->GetUserName().equals( aName ) )
if( aNPIter->GetUserName() == aName )
{
if( aNPIter->HasPasswords( PERSISTENT_RECORD ) && m_pStorageFile )
m_pStorageFile->remove( aURL, aName ); // remove record ( aURL, aName )
......@@ -936,7 +936,7 @@ void SAL_CALL PasswordContainer::removePersistent( const OUString& aURL, const O
if( aIter != m_aContainer.end() )
{
for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); ++aNPIter )
if( aNPIter->GetUserName().equals( aName ) )
if( aNPIter->GetUserName() == aName )
{
if( aNPIter->HasPasswords( PERSISTENT_RECORD ) )
{
......@@ -1060,7 +1060,7 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R
do {
aPass = RequestPasswordFromUser( aRMode, xTmpHandler );
bResult = ( !aPass.isEmpty() && aPass.equals( m_aMasterPasswd ) );
bResult = ( !aPass.isEmpty() && aPass == m_aMasterPasswd );
aRMode = PasswordRequestMode_PASSWORD_REENTER; // further questions with error notification
} while( !bResult && !aPass.isEmpty() );