diff options
Diffstat (limited to 'sw/source/ui/shells')
-rw-r--r-- | sw/source/ui/shells/langhelper.cxx | 20 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh1.cxx | 20 |
2 files changed, 20 insertions, 20 deletions
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; } |