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

New commits:
commit 5b9fd9222a10ce9fcf632e940ed720f990e183da
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 10:22:52 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>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2f378ada3a6a..91f6b771a8f1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4587,7 +4587,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.
@@ -4598,7 +4598,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 6b7265d8e85f..ae97d953b4c3 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