sc/source/core/data/document.cxx | 57 ++++++++++++++++++++++++++++++++++++--- sc/source/ui/view/tabview3.cxx | 19 ++++++++++--- 2 files changed, 69 insertions(+), 7 deletions(-)
New commits: commit f8a2dcce4f089e9fb7ce5cfd51cdb15ce4a87674 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue Jun 14 15:09:14 2016 +0200 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 <vmik...@collabora.co.uk> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8e22b96..a99d9e2 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 1c270f2..042b859 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()); + } } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits