From 4135c764a901b791cb182cdb8201ccf173ea3033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Fri, 8 Nov 2019 15:40:02 +0100 Subject: [PATCH] jsdialogs: send .uno:FillColor & XLineColor status updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://gerrit.libreoffice.org/82307 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos (cherry picked from commit c28ea22c5198c1162fc5a535d35b407762b8a865) Change-Id: I665ca45293fb3e98a7940e24c1f14a5963b8d073 Reviewed-on: https://gerrit.libreoffice.org/82309 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- svx/source/svdraw/svdedtv1.cxx | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 15d69fa3e132..8c83304015dc 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -65,6 +65,11 @@ #include #include #include +#include +#include +#include +#include +#include #include // EditView @@ -927,6 +932,43 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con rAttr.MergeValue(rItem, true); } + if (comphelper::LibreOfficeKit::isActive()) + { + OUString sPayload; + switch(nWhich) + { + case XATTR_LINECOLOR: + { + const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINECOLOR); + if (pItem) + { + Color aColor = static_cast(pItem)->GetColorValue(); + sPayload = OUString::number(static_cast(aColor)); + + sPayload = ".uno:XLineColor=" + sPayload; + } + break; + } + + case XATTR_FILLCOLOR: + { + const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLCOLOR); + if (pItem) + { + Color aColor = static_cast(pItem)->GetColorValue(); + sPayload = OUString::number(static_cast(aColor)); + + sPayload = ".uno:FillColor=" + sPayload; + } + break; + } + } + + if (!sPayload.isEmpty()) + GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, + OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr()); + } + nWhich = aIter.NextWhich(); } }