diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-11 16:37:33 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-15 12:25:45 +0200 |
commit | fac5fe2c597b1d13dcee45121562041df860e2b2 (patch) | |
tree | d486618713d01002ecdf4be4aa459892b3493ecd | |
parent | c99cc9750841e92e4ba5678a3e558dd4668dd264 (diff) |
convert sw/source/ui/lingu/*.cxx from String to OUString
Change-Id: Ia582d330439674a7073fa6ddd13693fb9d3de86a
-rw-r--r-- | sw/source/ui/lingu/hhcwrp.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/lingu/olmenu.cxx | 46 |
2 files changed, 31 insertions, 31 deletions
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx index 85a408e28f83..3472ba542c58 100644 --- a/sw/source/ui/lingu/hhcwrp.cxx +++ b/sw/source/ui/lingu/hhcwrp.cxx @@ -281,9 +281,9 @@ void SwHHCWrapper::ChangeText( const OUString &rNewText, nChgLen = nIndex - nChgPos; nConvChgLen = nPos - nConvChgPos; #if OSL_DEBUG_LEVEL > 1 - String aInOrig( rOrigText.copy( nChgPos, nChgLen ) ); + OUString aInOrig( rOrigText.copy( nChgPos, nChgLen ) ); #endif - String aInNew( rNewText.copy( nConvChgPos, nConvChgLen ) ); + OUString aInNew( rNewText.copy( nConvChgPos, nConvChgLen ) ); // set selection to sub string to be replaced in original text xub_StrLen nChgInNodeStartIndex = static_cast< xub_StrLen >( nStartIndex + nCorrectionOffset + nChgPos ); @@ -291,7 +291,7 @@ void SwHHCWrapper::ChangeText( const OUString &rNewText, m_rWrtShell.GetCrsr()->GetMark()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex ); m_rWrtShell.GetCrsr()->GetPoint()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex + nChgLen ); #if OSL_DEBUG_LEVEL > 1 - String aSelTxt1( m_rWrtShell.GetSelTxt() ); + OUString aSelTxt1( m_rWrtShell.GetSelTxt() ); #endif // replace selected sub string with the corresponding @@ -346,7 +346,7 @@ void SwHHCWrapper::ChangeText_impl( const OUString &rNewText, bool bKeepAttribut m_rWrtShell.GetCurAttr( aItemSet ); #if OSL_DEBUG_LEVEL > 1 - String aSelTxt1( m_rWrtShell.GetSelTxt() ); + OUString aSelTxt1( m_rWrtShell.GetSelTxt() ); #endif m_rWrtShell.Delete(); m_rWrtShell.Insert( rNewText ); @@ -357,7 +357,7 @@ void SwHHCWrapper::ChangeText_impl( const OUString &rNewText, bool bKeepAttribut SwPosition *pMark = m_rWrtShell.GetCrsr()->GetMark(); pMark->nContent = pMark->nContent.GetIndex() - rNewText.getLength(); #if OSL_DEBUG_LEVEL > 1 - String aSelTxt2( m_rWrtShell.GetSelTxt() ); + OUString aSelTxt2( m_rWrtShell.GetSelTxt() ); #endif // since 'SetAttr' below functions like merging with the attributes @@ -402,7 +402,7 @@ void SwHHCWrapper::ReplaceUnit( OSL_ENSURE( aOrigTxt == rOrigText, "!! text mismatch !!" ); SwFmtRuby *pRuby = 0; bool bRubyBelow = false; - String aNewOrigText; + OUString aNewOrigText; switch (eAction) { case eExchange : @@ -449,7 +449,7 @@ void SwHHCWrapper::ReplaceUnit( if (pRuby) { m_rWrtShell.StartUndo( UNDO_SETRUBYATTR ); - if (aNewOrigText.Len()) + if (!aNewOrigText.isEmpty()) { // according to FT we currently should not bother about keeping // attributes in Hangul/Hanja conversion @@ -464,7 +464,7 @@ void SwHHCWrapper::ReplaceUnit( // of the flag. m_rWrtShell.EndSelect(); - m_rWrtShell.Left( 0, sal_True, aNewOrigText.Len(), sal_True, sal_True ); + m_rWrtShell.Left( 0, sal_True, aNewOrigText.getLength(), sal_True, sal_True ); } pRuby->SetPosition( static_cast<sal_uInt16>(bRubyBelow) ); diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index be4dd09a8355..138ca4623bdf 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -220,12 +220,12 @@ void SwSpellPopup::fillLangPopupMenu( } } - pPopupMenu->InsertItem( nLangItemIdStart + MN_NONE_OFFSET, String(SW_RES( STR_LANGSTATUS_NONE )), MIB_RADIOCHECK ); + pPopupMenu->InsertItem( nLangItemIdStart + MN_NONE_OFFSET, OUString(SW_RES( STR_LANGSTATUS_NONE )), MIB_RADIOCHECK ); if ( aLanguageTable.GetString( LANGUAGE_NONE ) == aCurLang ) pPopupMenu->CheckItem( nLangItemIdStart + MN_NONE_OFFSET, sal_True ); - pPopupMenu->InsertItem( nLangItemIdStart + MN_RESET_OFFSET, String(SW_RES( STR_RESET_TO_DEFAULT_LANGUAGE )), 0 ); - pPopupMenu->InsertItem( nLangItemIdStart + MN_MORE_OFFSET, String(SW_RES( STR_LANGSTATUS_MORE )), 0 ); + pPopupMenu->InsertItem( nLangItemIdStart + MN_RESET_OFFSET, OUString(SW_RES( STR_RESET_TO_DEFAULT_LANGUAGE )), 0 ); + pPopupMenu->InsertItem( nLangItemIdStart + MN_MORE_OFFSET, OUString(SW_RES( STR_LANGSTATUS_MORE )), 0 ); } @@ -235,7 +235,7 @@ static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl ) OUString aTmp; osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp ); Graphic aGraphic; - const String aFilterName( IMP_PNG ); + const OUString aFilterName( IMP_PNG ); if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) ) { aRes = Image( aGraphic.GetBitmapEx() ); @@ -346,7 +346,7 @@ SwSpellPopup::SwSpellPopup( } } - OUString aIgnoreSelection( String( SW_RES( STR_IGNORE_SELECTION ) ) ); + OUString aIgnoreSelection( OUString( SW_RES( STR_IGNORE_SELECTION ) ) ); OUString aSpellingAndGrammar = RetrieveLabelFromCommand( ".uno:SpellingAndGrammarDialog" ); SetItemText( MN_SPELLING_DLG, aSpellingAndGrammar ); sal_uInt16 nItemPos = GetItemPos( MN_IGNORE_WORD ); @@ -431,18 +431,18 @@ SwSpellPopup::SwSpellPopup( //ADD NEW LANGUAGE MENU ITEM /////////////////////////////////////////////////////////////////////////// - String aScriptTypesInUse( OUString::number( pWrtSh->GetScriptType() ) ); + OUString aScriptTypesInUse( OUString::number( pWrtSh->GetScriptType() ) ); SvtLanguageTable aLanguageTable; // get keyboard language - String aKeyboardLang; + OUString aKeyboardLang; SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin(); LanguageType nLang = rEditWin.GetInputLanguage(); if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM) aKeyboardLang = aLanguageTable.GetString( nLang ); // get the language that is in use - String aCurrentLang = OUString("*"); + OUString aCurrentLang("*"); nLang = SwLangHelper::GetCurrentLanguage( *pWrtSh ); if (nLang != LANGUAGE_DONTKNOW) aCurrentLang = aLanguageTable.GetString( nLang ); @@ -555,7 +555,7 @@ aInfo16( SW_RES(IMG_INFO_16) ) InsertSeparator(OString(), nPos++); } - OUString aIgnoreSelection( String( SW_RES( STR_IGNORE_SELECTION ) ) ); + OUString aIgnoreSelection( SW_RES( STR_IGNORE_SELECTION ) ); OUString aSpellingAndGrammar = RetrieveLabelFromCommand( ".uno:SpellingAndGrammarDialog" ); SetItemText( MN_SPELLING_DLG, aSpellingAndGrammar ); sal_uInt16 nItemPos = GetItemPos( MN_IGNORE_WORD ); @@ -586,18 +586,18 @@ aInfo16( SW_RES(IMG_INFO_16) ) //ADD NEW LANGUAGE MENU ITEM /////////////////////////////////////////////////////////////////////////// - String aScriptTypesInUse( OUString::number( pWrtSh->GetScriptType() ) ); + OUString aScriptTypesInUse( OUString::number( pWrtSh->GetScriptType() ) ); SvtLanguageTable aLanguageTable; // get keyboard language - String aKeyboardLang; + OUString aKeyboardLang; SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin(); LanguageType nLang = rEditWin.GetInputLanguage(); if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM) aKeyboardLang = aLanguageTable.GetString( nLang ); // get the language that is in use - String aCurrentLang = OUString("*"); + OUString aCurrentLang("*"); nLang = SwLangHelper::GetCurrentLanguage( *pWrtSh ); if (nLang != LANGUAGE_DONTKNOW) aCurrentLang = aLanguageTable.GetString( nLang ); @@ -687,27 +687,27 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) sal_Bool bOldIns = pSh->IsInsMode(); pSh->SetInsMode( sal_True ); - String aTmp( aSuggestions[ nAltIdx ] ); - String aOrig( bGrammarResults ? OUString() : xSpellAlt->getWord() ); + OUString aTmp( aSuggestions[ nAltIdx ] ); + OUString aOrig( bGrammarResults ? OUString() : xSpellAlt->getWord() ); // if orginal word has a trailing . (likely the end of a sentence) // and the replacement text hasn't, then add it to the replacement - if (aTmp.Len() && aOrig.Len() && - '.' == aOrig.GetChar( aOrig.Len() - 1) && /* !IsAlphaNumeric ??*/ - '.' != aTmp.GetChar( aTmp.Len() - 1)) + if (!aTmp.isEmpty() && !aOrig.isEmpty() && + '.' == aOrig[ aOrig.getLength() - 1] && /* !IsAlphaNumeric ??*/ + '.' != aTmp[ aTmp.getLength() - 1]) { - aTmp += '.'; + aTmp += "."; } // #111827# SwRewriter aRewriter; aRewriter.AddRule(UndoArg1, pSh->GetCrsrDescr()); - aRewriter.AddRule(UndoArg2, String(SW_RES(STR_YIELDS))); + aRewriter.AddRule(UndoArg2, OUString(SW_RES(STR_YIELDS))); - String aTmpStr( SW_RES(STR_START_QUOTE) ); + OUString aTmpStr( SW_RES(STR_START_QUOTE) ); aTmpStr += aTmp; - aTmpStr += String(SW_RES(STR_END_QUOTE)); + aTmpStr += OUString(SW_RES(STR_END_QUOTE)); aRewriter.AddRule(UndoArg3, aTmpStr); pSh->StartUndo(UNDO_UI_REPLACE, &aRewriter); @@ -780,7 +780,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) else if ((MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) || nId == MN_ADD_TO_DIC_SINGLE) { OUString aWord( xSpellAlt->getWord() ); - String aDicName; + OUString aDicName; if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) { @@ -847,7 +847,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, 0 ); - String aNewLangTxt; + OUString aNewLangTxt; if (MN_SET_LANGUAGE_SELECTION_START <= nId && nId <= MN_SET_LANGUAGE_SELECTION_END) { |