diff options
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/docshell/olinefun.cxx | 40 |
2 files changed, 23 insertions, 33 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index f33efe8cf789..4cbbd06b2050 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -614,6 +614,12 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, ScDocShellModificator aModificator( rDocShell ); ScDocument& rDoc = rDocShell.GetDocument(); + + if (ScTabViewShell::isAnyEditViewInRange(/*bColumns*/ false, rQueryParam.nRow1, rQueryParam.nRow2)) + { + return false; + } + if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; ScDBData* pDBData = rDoc.GetDBAtArea( nTab, rQueryParam.nCol1, rQueryParam.nRow1, @@ -924,6 +930,16 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, pOld, bDoSize, pAdvSource ) ); } + ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); + if ( pViewSh ) + { + // could there be horizontal autofilter ? + // maybe it would be better to set bColumns to !rQueryParam.bByRow ? + // anyway at the beginning the value of bByRow is 'false' + // then after the first sort action it becomes 'true' + pViewSh->OnLOKShowHideColRow(/*bColumns*/ false, rQueryParam.nRow1 - 1); + } + if (bCopy) { SCCOL nEndX = aLocalParam.nCol2; diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index 2e07e6d2d2c0..22dec17cae06 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -78,32 +78,6 @@ static void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab, rDocShell.PostPaint( nStartCol,nStartRow,nTab, MAXCOL,MAXROW,nTab, nParts ); } -static bool lcl_IsAnyViewEditingInEntryRange(bool bColumns, SCCOLROW nStart, SCCOLROW nEnd) -{ - if (comphelper::LibreOfficeKit::isActive()) - { - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) - { - ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell); - if (pTabViewShell) - { - ScInputHandler* pInputHandler = pTabViewShell->GetInputHandler(); - if (pInputHandler && pInputHandler->GetActiveView()) - { - const ScViewData& rViewData = pTabViewShell->GetViewData(); - SCCOLROW nPos = bColumns ? rViewData.GetCurX() : rViewData.GetCurY(); - if (nStart <= nPos && nPos <= nEnd) - return true; - } - } - pViewShell = SfxViewShell::GetNext(*pViewShell); - } - } - return false; -} - - void ScOutlineDocFunc::MakeOutline( const ScRange& rRange, bool bColumns, bool bRecord, bool bApi ) { SCCOL nStartCol = rRange.aStart.Col(); @@ -396,7 +370,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel sal_uInt16 nThisLevel = aIter.LastLevel(); bool bShow = (nThisLevel < nLevel); - if (!bShow && lcl_IsAnyViewEditingInEntryRange(bColumns, nThisStart, nThisEnd)) + if (!bShow && ScTabViewShell::isAnyEditViewInRange(bColumns, nThisStart, nThisEnd)) continue; if (bShow) // enable @@ -446,7 +420,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); if ( pViewSh ) - pViewSh->OnLOKShowHideOutline(bColumns, nStart - 1); + pViewSh->OnLOKShowHideColRow(bColumns, nStart - 1); if (bPaint) lcl_PaintWidthHeight( rDocShell, nTab, bColumns, nStart, nEnd ); @@ -557,8 +531,8 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord ) ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); if ( pViewSh ) { - pViewSh->OnLOKShowHideOutline(/*columns: */ true, nMinStartCol - 1); - pViewSh->OnLOKShowHideOutline(/*columns: */ false, nMinStartRow - 1); + pViewSh->OnLOKShowHideColRow(/*columns: */ true, nMinStartCol - 1); + pViewSh->OnLOKShowHideColRow(/*columns: */ false, nMinStartRow - 1); } rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PaintPartFlags::Grid | PaintPartFlags::Left | PaintPartFlags::Top ); @@ -744,7 +718,7 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); if ( pViewSh ) - pViewSh->OnLOKShowHideOutline(bColumns, nStart - 1); + pViewSh->OnLOKShowHideColRow(bColumns, nStart - 1); if (bPaint) lcl_PaintWidthHeight( rDocShell, nTab, bColumns, nStart, nEnd ); @@ -770,7 +744,7 @@ bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel SCCOLROW nEnd = pEntry->GetEnd(); - if (lcl_IsAnyViewEditingInEntryRange(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 @@ -813,7 +787,7 @@ bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); if ( pViewSh ) - pViewSh->OnLOKShowHideOutline(bColumns, nStart - 1); + pViewSh->OnLOKShowHideColRow(bColumns, nStart - 1); if (bPaint) lcl_PaintWidthHeight( rDocShell, nTab, bColumns, nStart, nEnd ); |