summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-08-10 12:57:00 +0200
committerJan Holesovsky <kendy@collabora.com>2020-08-10 21:09:01 +0200
commit035d850179688137dcf145cf3e779b6e05779239 (patch)
treecc42959841df472fdd90c6a8e961c5212ecd53cf
parentlok: Hide not working 'More Styles' option (diff)
downloadcore-035d850179688137dcf145cf3e779b6e05779239.tar.gz
core-035d850179688137dcf145cf3e779b6e05779239.zip
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>
-rw-r--r--desktop/source/lib/init.cxx4
-rw-r--r--editeng/source/items/frmitems.cxx31
-rw-r--r--include/editeng/boxitem.hxx4
3 files changed, 38 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7e6b71c77c1e..d33454297cf8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2756,7 +2756,9 @@ static void doc_iniUnoCommands ()
OUString(".uno:ParaspaceIncrease"),
OUString(".uno:ParaspaceDecrease"),
OUString(".uno:AcceptTrackedChange"),
- OUString(".uno:RejectTrackedChange")
+ OUString(".uno:RejectTrackedChange"),
+ OUString(".uno:BorderInner"),
+ OUString(".uno:BorderOuter")
};
util::URL aCommandURL;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 0e1c22731ad7..d21e3ce75591 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1440,6 +1440,23 @@ SvxBoxItem& SvxBoxItem::operator=( const SvxBoxItem& rBox )
}
+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 )
@@ -2318,6 +2335,20 @@ 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;
+}
+
SvxBoxInfoItem &SvxBoxInfoItem::operator=( const SvxBoxInfoItem& rCpy )
{
if (this != &rCpy)
diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx
index 103967578f20..8cf1c2d60545 100644
--- a/include/editeng/boxitem.hxx
+++ b/include/editeng/boxitem.hxx
@@ -118,6 +118,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)
@@ -234,6 +236,8 @@ public:
nValidFlags &= ~nValid;
}
void ResetFlags();
+
+ virtual boost::property_tree::ptree dumpAsJSON() const override;
};
namespace editeng