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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 17 09:21:06 UTC 2021


 vcl/source/control/button.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 8e5cb2bcae998b8606de12c7bc4cde1f98346190
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Jul 6 10:23:50 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Aug 17 11:20:33 2021 +0200

    jsdialog: image for radiobuttons
    
    Change-Id: Ic6027223c5771ffb659a4503cfd305d0decc2433
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118465
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119244
    Tested-by: Jenkins

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 517af24408bf..a9d34103555c 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2954,6 +2954,18 @@ void RadioButton::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
 
     if (!sGroupId.isEmpty())
         rJsonWriter.put("group", sGroupId);
+
+    if (!!maImage)
+    {
+        SvMemoryStream aOStm(6535, 6535);
+        if(GraphicConverter::Export(aOStm, maImage.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,");
+            ::comphelper::Base64::encode(aBuffer, aSeq);
+            rJsonWriter.put("image", aBuffer.makeStringAndClear());
+        }
+    }
 }
 
 FactoryFunction RadioButton::GetUITestFactory() const


More information about the Libreoffice-commits mailing list