[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit libreofficekit/source sc/source
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jul 4 13:28:13 UTC 2020
desktop/source/lib/init.cxx | 1
include/LibreOfficeKit/LibreOfficeKitEnums.h | 16 +++++++++
libreofficekit/source/gtk/lokdocview.cxx | 1
sc/source/ui/inc/tabvwsh.hxx | 4 ++
sc/source/ui/undo/undoblk.cxx | 36 +++++++++++++++++-----
sc/source/ui/undo/undoblk2.cxx | 7 +++-
sc/source/ui/undo/undodat.cxx | 28 +++++++++++++++++
sc/source/ui/view/dbfunc.cxx | 5 +++
sc/source/ui/view/dbfunc3.cxx | 42 +++++++++++++++++++++++++
sc/source/ui/view/tabvwshc.cxx | 44 +++++++++++++++++++++++++++
sc/source/ui/view/viewfun2.cxx | 17 +++++++++-
sc/source/ui/view/viewfunc.cxx | 21 +++++++++++-
12 files changed, 210 insertions(+), 12 deletions(-)
New commits:
commit 2c798d6715194e910cef9cad1039f464d86dc06f
Author: Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Tue May 19 12:42:33 2020 +0530
Commit: Dennis Francis <dennis.francis at collabora.com>
CommitDate: Sat Jul 4 15:27:29 2020 +0200
lokit: add new callback type LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY
This is to notify the clients about changes in current sheet's geometry
data. Use this to notify clients of various sheet geometry invalidations
if the new feature flag scPrintTwipsMsgs is set.
Change-Id: I478d2e646606320399905d7b15881a165a53146d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96969
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Dennis Francis <dennis.francis at collabora.com>
(cherry picked from commit 7d0181f519f83b978b9040986738ad0cedc020ba)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97956
Tested-by: Jenkins
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e20fc2f5e37f..767204cf05ee 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1410,6 +1410,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
case LOK_CALLBACK_INVALIDATE_HEADER:
case LOK_CALLBACK_WINDOW:
case LOK_CALLBACK_CALC_FUNCTION_LIST:
+ case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
{
const auto& pos = std::find_if(m_queue.rbegin(), m_queue.rend(),
[type] (const queue_type::value_type& elem) { return (elem.Type == type); });
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 8a741d5f62e2..dfafd94656d9 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -752,6 +752,20 @@ typedef enum
* }
*/
LOK_CALLBACK_FORM_FIELD_BUTTON = 49,
+
+ /**
+ * This is Calc specific. Indicates that some or all of the current sheet's
+ * geometry data has changed. Clients must request a full or partial sheet
+ * geometry data set.
+ *
+ * The payload specifies what part of the sheet geometry data has changed.
+ * The payload format is:
+ * 'all|rows|columns [sizes [hidden [filtered [groups]]]]'
+ *
+ * For example, the payload 'rows sizes groups' indicates that the row heights
+ * and row-groups data have changed.
+ */
+ LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY = 50,
}
LibreOfficeKitCallbackType;
@@ -880,6 +894,8 @@ static inline const char* lokCallbackTypeToString(int nType)
return "LOK_CALLBACK_TAB_STOP_LIST";
case LOK_CALLBACK_FORM_FIELD_BUTTON:
return "LOK_CALLBACK_FORM_FIELD_BUTTON";
+ case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
+ return "LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY";
}
assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index ae2c00bcaa08..559b03fcc189 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1401,6 +1401,7 @@ callback (gpointer pData)
case LOK_CALLBACK_CALC_FUNCTION_LIST:
case LOK_CALLBACK_TAB_STOP_LIST:
case LOK_CALLBACK_FORM_FIELD_BUTTON:
+ case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
{
// TODO: Implement me
break;
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index ee7b6e18cb49..7a9b32c32729 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -390,6 +390,10 @@ public:
/// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab is equal to nCurrentTabIndex
static void notifyAllViewsHeaderInvalidation(SfxViewShell* pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex);
static bool isAnyEditViewInRange(SfxViewShell* pForViewShell, bool bColumns, SCCOLROW nStart, SCCOLROW nEnd);
+ /// Emits a LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY for all views whose current tab
+ /// is equal to nCurrentTabIndex
+ static void notifyAllViewsSheetGeomInvalidation(SfxViewShell* pForViewShell, bool bColumns, bool bRows, bool bSizes,
+ bool bHidden, bool bFiltered, bool bGroups, SCTAB nCurrentTabIndex);
css::uno::Reference<css::drawing::XShapes> getSelectedXShapes();
static css::uno::Reference<css::datatransfer::XTransferable2> GetClipData(vcl::Window* pWin);
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index cf0669c90495..dacbfa00d9f7 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -273,11 +273,21 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
if (comphelper::LibreOfficeKit::isActive())
{
- if (eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER || eCmd == INS_CELLSRIGHT)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, COLUMN_HEADER, pViewShell->GetViewData().GetTabNo());
+ SCTAB nTab = pViewShell->GetViewData().GetTabNo();
+ bool bColsAffected = (eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER || eCmd == INS_CELLSRIGHT);
+ bool bRowsAffected = (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER || eCmd == INS_CELLSDOWN);
- if (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER || eCmd == INS_CELLSDOWN)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, ROW_HEADER, pViewShell->GetViewData().GetTabNo());
+ if (bColsAffected)
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, COLUMN_HEADER, nTab);
+
+ if (bRowsAffected)
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, ROW_HEADER, nTab);
+
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ pViewShell,
+ bColsAffected, bRowsAffected,
+ true /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
}
}
}
@@ -534,11 +544,21 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
{
if (comphelper::LibreOfficeKit::isActive())
{
- if (eCmd == DelCellCmd::Cols || eCmd == DelCellCmd::CellsLeft)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, COLUMN_HEADER, pViewShell->GetViewData().GetTabNo());
+ SCTAB nTab = pViewShell->GetViewData().GetTabNo();
+ bool bColsAffected = (eCmd == DelCellCmd::Cols || eCmd == DelCellCmd::CellsLeft);
+ bool bRowsAffected = (eCmd == DelCellCmd::Rows || eCmd == DelCellCmd::CellsUp);
+
+ if (bColsAffected)
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, COLUMN_HEADER, nTab);
+
+ if (bRowsAffected)
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, ROW_HEADER, nTab);
- if (eCmd == DelCellCmd::Rows || eCmd == DelCellCmd::CellsUp)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, ROW_HEADER, pViewShell->GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ pViewShell,
+ bColsAffected, bRowsAffected,
+ true /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
}
}
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 9b4de7f89f62..7e13a13ef25a 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -125,9 +125,14 @@ void ScUndoWidthOrHeight::Undo()
if (pViewShell)
{
+ SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNo();
+ bool bAffectsVisibility = (eMode != SC_SIZE_ORIGINAL && eMode != SC_SIZE_VISOPT);
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ pViewShell, bWidth /* bColumns */, !bWidth /* bRows */,
+ true /* bSizes*/, bAffectsVisibility /* bHidden */, bAffectsVisibility /* bFiltered */,
+ false /* bGroups */, nCurrentTab);
pViewShell->UpdateScrollBars(bWidth ? COLUMN_HEADER : ROW_HEADER);
- SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNo();
if ( nCurrentTab < nStartTab || nCurrentTab > nEndTab )
pViewShell->SetTabNo( nStartTab );
}
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index d83f1948cc6c..eb356af9da62 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -100,6 +100,9 @@ void ScUndoDoOutline::Undo()
else
pUndoDoc->CopyToDocument(0, nStart, nTab, rDoc.MaxCol(), nEnd, nTab, InsertDeleteFlags::NONE, false, rDoc);
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(pViewShell, bColumns, !bColumns,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
pViewShell->UpdateScrollBars();
pDocShell->PostPaint(0,0,nTab,rDoc.MaxCol(),rDoc.MaxRow(),nTab,PaintPartFlags::Grid|PaintPartFlags::Left|PaintPartFlags::Top);
@@ -180,6 +183,11 @@ void ScUndoMakeOutline::Undo()
pDocShell->PostPaint(0,0,nTab,rDoc.MaxCol(),rDoc.MaxRow(),nTab,PaintPartFlags::Grid|PaintPartFlags::Left|PaintPartFlags::Top|PaintPartFlags::Size);
ScTabViewShell::notifyAllViewsHeaderInvalidation( pViewShell, bColumns ? COLUMN_HEADER : ROW_HEADER, nTab );
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ pViewShell,
+ bColumns /* bColumns */, !bColumns /* bRows */,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
EndUndo();
}
@@ -262,6 +270,9 @@ void ScUndoOutlineLevel::Undo()
rDoc.UpdatePageBreaks( nTab );
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(pViewShell, bColumns, !bColumns,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
pViewShell->UpdateScrollBars();
SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
@@ -354,6 +365,9 @@ void ScUndoOutlineBlock::Undo()
rDoc.UpdatePageBreaks( nTab );
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(pViewShell, true /* bColumns */, true /* bRows */,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
pViewShell->UpdateScrollBars();
SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
@@ -450,6 +464,11 @@ void ScUndoRemoveAllOutlines::Undo()
pDocShell->PostPaint(0,0,nTab,rDoc.MaxCol(),rDoc.MaxRow(),nTab,PaintPartFlags::Grid|PaintPartFlags::Left|PaintPartFlags::Top|PaintPartFlags::Size);
ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, BOTH_HEADERS, nTab);
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ pViewShell,
+ true /* bColumns */, true /* bRows */,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
EndUndo();
}
@@ -815,6 +834,11 @@ void ScUndoQuery::Undo()
// invalidate cache positions and update cursor and selection
pViewShell->OnLOKShowHideColRow(/*bColumns*/ false, aQueryParam.nRow1 - 1);
ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, ROW_HEADER, nTab);
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ pViewShell,
+ false /* bColumns */, true /* bRows */,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ false /* bGroups */, nTab);
// Paint
@@ -1333,6 +1357,10 @@ void ScUndoRepeatDB::Undo()
if (xUndoDB)
rDoc.SetDBCollection(std::unique_ptr<ScDBCollection>(new ScDBCollection(*xUndoDB)), true);
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(pViewShell, false /* bColumns */, true /* bRows */,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ false /* bGroups */, nTab);
+
SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 74d211d02683..ba99e9185a8c 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -257,6 +257,11 @@ void ScDBFunc::Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource
if (!bCopy)
{
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ GetViewData().GetViewShell(),
+ false /* bColumns */, true /* bRows */,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ false /* bGroups */, nTab);
UpdateScrollBars(ROW_HEADER);
SelectionChanged(); // for attribute states (filtered rows are ignored)
}
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 24e660ba19bb..429725af03dd 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -94,6 +94,10 @@ void ScDBFunc::MakeOutline( bool bColumns, bool bRecord )
aFunc.MakeOutline( aRange, bColumns, bRecord, false );
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), bColumns ? COLUMN_HEADER : ROW_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ bColumns, !bColumns, false /* bSizes*/,
+ false /* bHidden */, false /* bFiltered */,
+ true /* bGroups */, GetViewData().GetTabNo());
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -111,6 +115,10 @@ void ScDBFunc::RemoveOutline( bool bColumns, bool bRecord )
aFunc.RemoveOutline( aRange, bColumns, bRecord, false );
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), bColumns ? COLUMN_HEADER : ROW_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ bColumns, !bColumns, false /* bSizes*/,
+ true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, GetViewData().GetTabNo());
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -191,6 +199,10 @@ void ScDBFunc::RemoveAllOutlines( bool bRecord )
if (bOk)
{
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ true /* bColumns */, true /* bRows */, false /* bSizes*/,
+ true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
UpdateScrollBars(BOTH_HEADERS);
}
}
@@ -225,7 +237,13 @@ void ScDBFunc::SelectLevel( bool bColumns, sal_uInt16 nLevel, bool bRecord )
bool bOk = aFunc.SelectLevel( nTab, bColumns, nLevel, bRecord, true/*bPaint*/ );
if (bOk)
+ {
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ bColumns, !bColumns, false /* bSizes*/,
+ true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
UpdateScrollBars(bColumns ? COLUMN_HEADER : ROW_HEADER);
+ }
}
// show individual outline groups
@@ -253,7 +271,13 @@ void ScDBFunc::ShowOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
aFunc.ShowOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint );
if ( bPaint )
+ {
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ bColumns, !bColumns, false /* bSizes*/,
+ true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
UpdateScrollBars(bColumns ? COLUMN_HEADER : ROW_HEADER);
+ }
}
// hide individual outline groups
@@ -267,7 +291,13 @@ void ScDBFunc::HideOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
bool bOk = aFunc.HideOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint );
if ( bOk && bPaint )
+ {
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ bColumns, !bColumns, false /* bSizes*/,
+ true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, nTab);
UpdateScrollBars(bColumns ? COLUMN_HEADER : ROW_HEADER);
+ }
}
// menu status: show/hide marked range
@@ -359,7 +389,13 @@ void ScDBFunc::ShowMarkedOutlines( bool bRecord )
ScOutlineDocFunc aFunc(*pDocSh);
bool bDone = aFunc.ShowMarkedOutlines( aRange, bRecord );
if (bDone)
+ {
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ GetViewData().GetViewShell(), true, true,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, GetViewData().GetTabNo());
UpdateScrollBars();
+ }
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -376,7 +412,13 @@ void ScDBFunc::HideMarkedOutlines( bool bRecord )
ScOutlineDocFunc aFunc(*pDocSh);
bool bDone = aFunc.HideMarkedOutlines( aRange, bRecord );
if (bDone)
+ {
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ GetViewData().GetViewShell(), true, true,
+ false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, GetViewData().GetTabNo());
UpdateScrollBars();
+ }
}
else
ErrorMessage(STR_NOMULTISELECT);
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 19b99ec93aa8..18292cc5fc66 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -553,6 +553,50 @@ bool ScTabViewShell::isAnyEditViewInRange(SfxViewShell* pForViewShell, bool bCol
return false;
}
+void ScTabViewShell::notifyAllViewsSheetGeomInvalidation(SfxViewShell* pForViewShell, bool bColumns,
+ bool bRows, bool bSizes, bool bHidden, bool bFiltered,
+ bool bGroups, SCTAB nCurrentTabIndex)
+{
+ if (!comphelper::LibreOfficeKit::isActive() ||
+ !comphelper::LibreOfficeKit::isCompatFlagSet(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs))
+ return;
+
+ if (!bColumns && !bRows)
+ return;
+
+ bool bAllTypes = bSizes && bHidden && bFiltered && bGroups;
+ bool bAllDims = bColumns && bRows;
+ OString aPayload = bAllDims ? "all" : bColumns ? "columns" : "rows";
+
+ if (!bAllTypes)
+ {
+ if (bSizes)
+ aPayload += " sizes";
+
+ if (bHidden)
+ aPayload += " hidden";
+
+ if (bFiltered)
+ aPayload += " filtered";
+
+ if (bGroups)
+ aPayload += " groups";
+ }
+
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ while (pViewShell)
+ {
+ ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
+ if (pTabViewShell && pViewShell->GetDocId() == pForViewShell->GetDocId() &&
+ (nCurrentTabIndex == -1 || pTabViewShell->getPart() == nCurrentTabIndex))
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY, aPayload.getStr());
+ }
+ pViewShell = SfxViewShell::GetNext(*pViewShell);
+ }
+}
+
bool ScTabViewShell::UseSubTotal(ScRangeList* pRangeList)
{
bool bSubTotal = false;
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 3a3bb3e65645..44ed2045c389 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -175,7 +175,15 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData )
pDocSh->UpdateOle(&GetViewData());
if (comphelper::LibreOfficeKit::isActive())
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNo());
+ {
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ GetViewData().GetViewShell(),
+ false /* bColumns */, true /* bRows */,
+ true /* bSizes*/, false /* bHidden */, false /* bFiltered */,
+ false /* bGroups */, nTab);
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, nTab);
+ }
return bAnyChanged;
}
@@ -224,7 +232,14 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow )
PaintPartFlags::Grid | PaintPartFlags::Left );
if (comphelper::LibreOfficeKit::isActive())
+ {
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+ GetViewData().GetViewShell(),
+ false /* bColumns */, true /* bRows */,
+ true /* bSizes*/, false /* bHidden */, false /* bFiltered */,
+ false /* bGroups */, nTab);
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNo());
+ }
return bChanged;
}
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index ab700220c42a..bf9d926acd97 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1630,6 +1630,11 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste )
if (bInsertRows)
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNo());
+
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ bInsertCols, bInsertRows, true /* bSizes*/,
+ true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, GetViewData().GetTabNo());
}
}
OUString aStartAddress = aRange.aStart.GetColRowString();
@@ -1703,11 +1708,18 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
if (comphelper::LibreOfficeKit::isActive())
{
- if (eCmd == DelCellCmd::Cols)
+ bool bColsDeleted = (eCmd == DelCellCmd::Cols);
+ bool bRowsDeleted = (eCmd == DelCellCmd::Rows);
+ if (bColsDeleted)
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), COLUMN_HEADER, GetViewData().GetTabNo());
- if (eCmd == DelCellCmd::Rows)
+ if (bRowsDeleted)
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNo());
+
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ bColsDeleted, bRowsDeleted, true /* bSizes*/,
+ true /* bHidden */, true /* bFiltered */,
+ true /* bGroups */, GetViewData().GetTabNo());
}
}
else
@@ -2253,6 +2265,11 @@ void ScViewFunc::SetWidthOrHeight(
for (const SCTAB& nTab : aMarkData)
rDoc.UpdatePageBreaks( nTab );
+ bool bAffectsVisibility = (eMode != SC_SIZE_ORIGINAL && eMode != SC_SIZE_VISOPT);
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
+ bWidth /* bColumns */, !bWidth /* bRows */,
+ true /* bSizes*/, bAffectsVisibility /* bHidden */, bAffectsVisibility /* bFiltered */,
+ false /* bGroups */, nCurTab);
GetViewData().GetView()->UpdateScrollBars(bWidth ? COLUMN_HEADER : ROW_HEADER);
{
More information about the Libreoffice-commits
mailing list