summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-11-21 12:59:17 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2019-11-27 09:21:36 +0100
commit2269225b81c2c2ee176db91d25fe1533b40b5e5e (patch)
treeeed1ae1836ecbbbc44374970ef1b86c12af42266 /sd/source
parentaa5b9c86e20dddac55f73d241bb030b1ca51d786 (diff)
jsdialogs: send .uno:FillStyle updates in Impress
Change-Id: I9b266d9134678e98a5540ec3681d24b3ea43506a Reviewed-on: https://gerrit.libreoffice.org/83382 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/83778 Tested-by: Jenkins
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/view/drviewsf.cxx62
1 files changed, 62 insertions, 0 deletions
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 565283ce1c3a..4943effb2416 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -60,10 +60,68 @@
#include <svx/nbdtmgfact.hxx>
#include <svx/nbdtmg.hxx>
#include <memory>
+#include <svx/xfillit0.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+using namespace com::sun::star::drawing;
using namespace svx::sidebar;
using namespace ::com::sun::star;
+namespace {
+ OUString lcl_fillStyleEnumToString(FillStyle eStyle)
+ {
+ switch (eStyle)
+ {
+ case FillStyle_NONE:
+ return "NONE";
+
+ case FillStyle_SOLID:
+ return "SOLID";
+
+ case FillStyle_GRADIENT:
+ return "GRADIENT";
+
+ case FillStyle_HATCH:
+ return "HATCH";
+
+ case FillStyle_BITMAP:
+ return "BITMAP";
+
+ default:
+ return "";
+ }
+ }
+
+ void lcl_sendAttrUpdatesForLOK(SfxViewShell* pShell, const SfxItemSet& rSet)
+ {
+ if (!pShell)
+ return;
+
+ OUString sPayload;
+ const SfxPoolItem* pItem = rSet.GetItem(SID_ATTR_FILL_STYLE);
+
+ if (pItem)
+ {
+ const XFillStyleItem* pFillStyleItem = static_cast<const XFillStyleItem*>(pItem);
+ FillStyle eStyle;
+ css::uno::Any aAny;
+
+ pFillStyleItem->QueryValue(aAny);
+ aAny >>= eStyle;
+ sPayload = ".uno:FillStyle=" + lcl_fillStyleEnumToString(eStyle);
+ }
+
+ if (!sPayload.isEmpty())
+ {
+ pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+ OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
+ }
+ }
+}
+
namespace sd {
/**
@@ -726,6 +784,10 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
rSet.DisableItem( nWhich );
}
nWhich = aNewIter.NextWhich();
+
+ SfxViewShell* pViewShell = GetDrawView()->GetSfxViewShell();
+ if (pViewShell && comphelper::LibreOfficeKit::isActive())
+ lcl_sendAttrUpdatesForLOK( pViewShell, *pSet );
}
}