desktop/source/lib/init.cxx   |    4 ++--
 vcl/source/control/button.cxx |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 68c13732a3518442f4cbd64330e692a66dad8515
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Aug 22 09:00:03 2022 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Aug 22 11:48:23 2022 +0200

    Use comphelper::Base64::encode taking OStringBuffer where applicable
    
    Change-Id: I65c46ad97804827477adba7bbc4eed13cc16b606
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138654
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit 5b9fd9222a10ce9fcf632e940ed720f990e183da)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138540
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 16bf1cb16542..ada68c426d61 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4600,7 +4600,7 @@ static bool encodeImageAsHTML(
     // Encode in base64.
     auto aSeq = Sequence<sal_Int8>(reinterpret_cast<const 
sal_Int8*>(aRet.getStr()),
                                    aRet.getLength());
-    OUStringBuffer aBase64Data;
+    OStringBuffer aBase64Data;
     comphelper::Base64::encode(aBase64Data, aSeq);
 
     // Embed in HTML.
@@ -4611,7 +4611,7 @@ static bool encodeImageAsHTML(
         + getGenerator().toUtf8()
         + "\"/>"
         "</head><body><img src=\"data:" + aMimeType + ";base64,"
-        + aBase64Data.makeStringAndClear().toUtf8() + "\"/></body></html>";
+        + aBase64Data + "\"/></body></html>";
 
     return true;
 }
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 210d2b6290e0..ddec46b6c27b 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -628,9 +628,9 @@ void Button::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
         if(GraphicConverter::Export(aOStm, GetModeImage().GetBitmapEx(), 
ConvertDataFormat::PNG) == ERRCODE_NONE)
         {
             css::uno::Sequence<sal_Int8> aSeq( static_cast<sal_Int8 const 
*>(aOStm.GetData()), aOStm.Tell());
-            OUStringBuffer aBuffer("data:image/png;base64,");
+            OStringBuffer aBuffer("data:image/png;base64,");
             ::comphelper::Base64::encode(aBuffer, aSeq);
-            rJsonWriter.put("image", aBuffer.makeStringAndClear());
+            rJsonWriter.put("image", aBuffer);
         }
     }
 

Reply via email to