diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-08-10 12:57:00 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-08-26 13:18:43 +0200 |
commit | cc2823b980d0ab87278de87282ddfc6a49b2508a (patch) | |
tree | d45297cef6a53218e22d50cd9804900be4358a14 | |
parent | 77f12e60687ab639da34aa71e84085d1c3d5a402 (diff) |
lok: send cell border state updates
Change-Id: I400ee3cb9f0a98804d98e25d0164fa5148b79191
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100424
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101385
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | desktop/source/lib/init.cxx | 4 | ||||
-rw-r--r-- | editeng/source/items/frmitems.cxx | 33 | ||||
-rw-r--r-- | include/editeng/boxitem.hxx | 4 |
3 files changed, 40 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 35a518d701ad..b61767ff4a88 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2824,7 +2824,9 @@ static void doc_iniUnoCommands () OUString(".uno:AlignMiddle"), OUString(".uno:AlignDown"), OUString(".uno:TraceChangeMode"), - OUString(".uno:FreezePanesRow") + OUString(".uno:FreezePanesRow"), + OUString(".uno:BorderInner"), + OUString(".uno:BorderOuter") }; util::URL aCommandURL; diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 53b3b0d15ff7..371621157b8e 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -1294,6 +1294,23 @@ SvxBoxItem::~SvxBoxItem() } +boost::property_tree::ptree SvxBoxItem::dumpAsJSON() const +{ + boost::property_tree::ptree aTree; + + boost::property_tree::ptree aState; + aState.put("top", GetTop() && !GetTop()->isEmpty()); + aState.put("bottom", GetBottom() && !GetBottom()->isEmpty()); + aState.put("left", GetLeft() && !GetLeft()->isEmpty()); + aState.put("right", GetRight() && !GetRight()->isEmpty()); + + aTree.push_back(std::make_pair("state", aState)); + aTree.put("commandName", ".uno:BorderOuter"); + + return aTree; +} + + static bool CmpBrdLn( const std::unique_ptr<SvxBorderLine> & pBrd1, const SvxBorderLine* pBrd2 ) { if( pBrd1.get() == pBrd2 ) @@ -2072,6 +2089,22 @@ SvxBoxInfoItem::~SvxBoxInfoItem() { } + +boost::property_tree::ptree SvxBoxInfoItem::dumpAsJSON() const +{ + boost::property_tree::ptree aTree; + + boost::property_tree::ptree aState; + aState.put("vertical", GetVert() && !GetVert()->isEmpty()); + aState.put("horizontal", GetHori() && !GetHori()->isEmpty()); + + aTree.push_back(std::make_pair("state", aState)); + aTree.put("commandName", ".uno:BorderInner"); + + return aTree; +} + + bool SvxBoxInfoItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx index 7ebb52b12212..3ef4a05ff11c 100644 --- a/include/editeng/boxitem.hxx +++ b/include/editeng/boxitem.hxx @@ -115,6 +115,8 @@ public: static css::table::BorderLine2 SvxLineToLine( const editeng::SvxBorderLine* pLine, bool bConvert ); static bool LineToSvxLine(const css::table::BorderLine& rLine, editeng::SvxBorderLine& rSvxLine, bool bConvert); static bool LineToSvxLine(const css::table::BorderLine2& rLine, editeng::SvxBorderLine& rSvxLine, bool bConvert); + + virtual boost::property_tree::ptree dumpAsJSON() const override; }; inline void SvxBoxItem::SetAllDistances(sal_uInt16 const nNew) @@ -230,6 +232,8 @@ public: nValidFlags &= ~nValid; } void ResetFlags(); + + virtual boost::property_tree::ptree dumpAsJSON() const override; }; namespace editeng |