summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/items/frmitems.cxx28
-rw-r--r--include/editeng/lrspitem.hxx2
-rw-r--r--sd/source/ui/view/drtxtob.cxx24
-rw-r--r--sw/source/uibase/shells/txtattr.cxx28
4 files changed, 34 insertions, 48 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 9c728636d85d..0e1c22731ad7 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -686,6 +686,34 @@ void SvxLRSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) const
}
+boost::property_tree::ptree SvxLRSpaceItem::dumpAsJSON() const
+{
+ boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
+
+ boost::property_tree::ptree aState;
+
+ MapUnit eTargetUnit = MapUnit::MapInch;
+
+ OUString sLeft = GetMetricText(GetLeft(),
+ MapUnit::MapTwip, eTargetUnit, nullptr);
+
+ OUString sRight = GetMetricText(GetRight(),
+ MapUnit::MapTwip, eTargetUnit, nullptr);
+
+ OUString sFirstline = GetMetricText(GetTextFirstLineOfst(),
+ MapUnit::MapTwip, eTargetUnit, nullptr);
+
+ aState.put("left", sLeft);
+ aState.put("right", sRight);
+ aState.put("firstline", sFirstline);
+ aState.put("unit", "inch");
+
+ aTree.push_back(std::make_pair("state", aState));
+
+ return aTree;
+}
+
+
SvxULSpaceItem::SvxULSpaceItem( const sal_uInt16 nId )
: SfxPoolItem(nId)
, nUpper(0)
diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx
index a1b768dda66d..5584fe698d83 100644
--- a/include/editeng/lrspitem.hxx
+++ b/include/editeng/lrspitem.hxx
@@ -118,7 +118,9 @@ public:
{ return nPropFirstLineOfst; }
void SetTextFirstLineOfstValue( const short nValue )
{ nFirstLineOfst = nValue; }
+
void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
+ virtual boost::property_tree::ptree dumpAsJSON() const override;
};
inline SvxLRSpaceItem &SvxLRSpaceItem::operator=( const SvxLRSpaceItem &rCpy )
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 997bbe1d8620..fa0e40d1461f 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -49,8 +49,6 @@
#include <editeng/frmdiritem.hxx>
#include <editeng/fhgtitem.hxx>
#include <comphelper/lok.hxx>
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
-#include <editeng/itemtype.hxx>
#include <sfx2/objface.hxx>
@@ -572,28 +570,6 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
rSet.Put(aLRSpace);
Invalidate(SID_ATTR_PARA_LRSPACE);
- if (comphelper::LibreOfficeKit::isActive())
- {
- // TODO: set correct unit
- MapUnit eTargetUnit = MapUnit::MapInch;
-
- OUString sLeft = GetMetricText(aLRSpace.GetLeft(),
- MapUnit::MapTwip, eTargetUnit, nullptr);
-
- OUString sRight = GetMetricText(aLRSpace.GetRight(),
- MapUnit::MapTwip, eTargetUnit, nullptr);
-
- OUString sFirstline = GetMetricText(aLRSpace.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());
- }
-
//Added by xuxu
SfxItemState eState = aAttrSet.GetItemState( EE_PARA_LRSPACE );
if ( eState == SfxItemState::DONTCARE )
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index 70ef0ba431f7..5af84af21eff 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -39,8 +39,6 @@
#include <editeng/cmapitem.hxx>
#include <paratr.hxx>
#include <comphelper/lok.hxx>
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
-#include <editeng/itemtype.hxx>
#include <fmtinfmt.hxx>
#include <docsh.hxx>
@@ -725,28 +723,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);
@@ -840,6 +816,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: */