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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 24 15:48:16 UTC 2020


 include/vcl/layout.hxx       |   21 +--------------------
 vcl/source/window/layout.cxx |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 20 deletions(-)

New commits:
commit 0e498d7862e07b9f665b796e1386737f1bdb9b29
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jun 24 12:08:12 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jun 24 17:47:28 2020 +0200

    Move DumpAsPropertyTree code to cxx file
    
    Change-Id: Ib450c860aa11f0e8be933de4c6e216ca9c0d0b5a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97018
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 1081415fc4cf..9caa0c86a0e4 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -807,26 +807,7 @@ public:
         m_xTransferHelper = rHelper;
         m_nDragAction = eDNDConstants;
     }
-    boost::property_tree::ptree DumpAsPropertyTree() override
-    {
-        boost::property_tree::ptree aTree(Control::DumpAsPropertyTree());
-        aTree.put("type", "drawingarea");
-        ScopedVclPtrInstance<VirtualDevice> pDevice;
-        pDevice->SetOutputSize( GetSizePixel() );
-        tools::Rectangle aRect(Point(0,0), GetSizePixel());
-        Paint(*pDevice, aRect);
-        BitmapEx aImage = pDevice->GetBitmapEx( Point(0,0), GetSizePixel() );
-        SvMemoryStream aOStm(65535, 65535);
-
-        if(GraphicConverter::Export(aOStm, aImage, 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);
-            aTree.put("image", aBuffer.makeStringAndClear());
-        }
-        return aTree;
-    }
+    boost::property_tree::ptree DumpAsPropertyTree() override;
 };
 
 //Get first window of a pTopLevel window as
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 29c4cf0e7d41..af7208c52cb8 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2855,4 +2855,25 @@ VclScrolledWindow::~VclScrolledWindow()
     disposeOnce();
 }
 
+boost::property_tree::ptree VclDrawingArea::DumpAsPropertyTree()
+{
+    boost::property_tree::ptree aTree(Control::DumpAsPropertyTree());
+    aTree.put("type", "drawingarea");
+    ScopedVclPtrInstance<VirtualDevice> pDevice;
+    pDevice->SetOutputSize( GetSizePixel() );
+    tools::Rectangle aRect(Point(0,0), GetSizePixel());
+    Paint(*pDevice, aRect);
+    BitmapEx aImage = pDevice->GetBitmapEx( Point(0,0), GetSizePixel() );
+    SvMemoryStream aOStm(65535, 65535);
+
+    if(GraphicConverter::Export(aOStm, aImage, 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);
+        aTree.put("image", aBuffer.makeStringAndClear());
+    }
+    return aTree;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list