diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-29 16:11:56 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-29 16:14:57 -0400 |
commit | 8acb68bae5319836a8c0c9fa6ddfc907b0dd6c48 (patch) | |
tree | bd8e54722de84aa24c9c80d3f734ce12d2128d05 /sc/source/ui | |
parent | 391a57ef65687f2e373bac8d410e551aafa780ec (diff) |
Check whether or not a visible range has changed.
Change-Id: I83581c8964ff43af1b1c42df82236274db446953
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin2.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/tabview4.cxx | 8 |
6 files changed, 27 insertions, 13 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index f32ea5e0141f..1befc351361c 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -119,6 +119,7 @@ private: VisibleRange(); bool isInside(SCCOL nCol, SCROW nRow) const; + bool set(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); }; VisibleRange maVisibleRange; @@ -374,7 +375,7 @@ public: void CheckNeedsRepaint(); void UpdateDPFromFieldPopupMenu(); - void UpdateVisibleRange(); + bool UpdateVisibleRange(); void SetInRefMode( bool bRefMode ); diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 9b971da8cb96..92a42ae70e18 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -213,7 +213,7 @@ protected: void ZoomChanged(); void UpdateShow(); - void UpdateVisibleRange(); + bool UpdateVisibleRange(); void GetBorderSize( SvBorder& rBorder, const Size& rSize ); void ResetDrawDragMode(); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index dc13e38904eb..208318b01c3a 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -177,6 +177,18 @@ bool ScGridWindow::VisibleRange::isInside(SCCOL nCol, SCROW nRow) const return mnCol1 <= nCol && nCol <= mnCol2 && mnRow1 <= nRow && nRow <= mnRow2; } +bool ScGridWindow::VisibleRange::set(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) +{ + bool bChanged = mnCol1 != nCol1 || mnRow1 != nRow1 || mnCol2 != nCol2 || mnRow2 != nRow2; + + mnCol1 = nCol1; + mnRow1 = nRow1; + mnCol2 = nCol2; + mnRow2 = nRow2; + + return bChanged; +} + // ============================================================================ class ScFilterListBox : public ListBox diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 554d7370e986..71914dad5bc4 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -594,7 +594,7 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu() aFunc.UpdatePivotTable(*pDPObj, true, false); } -void ScGridWindow::UpdateVisibleRange() +bool ScGridWindow::UpdateVisibleRange() { SCCOL nPosX = pViewData->GetPosX(eHWhich); SCROW nPosY = pViewData->GetPosY(eVWhich); @@ -604,10 +604,7 @@ void ScGridWindow::UpdateVisibleRange() if (nYBottom > MAXROW) nYBottom = MAXROW; // Store the current visible range. - maVisibleRange.mnCol1 = nPosX; - maVisibleRange.mnCol2 = nXRight; - maVisibleRange.mnRow1 = nPosY; - maVisibleRange.mnRow2 = nYBottom; + return maVisibleRange.set(nPosX, nPosY, nXRight, nYBottom); } void ScGridWindow::DPMouseMove( const MouseEvent& rMEvt ) diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 5a431dc41ac8..a83fba24942c 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1544,15 +1544,19 @@ void ScTabView::UpdateShow() //! neue Gridwindows eintragen } -void ScTabView::UpdateVisibleRange() +bool ScTabView::UpdateVisibleRange() { + bool bChanged = false; for (int i = 0; i < 4; ++i) { if (!pGridWin[i] || !pGridWin[i]->IsVisible()) continue; - pGridWin[i]->UpdateVisibleRange(); + if (pGridWin[i]->UpdateVisibleRange()) + bChanged = true; } + + return bChanged; } // --- Splitter -------------------------------------------------------- diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index e8f29a281edc..47fbc1453558 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -427,6 +427,9 @@ void ScTabView::UpdateScrollBars() if ( aViewData.IsActive() ) { + if (UpdateVisibleRange()) + SC_MOD()->AnythingChanged(); // if visible area has changed + ScSplitPos eActive = aViewData.GetActivePart(); ScHSplitPos eHWhich = WhichH( eActive ); ScVSplitPos eVWhich = WhichV( eActive ); @@ -437,10 +440,7 @@ void ScTabView::UpdateScrollBars() if ( nEndX > MAXCOL ) nEndX = MAXCOL; if ( nEndY > MAXROW ) nEndY = MAXROW; ScRange aVisible( nPosX, nPosY, nTab, nEndX, nEndY, nTab ); - if ( pDoc->SetVisibleSpellRange( aVisible ) ) - SC_MOD()->AnythingChanged(); // if visible area has changed - - UpdateVisibleRange(); + pDoc->SetVisibleSpellRange(aVisible); } } |