diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-12 17:17:36 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-13 09:50:58 +0100 |
commit | 546d26cccea7ede60fd13eb30a5e46f0c23477b4 (patch) | |
tree | bc73ca358b9ec96b2658a6bf4ba2aa7844940ff0 /sw | |
parent | 258e06cfffe7ceebb86cefa2413d6af476a972c6 (diff) |
jsdialogs: send table row/column size updates
Change-Id: I1b41fe50e93dc14db60c7548a1ae0c54113da329
Reviewed-on: https://gerrit.libreoffice.org/82542
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index df63915ce961..073fe280c924 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -48,6 +48,9 @@ #include <sfx2/viewfrm.hxx> #include <vcl/EnumContext.hxx> #include <o3tl/enumrange.hxx> +#include <comphelper/lok.hxx> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <editeng/itemtype.hxx> #include <fmtornt.hxx> #include <fmtclds.hxx> @@ -1427,6 +1430,19 @@ void SwTableShell::GetState(SfxItemSet &rSet) long nHeight = pHeight->GetHeight(); aRowHeight.SetValue(nHeight); rSet.Put(aRowHeight); + + if (comphelper::LibreOfficeKit::isActive()) + { + // TODO: set correct unit + MapUnit eTargetUnit = MapUnit::MapInch; + OUString sHeight = GetMetricText(nHeight, + MapUnit::MapTwip, eTargetUnit, nullptr); + + OUString sPayload = ".uno:TableRowHeight=" + sHeight; + + GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, + OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr()); + } } break; } @@ -1438,6 +1454,20 @@ void SwTableShell::GetState(SfxItemSet &rSet) SwTwips nWidth = aFunc.GetColWidth(aFunc.GetCurColNum()); aColumnWidth.SetValue(nWidth); rSet.Put(aColumnWidth); + + if (comphelper::LibreOfficeKit::isActive()) + { + // TODO: set correct unit + MapUnit eTargetUnit = MapUnit::MapInch; + OUString sWidth = GetMetricText(nWidth, + MapUnit::MapTwip, eTargetUnit, nullptr); + + OUString sPayload = ".uno:TableColumWidth=" + sWidth; + + GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, + OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr()); + } + break; } } |