diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2022-05-12 13:13:35 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2022-05-21 09:14:42 +0200 |
commit | b846fb660a91130aceee52fed11170a95b2f3934 (patch) | |
tree | 6bd853642dfb05a6df8b804341eca2af4995b79c /sc/source/ui/undo | |
parent | a2ffd71f20e14f797f30223fe29b3ac1e92eafdf (diff) |
lok-calc: new callback for print ranges
With this callback the lok clients can read and draw the print ranges on
each sheet of the Calc document.
Conflicts:
include/LibreOfficeKit/LibreOfficeKitEnums.h
libreofficekit/source/gtk/lokdocview.cxx
Change-Id: Ie19351d4420e0f3d4191f6a354ce99ab830aede2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134375
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
(cherry picked from commit 172bc7a8f4eeab907adac077407186fbbd046a77)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134527
Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
(cherry picked from commit 29b7b25d454e0a6cd07c00e13fdb83cc8a381583)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134614
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r-- | sc/source/ui/undo/undotab.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 7ce4c23d17c2..b898faf8075f 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -49,6 +49,9 @@ #include <drwlayer.hxx> #include <scresid.hxx> #include <sheetevents.hxx> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> +#include <tools/json_writer.hxx> #include <memory> #include <utility> @@ -1317,6 +1320,18 @@ void ScUndoPrintRange::DoChange(bool bUndo) ScPrintFunc( pDocShell, pDocShell->GetPrinter(), nTab ).UpdatePages(); + if (pViewShell && comphelper::LibreOfficeKit::isActive()) + { + tools::JsonWriter aJsonWriter; + if (bUndo) + pOldRanges->GetPrintRangesInfo(aJsonWriter); + else + pNewRanges->GetPrintRangesInfo(aJsonWriter); + + const std::string message = aJsonWriter.extractAsStdString(); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_PRINT_RANGES, message.c_str()); + } + pDocShell->PostPaint( ScRange(0,0,nTab,rDoc.MaxCol(),rDoc.MaxRow(),nTab), PaintPartFlags::Grid ); } |