sw/source/uibase/shells/drawdlg.cxx | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+)
New commits: commit 04302a800860bc016fb297195a653bff5b9f454f Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Nov 21 11:03:11 2019 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Wed Nov 27 16:01:29 2019 +0100 jsdialogs: send .uno:FillStyle updates Change-Id: I31eab196466b380d1121dece59e9c19f8380fb9b Reviewed-on: https://gerrit.libreoffice.org/83366 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/83777 Tested-by: Jenkins diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index 181107829a7f..c465c04618b9 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -39,6 +39,13 @@ #include <svx/xflclit.hxx> #include <svx/chrtitem.hxx> #include <svx/xlnwtit.hxx> +#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; void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) { @@ -250,6 +257,56 @@ namespace pArgs->Put(aItem); } } + + 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()); + } + } } void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq) @@ -318,6 +375,10 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) } else rSet.Put(pSdrView->GetDefaultAttr()); + + SfxViewShell* pViewShell = GetShell().GetSfxViewShell(); + if (pViewShell && comphelper::LibreOfficeKit::isActive()) + lcl_sendAttrUpdatesForLOK( pViewShell, rSet ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits