diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-09-05 15:01:34 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-11-21 12:37:03 +0100 |
commit | d29349a3f8808e650a9432bd087e352845e8b0d3 (patch) | |
tree | a1e974477e994b74ebccb053a69d431bb9ae4f76 /sc | |
parent | 5762aa5c0efb75e8b7713b4c2ee8bd9300fc06cf (diff) |
lok: Notify about last used row and column in Calc
We use HelperNotifyChanges::NotifyIfChangesListeners
notifier so we know which cell was modified and we
can correctly target only affected users.
Change-Id: Iaeb68e350e85e4ed1492a7d350a790e68f2d63af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139473
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142994
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/docsh.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 18 |
3 files changed, 22 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index df55d056f7f2..40a8311b7bf7 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -45,6 +45,7 @@ #include <sfx2/docfile.hxx> #include <sfx2/event.hxx> #include <sfx2/docfilt.hxx> +#include <sfx2/lokhelper.hxx> #include <sfx2/objface.hxx> #include <sfx2/viewfrm.hxx> #include <svl/documentlockfile.hxx> diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 7830984145c9..660f17aee3f4 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -24,6 +24,7 @@ #include <sfx2/sfxmodelfactory.hxx> #include <sfx2/viewsh.hxx> #include <o3tl/deleter.hxx> +#include <comphelper/lok.hxx> #include <comphelper/servicehelper.hxx> #include <scdllapi.h> @@ -472,7 +473,8 @@ namespace HelperNotifyChanges inline ScModelObj* getMustPropagateChangesModel(const ScDocShell &rDocShell) { ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(rDocShell.GetModel()); - if (pModelObj && pModelObj->HasChangesListeners()) + const bool isLOK = comphelper::LibreOfficeKit::isActive(); // for LOK_CALLBACK_DOCUMENT_SIZE_CHANGED + if (pModelObj && (pModelObj->HasChangesListeners() || isLOK)) return pModelObj; return nullptr; } diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index bb8a1ce81e7b..0701cae0d9ca 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -3218,6 +3218,24 @@ void ScModelObj::NotifyChanges( const OUString& rOperation, const ScRangeList& r } } + if (comphelper::LibreOfficeKit::isActive()) + { + size_t nRangeCount = rRanges.size(); + for ( size_t nIndex = 0; nIndex < nRangeCount; ++nIndex ) + { + ScRange const & rRange = rRanges[ nIndex ]; + ScAddress const & rEnd = rRange.aEnd; + const Size aCurrentDataArea = getDataArea(rEnd.Tab()); + + SCCOL nLastCol = aCurrentDataArea.Width(); + SCROW nLastRow = aCurrentDataArea.Height(); + + // is equal -> probably we just edited last col/row + if (rEnd.Col() >= nLastCol || rEnd.Row() >= nLastRow) + SfxLokHelper::notifyPartSizeChangedAllViews(this, rEnd.Tab()); + } + } + // handle sheet events //! separate method with ScMarkData? Then change HasChangesListeners back. if ( !(rOperation == "cell-change" && pDocShell) ) |