[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - vcl/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 30 07:47:25 UTC 2019
vcl/source/window/layout.cxx | 6 +-----
vcl/source/window/toolbox2.cxx | 15 +++++++++++++++
vcl/source/window/window.cxx | 13 +++++++++++--
3 files changed, 27 insertions(+), 7 deletions(-)
New commits:
commit 657b73d6be7c0efbbe838b3d3b90276bda702d58
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Sep 26 15:34:18 2019 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Sep 30 09:46:59 2019 +0200
jsdialogs: send images for toolbox items
Change-Id: I28a430271058290729cb254f2912341d32298590
Reviewed-on: https://gerrit.libreoffice.org/79700
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 5e5de5430d22..e0a6e93c087b 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -36,6 +36,9 @@
#include <svdata.hxx>
#include <brdwin.hxx>
#include <toolbox.h>
+#include <tools/stream.hxx>
+#include <vcl/cvtgrf.hxx>
+#include <comphelper/base64.hxx>
#include <unotools/confignode.hxx>
@@ -1801,6 +1804,18 @@ boost::property_tree::ptree ToolBox::DumpAsPropertyTree()
{
boost::property_tree::ptree aEntry;
int nId = GetItemId(i);
+
+ Image aImage = GetItemImage(nId);
+ SvMemoryStream aOStm(65535, 65535);
+
+ if(GraphicConverter::Export(aOStm, aImage.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);
+ aEntry.put("image", aBuffer.makeStringAndClear());
+ }
+
aEntry.put("type", "toolitem");
aEntry.put("text", GetItemText(nId));
aEntry.put("command", GetItemCommand(nId));
commit 71b49d2c5d2e463299f2ea05730337387a0f93ba
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Sep 25 16:27:57 2019 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Sep 30 09:46:44 2019 +0200
jsdialogs: send grid attach data
Change-Id: I667e1ba97f42ac3e7b806bcec929ff346400bdda
Reviewed-on: https://gerrit.libreoffice.org/79699
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 44988cfee49c..9b44f09857ae 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1439,11 +1439,7 @@ void VclGrid::setAllocation(const Size& rAllocation)
boost::property_tree::ptree VclGrid::DumpAsPropertyTree()
{
boost::property_tree::ptree aTree(VclContainer::DumpAsPropertyTree());
- array_type A = assembleGrid(*this);
- sal_Int32 nMaxX = A.shape()[0];
- sal_Int32 nMaxY = A.shape()[1];
- aTree.put("cols", nMaxX);
- aTree.put("rows", nMaxY);
+ aTree.put("type", "grid");
return aTree;
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b080c6b706b6..24724e6c8ada 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3352,8 +3352,17 @@ boost::property_tree::ptree Window::DumpAsPropertyTree()
{
while (pChild)
{
- if (pChild->IsVisible())
- aChildren.push_back(std::make_pair("", pChild->DumpAsPropertyTree()));
+ if (pChild->IsVisible()) {
+ boost::property_tree::ptree aSubTree = pChild->DumpAsPropertyTree();
+ int nLeft = pChild->get_grid_left_attach();
+ int nTop = pChild->get_grid_top_attach();
+ if (nLeft != -1 && nTop != -1)
+ {
+ aSubTree.put("left", OUString::number(nLeft));
+ aSubTree.put("top", OUString::number(nTop));
+ }
+ aChildren.push_back(std::make_pair("", aSubTree));
+ }
pChild = pChild->mpWindowImpl->mpNext;
}
aTree.add_child("children", aChildren);
More information about the Libreoffice-commits
mailing list