From db0f4b28d9f1583d9977f76114d86bac489de161 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 28 Nov 2019 14:41:53 +0100 Subject: jsdialog: migrate left/right margin to generic items dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie687393ae4b9a7f8350eea07c1d417c11fc532bd Reviewed-on: https://gerrit.libreoffice.org/84002 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- sw/source/uibase/shells/txtattr.cxx | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'sw') diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 737a1e094e41..1b11fcca7bad 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -40,8 +40,6 @@ #include #include #include -#include -#include #include #include @@ -755,28 +753,6 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) SvxLRSpaceItem aLR = aCoreSet.Get( RES_LR_SPACE ); aLR.SetWhich(nSlot); rSet.Put(aLR); - - if (comphelper::LibreOfficeKit::isActive()) - { - // TODO: set correct unit - MapUnit eTargetUnit = MapUnit::MapInch; - - OUString sLeft = GetMetricText(aLR.GetLeft(), - MapUnit::MapTwip, eTargetUnit, nullptr); - - OUString sRight = GetMetricText(aLR.GetRight(), - MapUnit::MapTwip, eTargetUnit, nullptr); - - OUString sFirstline = GetMetricText(aLR.GetTextFirstLineOfst(), - MapUnit::MapTwip, eTargetUnit, nullptr); - - OUString sPayload = ".uno:LeftRightParaMargin={\"left\": \"" + sLeft + - "\", \"right\": \"" + sRight + - "\", \"firstline\": \"" + sFirstline + "\"}"; - - GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, - OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr()); - } } else rSet.InvalidateItem(nSlot); @@ -870,6 +846,10 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) } rSet.Put(aCoreSet,false); + + SfxViewShell* pViewShell = SfxViewShell::Current(); + if (pViewShell && comphelper::LibreOfficeKit::isActive()) + pViewShell->sendUnoStatus( &rSet ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit