diff options
Diffstat (limited to 'vcl/source/window/layout.cxx')
-rw-r--r-- | vcl/source/window/layout.cxx | 33 |
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: */ |