summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-14 15:09:14 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-14 14:23:58 +0000
commitf8a2dcce4f089e9fb7ce5cfd51cdb15ce4a87674 (patch)
tree8bd5845dde066cb6150a9f4f022c28befa1c6618 /sc
parentc07257be27869d66736211fde75efff835432138 (diff)
sc: implement per-view LOK_CALLBACK_DOCUMENT_SIZE_CHANGED
Need to notify all the views when inserting or deleting a sheet. Change-Id: Ifadf6af4a307d555eacfa4623eed84400d06c293 Reviewed-on: https://gerrit.libreoffice.org/26264 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/document.cxx57
-rw-r--r--sc/source/ui/view/tabview3.cxx19
2 files changed, 69 insertions, 7 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 8e22b96cacdd..a99d9e2e8d7f 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -31,6 +31,7 @@
#include <svx/svdocapt.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
+#include <sfx2/viewsh.hxx>
#include <sfx2/docfile.hxx>
#include <svl/poolcach.hxx>
#include <unotools/saveopt.hxx>
@@ -584,7 +585,19 @@ bool ScDocument::InsertTab(
SetAllFormulasDirty(aCxt);
if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer())
- GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ {
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ while (pViewShell)
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ pViewShell = SfxViewShell::GetNext(*pViewShell);
+ }
+ }
+ else
+ GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ }
}
return bValid;
@@ -750,7 +763,19 @@ bool ScDocument::DeleteTab( SCTAB nTab )
pChartListenerCollection->UpdateScheduledSeriesRanges();
if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer())
- GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ {
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ while (pViewShell)
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ pViewShell = SfxViewShell::GetNext(*pViewShell);
+ }
+ }
+ else
+ GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ }
bValid = true;
}
@@ -840,7 +865,19 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets )
pChartListenerCollection->UpdateScheduledSeriesRanges();
if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer())
- GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ {
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ while (pViewShell)
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ pViewShell = SfxViewShell::GetNext(*pViewShell);
+ }
+ }
+ else
+ GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ }
bValid = true;
}
@@ -885,7 +922,19 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& rName, bool /* bUpdateRe
(*it)->SetStreamValid( false );
if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer())
- GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ {
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ while (pViewShell)
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ pViewShell = SfxViewShell::GetNext(*pViewShell);
+ }
+ }
+ else
+ GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ }
}
}
}
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 1c270f21ad7b..042b85935fcb 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -322,7 +322,10 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
if (pDocSh)
{
- pDocSh->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ else
+ pDocSh->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
// New area extended to the right of the sheet after last column
// including overlapping area with aNewRowArea
@@ -333,11 +336,21 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
// Only invalidate if spreadsheet extended to the right
if (aNewColArea.getWidth())
- pDocSh->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewColArea.toString().getStr());
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewColArea.toString().getStr());
+ else
+ pDocSh->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewColArea.toString().getStr());
+ }
// Only invalidate if spreadsheet extended to the bottom
if (aNewRowArea.getHeight())
- pDocSh->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewRowArea.toString().getStr());
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewRowArea.toString().getStr());
+ else
+ pDocSh->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewRowArea.toString().getStr());
+ }
}
}
}