diff options
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/chrdlg/drpcps.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmresultdialogs.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/misc/bookmark.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/misc/glossary.cxx | 7 | ||||
-rw-r--r-- | sw/source/ui/vba/vbatemplate.cxx | 7 |
8 files changed, 31 insertions, 29 deletions
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 854e3f29fcf3..fafe26d3ca07 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -107,10 +107,10 @@ void SwDropCapsPict::InitPrinter() // Create Default-String from character-count (A, AB, ABC, ...) OUString GetDefaultString(sal_Int32 nChars) { - OUString aStr; + OUStringBuffer aStr(nChars); for (sal_Int32 i = 0; i < nChars; i++) - aStr += OUString(static_cast<char>(i + 65)); - return aStr; + aStr.append(static_cast<sal_Unicode>(i + 65)); + return aStr.makeStringAndClear(); } static void calcFontHeightAnyAscent(vcl::RenderContext& rWin, vcl::Font const & _rFont, long& _nHeight, long& _nAscent) diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 0e3d04664e5a..b024cd71c264 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -594,21 +594,21 @@ namespace void lcl_WriteValues(const std::vector<OUString> *pFields, SvStream* pStream) { - OUString sLine; + OUStringBuffer sLine; const std::vector< OUString >::const_iterator aBegin = pFields->begin(); const std::vector< OUString >::const_iterator aEnd = pFields->end(); for(std::vector< OUString >::const_iterator aIter = aBegin; aIter != aEnd; ++aIter) { if (aIter==aBegin) { - sLine += "\"" + *aIter + "\""; + sLine.append("\"").append(*aIter).append("\""); } else { - sLine += "\t\"" + *aIter + "\""; + sLine.append("\t\"").append(*aIter).append("\""); } } - pStream->WriteByteStringLine( sLine, RTL_TEXTENCODING_UTF8 ); + pStream->WriteByteStringLine( sLine.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); } } diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 1b3c4f237772..f5680b980040 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -1114,7 +1114,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) OUString sEMail = lcl_GetColumnValueOf(sEMailColumn, xColAccess); SwMailDescriptor aDesc; aDesc.sEMail = sEMail; - OUString sBody; + OUStringBuffer sBody; if(bAsBody) { { @@ -1132,8 +1132,8 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) bool bDone = pInStream->ReadLine( sLine ); while ( bDone ) { - sBody += OStringToOUString(sLine, eEncoding); - sBody += "\n"; + sBody.append( OStringToOUString(sLine, eEncoding) ); + sBody.append("\n"); bDone = pInStream->ReadLine( sLine ); } } @@ -1183,10 +1183,10 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) } sGreeting += "\n"; - sBody = sGreeting + sBody; + sBody.insert(0, sGreeting); } } - aDesc.sBodyContent = sBody; + aDesc.sBodyContent = sBody.makeStringAndClear(); if(MM_DOCTYPE_HTML == nDocType) { aDesc.sBodyMimeType = "text/html; charset=" + diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index a791bf0d341d..2b42694961da 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3392,7 +3392,7 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, Button*, pBtn, void ) OUString SwTokenWindow::GetPattern() const { - OUString sRet; + OUStringBuffer sRet; for (auto it = m_aControlList.cbegin(); it != m_aControlList.cend(); ++it) { @@ -3403,10 +3403,10 @@ OUString SwTokenWindow::GetPattern() const : static_cast<const SwTOXButton*>(pCtrl)->GetFormToken(); //TODO: prevent input of TOX_STYLE_DELIMITER in KeyInput - sRet += rNewToken.GetString(); + sRet.append(rNewToken.GetString()); } - return sRet; + return sRet.makeStringAndClear(); } // Check if a control of the specified TokenType is already contained in the list diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index aa813f77fefd..81a76489fb10 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1222,10 +1222,10 @@ IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl, Button*, void) } SwFieldMgr aMgr(pSh); - OUString sFields; + OUStringBuffer sFields; for(OUString & s : m_sFields) { - sFields += s + OUStringLiteral1(TOX_STYLE_DELIMITER); + sFields.append(s).append(TOX_STYLE_DELIMITER); } if(bNewEntry) { @@ -1236,12 +1236,12 @@ IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl, Button*, void) aNewData.SetAuthorField(static_cast<ToxAuthorityField>(i), m_sFields[i]); pSh->ChangeAuthorityData(&aNewData); } - SwInsertField_Data aData(TYP_AUTHORITY, 0, sFields, OUString(), 0 ); + SwInsertField_Data aData(TYP_AUTHORITY, 0, sFields.makeStringAndClear(), OUString(), 0 ); aMgr.InsertField( aData ); } else if(aMgr.GetCurField()) { - aMgr.UpdateCurField(0, sFields, OUString()); + aMgr.UpdateCurField(0, sFields.makeStringAndClear(), OUString()); } } if(!bNewEntry) diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index f2eb26d68384..61182dae5e04 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -145,15 +145,15 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, SelectionChangedHdl, SvTreeListBox*, void) if (!m_pBookmarksBox->HasFocus()) return; - OUString sEditBoxText; + OUStringBuffer sEditBoxText; SvTreeListEntry* pSelected = m_pBookmarksBox->FirstSelected(); for (sal_Int32 i = m_pBookmarksBox->GetSelectionCount(); i; i--) { sw::mark::IMark* pBookmark = static_cast<sw::mark::IMark*>(pSelected->GetUserData()); OUString sEntryName = pBookmark->GetName(); - sEditBoxText = sEditBoxText + sEntryName; + sEditBoxText.append(sEntryName); if (i > 1) - sEditBoxText += ";"; + sEditBoxText.append(";"); pSelected = m_pBookmarksBox->NextSelected(pSelected); } if (m_pBookmarksBox->GetSelectionCount() > 0) @@ -162,7 +162,7 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, SelectionChangedHdl, SvTreeListBox*, void) m_pGotoBtn->Enable(m_pBookmarksBox->GetSelectionCount() == 1); m_pRenameBtn->Enable(m_pBookmarksBox->GetSelectionCount() == 1); m_pDeleteBtn->Enable(); - m_pEditBox->SetText(sEditBoxText); + m_pEditBox->SetText(sEditBoxText.makeStringAndClear()); } else { diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 386377e6c476..1d991e7ab272 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -92,14 +92,15 @@ static OUString lcl_GetValidShortCut( const OUString& rName ) while( rName[nStart-1]==' ' && nStart < nSz ) nStart++; - OUString aBuf = OUString(rName[nStart-1]); + OUStringBuffer aBuf; + aBuf.append(rName[nStart-1]); for( ; nStart < nSz; ++nStart ) { if( rName[nStart-1]==' ' && rName[nStart]!=' ') - aBuf += OUStringLiteral1(rName[nStart]); + aBuf.append(rName[nStart]); } - return aBuf; + return aBuf.makeStringAndClear(); } struct GroupUserData diff --git a/sw/source/ui/vba/vbatemplate.cxx b/sw/source/ui/vba/vbatemplate.cxx index 27af69f99148..c33cdb000b8d 100644 --- a/sw/source/ui/vba/vbatemplate.cxx +++ b/sw/source/ui/vba/vbatemplate.cxx @@ -32,7 +32,7 @@ using namespace ::com::sun::star; static OUString lcl_CheckGroupName( const OUString& rGroupName ) { - OUString sRet; + OUStringBuffer sRet; //group name should contain only A-Z and a-z and spaces for( sal_Int32 i = 0; i < rGroupName.getLength(); i++ ) { @@ -40,10 +40,11 @@ static OUString lcl_CheckGroupName( const OUString& rGroupName ) if (rtl::isAsciiAlphanumeric(cChar) || cChar == '_' || cChar == 0x20) { - sRet += OUStringLiteral1(cChar); + sRet.append(cChar); } } - return comphelper::string::strip(sRet, ' '); + sRet.strip(' '); + return sRet.makeStringAndClear(); } SwVbaTemplate::SwVbaTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const OUString& rFullUrl ) |