diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-09 09:50:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-09 13:17:27 +0100 |
commit | 5089bdb234a93bcb62b597c18b8ab66048246b13 (patch) | |
tree | 0983967d89d9662b8484c88d2590cfdd7362fa43 /sw/source/ui | |
parent | 0ba03a38f022ca8d3705ae1370bb1d739e1e973f (diff) |
Related: fdo#38838 remove UniString::EqualsAscii
Change-Id: I55c85c1c44452c7fb6ac40591aea7177d054affe
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/envelp/envimg.cxx | 22 | ||||
-rw-r--r-- | sw/source/ui/fldui/changedb.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/langhelper.cxx | 20 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh1.cxx | 20 |
5 files changed, 38 insertions, 45 deletions
diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx index 63be8798743c..b31c1d9fe740 100644 --- a/sw/source/ui/envelp/envimg.cxx +++ b/sw/source/ui/envelp/envimg.cxx @@ -59,34 +59,34 @@ SW_DLLPUBLIC String MakeSender() bool bLastLength = true; for( xub_StrLen i = 0; i < nTokenCount; i++ ) { - String sToken = sSenderToken.GetToken( 0, ';', nSttPos ); - if(sToken.EqualsAscii("COMPANY")) + OUString sToken = sSenderToken.GetToken( 0, ';', nSttPos ); + if (sToken == "COMPANY") { xub_StrLen nOldLen = sRet.Len(); sRet += (String)rUserOpt.GetCompany(); bLastLength = sRet.Len() != nOldLen; } - else if(sToken.EqualsAscii("CR")) + else if (sToken == "CR") { if(bLastLength) sRet +=NEXTLINE; bLastLength = true; } - else if(sToken.EqualsAscii("FIRSTNAME")) + else if (sToken == "FIRSTNAME") sRet += (String)rUserOpt.GetFirstName(); - else if(sToken.EqualsAscii("LASTNAME")) + else if (sToken == "LASTNAME") sRet += (String)rUserOpt.GetLastName(); - else if(sToken.EqualsAscii("ADDRESS")) + else if (sToken == "ADDRESS") sRet += (String)rUserOpt.GetStreet(); - else if(sToken.EqualsAscii("COUNTRY")) + else if (sToken == "COUNTRY") sRet += (String)rUserOpt.GetCountry(); - else if(sToken.EqualsAscii("POSTALCODE")) + else if (sToken == "POSTALCODE") sRet += (String)rUserOpt.GetZip(); - else if(sToken.EqualsAscii("CITY")) + else if (sToken == "CITY") sRet += (String)rUserOpt.GetCity(); - else if(sToken.EqualsAscii("STATEPROV")) + else if (sToken == "STATEPROV") sRet += (String)rUserOpt.GetState(); - else if(sToken.Len()) //spaces + else if (!sToken.isEmpty()) //spaces sRet += sToken; } return sRet; diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index aba46b36483e..e71e3988135b 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -253,19 +253,12 @@ IMPL_LINK_NOARG(SwChangeDBDlg, TreeSelectHdl) --------------------------------------------------------------------*/ void SwChangeDBDlg::ShowDBName(const SwDBData& rDBData) { - String sTmp(rDBData.sDataSource); - String sName; - sTmp += '.'; - sTmp += (String)rDBData.sCommand; + OUString sTmp(rDBData.sDataSource); + sTmp += "."; + sTmp += rDBData.sCommand; - for (sal_uInt16 i = 0; i < sTmp.Len(); i++) - { - sName += sTmp.GetChar(i); - if (sTmp.GetChar(i) == '~') - sName += '~'; - } - - if (sName.EqualsAscii(".")) //empty + OUString sName(sTmp.replaceAll("~", "~~")); + if (sName == ".") //empty sName = SW_RESSTR(SW_STR_NONE); m_pDocDBNameFT->SetText(sName); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 3064a955a695..53d55c0cf4b4 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1088,8 +1088,8 @@ void SwTOXSelectTabPage::ApplyTOXDescription() } else if(TOX_AUTHORITIES == aCurType.eType) { - String sBrackets(rDesc.GetAuthBrackets()); - if(!sBrackets.Len() || sBrackets.EqualsAscii(" ")) + OUString sBrackets(rDesc.GetAuthBrackets()); + if(sBrackets.isEmpty() || sBrackets == " ") m_pBracketLB->SelectEntryPos(0); else m_pBracketLB->SelectEntry(sBrackets); diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx index 336157533c61..bea63a82aebe 100644 --- a/sw/source/ui/shells/langhelper.cxx +++ b/sw/source/ui/shells/langhelper.cxx @@ -111,7 +111,7 @@ namespace SwLangHelper EditEngine * pEditEngine = rEditView.GetEditEngine(); // get the language - String aNewLangTxt; + OUString aNewLangTxt; SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, SID_LANGUAGE_STATUS , sal_False ); if (pItem) @@ -122,7 +122,7 @@ namespace SwLangHelper //!! SwTextShell got destroyed meanwhile.) SfxViewFrame *pViewFrame = rView.GetViewFrame(); - if (aNewLangTxt.EqualsAscii( "*" )) + if (aNewLangTxt == "*" ) { // open the dialog "Tools/Options/Language Settings - Language" SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); @@ -136,7 +136,7 @@ namespace SwLangHelper else { // setting the new language... - if (aNewLangTxt.Len() > 0) + if (!aNewLangTxt.isEmpty()) { const OUString aSelectionLangPrefix("Current_"); const OUString aParagraphLangPrefix("Paragraph_"); @@ -144,26 +144,26 @@ namespace SwLangHelper const String aStrNone( OUString("LANGUAGE_NONE") ); const String aStrResetLangs( OUString("RESET_LANGUAGES") ); - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; bool bForSelection = true; bool bForParagraph = false; - if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aSelectionLangPrefix, 0 ))) + if (-1 != (nPos = aNewLangTxt.indexOf( aSelectionLangPrefix, 0 ))) { // ... for the current selection - aNewLangTxt = aNewLangTxt.Erase( nPos, aSelectionLangPrefix.getLength() ); + aNewLangTxt = aNewLangTxt.replaceAt(nPos, aSelectionLangPrefix.getLength(), ""); bForSelection = true; } - else if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aParagraphLangPrefix , 0 ))) + else if (-1 != (nPos = aNewLangTxt.indexOf( aParagraphLangPrefix , 0 ))) { // ... for the current paragraph language - aNewLangTxt = aNewLangTxt.Erase( nPos, aParagraphLangPrefix.getLength() ); + aNewLangTxt = aNewLangTxt.replaceAt(nPos, aParagraphLangPrefix.getLength(), ""); bForSelection = true; bForParagraph = true; } - else if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aDocumentLangPrefix , 0 ))) + else if (-1 != (nPos = aNewLangTxt.indexOf( aDocumentLangPrefix , 0 ))) { // ... as default document language - aNewLangTxt = aNewLangTxt.Erase( nPos, aDocumentLangPrefix.getLength() ); + aNewLangTxt = aNewLangTxt.replaceAt(nPos, aDocumentLangPrefix.getLength(), ""); bForSelection = false; } diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index c018b5f15021..af18041f63ea 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -291,7 +291,7 @@ void SwTextShell::Execute(SfxRequest &rReq) case SID_LANGUAGE_STATUS: { // get the language - String aNewLangTxt; + OUString aNewLangTxt; SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_LANGUAGE_STATUS , sal_False ); if (pItem2) aNewLangTxt = pItem2->GetValue(); @@ -301,7 +301,7 @@ void SwTextShell::Execute(SfxRequest &rReq) //!! SwTextShell got destroyed meanwhile.) SfxViewFrame *pViewFrame = GetView().GetViewFrame(); - if (aNewLangTxt.EqualsAscii( "*" )) + if (aNewLangTxt == "*") { // open the dialog "Tools/Options/Language Settings - Language" // to set the documents default language @@ -326,7 +326,7 @@ void SwTextShell::Execute(SfxRequest &rReq) rWrtSh.Push(); // setting the new language... - if (aNewLangTxt.Len() > 0) + if (!aNewLangTxt.isEmpty()) { const OUString aSelectionLangPrefix("Current_"); const OUString aParagraphLangPrefix("Paragraph_"); @@ -340,26 +340,26 @@ void SwTextShell::Execute(SfxRequest &rReq) RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, 0 ); - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; bool bForSelection = true; bool bForParagraph = false; - if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aSelectionLangPrefix, 0 ))) + if (-1 != (nPos = aNewLangTxt.indexOf( aSelectionLangPrefix, 0 ))) { // ... for the current selection - aNewLangTxt = aNewLangTxt.Erase( nPos, aSelectionLangPrefix.getLength() ); + aNewLangTxt = aNewLangTxt.replaceAt(nPos, aSelectionLangPrefix.getLength(), ""); bForSelection = true; } - else if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aParagraphLangPrefix , 0 ))) + else if (-1 != (nPos = aNewLangTxt.indexOf(aParagraphLangPrefix, 0))) { // ... for the current paragraph language - aNewLangTxt = aNewLangTxt.Erase( nPos, aParagraphLangPrefix.getLength() ); + aNewLangTxt = aNewLangTxt.replaceAt(nPos, aParagraphLangPrefix.getLength(), ""); bForSelection = true; bForParagraph = true; } - else if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aDocumentLangPrefix , 0 ))) + else if (-1 != (nPos = aNewLangTxt.indexOf(aDocumentLangPrefix, 0))) { // ... as default document language - aNewLangTxt = aNewLangTxt.Erase( nPos, aDocumentLangPrefix.getLength() ); + aNewLangTxt = aNewLangTxt.replaceAt(nPos, aDocumentLangPrefix.getLength(), ""); bForSelection = false; } |