summaryrefslogtreecommitdiff
path: root/vcl/source/window/layout.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-22 16:45:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-25 10:16:37 +0200
commit01e37e3e5626551b6e8d261e357afcea1ba7c758 (patch)
treebbd1bd5402b07c44747d7962a9db48f9c04c1de0 /vcl/source/window/layout.cxx
parente318d5d8146d18e2c76e23f2e3c39527f2af9f36 (diff)
use tools::JsonWriter for dumping property tree
Change-Id: I8f55af19ba10b71bd621e69b27000ab7cb565309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96677 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/layout.cxx')
-rw-r--r--vcl/source/window/layout.cxx33
1 files changed, 15 insertions, 18 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index af7208c52cb8..f09563fddaad 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -27,6 +27,7 @@
#include <boost/property_tree/ptree.hpp>
#include <vcl/vclmedit.hxx>
#include <sal/log.hxx>
+#include <tools/json_writer.hxx>
VclContainer::VclContainer(vcl::Window *pParent, WinBits nStyle)
: Window(WindowType::CONTAINER)
@@ -360,11 +361,10 @@ bool VclBox::set_property(const OString &rKey, const OUString &rValue)
return true;
}
-boost::property_tree::ptree VclBox::DumpAsPropertyTree()
+void VclBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
{
- boost::property_tree::ptree aTree(VclContainer::DumpAsPropertyTree());
- aTree.put("vertical", m_bVerticalContainer);
- return aTree;
+ VclContainer::DumpAsPropertyTree(rJsonWriter);
+ rJsonWriter.put("vertical", m_bVerticalContainer);
}
sal_uInt16 VclBox::getDefaultAccessibleRole() const
@@ -1308,11 +1308,10 @@ void VclGrid::setAllocation(const Size& rAllocation)
}
}
-boost::property_tree::ptree VclGrid::DumpAsPropertyTree()
+void VclGrid::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
{
- boost::property_tree::ptree aTree(VclContainer::DumpAsPropertyTree());
- aTree.put("type", "grid");
- return aTree;
+ VclContainer::DumpAsPropertyTree(rJsonWriter);
+ rJsonWriter.put("type", "grid");
}
bool toBool(const OUString &rValue)
@@ -1493,11 +1492,10 @@ OUString VclFrame::getDefaultAccessibleName() const
return VclBin::getDefaultAccessibleName();
}
-boost::property_tree::ptree VclFrame::DumpAsPropertyTree()
+void VclFrame::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
{
- boost::property_tree::ptree aTree(VclBin::DumpAsPropertyTree());
- aTree.put("type", "frame");
- return aTree;
+ VclBin::DumpAsPropertyTree(rJsonWriter);
+ rJsonWriter.put("type", "frame");
}
Size VclAlignment::calculateRequisition() const
@@ -2855,25 +2853,24 @@ VclScrolledWindow::~VclScrolledWindow()
disposeOnce();
}
-boost::property_tree::ptree VclDrawingArea::DumpAsPropertyTree()
+void VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
{
- boost::property_tree::ptree aTree(Control::DumpAsPropertyTree());
- aTree.put("type", "drawingarea");
+ Control::DumpAsPropertyTree(rJsonWriter);
+ rJsonWriter.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());
+ rJsonWriter.put("image", aBuffer.makeStringAndClear());
}
- return aTree;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */