diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-14 11:00:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-15 12:25:47 +0200 |
commit | 9c52261c39a1090d07e2f5d2a41ca0c0fea41e81 (patch) | |
tree | ac00f19c91ca773557e01c6b2def0cc11c320982 /sw | |
parent | 8cb77fd34ae57f5aef0dce09fe4558db927e56b7 (diff) |
convert sw/source/ui/docvw/*.cxx from String to OUString
Change-Id: I3a70366bc4992557393ce478f0c457b26881402b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/acmplwrd.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/acmplwrd.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/docvw/AnnotationMenuButton.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/docvw/HeaderFooterWin.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/docvw/SidebarTxtControl.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 61 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin2.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/docvw/srcedtw.cxx | 2 |
8 files changed, 49 insertions, 52 deletions
diff --git a/sw/inc/acmplwrd.hxx b/sw/inc/acmplwrd.hxx index 416404f24422..9b6adc3a7377 100644 --- a/sw/inc/acmplwrd.hxx +++ b/sw/inc/acmplwrd.hxx @@ -70,7 +70,7 @@ public: void CheckChangedList(const editeng::SortedAutoCompleteStrings& rNewLst); // Returns all words matching a given prefix aMatch. - bool GetWordsMatching(String aMatch, std::vector<String>& aWords) const; + bool GetWordsMatching(OUString aMatch, std::vector<OUString>& aWords) const; }; diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index bae263805a40..c81d18a745bd 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -348,9 +348,9 @@ void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n ) * @param aMatch the prefix to search for * @param aWords the words to search in */ -bool SwAutoCompleteWord::GetWordsMatching(String aMatch, std::vector<String>& aWords) const +bool SwAutoCompleteWord::GetWordsMatching(OUString aMatch, std::vector<OUString>& aWords) const { - OUString aStringRoot = OUString( aMatch ); + OUString aStringRoot = aMatch; std::vector<OUString> suggestions; m_LookupTree.findSuggestions(aStringRoot, suggestions); @@ -362,7 +362,7 @@ bool SwAutoCompleteWord::GetWordsMatching(String aMatch, std::vector<String>& aW for (size_t i = 0; i < suggestions.size(); i++) { - aWords.push_back( String(suggestions[i]) ); + aWords.push_back( suggestions[i] ); } return true; diff --git a/sw/source/ui/docvw/AnnotationMenuButton.cxx b/sw/source/ui/docvw/AnnotationMenuButton.cxx index 7329f8e22678..0bd4bf29e4bc 100644 --- a/sw/source/ui/docvw/AnnotationMenuButton.cxx +++ b/sw/source/ui/docvw/AnnotationMenuButton.cxx @@ -89,12 +89,12 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt ) else { SvtUserOptions aUserOpt; - String sAuthor; - if ( !(sAuthor = aUserOpt.GetFullName()).Len() ) + OUString sAuthor; + if ( (sAuthor = aUserOpt.GetFullName()).isEmpty() ) { - if ( !(sAuthor = aUserOpt.GetID()).Len() ) + if ( (sAuthor = aUserOpt.GetID()).isEmpty() ) { - sAuthor = String( SW_RES( STR_REDLINE_UNKNOWN_AUTHOR )); + sAuthor = SW_RES( STR_REDLINE_UNKNOWN_AUTHOR ); } } // do not allow to reply to ourself and no answer possible if this note is in a protected section diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx index 7da710c97db1..19c5b5e35185 100644 --- a/sw/source/ui/docvw/HeaderFooterWin.cxx +++ b/sw/source/ui/docvw/HeaderFooterWin.cxx @@ -188,7 +188,7 @@ void SwHeaderFooterWin::SetOffset( Point aOffset, long nXLineStart, long nXLineE // Compute the text size and get the box position & size from it Rectangle aTextRect; - GetTextBoundRect( aTextRect, String( m_sLabel ) ); + GetTextBoundRect( aTextRect, OUString( m_sLabel ) ); Rectangle aTextPxRect = LogicToPixel( aTextRect ); FontMetric aFontMetric = GetFontMetric( GetFont() ); Size aBoxSize ( aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2, @@ -294,7 +294,7 @@ void SwHeaderFooterWin::Paint( const Rectangle& ) aSeq[2] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( aTextMatrix, - String( m_sLabel ), 0, m_sLabel.getLength(), + OUString( m_sLabel ), 0, m_sLabel.getLength(), std::vector< double >( ), aFontAttr, com::sun::star::lang::Locale(), @@ -393,7 +393,7 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot ) SwView& rView = GetEditWin()->GetView(); SwWrtShell& rSh = rView.GetWrtShell(); - const String& rStyleName = GetPageFrame()->GetPageDesc()->GetName(); + const OUString& rStyleName = GetPageFrame()->GetPageDesc()->GetName(); switch ( nSlot ) { case FN_HEADERFOOTER_EDIT: @@ -476,7 +476,7 @@ void SwHeaderFooterWin::MouseButtonDown( const MouseEvent& rMEvt ) SwView& rView = GetEditWin()->GetView(); SwWrtShell& rSh = rView.GetWrtShell(); - const String& rStyleName = GetPageFrame()->GetPageDesc()->GetName(); + const OUString& rStyleName = GetPageFrame()->GetPageDesc()->GetName(); rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false ); } else diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx index 4cdf95b414b4..ffed69a12354 100644 --- a/sw/source/ui/docvw/SidebarTxtControl.cxx +++ b/sw/source/ui/docvw/SidebarTxtControl.cxx @@ -111,11 +111,9 @@ void SidebarTxtControl::RequestHelp(const HelpEvent &rEvt) if ( nResId && mrDocView.GetWrtShell().GetContentAtPos( mrSidebarWin.GetAnchorPos(), aCntntAtPos ) ) { - OUString sTxt(SW_RESSTR(nResId)); - sTxt += ": "; - sTxt += aCntntAtPos.aFnd.pRedl->GetAuthorString(); - sTxt += " - "; - sTxt += GetAppLangDateTimeString( aCntntAtPos.aFnd.pRedl->GetTimeStamp() ); + OUString sTxt = SW_RESSTR( nResId ) + ": " + + aCntntAtPos.aFnd.pRedl->GetAuthorString() + " - " + + GetAppLangDateTimeString( aCntntAtPos.aFnd.pRedl->GetTimeStamp() ); Help::ShowQuickHelp( this,PixelToLogic(Rectangle(rEvt.GetMousePosPixel(),Size(50,10))),sTxt); } } @@ -271,8 +269,8 @@ void SidebarTxtControl::MouseButtonDown( const MouseEvent& rMEvt ) { GetTextView()->MouseButtonDown( rMEvt ); SwWrtShell &rSh = mrDocView.GetWrtShell(); - String sURL( pURL->GetURL() ); - String sTarget( pURL->GetTargetFrame() ); + OUString sURL( pURL->GetURL() ); + OUString sTarget( pURL->GetTargetFrame() ); ::LoadURL(rSh, sURL, URLLOAD_NOFILTER, sTarget); return; } diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 98a72971bad8..d4841f1798fe 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -278,7 +278,7 @@ struct QuickHelpData } // Fills internal structures with hopefully helpful information. - void FillStrArr( SwWrtShell& rSh, const String& rWord ); + void FillStrArr( SwWrtShell& rSh, const OUString& rWord ); void SortAndFilter(); }; @@ -727,7 +727,7 @@ sal_Bool SwEditWin::IsInputSequenceCheckingRequired( const OUString &rText, cons //return INVALID_HINT if language should not be explictly overridden, the correct //HintId to use for the eBufferLanguage otherwise static sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView& rView, - const String &rInBuffer) + const OUString &rInBuffer) { sal_uInt16 nWhich = INVALID_HINT; @@ -789,7 +789,7 @@ static sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView& // configuration switch that allows to give the preference // to the OOo setting or the system setting explicitly // and/or a better handling of the script type. - i18n::UnicodeScript eType = rInBuffer.Len() ? + i18n::UnicodeScript eType = !rInBuffer.isEmpty() ? (i18n::UnicodeScript)GetAppCharClass().getScript( rInBuffer, 0 ) : i18n::UnicodeScript_kScriptCount; @@ -1527,7 +1527,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) TblChgWidthHeightType eTblChgMode = nsTblChgWidthHeightType::WH_COL_LEFT; // initialization just for warning-free code sal_uInt16 nTblChgSize = 0; bool bStopKeyInputTimer = true; - String sFmlEntry; + OUString sFmlEntry; enum SW_KeyState { KS_Start, KS_CheckKey, KS_InsChar, KS_InsTab, @@ -1619,7 +1619,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) rSh.MoveSection( fnSectionCurr, fnSectionEnd ); rSh.Pop( sal_True ); rSh.EndSelect(); - sFmlEntry = '='; + sFmlEntry = "="; } else rSh.Pop( sal_False ); @@ -4472,8 +4472,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) const SvxURLField *pField = aVEvt.pURLField; if (pField) { - String sURL(pField->GetURL()); - String sTarget(pField->GetTargetFrame()); + OUString sURL(pField->GetURL()); + OUString sTarget(pField->GetTargetFrame()); ::LoadURL(rSh, sURL, nFilter, sTarget); } bCallShadowCrsr = sal_False; @@ -4600,7 +4600,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } else { - String aStyleName; + OUString aStyleName; switch ( m_pApplyTempl->eType ) { case SFX_STYLE_FAMILY_PARA: @@ -4664,7 +4664,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) uno::Reference< frame::XDispatchRecorder > xRecorder = m_rView.GetViewFrame()->GetBindings().GetRecorder(); - if ( aStyleName.Len() && xRecorder.is() ) + if ( !aStyleName.isEmpty() && xRecorder.is() ) { SfxShell *pSfxShell = lcl_GetShellFromDispatcher( m_rView, TYPE(SwTextShell) ); if ( pSfxShell ) @@ -5065,16 +5065,16 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) else { bCallBase = false; - String sRecord = rSh.DeleteExtTextInput(); + OUString sRecord = rSh.DeleteExtTextInput(); uno::Reference< frame::XDispatchRecorder > xRecorder = m_rView.GetViewFrame()->GetBindings().GetRecorder(); - if ( sRecord.Len() ) + if ( !sRecord.isEmpty() ) { // convert quotes in IME text // works on the last input character, this is escpecially in Korean text often done // quotes that are inside of the string are not replaced! - const sal_Unicode aCh = sRecord.GetChar(sRecord.Len() - 1); + const sal_Unicode aCh = sRecord[sRecord.getLength() - 1]; SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect(); if(pACorr && @@ -5670,9 +5670,9 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen ) } else { - String sStr( m_aHelpStrings[ nCurArrPos ] ); - sStr.Erase( 0, nLen ); - sal_uInt16 nL = sStr.Len(); + OUString sStr( m_aHelpStrings[ nCurArrPos ] ); + sStr = sStr.copy( nLen ); + sal_uInt16 nL = sStr.getLength(); const sal_uInt16 nVal = EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE | EXTTEXTINPUT_ATTR_HIGHLIGHT; const std::vector<sal_uInt16> aAttrs( nL, nVal ); @@ -5703,17 +5703,17 @@ void QuickHelpData::Stop( SwWrtShell& rSh ) ClearCntnt(); } -void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) +void QuickHelpData::FillStrArr( SwWrtShell& rSh, const OUString& rWord ) { enum Capitalization { CASE_LOWER, CASE_UPPER, CASE_SENTENCE, CASE_OTHER }; // Determine word capitalization const CharClass& rCC = GetAppCharClass(); - const String sWordLower = rCC.lowercase( rWord ); + const OUString sWordLower = rCC.lowercase( rWord ); Capitalization aWordCase = CASE_OTHER; - if ( rWord.Len() > 0 ) + if ( !rWord.isEmpty() ) { - if ( rWord.GetChar(0) == sWordLower.GetChar(0) ) + if ( rWord[0] == sWordLower[0] ) { if ( rWord == sWordLower ) aWordCase = CASE_LOWER; @@ -5721,8 +5721,8 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) else { // First character is not lower case i.e. assume upper or title case - String sWordSentence = sWordLower; - sWordSentence.SetChar( 0, rWord.GetChar(0) ); + OUString sWordSentence = sWordLower; + sWordSentence = sWordSentence.replaceAt( 0, 1, OUString(rWord[0]) ); if ( rWord == sWordSentence ) aWordCase = CASE_SENTENCE; else @@ -5742,18 +5742,17 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) { for ( long n = 0; n < aNames.getLength(); ++n ) { - const String& rStr( aNames[n].FullName ); + const OUString& rStr( aNames[n].FullName ); // Check string longer than word and case insensitive match - if( rStr.Len() > rWord.Len() && - static_cast<String>( rCC.lowercase( rStr, 0, rWord.Len() ) ) - == sWordLower ) + if( rStr.getLength() > rWord.getLength() && + rCC.lowercase( rStr, 0, rWord.getLength() ) == sWordLower ) { if ( aWordCase == CASE_LOWER ) m_aHelpStrings.push_back( rCC.lowercase( rStr ) ); else if ( aWordCase == CASE_SENTENCE ) { - String sTmp = rCC.lowercase( rStr ); - sTmp.SetChar( 0, rStr.GetChar(0) ); + OUString sTmp = rCC.lowercase( rStr ); + sTmp = sTmp.replaceAt( 0, 1, OUString(rStr[0]) ); m_aHelpStrings.push_back( sTmp ); } else if ( aWordCase == CASE_UPPER ) @@ -5769,19 +5768,19 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) // Add matching words from AutoCompleteWord list const SwAutoCompleteWord& rACList = rSh.GetAutoCompleteWords(); - std::vector<String> strings; + std::vector<OUString> strings; if ( rACList.GetWordsMatching( rWord, strings ) ) { for (unsigned int i= 0; i<strings.size(); i++) { - String aCompletedString = strings[i]; + OUString aCompletedString = strings[i]; if ( aWordCase == CASE_LOWER ) m_aHelpStrings.push_back( rCC.lowercase( aCompletedString ) ); else if ( aWordCase == CASE_SENTENCE ) { - String sTmp = rCC.lowercase( aCompletedString ); - sTmp.SetChar( 0, aCompletedString.GetChar(0) ); + OUString sTmp = rCC.lowercase( aCompletedString ); + sTmp = sTmp.replaceAt( 0, 1, OUString(aCompletedString[0]) ); m_aHelpStrings.push_back( sTmp ); } else if ( aWordCase == CASE_UPPER ) diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index 2068ebd037ae..91e3a36b0fb3 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -181,7 +181,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) // #i104300# // special handling if target is a cross-reference bookmark { - String sTmpSearchStr = sTxt.copy( 1 ); + OUString sTmpSearchStr = sTxt.copy( 1 ); IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); IDocumentMarkAccess::const_iterator_t ppBkmk = diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index 05fc3b654249..7d3f42bbc649 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -640,7 +640,7 @@ void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara ) { sal_Bool bTempModified = IsModified(); pTextEngine->RemoveAttribs( nPara, (sal_Bool)sal_True ); - String aSource( pTextEngine->GetText( nPara ) ); + OUString aSource( pTextEngine->GetText( nPara ) ); pTextEngine->SetUpdateMode( sal_False ); ImpDoHighlight( aSource, nPara ); TextView* pTmp = pTextEngine->GetActiveView(); |