summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx5
-rw-r--r--sc/source/ui/docshell/docsh4.cxx5
-rw-r--r--sc/source/ui/docshell/olinefun.cxx9
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx5
-rw-r--r--sc/source/ui/undo/undoblk.cxx8
-rw-r--r--sc/source/ui/undo/undodat.cxx10
-rw-r--r--sc/source/ui/view/dbfunc3.cxx7
-rw-r--r--sc/source/ui/view/gridwin.cxx5
-rw-r--r--sc/source/ui/view/gridwin4.cxx4
-rw-r--r--sc/source/ui/view/tabview4.cxx2
-rw-r--r--sc/source/ui/view/tabview5.cxx3
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx15
-rw-r--r--sc/source/ui/view/tabvwshc.cxx14
-rw-r--r--sc/source/ui/view/viewfun2.cxx4
-rw-r--r--sc/source/ui/view/viewfunc.cxx17
16 files changed, 52 insertions, 65 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 3ad4fc6032eb..5060c53ff205 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -620,8 +620,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
ScDocument& rDoc = rDocShell.GetDocument();
- ScTabViewShell* pViewSh = rDocShell.GetBestViewShell();
- if (pViewSh && ScTabViewShell::isAnyEditViewInRange(pViewSh, /*bColumns*/ false, rQueryParam.nRow1, rQueryParam.nRow2))
+ if (ScTabViewShell::isAnyEditViewInRange(/*bColumns*/ false, rQueryParam.nRow1, rQueryParam.nRow2))
{
return false;
}
@@ -936,6 +935,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
pOld, bDoSize, pAdvSource ) );
}
+ ScTabViewShell* pViewSh = rDocShell.GetBestViewShell();
if ( pViewSh )
{
// could there be horizontal autofilter ?
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index ffb74bc7411c..38af064a918c 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -139,7 +139,6 @@ static void lcl_PaintAbove( ScDocShell& rDocShell, const ScRange& rRange )
bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint )
{
ScDocument& rDoc = rDocShell.GetDocument();
- SfxViewShell* pSomeViewForThisDoc = rDocShell.GetBestViewShell(false);
if ( rDoc.IsImportingXML() )
{
// for XML import, all row heights are updated together after importing
@@ -160,7 +159,7 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint )
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId())
+ if (pTabViewShell)
{
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
}
@@ -182,7 +181,7 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint )
PaintPartFlags::Grid | PaintPartFlags::Left);
if (comphelper::LibreOfficeKit::isActive())
- ScTabViewShell::notifyAllViewsHeaderInvalidation(pSomeViewForThisDoc, ROW_HEADER, nTab);
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, nTab);
return bChanged;
}
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 6cce2f468b4d..8d9d5ce9cb12 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2528,13 +2528,10 @@ void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu
boost::property_tree::write_json(aStream, aTree);
std::string aPayload = aStream.str();
- ScViewData* pViewData = GetViewData();
- SfxViewShell* pThisViewShell = ( pViewData ? pViewData->GetViewShell() : nullptr );
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
- if (pThisViewShell == nullptr || pViewShell->GetDocId() == pThisViewShell->GetDocId())
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_COMMENT, aPayload.c_str());
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_COMMENT, aPayload.c_str());
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
}
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index d92de37eca25..23a8f846af35 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -317,7 +317,6 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
bool bRecord, bool bPaint )
{
ScDocument& rDoc = rDocShell.GetDocument();
- ScTabViewShell* pViewSh = rDocShell.GetBestViewShell();
if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
@@ -365,7 +364,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
sal_uInt16 nThisLevel = aIter.LastLevel();
bool bShow = (nThisLevel < nLevel);
- if (!bShow && pViewSh && ScTabViewShell::isAnyEditViewInRange(pViewSh, bColumns, nThisStart, nThisEnd))
+ if (!bShow && ScTabViewShell::isAnyEditViewInRange(bColumns, nThisStart, nThisEnd))
continue;
if (bShow) // enable
@@ -413,6 +412,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
rDoc.SetDrawPageSize(nTab);
rDoc.UpdatePageBreaks( nTab );
+ ScTabViewShell* pViewSh = rDocShell.GetBestViewShell();
if ( pViewSh )
pViewSh->OnLOKShowHideColRow(bColumns, nStart - 1);
@@ -735,8 +735,8 @@ bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
SCCOLROW nStart = pEntry->GetStart();
SCCOLROW nEnd = pEntry->GetEnd();
- ScTabViewShell* pViewSh = rDocShell.GetBestViewShell();
- if (pViewSh && ScTabViewShell::isAnyEditViewInRange(pViewSh, bColumns, nStart, nEnd))
+
+ if (ScTabViewShell::isAnyEditViewInRange(bColumns, nStart, nEnd))
return false;
// TODO undo can mess things up when another view is editing a cell in the range of group entry
@@ -777,6 +777,7 @@ bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
rDoc.InvalidatePageBreaks(nTab);
rDoc.UpdatePageBreaks( nTab );
+ ScTabViewShell* pViewSh = rDocShell.GetBestViewShell();
if ( pViewSh )
pViewSh->OnLOKShowHideColRow(bColumns, nStart - 1);
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index bbce30066e3b..8191d629b381 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -390,8 +390,9 @@ public:
/// See SfxViewShell::NotifyCursor().
void NotifyCursor(SfxViewShell* pViewShell) const override;
/// 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);
+ static void notifyAllViewsHeaderInvalidation(HeaderType eHeaderType, SCTAB nCurrentTabIndex);
+ static void notifyAllViewsHeaderInvalidation(bool Columns, SCTAB nCurrentTabIndex);
+ static bool isAnyEditViewInRange(bool bColumns, SCCOLROW nStart, SCCOLROW nEnd);
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 956d99d91cab..6e0f254d34bb 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -278,10 +278,10 @@ 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());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(COLUMN_HEADER, pViewShell->GetViewData().GetTabNo());
if (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER || eCmd == INS_CELLSDOWN)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, ROW_HEADER, pViewShell->GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, pViewShell->GetViewData().GetTabNo());
}
}
}
@@ -538,10 +538,10 @@ 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());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(COLUMN_HEADER, pViewShell->GetViewData().GetTabNo());
if (eCmd == DelCellCmd::Rows || eCmd == DelCellCmd::CellsUp)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, ROW_HEADER, pViewShell->GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, pViewShell->GetViewData().GetTabNo());
}
}
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 20d6eac3b6ea..45047082faca 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -184,7 +184,7 @@ void ScUndoMakeOutline::Undo()
pDocShell->PostPaint(0,0,nTab,MAXCOL,MAXROW,nTab,PaintPartFlags::Grid|PaintPartFlags::Left|PaintPartFlags::Top|PaintPartFlags::Size);
- ScTabViewShell::notifyAllViewsHeaderInvalidation( pViewShell, bColumns ? COLUMN_HEADER : ROW_HEADER, nTab );
+ ScTabViewShell::notifyAllViewsHeaderInvalidation( bColumns, nTab );
EndUndo();
}
@@ -453,7 +453,7 @@ void ScUndoRemoveAllOutlines::Undo()
pDocShell->PostPaint(0,0,nTab,MAXCOL,MAXROW,nTab,PaintPartFlags::Grid|PaintPartFlags::Left|PaintPartFlags::Top|PaintPartFlags::Size);
- ScTabViewShell::notifyAllViewsHeaderInvalidation(pViewShell, BOTH_HEADERS, nTab);
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(BOTH_HEADERS, nTab);
EndUndo();
}
@@ -737,13 +737,13 @@ OUString ScUndoQuery::GetComment() const
void ScUndoQuery::Undo()
{
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (ScTabViewShell::isAnyEditViewInRange(pViewShell, /*bColumns*/ false, aQueryParam.nRow1, aQueryParam.nRow2))
+ if (ScTabViewShell::isAnyEditViewInRange(/*bColumns*/ false, aQueryParam.nRow1, aQueryParam.nRow2))
return;
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
bool bCopy = !aQueryParam.bInplace;
SCCOL nDestEndCol = 0;
@@ -818,7 +818,7 @@ 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::notifyAllViewsHeaderInvalidation(ROW_HEADER, nTab);
// Paint
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index fc849c2ba8c0..d1f57b46dead 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -105,7 +105,7 @@ void ScDBFunc::MakeOutline( bool bColumns, bool bRecord )
ScOutlineDocFunc aFunc(*pDocSh);
aFunc.MakeOutline( aRange, bColumns, bRecord, false );
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), bColumns ? COLUMN_HEADER : ROW_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(bColumns, GetViewData().GetTabNo());
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -122,7 +122,7 @@ void ScDBFunc::RemoveOutline( bool bColumns, bool bRecord )
ScOutlineDocFunc aFunc(*pDocSh);
aFunc.RemoveOutline( aRange, bColumns, bRecord, false );
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), bColumns ? COLUMN_HEADER : ROW_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(bColumns, GetViewData().GetTabNo());
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -2253,12 +2253,11 @@ void ScDBFunc::OnLOKShowHideColRow(bool bColumns, SCCOLROW nStart)
return;
SCTAB nCurrentTabIndex = GetViewData().GetTabNo();
- SfxViewShell* pThisViewShell = GetViewData().GetViewShell();
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pTabViewShell->GetDocId() == pThisViewShell->GetDocId())
+ if (pTabViewShell)
{
if (bColumns)
pTabViewShell->GetViewData().GetLOKWidthHelper(nCurrentTabIndex)->invalidateByIndex(nStart);
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index c0e437b8f98d..6e8cfc680e47 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -825,7 +825,7 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode)
// Something went terribly wrong!
return;
- if (ScTabViewShell::isAnyEditViewInRange(pViewData->GetViewShell(), /*bColumns*/ false, aParam.nRow1, aParam.nRow2))
+ if (ScTabViewShell::isAnyEditViewInRange(/*bColumns*/ false, aParam.nRow1, aParam.nRow2))
return;
pEntry->bDoQuery = true;
@@ -5733,9 +5733,6 @@ void ScGridWindow::notifyKitCellViewCursor(const SfxViewShell* pForShell) const
{
ScTabViewShell* pViewShell = pViewData->GetViewShell();
- if (pViewShell->GetDocId() != pForShell->GetDocId())
- return;
-
OString aCursor("EMPTY");
if (mpOOCursors) // cf. getCellCursor above
{
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 80739983cf80..065f56bf1591 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -336,7 +336,7 @@ void ScGridWindow::InvalidateLOKViewCursor(const tools::Rectangle& rCursorRect,
while (pViewShell)
{
- if (pViewShell != pThisViewShell && pViewShell->GetDocId() == pThisViewShell->GetDocId())
+ if (pViewShell != pThisViewShell)
{
ScTabViewShell* pOtherViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
if (pOtherViewShell)
@@ -955,7 +955,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
while (pViewShell)
{
- if (pViewShell != pThisViewShell && pViewShell->GetDocId() == pThisViewShell->GetDocId())
+ if (pViewShell != pThisViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
if (pTabViewShell)
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index a8051c7e8128..2efc0ef197ca 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -392,7 +392,7 @@ static long lcl_GetScrollRange( SCCOLROW nDocEnd, SCCOLROW nPos, SCCOLROW nVis,
void ScTabView::UpdateScrollBars( HeaderType eHeaderType )
{
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), eHeaderType, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(eHeaderType, GetViewData().GetTabNo());
long nDiff;
bool bTop = ( aViewData.GetVSplitMode() != SC_SPLIT_NONE );
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index abf8a1e8ccb4..b8736dd6d6e5 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -677,12 +677,11 @@ void ScTabView::OnLOKNoteStateChanged(const ScPostIt* pNote)
aInvalidRect.AdjustTop( -nBorderSize );
aInvalidRect.AdjustBottom( nBorderSize );
- SfxViewShell* pCurrentViewShell = SfxViewShell::Current();
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pViewShell->GetDocId() == pCurrentViewShell->GetDocId())
+ if (pTabViewShell)
{
for (auto& pWin: pTabViewShell->pGridWin)
{
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index afbe40780c3f..ec912c115848 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -141,11 +141,6 @@ void ScTabViewShell::Activate(bool bMDI)
SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
while ( pSh!=nullptr && pOldHdl!=nullptr)
{
- // Hmm, what if pSh is a shell for a different document? But as this code
- // does not seem to be LibreOfficeKit-specific, probably that doesn't
- // happen, because having multiple documents open simultaneously has of
- // course not been a problem at all in traditional desktop LibreOffice.
- // (Unlike in a LibreOfficeKit-based process where it has been a problem.)
if (static_cast<ScTabViewShell*>(pSh)->GetInputHandler() == pOldHdl)
{
pOldHdl->ResetDelayTimer();
@@ -1721,12 +1716,8 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
// have we already one view ?
if (pViewShell)
{
- // this view is not yet visible at this stage, so we look for not visible views, too, for this same document
- SfxViewShell* pViewShell2 = pViewShell;
- do
- {
- pViewShell2 = SfxViewShell::GetNext(*pViewShell2, /*only visible shells*/ false);
- } while (pViewShell2 && pViewShell2->GetDocId() != pViewShell->GetDocId());
+ // this view is not yet visible at this stage, so we look for not visible views, too
+ SfxViewShell* pViewShell2 = SfxViewShell::GetNext(*pViewShell, /*only visible shells*/ false);
// if the second view is not this one, it means that there is
// already more than one active view and so the formula mode
// has already been disabled
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index aba771e1035a..1f0cd9bf737b 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -572,7 +572,7 @@ css::uno::Reference<css::datatransfer::XTransferable2> ScTabViewShell::GetClipDa
return xTransferable;
}
-void ScTabViewShell::notifyAllViewsHeaderInvalidation(SfxViewShell* pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex)
+void ScTabViewShell::notifyAllViewsHeaderInvalidation(HeaderType eHeaderType, SCTAB nCurrentTabIndex)
{
if (comphelper::LibreOfficeKit::isActive())
{
@@ -595,7 +595,7 @@ void ScTabViewShell::notifyAllViewsHeaderInvalidation(SfxViewShell* pForViewShel
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pViewShell->GetDocId() == pForViewShell->GetDocId() && (nCurrentTabIndex == -1 || pTabViewShell->getPart() == nCurrentTabIndex))
+ if (pTabViewShell && (nCurrentTabIndex == -1 || pTabViewShell->getPart() == nCurrentTabIndex))
{
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_HEADER, aPayload.getStr());
}
@@ -604,7 +604,13 @@ void ScTabViewShell::notifyAllViewsHeaderInvalidation(SfxViewShell* pForViewShel
}
}
-bool ScTabViewShell::isAnyEditViewInRange(SfxViewShell* pForViewShell, bool bColumns, SCCOLROW nStart, SCCOLROW nEnd)
+void ScTabViewShell::notifyAllViewsHeaderInvalidation(bool bColumns, SCTAB nCurrentTabIndex)
+{
+ HeaderType eHeaderType = bColumns ? COLUMN_HEADER : ROW_HEADER;
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(eHeaderType, nCurrentTabIndex);
+}
+
+bool ScTabViewShell::isAnyEditViewInRange(bool bColumns, SCCOLROW nStart, SCCOLROW nEnd)
{
if (comphelper::LibreOfficeKit::isActive())
{
@@ -612,7 +618,7 @@ bool ScTabViewShell::isAnyEditViewInRange(SfxViewShell* pForViewShell, bool bCol
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pTabViewShell->GetDocId() == pForViewShell->GetDocId())
+ if (pTabViewShell)
{
ScInputHandler* pInputHandler = pTabViewShell->GetInputHandler();
if (pInputHandler && pInputHandler->GetActiveView())
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index aa4f05844693..1b948b916746 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -170,7 +170,7 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData )
pDocSh->UpdateOle(&GetViewData());
if (comphelper::LibreOfficeKit::isActive())
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, GetViewData().GetTabNo());
return bAnyChanged;
}
@@ -219,7 +219,7 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow )
PaintPartFlags::Grid | PaintPartFlags::Left );
if (comphelper::LibreOfficeKit::isActive())
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, GetViewData().GetTabNo());
return bChanged;
}
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index bed9550e77b1..a0e1185a6d3f 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1481,12 +1481,11 @@ void ScViewFunc::OnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset)
return;
SCTAB nCurrentTabIndex = GetViewData().GetTabNo();
- SfxViewShell* pCurrentViewShell = GetViewData().GetViewShell();
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
+ if (pTabViewShell)
{
pTabViewShell->GetViewData().GetLOKWidthHelper(nCurrentTabIndex)->invalidateByIndex(nStartCol);
@@ -1537,12 +1536,11 @@ void ScViewFunc::OnLOKInsertDeleteRow(SCROW nStartRow, long nOffset)
return;
SCTAB nCurrentTabIndex = GetViewData().GetTabNo();
- SfxViewShell* pCurrentViewShell = GetViewData().GetViewShell();
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
+ if (pTabViewShell)
{
pTabViewShell->GetViewData().GetLOKHeightHelper(nCurrentTabIndex)->invalidateByIndex(nStartRow);
@@ -1593,12 +1591,11 @@ void ScViewFunc::OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth)
return;
SCTAB nCurTab = GetViewData().GetTabNo();
- SfxViewShell* pCurrentViewShell = GetViewData().GetViewShell();
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
+ if (pTabViewShell)
{
if (bWidth)
pTabViewShell->GetViewData().GetLOKWidthHelper(nCurTab)->invalidateByIndex(nStart);
@@ -1639,10 +1636,10 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste )
if (comphelper::LibreOfficeKit::isActive())
{
if (bInsertCols)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), COLUMN_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(COLUMN_HEADER, GetViewData().GetTabNo());
if (bInsertRows)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, GetViewData().GetTabNo());
}
}
return bSuccess;
@@ -1714,10 +1711,10 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
if (comphelper::LibreOfficeKit::isActive())
{
if (eCmd == DelCellCmd::Cols)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), COLUMN_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(COLUMN_HEADER, GetViewData().GetTabNo());
if (eCmd == DelCellCmd::Rows)
- ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNo());
+ ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, GetViewData().GetTabNo());
}
}
else