[Libreoffice-commits] core.git: cui/source

Arkadiy Illarionov qarkai at gmail.com
Wed Oct 4 07:01:46 UTC 2017


 cui/source/options/certpath.cxx  |   11 +++++------
 cui/source/options/optjava.cxx   |   11 +++--------
 cui/source/options/optlingu.cxx  |    5 ++---
 cui/source/options/treeopt.cxx   |   10 ++++------
 cui/source/tabpages/autocdlg.cxx |    8 +++-----
 5 files changed, 17 insertions(+), 28 deletions(-)

New commits:
commit 9db36aac932f688adc492a90a7cd4b350dd19ed8
Author: Arkadiy Illarionov <qarkai at gmail.com>
Date:   Sun Oct 1 15:52:47 2017 +0300

    tdf#112689 Replace chained O(U)StringBuffer::append with operator+ in cui
    
    Change-Id: I41392108792ee91e01e32eb88ef50f238c2d3717
    Reviewed-on: https://gerrit.libreoffice.org/42996
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index d41a7e77b8aa..67f541a6363e 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -46,10 +46,9 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent)
 
     OUString sProfile(get<FixedText>("profile")->GetText());
     OUString sDirectory(get<FixedText>("dir")->GetText());
+    OUString sHeader = "\t" + sProfile + "\t" + sDirectory;
 
-    OUStringBuffer sHeader;
-    sHeader.append('\t').append(sProfile).append('\t').append(sDirectory);
-    m_pCertPathList->InsertHeaderEntry( sHeader.makeStringAndClear(), HEADERBAR_APPEND, HeaderBarItemBits::LEFT );
+    m_pCertPathList->InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HeaderBarItemBits::LEFT );
     m_pCertPathList->SetCheckButtonHdl( LINK( this, CertPathDialog, CheckHdl_Impl ) );
 
     m_pAddBtn->SetClickHdl( LINK( this, CertPathDialog, AddHdl_Impl ) );
@@ -75,9 +74,9 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent)
             if (!profile.isEmpty())
             {
                 OUString sProfilePath = xMozillaBootstrap->getProfilePath( productTypes[i], profile );
-                OUStringBuffer sEntry;
-                sEntry.append('\t').appendAscii(productNames[i]).append(':').append(profile).append('\t').append(sProfilePath);
-                SvTreeListEntry *pEntry = m_pCertPathList->InsertEntry(sEntry.makeStringAndClear());
+                OUString sEntry = "\t" + OUString::createFromAscii(productNames[i]) + ":" + profile
+                                + "\t" + sProfilePath;
+                SvTreeListEntry *pEntry = m_pCertPathList->InsertEntry(sEntry);
                 OUString* pCertPath = new OUString(sProfilePath);
                 pEntry->SetUserData(pCertPath);
             }
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 773230ad8fc9..323313c748d3 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -455,15 +455,10 @@ void SvxJavaOptionsPage::LoadJREs()
 void SvxJavaOptionsPage::AddJRE( JavaInfo const * _pInfo )
 {
 #if HAVE_FEATURE_JAVA
-    OUStringBuffer sEntry;
-    sEntry.append('\t');
-    sEntry.append(_pInfo->sVendor);
-    sEntry.append('\t');
-    sEntry.append(_pInfo->sVersion);
-    sEntry.append('\t');
+    OUString sEntry = "\t" + _pInfo->sVendor + "\t" + _pInfo->sVersion + "\t";
     if ( ( _pInfo->nFeatures & JFW_FEATURE_ACCESSBRIDGE ) == JFW_FEATURE_ACCESSBRIDGE )
-        sEntry.append(m_sAccessibilityText);
-    SvTreeListEntry* pEntry = m_pJavaList->InsertEntry(sEntry.makeStringAndClear());
+        sEntry += m_sAccessibilityText;
+    SvTreeListEntry* pEntry = m_pJavaList->InsertEntry(sEntry);
     INetURLObject aLocObj( _pInfo->sLocation );
     OUString* pLocation = new OUString( aLocObj.getFSysPath( FSysStyle::Detect ) );
     pEntry->SetUserData( pLocation );
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 6a7ddc081831..6a7572d32821 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -421,10 +421,9 @@ void BrwString_Impl::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::Rend
         OptionsUserData aData(reinterpret_cast<sal_uLong>(rEntry.GetUserData()));
         if (aData.HasNumericValue())
         {
-            OUStringBuffer sTxt;
-            sTxt.append(' ').append(static_cast<sal_Int32>(aData.GetNumericValue()));
+            OUString sTxt = " " + OUString::number(aData.GetNumericValue());
             rRenderContext.SetFont(aFont);
-            rRenderContext.DrawText(aNewPos, sTxt.makeStringAndClear());
+            rRenderContext.DrawText(aNewPos, sTxt);
         }
 
         rRenderContext.Pop();
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 9d55bd91c81e..fe88b2a8b7a6 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1049,12 +1049,10 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
     }
 
     {
-        OUStringBuffer sTitleBuf(sTitle);
-        sTitleBuf.append(" - ");
-        sTitleBuf.append(pTreeLB->GetEntryText(pParent));
-        sTitleBuf.append(" - ");
-        sTitleBuf.append(pTreeLB->GetEntryText(pEntry));
-        SetText(sTitleBuf.makeStringAndClear());
+        OUString sTitleText = sTitle
+                            + " - " + pTreeLB->GetEntryText(pParent)
+                            + " - " + pTreeLB->GetEntryText(pEntry);
+        SetText(sTitleText);
     }
 
     pCurrentPageEntry = pEntry;
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 65edb0fc84f2..e1a8af09e7dd 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -453,11 +453,9 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
     };
 
     m_pCheckLB->SvSimpleTable::SetTabs(aStaticTabs);
-    OUStringBuffer sHeader(get<vcl::Window>("m")->GetText());
-    sHeader.append('\t');
-    sHeader.append(get<vcl::Window>("t")->GetText());
-    sHeader.append('\t');
-    m_pCheckLB->InsertHeaderEntry(sHeader.makeStringAndClear(), HEADERBAR_APPEND,
+    OUString sHeader = get<vcl::Window>("m")->GetText() + "\t"
+                     + get<vcl::Window>("t")->GetText() + "\t";
+    m_pCheckLB->InsertHeaderEntry(sHeader, HEADERBAR_APPEND,
                         HeaderBarItemBits::CENTER | HeaderBarItemBits::VCENTER | HeaderBarItemBits::FIXEDPOS | HeaderBarItemBits::FIXED);
 
     m_pEditPB->SetClickHdl(LINK(this, OfaSwAutoFmtOptionsPage, EditHdl));


More information about the Libreoffice-commits mailing list