diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 12:14:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 12:30:39 +0200 |
commit | e5a71788c7740c70cf610bcb6d67f7bc8b806761 (patch) | |
tree | 807ec031c7b526f40915fe774af10cfd9945e70f | |
parent | 917d34657ae195edaef411b5446f70346cabf9e2 (diff) |
convert ScUpdateMode to scoped enum
and drop unused SC_UPDATE_CHANGED.
I can't find anything in our git history to even indicate when it was
last in use.
Change-Id: Iec6192a3d02132d15b3f392264e81f36b1fd4fad
-rw-r--r-- | sc/inc/viewutil.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin3.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 35 | ||||
-rw-r--r-- | sc/source/ui/view/select.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 75 | ||||
-rw-r--r-- | sc/source/ui/view/tabview4.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh5.cxx | 2 |
10 files changed, 56 insertions, 87 deletions
diff --git a/sc/inc/viewutil.hxx b/sc/inc/viewutil.hxx index bbccd75827d2..2819ace34952 100644 --- a/sc/inc/viewutil.hxx +++ b/sc/inc/viewutil.hxx @@ -35,7 +35,7 @@ class ScAddress; class ScRange; class ScMarkData; enum class SvtScriptType; -enum ScUpdateMode { SC_UPDATE_ALL, SC_UPDATE_CHANGED, SC_UPDATE_MARKS }; +enum class ScUpdateMode { All, Marks }; class SC_DLLPUBLIC ScViewUtil { diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index dff2da78e99f..d8217c5400f9 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -253,7 +253,7 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou SdrObject* GetEditObject(); bool IsMyModel(SdrEditView* pSdrView); - void DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sal_uLong nLayer ); + void DrawRedraw( ScOutputData& rOutputData, sal_uLong nLayer ); void DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pContentDev ); void DrawAfterScroll(); Rectangle GetListValButtonRect( const ScAddress& rButtonPos ); @@ -374,7 +374,7 @@ public: ScUpdateMode eMode ); /// Draw content of the gridwindow; shared between the desktop and the tiled rendering. - void DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableInfo, ScOutputData& aOutputData, bool bLogicText, ScUpdateMode eMode); + void DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableInfo, ScOutputData& aOutputData, bool bLogicText); void CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress); diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index d7c659eed6b2..3d7d54a3a516 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -451,7 +451,7 @@ public: // Zeichnen void PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - ScUpdateMode eMode = SC_UPDATE_ALL ); + ScUpdateMode eMode = ScUpdateMode::All ); void PaintGrid(); diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index 80111d1004ba..8bfc22fc773f 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -185,7 +185,7 @@ bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt) return false; } -void ScGridWindow::DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sal_uLong nLayer ) +void ScGridWindow::DrawRedraw( ScOutputData& rOutputData, sal_uLong nLayer ) { const ScViewOptions& rOpts = pViewData->GetOptions(); @@ -206,14 +206,7 @@ void ScGridWindow::DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sa pDrView->setHideFormControl(!bDrawDraw); } - if(SC_UPDATE_CHANGED == eMode) - { - rOutputData.DrawingSingle((sal_uInt16)nLayer); - } - else - { - rOutputData.DrawSelectiveObjects((sal_uInt16)nLayer); - } + rOutputData.DrawSelectiveObjects((sal_uInt16)nLayer); } } diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index b26ac767aae9..5f0bbb329ffe 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -371,7 +371,7 @@ void ScGridWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangl ScViewData::AddPixelsWhile( nScrY, aPixRect.Bottom(), nY2, MAXROW, nPPTY, pDoc, nTab); } - Draw( nX1,nY1,nX2,nY2, SC_UPDATE_MARKS ); // don't continue with painting + Draw( nX1,nY1,nX2,nY2, ScUpdateMode::Marks ); // don't continue with painting bIsInPaint = false; } @@ -417,7 +417,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod if (nY2 > maVisibleRange.mnRow2) nY2 = maVisibleRange.mnRow2; - if ( eMode != SC_UPDATE_MARKS && nX2 < maVisibleRange.mnCol2) + if ( eMode != ScUpdateMode::Marks && nX2 < maVisibleRange.mnCol2) nX2 = maVisibleRange.mnCol2; // to continue painting // point of no return @@ -504,7 +504,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod bLogicText = true; // use logic MapMode } - DrawContent(*this, aTabInfo, aOutputData, bLogicText, eMode); + DrawContent(*this, aTabInfo, aOutputData, bLogicText); // If something was inverted during the Paint (selection changed from Basic Macro) // then this is now mixed up and has to be repainted @@ -519,7 +519,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod } void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableInfo, ScOutputData& aOutputData, - bool bLogicText, ScUpdateMode eMode) + bool bLogicText) { ScModule* pScMod = SC_MOD(); ScDocShell* pDocSh = pViewData->GetDocShell(); @@ -560,12 +560,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI bool bPage = rOpts.GetOption( VOPT_PAGEBREAKS ); - if ( eMode == SC_UPDATE_CHANGED ) - { - aOutputData.FindChanged(); - aOutputData.SetSingleGrid(true); - } - bool bPageMode = pViewData->IsPagebreakMode(); if (bPageMode) // after FindChanged { @@ -713,7 +707,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI // drawing background pContentDev->SetMapMode(aDrawMode); - DrawRedraw( aOutputData, eMode, SC_LAYER_BACK ); + DrawRedraw( aOutputData, SC_LAYER_BACK ); } else aOutputData.SetSolidBackground(true); @@ -793,8 +787,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI //! Merge SetChangedClip() with DrawMarks() ?? (different MapMode!) bool bAny = true; - if (eMode == SC_UPDATE_CHANGED) - bAny = aOutputData.SetChangedClip(); if (bAny) { if ( bHasChange ) @@ -804,9 +796,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI lcl_DrawScenarioFrames( pContentDev, pViewData, eWhich, nX1,nY1,nX2,nY2 ); lcl_DrawHighlight( aOutputData, pViewData, rHigh ); - - if (eMode == SC_UPDATE_CHANGED) - pContentDev->SetClipRegion(); } } @@ -830,8 +819,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI comphelper::LibreOfficeKit::setLocalRendering(); } - DrawRedraw( aOutputData, eMode, SC_LAYER_FRONT ); - DrawRedraw( aOutputData, eMode, SC_LAYER_INTERN ); + DrawRedraw( aOutputData, SC_LAYER_FRONT ); + DrawRedraw( aOutputData, SC_LAYER_INTERN ); DrawSdrGrid( aDrawingRectLogic, pContentDev ); if (bIsTiledRendering) @@ -839,14 +828,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI pContentDev->SetMapMode(aOrig); } - if (!bIsInScroll) // Drawing marks - { - if(eMode == SC_UPDATE_CHANGED && aOutputData.SetChangedClip()) - { - pContentDev->SetClipRegion(); - } - } - pContentDev->SetMapMode(MapUnit::MapPixel); if ( pViewData->IsRefMode() && nTab >= pViewData->GetRefStartZ() && nTab <= pViewData->GetRefEndZ() ) @@ -1224,7 +1205,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, } // draw the content - DrawContent(rDevice, aTabInfo, aOutputData, true, SC_UPDATE_ALL); + DrawContent(rDevice, aTabInfo, aOutputData, true); rDevice.SetMapMode(aOriginalMode); } diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index 714b99129ff3..b4c99e6831ca 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -517,7 +517,7 @@ bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, bool bScrol pViewData->GetView()->UpdateShrinkOverlay(); pViewData->GetView()-> - PaintArea( nStartX,nDelStartY, nEndX,nEndY, SC_UPDATE_MARKS ); + PaintArea( nStartX,nDelStartY, nEndX,nEndY, ScUpdateMode::Marks ); nPosX = nEndX; // keep red border around range nPosY = nEndY; diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 16ad08089402..6cc704df99f6 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -323,7 +323,7 @@ void ScTabView::PaintMarks(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO aViewData.GetDocument()->ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, aViewData.GetTabNo() ); - PaintArea( nStartCol, nStartRow, nEndCol, nEndRow, SC_UPDATE_MARKS ); + PaintArea( nStartCol, nStartRow, nEndCol, nEndRow, ScUpdateMode::Marks ); } bool ScTabView::IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 7690d4b90eea..343ec37f937c 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2136,7 +2136,7 @@ void ScTabView::KillEditView( bool bNoPaint ) // #i73567# the cell still has to be repainted else if (bExtended || ( bAtCursor && !bNoPaint )) { - pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, SC_UPDATE_ALL ); + pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::All ); pGridWin[i]->UpdateSelectionOverlay(); } } @@ -2250,7 +2250,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO nCol1 = nScrX; if (nCol2 < nScrX) { - if ( eMode == SC_UPDATE_ALL ) // for UPDATE_ALL, paint anyway + if ( eMode == ScUpdateMode::All ) // for UPDATE_ALL, paint anyway nCol2 = nScrX; // (because of extending strings to the right) else bOut = true; // completely outside the window @@ -2276,43 +2276,38 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO if (bOut) continue; - if ( eMode == SC_UPDATE_CHANGED ) - pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, eMode ); - else // ALL or MARKS - { - bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() ); - long nLayoutSign = bLayoutRTL ? -1 : 1; + bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() ); + long nLayoutSign = bLayoutRTL ? -1 : 1; - Point aStart = aViewData.GetScrPos( nCol1, nRow1, (ScSplitPos) i ); - Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, (ScSplitPos) i ); - if ( eMode == SC_UPDATE_ALL ) - aEnd.X() = bLayoutRTL ? 0 : (pGridWin[i]->GetOutputSizePixel().Width()); - aEnd.X() -= nLayoutSign; - aEnd.Y() -= 1; + Point aStart = aViewData.GetScrPos( nCol1, nRow1, (ScSplitPos) i ); + Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, (ScSplitPos) i ); + if ( eMode == ScUpdateMode::All ) + aEnd.X() = bLayoutRTL ? 0 : (pGridWin[i]->GetOutputSizePixel().Width()); + aEnd.X() -= nLayoutSign; + aEnd.Y() -= 1; - // #i85232# include area below cells (could be done in GetScrPos?) - if ( eMode == SC_UPDATE_ALL && nRow2 >= MAXROW ) - aEnd.Y() = pGridWin[i]->GetOutputSizePixel().Height(); + // #i85232# include area below cells (could be done in GetScrPos?) + if ( eMode == ScUpdateMode::All && nRow2 >= MAXROW ) + aEnd.Y() = pGridWin[i]->GetOutputSizePixel().Height(); - aStart.X() -= nLayoutSign; // include change marks - aStart.Y() -= 1; + aStart.X() -= nLayoutSign; // include change marks + aStart.Y() -= 1; - bool bMarkClipped = aViewData.GetOptions().GetOption( VOPT_CLIPMARKS ); - if (bMarkClipped) + bool bMarkClipped = aViewData.GetOptions().GetOption( VOPT_CLIPMARKS ); + if (bMarkClipped) + { + // ScColumn::IsEmptyBlock has to be optimized for this + // (switch to Search() ) + //!if ( nCol1 > 0 && !aViewData.GetDocument()->IsBlockEmpty( + //! aViewData.GetTabNo(), + //! 0, nRow1, nCol1-1, nRow2 ) ) { - // ScColumn::IsEmptyBlock has to be optimized for this - // (switch to Search() ) - //!if ( nCol1 > 0 && !aViewData.GetDocument()->IsBlockEmpty( - //! aViewData.GetTabNo(), - //! 0, nRow1, nCol1-1, nRow2 ) ) - { - long nMarkPixel = (long)( SC_CLIPMARK_SIZE * aViewData.GetPPTX() ); - aStart.X() -= nMarkPixel * nLayoutSign; - } + long nMarkPixel = (long)( SC_CLIPMARK_SIZE * aViewData.GetPPTX() ); + aStart.X() -= nMarkPixel * nLayoutSign; } - - pGridWin[i]->Invalidate( pGridWin[i]->PixelToLogic( Rectangle( aStart,aEnd ) ) ); } + + pGridWin[i]->Invalidate( pGridWin[i]->PixelToLogic( Rectangle( aStart,aEnd ) ) ); } // #i79909# Calling UpdateAllOverlays here isn't necessary and would lead to overlay calls from a timer, @@ -2340,7 +2335,7 @@ void ScTabView::PaintRangeFinderEntry (ScRangeFindData* pData, const SCTAB nTab) SCROW nRow2 = aRef.aEnd.Row(); // remove -> repaint - // SC_UPDATE_MARKS: Invalidate, nothing until end of row + // ScUpdateMode::Marks: Invalidate, nothing until end of row bool bHiddenEdge = false; SCROW nTmp; @@ -2375,13 +2370,13 @@ void ScTabView::PaintRangeFinderEntry (ScRangeFindData* pData, const SCTAB nTab) if ( nCol2 - nCol1 > 1 && nRow2 - nRow1 > 1 && !bHiddenEdge ) { // only along the edges - PaintArea( nCol1, nRow1, nCol2, nRow1, SC_UPDATE_MARKS ); - PaintArea( nCol1, nRow1+1, nCol1, nRow2-1, SC_UPDATE_MARKS ); - PaintArea( nCol2, nRow1+1, nCol2, nRow2-1, SC_UPDATE_MARKS ); - PaintArea( nCol1, nRow2, nCol2, nRow2, SC_UPDATE_MARKS ); + PaintArea( nCol1, nRow1, nCol2, nRow1, ScUpdateMode::Marks ); + PaintArea( nCol1, nRow1+1, nCol1, nRow2-1, ScUpdateMode::Marks ); + PaintArea( nCol2, nRow1+1, nCol2, nRow2-1, ScUpdateMode::Marks ); + PaintArea( nCol1, nRow2, nCol2, nRow2, ScUpdateMode::Marks ); } else // all in one - PaintArea( nCol1, nRow1, nCol2, nRow2, SC_UPDATE_MARKS ); + PaintArea( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::Marks ); } } @@ -2420,7 +2415,7 @@ void ScTabView::AddHighlightRange( const ScRange& rRange, const Color& rColor ) SCTAB nTab = aViewData.GetTabNo(); if ( nTab >= rRange.aStart.Tab() && nTab <= rRange.aEnd.Tab() ) PaintArea( rRange.aStart.Col(), rRange.aStart.Row(), - rRange.aEnd.Col(), rRange.aEnd.Row(), SC_UPDATE_MARKS ); + rRange.aEnd.Col(), rRange.aEnd.Row(), ScUpdateMode::Marks ); } void ScTabView::ClearHighlightRanges() @@ -2432,7 +2427,7 @@ void ScTabView::ClearHighlightRanges() ScRange aRange = pIter->aRef; if ( nTab >= aRange.aStart.Tab() && nTab <= aRange.aEnd.Tab() ) PaintArea( aRange.aStart.Col(), aRange.aStart.Row(), - aRange.aEnd.Col(), aRange.aEnd.Row(), SC_UPDATE_MARKS ); + aRange.aEnd.Col(), aRange.aEnd.Row(), ScUpdateMode::Marks ); } maHighlightRanges.clear(); diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 3196b29c646e..3aaa0d1b2691 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -120,7 +120,7 @@ void ScTabView::StopRefMode() if ( nStartX == nEndX && nStartY == nEndY ) pDoc->ExtendMerge( nStartX, nStartY, nEndX, nEndY, aViewData.GetTabNo() ); - PaintArea( nStartX,nStartY,nEndX,nEndY, SC_UPDATE_MARKS ); + PaintArea( nStartX,nStartY,nEndX,nEndY, ScUpdateMode::Marks ); } pSelEngine->Reset(); @@ -169,7 +169,7 @@ void ScTabView::DoneRefMode( bool bContinue ) if ( nStartX == nEndX && nStartY == nEndY ) pDoc->ExtendMerge( nStartX, nStartY, nEndX, nEndY, aViewData.GetTabNo() ); - PaintArea( nStartX,nStartY,nEndX,nEndY, SC_UPDATE_MARKS ); + PaintArea( nStartX,nStartY,nEndX,nEndY, ScUpdateMode::Marks ); } } @@ -237,7 +237,7 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ) SCCOL nPaintEndX; SCROW nPaintEndY; if (aRect.GetDiff( nPaintStartX, nPaintStartY, nPaintEndX, nPaintEndY )) - PaintArea( nPaintStartX, nPaintStartY, nPaintEndX, nPaintEndY, SC_UPDATE_MARKS ); + PaintArea( nPaintStartX, nPaintStartY, nPaintEndX, nPaintEndY, ScUpdateMode::Marks ); } // Tip-Hilfe fuer Auto-Fill @@ -302,7 +302,7 @@ void ScTabView::InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eT pDoc->ExtendMerge( nStartX, nStartY, nEndX, nEndY, aViewData.GetTabNo() ); //! nur Markierung ueber Inhalte zeichnen! - PaintArea( nStartX,nStartY,nEndX,nEndY, SC_UPDATE_MARKS ); + PaintArea( nStartX,nStartY,nEndX,nEndY, ScUpdateMode::Marks ); // SetReference ohne Merge-Anpassung ScRange aRef( nCurX,nCurY,nCurZ, nCurX,nCurY,nCurZ ); diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx index 4e635ada68ed..456fe7f1e67d 100644 --- a/sc/source/ui/view/tabvwsh5.cxx +++ b/sc/source/ui/view/tabvwsh5.cxx @@ -64,7 +64,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) pPaintHint->GetEndCol(), pPaintHint->GetEndRow() ); if (nParts & PaintPartFlags::Marks) PaintArea( pPaintHint->GetStartCol(), pPaintHint->GetStartRow(), - pPaintHint->GetEndCol(), pPaintHint->GetEndRow(), SC_UPDATE_MARKS ); + pPaintHint->GetEndCol(), pPaintHint->GetEndRow(), ScUpdateMode::Marks ); if (nParts & PaintPartFlags::Left) PaintLeftArea( pPaintHint->GetStartRow(), pPaintHint->GetEndRow() ); if (nParts & PaintPartFlags::Top) |