diff options
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/docshell/olinefun.cxx | 9 |
4 files changed, 10 insertions, 13 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); |