summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-05-12 17:00:45 -0400
committerJan Holesovsky <kendy@collabora.com>2019-05-14 11:39:48 +0200
commit53dca9c92fd8941b90b2fd83ba7ec0e46d7bb35b (patch)
tree5ebe9343162cfdf465a5fc6e76b7bef0929030d3
parent171a2300d37d73065e5e3bd4b77678e35f678adf (diff)
LOK: sc: Issue DOCUMENT_SIZE_CHANGED only when size changes
Issuing DOCUMENT_SIZE_CHANGED triggers document-loaded event. This is accidental and historic, but the end result is that the client assumes everything is invalidated and fires initialization handlers, which are normally invoked the first time a document is loaded. Undesirable when really nothing has changed. Change-Id: Ia4fa4479ca627b0f605e4ff5009f7e631a26f6d7
-rw-r--r--sc/source/ui/view/tabview.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 520dafa3cd18..febe50df5f73 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2704,12 +2704,16 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle)
if (pDocSh)
{
- // Provide size in the payload, so clients don't have to
- // call lok::Document::getDocumentSize().
- std::stringstream ss;
- ss << aNewSize.Width() << ", " << aNewSize.Height();
- OString sSize = ss.str().c_str();
- aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sSize.getStr());
+ if (aOldSize != aNewSize)
+ {
+ // Provide size in the payload, so clients don't have to
+ // call lok::Document::getDocumentSize().
+ std::stringstream ss;
+ ss << aNewSize.Width() << ", " << aNewSize.Height();
+ OString sSize = ss.str().c_str();
+ aViewData.GetViewShell()->libreOfficeKitViewCallback(
+ LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sSize.getStr());
+ }
// New area extended to the right of the sheet after last column
// including overlapping area with aNewRowArea