[Libreoffice-commits] .: 2 commits - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri May 27 20:26:05 PDT 2011


 sc/source/ui/inc/tabview.hxx   |  158 ++++++++++++++++++++---------------------
 sc/source/ui/view/tabview.cxx  |  156 ++++++++++++++++++----------------------
 sc/source/ui/view/tabview2.cxx |   67 +++++++----------
 sc/source/ui/view/tabview3.cxx |   72 +++++++++---------
 sc/source/ui/view/tabview4.cxx |    8 +-
 sc/source/ui/view/tabview5.cxx |   24 +++---
 6 files changed, 232 insertions(+), 253 deletions(-)

New commits:
commit ea2768481d3204a781e6255b5fcb47336bea25c2
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri May 27 23:24:37 2011 -0400

    Massive cleanup of ScTabView. No more sal_Bool from the header.
    
    I found one abuse of sal_Bool being used as an integer.  The block
    mode was a boolean but had 3 different states.  Replaced that with
    enum.

diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 185a325..f523c53 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -71,14 +71,14 @@ class ScCornerButton : public Window
 {
 private:
     ScViewData*		pViewData;
-    sal_Bool			bAdd;
+    bool            bAdd;
 
 protected:
     virtual void	Paint( const Rectangle& rRect );
     virtual void	Resize();
     virtual void	MouseButtonDown( const MouseEvent& rMEvt );
 public:
-                    ScCornerButton( Window* pParent, ScViewData* pData, sal_Bool bAdditional );
+                    ScCornerButton( Window* pParent, ScViewData* pData, bool bAdditional );
                     ~ScCornerButton();
 
     virtual	void	StateChanged( StateChangedType nType );
@@ -91,6 +91,8 @@ public:
 class ScTabView
 {
 private:
+    enum BlockMode { None = 0, Normal = 1, Own = 2 };
+
     Window*				pFrameWin;				// als erstes !!!
     ScViewData			aViewData;				// muss ganz vorne stehen !
 
@@ -107,8 +109,6 @@ private:
     Size				aFrameSize;				// wie bei DoResize uebergeben
     Point				aBorderPos;
 
-    sal_Bool				bDrawSelMode;			// nur Zeichenobjekte selektieren ?
-
     FuPoor* 			pDrawActual;
     FuPoor*				pDrawOld;
 
@@ -135,7 +135,6 @@ private:
 
     ScDocument*         pBrushDocument;         // cell formats for format paint brush
     SfxItemSet*         pDrawBrushSet;          // drawing object attributes for paint brush
-    sal_Bool                bLockPaintBrush;        // keep for more than one use?
 
     Timer				aScrollTimer;
     ScGridWindow*		pTimerWindow;
@@ -143,13 +142,9 @@ private:
 
     sal_uLong				nTipVisible;
 
-    sal_Bool				bDragging;				// fuer Scrollbars
     long				nPrevDragPos;
 
-    sal_Bool				bIsBlockMode;           // Block markieren
-    sal_Bool				bBlockNeg;				// wird Markierung aufgehoben?
-    sal_Bool				bBlockCols;				// werden ganze Spalten markiert?
-    sal_Bool				bBlockRows;				// werden ganze Zeilen markiert?
+    BlockMode           meBlockMode;           // Block markieren
 
     SCCOL				nBlockStartX;
     SCCOL				nBlockEndX;
@@ -165,11 +160,17 @@ private:
 
     double              mfPendingTabBarWidth;       // Tab bar width relative to frame window width.
 
-    sal_Bool				bMinimized;
-    sal_Bool				bInUpdateHeader;
-    sal_Bool				bInActivatePart;
-    sal_Bool				bInZoomUpdate;
-    sal_Bool				bMoveIsShift;
+    bool                bMinimized:1;
+    bool                bInUpdateHeader:1;
+    bool                bInActivatePart:1;
+    bool                bInZoomUpdate:1;
+    bool                bMoveIsShift:1;
+    bool                bDrawSelMode:1;           // nur Zeichenobjekte selektieren ?
+    bool                bLockPaintBrush:1;        // keep for more than one use?
+    bool                bDragging:1;              // fuer Scrollbars
+    bool                bBlockNeg:1;              // wird Markierung aufgehoben?
+    bool                bBlockCols:1;             // werden ganze Spalten markiert?
+    bool                bBlockRows:1;             // werden ganze Zeilen markiert?
 
     void			Init();
 
@@ -187,8 +188,8 @@ private:
 
     void			UpdateVarZoom();
 
-    static void		SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, sal_Bool bLayoutRTL );
-    static long		GetScrollBarPos( ScrollBar& rScroll, sal_Bool bLayoutRTL );
+    static void     SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, bool bLayoutRTL );
+    static long     GetScrollBarPos( ScrollBar& rScroll, bool bLayoutRTL );
 
     void            GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY);
     void            GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
@@ -210,9 +211,8 @@ protected:
     void			GetBorderSize( SvBorder& rBorder, const Size& rSize );
 
     void			ResetDrawDragMode();
-    sal_Bool			IsDrawTextEdit() const;
-    void			DrawEnableAnim(sal_Bool bSet);
-    //HMHvoid			DrawShowMarkHdl(sal_Bool bShow);
+    bool            IsDrawTextEdit() const;
+    void            DrawEnableAnim(bool bSet);
 
     void			MakeDrawView( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
 
@@ -228,7 +228,7 @@ public:
 
     void			HideListBox();
 
-    sal_Bool			HasHintWindow() const	{ return pInputHintWindow != NULL; }
+    bool            HasHintWindow() const   { return pInputHintWindow != NULL; }
     void			RemoveHintWindow();
     void			TestHintWindow();
 
@@ -249,13 +249,13 @@ public:
     /** Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0). */
     double          GetPendingRelTabBarWidth() const;
 
-    void			DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInner = false );
-    void			RepeatResize( sal_Bool bUpdateFix = sal_True );
+    void            DoResize( const Point& rOffset, const Size& rSize, bool bInner = false );
+    void            RepeatResize( bool bUpdateFix = true );
     void			UpdateFixPos();
     Point			GetGridOffset() const;
 
-    sal_Bool			IsDrawSelMode() const 		{ return bDrawSelMode; }
-    void			SetDrawSelMode(sal_Bool bNew)	{ bDrawSelMode = bNew; }
+    bool            IsDrawSelMode() const       { return bDrawSelMode; }
+    void            SetDrawSelMode(bool bNew)   { bDrawSelMode = bNew; }
 
     void			SetDrawFuncPtr(FuPoor* pFuncPtr)	{ pDrawActual = pFuncPtr; }
     void			SetDrawFuncOldPtr(FuPoor* pFuncPtr)	{ pDrawOld = pFuncPtr; }
@@ -269,7 +269,7 @@ public:
     ScPageBreakData* GetPageBreakData()		{ return pPageBreakData; }
     ScHighlightRanges* GetHighlightRanges()	{ return pHighlightRanges; }
 
-    void			UpdatePageBreakData( sal_Bool bForcePaint = false );
+    void            UpdatePageBreakData( bool bForcePaint = false );
 
     void			DrawMarkRect( const Rectangle& rRect );
 
@@ -279,18 +279,22 @@ public:
     ScViewFunctionSet*		GetFunctionSet()	{ return &aFunctionSet; }
     ScViewSelectionEngine*	GetSelEngine()		{ return pSelEngine; }
 
-    sal_Bool			SelMouseButtonDown( const MouseEvent& rMEvt );
+    bool            SelMouseButtonDown( const MouseEvent& rMEvt );
 
     ScDrawView*		GetScDrawView()			{ return pDrawView; }
     SdrView*		GetSdrView();			// gegen CLOKs
 
-    sal_Bool			IsMinimized() const		{ return bMinimized; }
+    bool            IsMinimized() const     { return bMinimized; }
 
-    // bSameTabButMoved = true if the same sheet as before is activated, used after moving/copying/inserting/deleting a sheet
-    void			TabChanged( bool bSameTabButMoved = false );
-    void			SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool bAll );
+    /**
+     * Called after moving, copying, inserting or deleting a sheet.
+     *
+     * @param bSameTabButMoved true if the same sheet as before is activated.
+     */
+    void            TabChanged( bool bSameTabButMoved = false );
+    void            SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll );
     SC_DLLPUBLIC void            RefreshZoom();
-    void			SetPagebreakMode( sal_Bool bSet );
+    void            SetPagebreakMode( bool bSet );
 
     void			UpdateLayerLocks();
 
@@ -300,8 +304,8 @@ public:
     void			UpdateInputLine();
 
     void			InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType,
-                                    sal_Bool bPaint = sal_True );
-    void			DoneRefMode( sal_Bool bContinue = false );
+                                 bool bPaint = true );
+    void            DoneRefMode( bool bContinue = false );
     void			UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ );
     void			StopRefMode();
 
@@ -317,9 +321,9 @@ public:
 
     void			ActiveGrabFocus();
 
-    void			ClickCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bControl );
+    void            ClickCursor( SCCOL nPosX, SCROW nPosY, bool bControl );
 
-    SC_DLLPUBLIC void			SetCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bNew = false );
+    SC_DLLPUBLIC void SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew = false );
 
     SC_DLLPUBLIC void			CellContentChanged();
     void			SelectionChanged();
@@ -347,12 +351,10 @@ public:
                                     const ScSplitPos* pWhich = NULL );
 
     SvxZoomType     GetZoomType() const;
-    void            SetZoomType( SvxZoomType eNew, sal_Bool bAll );
+    void            SetZoomType( SvxZoomType eNew, bool bAll );
     sal_uInt16			CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom );
 
-//	void			CalcZoom( SvxZoomType eType, sal_uInt16& rZoom, SCCOL& rCol, SCROW& rRow );
-
-    sal_Bool        HasPageFieldDataAtCursor() const;
+    bool            HasPageFieldDataAtCursor() const;
     void			StartDataSelect();
 
                     //	MoveCursorAbs		- absolut
@@ -361,40 +363,40 @@ public:
                     //	MoveCursorArea		- Datenblock
                     //	MoveCursorEnd		- links oben / benutzter Bereich
 
-    SC_DLLPUBLIC void			MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
-                                    sal_Bool bShift, sal_Bool bControl,
-                                    sal_Bool bKeepOld = false, sal_Bool bKeepSel = false );
+    SC_DLLPUBLIC void MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
+                                     bool bShift, bool bControl,
+                                     bool bKeepOld = false, bool bKeepSel = false );
     void			MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
-                                    sal_Bool bShift, sal_Bool bKeepSel = false );
+                                   bool bShift, bool bKeepSel = false );
     void			MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
-                                    sal_Bool bShift, sal_Bool bKeepSel = false );
+                                    bool bShift, bool bKeepSel = false );
     void			MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
-                                    sal_Bool bShift, sal_Bool bKeepSel = false );
+                                    bool bShift, bool bKeepSel = false );
     void			MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
-                                    sal_Bool bShift, sal_Bool bKeepSel = false );
-    void			MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift );
+                                   bool bShift, bool bKeepSel = false );
+    void            MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, bool bShift );
 
-    void			MoveCursorEnter( sal_Bool bShift );		// Shift fuer Richtung (kein Markieren)
+    void            MoveCursorEnter( bool bShift );     // Shift fuer Richtung (kein Markieren)
 
-    sal_Bool            MoveCursorKeyInput( const KeyEvent& rKeyEvent );
+    bool            MoveCursorKeyInput( const KeyEvent& rKeyEvent );
 
-    void			FindNextUnprot( sal_Bool bShift, sal_Bool bInSelection = sal_True );
+    void            FindNextUnprot( bool bShift, bool bInSelection = true );
 
     SC_DLLPUBLIC void SetTabNo( SCTAB nTab, bool bNew = false, bool bExtendSelection = false, bool bSameTabButMoved = false );
-    void            SelectNextTab( short nDir, sal_Bool bExtendSelection = false );
+    void            SelectNextTab( short nDir, bool bExtendSelection = false );
 
-    void			ActivateView( sal_Bool bActivate, sal_Bool bFirst );
+    void            ActivateView( bool bActivate, bool bFirst );
     void			ActivatePart( ScSplitPos eWhich );
-    sal_Bool			IsInActivatePart() const	{ return bInActivatePart; }
+    bool            IsInActivatePart() const    { return bInActivatePart; }
 
     void			SetTimer( ScGridWindow* pWin, const MouseEvent& rMEvt );
     void			ResetTimer();
 
-    void 			ScrollX( long nDeltaX, ScHSplitPos eWhich, sal_Bool bUpdBars = sal_True );
-    void 			ScrollY( long nDeltaY, ScVSplitPos eWhich, sal_Bool bUpdBars = sal_True );
+    void            ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars = true );
+    void            ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars = true );
     SC_DLLPUBLIC void			ScrollLines( long nDeltaX, long nDeltaY );				// aktives
 
-    sal_Bool			ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos );
+    bool            ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos );
 
     void			ScrollToObject( SdrObject* pDrawObj );
     void			MakeVisible( const Rectangle& rHMMRect );
@@ -412,7 +414,7 @@ public:
     void			PaintLeftArea( SCROW nStartRow, SCROW nEndRow );
     void			PaintLeft();
 
-    sal_Bool			PaintExtras();
+    bool            PaintExtras();
 
     void			RecalcPPT();
 
@@ -443,25 +445,25 @@ public:
     void			InvalidateAttribs();
 
     void			MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW nRow );
-    void			KillEditView( sal_Bool bNoPaint );
+    void            KillEditView( bool bNoPaint );
     void			UpdateEditView();
 
 
                                     //	Bloecke
 
-    void			SelectAll( sal_Bool bContinue = false );
+    void            SelectAll( bool bContinue = false );
     void			SelectAllTables();
     void            DeselectAllTables();
 
     void			MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
-                                sal_Bool bCols = false, sal_Bool bRows = false, sal_Bool bCellSelection = false );
+                                bool bCols = false, bool bRows = false, bool bCellSelection = false );
     void			InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
-                                    sal_Bool bTestNeg = false,
-                                    sal_Bool bCols = false, sal_Bool bRows = false );
+                                   bool bTestNeg = false,
+                                   bool bCols = false, bool bRows = false );
     void			InitOwnBlockMode();
-    void			DoneBlockMode( sal_Bool bContinue = false );
+    void			DoneBlockMode( bool bContinue = false );
 
-    sal_Bool			IsBlockMode() const		{ return bIsBlockMode; }
+    bool            IsBlockMode() const;
 
     void            ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode);
     void            ExpandBlockPage(SCsCOL nMovX, SCsROW nMovY);
@@ -469,47 +471,47 @@ public:
 
     void			MarkColumns();
     void			MarkRows();
-    void			MarkDataArea( sal_Bool bIncludeCursor = sal_True );
+    void            MarkDataArea( bool bIncludeCursor = true );
     void			MarkMatrixFormula();
     void			Unmark();
 
-    void            MarkRange( const ScRange& rRange, sal_Bool bSetCursor = sal_True, sal_Bool bContinue = false );
+    void            MarkRange( const ScRange& rRange, bool bSetCursor = true, bool bContinue = false );
 
-    sal_Bool			IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
+    bool            IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
 
     void			PaintMarks( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
-    void			PaintBlock( sal_Bool bReset = false );
+    void            PaintBlock( bool bReset = false );
 
     void            SetMarkData( const ScMarkData& rNew );
     void            MarkDataChanged();
 
     void			LockModifiers( sal_uInt16 nModifiers );
     sal_uInt16			GetLockedModifiers() const;
-    void			ViewOptionsHasChanged( sal_Bool bHScrollChanged,
-                                            sal_Bool bGraphicsChanged = false);
+    void            ViewOptionsHasChanged( bool bHScrollChanged,
+                                           bool bGraphicsChanged = false);
 
     Point			GetMousePosPixel();
 
     void			SnapSplitPos( Point& rScreenPosPixel );
-    void			FreezeSplitters( sal_Bool bFreeze );
+    void            FreezeSplitters( bool bFreeze );
     void			RemoveSplit();
     void			SplitAtCursor();
-    void			SplitAtPixel( const Point& rPixel, sal_Bool bHor, sal_Bool bVer );
+    void            SplitAtPixel( const Point& rPixel, bool bHor, bool bVer );
     void			InvalidateSplit();
 
     void			ErrorMessage( sal_uInt16 nGlobStrId );
     Window*			GetParentOrChild( sal_uInt16 nChildId );
 
-    void			EnableRefInput(sal_Bool bFlag=sal_True);
+    void            EnableRefInput(bool bFlag = true);
 
     Window*			GetFrameWin() const	{ return pFrameWin; }
 
-    sal_Bool            HasPaintBrush() const           { return pBrushDocument || pDrawBrushSet; }
+    bool            HasPaintBrush() const           { return pBrushDocument || pDrawBrushSet; }
     ScDocument*     GetBrushDocument() const        { return pBrushDocument; }
     SfxItemSet*     GetDrawBrushSet() const         { return pDrawBrushSet; }
-    sal_Bool            IsPaintBrushLocked() const      { return bLockPaintBrush; }
-    void            SetBrushDocument( ScDocument* pNew, sal_Bool bLock );
-    void            SetDrawBrushSet( SfxItemSet* pNew, sal_Bool bLock );
+    bool            IsPaintBrushLocked() const      { return bLockPaintBrush; }
+    void            SetBrushDocument( ScDocument* pNew, bool bLock );
+    void            SetDrawBrushSet( SfxItemSet* pNew, bool bLock );
     void            ResetBrushDocument();
 };
 
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 138e647..9f04d30 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -168,7 +168,7 @@ using namespace ::com::sun::star;
 
 //	Corner-Button
 
-ScCornerButton::ScCornerButton( Window* pParent, ScViewData* pData, sal_Bool bAdditional ) :
+ScCornerButton::ScCornerButton( Window* pParent, ScViewData* pData, bool bAdditional ) :
     Window( pParent, WinBits( 0 ) ),
     pViewData( pData ),
     bAdd( bAdditional )
@@ -192,7 +192,7 @@ void ScCornerButton::Paint( const Rectangle& rRect )
 
     Window::Paint(rRect);
 
-    sal_Bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+    bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
     long nDarkX = bLayoutRTL ? 0 : nPosX;
 
     if ( !bAdd )
@@ -256,89 +256,79 @@ void ScCornerButton::Resize()
 void ScCornerButton::MouseButtonDown( const MouseEvent& rMEvt )
 {
     ScModule* pScMod = SC_MOD();
-    sal_Bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode();
+    bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode();
     if (!bDisable)
     {
         ScTabViewShell* pViewSh = pViewData->GetViewShell();
         pViewSh->SetActive();									// Appear und SetViewFrame
         pViewSh->ActiveGrabFocus();
 
-        sal_Bool bControl = rMEvt.IsMod1();
+        bool bControl = rMEvt.IsMod1();
         pViewSh->SelectAll( bControl );
     }
 }
 
 //==================================================================
 
-sal_Bool lcl_HasColOutline( const ScViewData& rViewData )
+bool lcl_HasColOutline( const ScViewData& rViewData )
 {
     const ScOutlineTable* pTable = rViewData.GetDocument()->GetOutlineTable(rViewData.GetTabNo());
     if (pTable)
     {
         const ScOutlineArray* pArray = pTable->GetColArray();
         if ( pArray->GetDepth() > 0 )
-            return sal_True;
+            return true;
     }
     return false;
 }
 
-sal_Bool lcl_HasRowOutline( const ScViewData& rViewData )
+bool lcl_HasRowOutline( const ScViewData& rViewData )
 {
     const ScOutlineTable* pTable = rViewData.GetDocument()->GetOutlineTable(rViewData.GetTabNo());
     if (pTable)
     {
         const ScOutlineArray* pArray = pTable->GetRowArray();
         if ( pArray->GetDepth() > 0 )
-            return sal_True;
+            return true;
     }
     return false;
 }
 
-//==================================================================
-
-//	Init und Konstruktoren
-//	ScTabView::Init() in tabview5.cxx wegen out of keys
-
-
-#define TABVIEW_INIT	\
-            pSelEngine( NULL ),												\
-            aFunctionSet( &aViewData ),										\
-            pHdrSelEng( NULL ),												\
-            aHdrFunc( &aViewData ),											\
-            pDrawView( NULL ),												\
-            bDrawSelMode( false ),											\
-            aVScrollTop( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ),		\
-            aVScrollBottom( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ),	\
-            aHScrollLeft( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ),		\
-            aHScrollRight( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ),	\
-            aCornerButton( pFrameWin, &aViewData, false ),					\
-            aTopButton( pFrameWin, &aViewData, sal_True ),						\
-            aScrollBarBox( pFrameWin, WB_SIZEABLE ),						\
-            pInputHintWindow( NULL ),										\
-            pPageBreakData( NULL ),											\
-            pHighlightRanges( NULL ),										\
-            pBrushDocument( NULL ),                                         \
-            pDrawBrushSet( NULL ),                                          \
-            bLockPaintBrush( false ),                                       \
-            pTimerWindow( NULL ),											\
-            nTipVisible( 0 ),												\
-            bDragging( false ),												\
-            bIsBlockMode( false ),											\
-            bBlockNeg( false ),												\
-            bBlockCols( false ),											\
-            bBlockRows( false ),											\
-            mfPendingTabBarWidth( -1.0 ),                                   \
-            bMinimized( false ),											\
-            bInUpdateHeader( false ),										\
-            bInActivatePart( false ),										\
-            bInZoomUpdate( false ),											\
-             bMoveIsShift( false )
-
-
 ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) :
-            pFrameWin( pParent ),
-            aViewData( &rDocSh, pViewShell ),
-            TABVIEW_INIT
+    pFrameWin( pParent ),
+    aViewData( &rDocSh, pViewShell ),
+    pSelEngine( NULL ),
+    aFunctionSet( &aViewData ),
+    pHdrSelEng( NULL ),
+    aHdrFunc( &aViewData ),
+    pDrawView( NULL ),
+    aVScrollTop( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ),
+    aVScrollBottom( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ),
+    aHScrollLeft( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ),
+    aHScrollRight( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ),
+    aCornerButton( pFrameWin, &aViewData, false ),
+    aTopButton( pFrameWin, &aViewData, sal_True ),
+    aScrollBarBox( pFrameWin, WB_SIZEABLE ),
+    pInputHintWindow( NULL ),
+    pPageBreakData( NULL ),
+    pHighlightRanges( NULL ),
+    pBrushDocument( NULL ),
+    pDrawBrushSet( NULL ),
+    pTimerWindow( NULL ),
+    nTipVisible( 0 ),
+    meBlockMode(None),
+    mfPendingTabBarWidth( -1.0 ),
+    bMinimized( false ),
+    bInUpdateHeader( false ),
+    bInActivatePart( false ),
+    bInZoomUpdate( false ),
+    bMoveIsShift( false ),
+    bDrawSelMode( false ),
+    bLockPaintBrush( false ),
+    bDragging( false ),
+    bBlockNeg( false ),
+    bBlockCols( false ),
+    bBlockRows( false )
 {
     RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScTabView::ScTabView" );
 
@@ -383,7 +373,7 @@ IMPL_LINK( ScTabView, TimerHdl, Timer*, EMPTYARG )
 // --- Resize ---------------------------------------------------------------------
 
 void lcl_SetPosSize( Window& rWindow, const Point& rPos, const Size& rSize,
-                        long nTotalWidth, sal_Bool bLayoutRTL )
+                        long nTotalWidth, bool bLayoutRTL )
 {
     Point aNewPos = rPos;
     if ( bLayoutRTL )
@@ -399,33 +389,33 @@ void lcl_SetPosSize( Window& rWindow, const Point& rPos, const Size& rSize,
     rWindow.SetPosSizePixel( aNewPos, rSize );
 }
 
-void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInner )
+void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
 {
     HideListBox();
 
-    sal_Bool bHasHint = ( pInputHintWindow != NULL );
+    bool bHasHint = ( pInputHintWindow != NULL );
     if (bHasHint)
         RemoveHintWindow();
 
-    sal_Bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() );
+    bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() );
     long nTotalWidth = rSize.Width();
     if ( bLayoutRTL )
         nTotalWidth += 2*rOffset.X();
 
-    sal_Bool bVScroll	 = aViewData.IsVScrollMode();
-    sal_Bool bHScroll	 = aViewData.IsHScrollMode();
-    sal_Bool bTabControl = aViewData.IsTabMode();
-    sal_Bool bHeaders	 = aViewData.IsHeaderMode();
-    sal_Bool bOutlMode	 = aViewData.IsOutlineMode();
-    sal_Bool bHOutline	 = bOutlMode && lcl_HasColOutline(aViewData);
-    sal_Bool bVOutline	 = bOutlMode && lcl_HasRowOutline(aViewData);
+    bool bVScroll    = aViewData.IsVScrollMode();
+    bool bHScroll    = aViewData.IsHScrollMode();
+    bool bTabControl = aViewData.IsTabMode();
+    bool bHeaders    = aViewData.IsHeaderMode();
+    bool bOutlMode   = aViewData.IsOutlineMode();
+    bool bHOutline   = bOutlMode && lcl_HasColOutline(aViewData);
+    bool bVOutline   = bOutlMode && lcl_HasRowOutline(aViewData);
 
     //	Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden:
     SfxScrollingMode eMode = aViewData.GetViewShell()->GetScrollingMode();
     if ( eMode == SCROLLING_NO )
         bHScroll = bVScroll = false;
     else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO )	//! Auto ???
-        bHScroll = bVScroll = sal_True;
+        bHScroll = bVScroll = true;
 
     if ( aViewData.GetDocShell()->IsPreview() )
         bHScroll = bVScroll = bTabControl = bHeaders = bOutlMode = bHOutline = bVOutline = false;
@@ -820,7 +810,7 @@ void ScTabView::UpdateVarZoom()
     SvxZoomType eZoomType = GetZoomType();
     if ( eZoomType != SVX_ZOOM_PERCENT && !bInZoomUpdate )
     {
-        bInZoomUpdate = sal_True;
+        bInZoomUpdate = true;
         const Fraction& rOldX = GetViewData()->GetZoomX();
         const Fraction& rOldY = GetViewData()->GetZoomY();
         long nOldPercent = ( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator();
@@ -842,18 +832,18 @@ void ScTabView::UpdateVarZoom()
 
 void ScTabView::UpdateFixPos()
 {
-    sal_Bool bResize = false;
+    bool bResize = false;
     if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX )
         if (aViewData.UpdateFixX())
-            bResize = sal_True;
+            bResize = true;
     if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX )
         if (aViewData.UpdateFixY())
-            bResize = sal_True;
+            bResize = true;
     if (bResize)
         RepeatResize(false);
 }
 
-void ScTabView::RepeatResize( sal_Bool bUpdateFix )
+void ScTabView::RepeatResize( bool bUpdateFix )
 {
     if ( bUpdateFix )
     {
@@ -1055,11 +1045,11 @@ Point ScTabView::GetGridOffset() const
 
 // ---  Scroll-Bars  --------------------------------------------------------
 
-sal_Bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
+bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
 {
     HideNoteMarker();
 
-    sal_Bool bDone = false;
+    bool bDone = false;
     const CommandWheelData* pData = rCEvt.GetWheelData();
     if ( pData && pData->GetMode() == COMMAND_WHEEL_ZOOM )
     {
@@ -1091,7 +1081,7 @@ sal_Bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
                 aViewData.GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
             }
 
-            bDone = sal_True;
+            bDone = true;
         }
     }
     else
@@ -1162,7 +1152,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
     {
         if (!bDragging)
         {
-            bDragging = sal_True;
+            bDragging = true;
             nPrevDragPos = nViewPos;
         }
 
@@ -1311,7 +1301,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
     return 0;
 }
 
-void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, sal_Bool bUpdBars )
+void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
 {
     sal_Bool bHasHint = ( pInputHintWindow != NULL );
     if (bHasHint)
@@ -1400,7 +1390,7 @@ void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, sal_Bool bUpdBars )
         TestHintWindow();		// neu positionieren
 }
 
-void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, sal_Bool bUpdBars )
+void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
 {
     sal_Bool bHasHint = ( pInputHintWindow != NULL );
     if (bHasHint)
@@ -1560,7 +1550,7 @@ void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY
 
     if ( nWidth != pRowBar[SC_SPLIT_BOTTOM]->GetWidth() && !bInUpdateHeader )
     {
-        bInUpdateHeader = sal_True;
+        bInUpdateHeader = true;
 
         pRowBar[SC_SPLIT_BOTTOM]->SetWidth( nWidth );
         if (pRowBar[SC_SPLIT_TOP])
@@ -2147,7 +2137,7 @@ void ScTabView::SnapSplitPos( Point& rScreenPosPixel )
     rScreenPosPixel = pWin->OutputToNormalizedScreenPixel( aMouse );
 }
 
-void ScTabView::FreezeSplitters( sal_Bool bFreeze )
+void ScTabView::FreezeSplitters( bool bFreeze )
 {
     ScSplitMode eOldH = aViewData.GetHSplitMode();
     ScSplitMode eOldV = aViewData.GetVSplitMode();
@@ -2157,7 +2147,7 @@ void ScTabView::FreezeSplitters( sal_Bool bFreeze )
         ePos = SC_SPLIT_TOPLEFT;
     Window* pWin = pGridWin[ePos];
 
-    sal_Bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() );
+    bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() );
 
     if ( bFreeze )
     {
@@ -2207,7 +2197,7 @@ void ScTabView::FreezeSplitters( sal_Bool bFreeze )
                 nBottomPos = aViewData.GetPosY(SC_SPLIT_BOTTOM);
         }
 
-        aSplit = aViewData.GetScrPos( static_cast<SCCOL>(nPosX), static_cast<SCROW>(nPosY), ePos, sal_True );
+        aSplit = aViewData.GetScrPos( static_cast<SCCOL>(nPosX), static_cast<SCROW>(nPosY), ePos, true );
         if (nPosX > aViewData.GetPosX(SC_SPLIT_LEFT))		// (aSplit.X() > 0) doesn't work for RTL
         {
             long nSplitPos = aSplit.X() + aWinStart.X();
@@ -2293,7 +2283,7 @@ void ScTabView::SplitAtCursor()
     RepeatResize();
 }
 
-void ScTabView::SplitAtPixel( const Point& rPixel, sal_Bool bHor, sal_Bool bVer )		// fuer API
+void ScTabView::SplitAtPixel( const Point& rPixel, bool bHor, bool bVer )
 {
     //	Pixel ist auf die ganze View bezogen, nicht auf das erste GridWin
 
@@ -2372,7 +2362,7 @@ void ScTabView::SetNewVisArea()
         aViewData.GetViewShell()->BroadcastAccessibility(SfxSimpleHint(SC_HINT_ACC_VISAREACHANGED));
 }
 
-sal_Bool ScTabView::HasPageFieldDataAtCursor() const
+bool ScTabView::HasPageFieldDataAtCursor() const
 {
     ScGridWindow* pWin = pGridWin[aViewData.GetActivePart()];
     SCCOL nCol = aViewData.GetCurX();
@@ -2417,7 +2407,7 @@ void ScTabView::StartDataSelect()
     pWin->DoAutoFilterMenue(nCol, nRow, !pAttr->HasAutoFilter());
 }
 
-void ScTabView::EnableRefInput(sal_Bool bFlag)
+void ScTabView::EnableRefInput(bool bFlag)
 {
     aHScrollLeft.EnableInput(bFlag);
     aHScrollRight.EnableInput(bFlag);
@@ -2427,7 +2417,7 @@ void ScTabView::EnableRefInput(sal_Bool bFlag)
 
     // ab hier dynamisch angelegte
 
-    if(pTabControl!=NULL) pTabControl->EnableInput(bFlag,sal_True);
+    if(pTabControl!=NULL) pTabControl->EnableInput(bFlag,true);
 
     if(pGridWin[SC_SPLIT_BOTTOMLEFT]!=NULL)
         pGridWin[SC_SPLIT_BOTTOMLEFT]->EnableInput(bFlag,false);
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index c353a9b..7dd0920 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -56,16 +56,6 @@
 #include "scmod.hxx"
 #include "tabprotection.hxx"
 
-#define SC_BLOCKMODE_NONE		0
-#define SC_BLOCKMODE_NORMAL		1
-#define SC_BLOCKMODE_OWN		2
-
-
-
-//
-//          Markier - Funktionen
-//
-
 void ScTabView::PaintMarks(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow )
 {
     if (!ValidCol(nStartCol)) nStartCol = MAXCOL;
@@ -86,9 +76,9 @@ void ScTabView::PaintMarks(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
     PaintArea( nStartCol, nStartRow, nEndCol, nEndRow, SC_UPDATE_MARKS );
 }
 
-sal_Bool ScTabView::IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
+bool ScTabView::IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
 {
-    return bIsBlockMode
+    return IsBlockMode()
         && nBlockStartX == nCol
         && nBlockStartY == nRow
         && nBlockStartZ == nTab;
@@ -96,7 +86,7 @@ sal_Bool ScTabView::IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
 
 void ScTabView::InitOwnBlockMode()
 {
-    if (!bIsBlockMode)
+    if (!IsBlockMode())
     {
         //	Wenn keine (alte) Markierung mehr da ist, Anker in SelectionEngine loeschen:
 
@@ -104,7 +94,7 @@ void ScTabView::InitOwnBlockMode()
         if (!rMark.IsMarked() && !rMark.IsMultiMarked())
             GetSelEngine()->CursorPosChanging( false, false );
 
-        bIsBlockMode = SC_BLOCKMODE_OWN;			//! Variable umbenennen!
+        meBlockMode = Own;
         nBlockStartX = 0;
         nBlockStartY = 0;
         nBlockStartZ = 0;
@@ -117,9 +107,9 @@ void ScTabView::InitOwnBlockMode()
 }
 
 void ScTabView::InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
-                                sal_Bool bTestNeg, sal_Bool bCols, sal_Bool bRows )
+                               bool bTestNeg, bool bCols, bool bRows )
 {
-    if (!bIsBlockMode)
+    if (!IsBlockMode())
     {
         if (!ValidCol(nCurX)) nCurX = MAXCOL;
         if (!ValidRow(nCurY)) nCurY = MAXROW;
@@ -141,7 +131,7 @@ void ScTabView::InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
             bBlockNeg = false;
         rMark.SetMarkNegative(bBlockNeg);
 
-        bIsBlockMode = SC_BLOCKMODE_NORMAL;			//! Variable umbenennen!
+        meBlockMode = Normal;
         bBlockCols = bCols;
         bBlockRows = bRows;
         nBlockStartX = nCurX;
@@ -169,13 +159,13 @@ void ScTabView::InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
     }
 }
 
-void ScTabView::DoneBlockMode( sal_Bool bContinue )            // Default FALSE
+void ScTabView::DoneBlockMode( bool bContinue )
 {
     //	Wenn zwischen Tabellen- und Header SelectionEngine gewechselt wird,
     //	wird evtl. DeselectAll gerufen, weil die andere Engine keinen Anker hat.
     //	Mit bMoveIsShift wird verhindert, dass dann die Selektion aufgehoben wird.
 
-    if (bIsBlockMode && !bMoveIsShift)
+    if (IsBlockMode() && !bMoveIsShift)
     {
         ScMarkData& rMark = aViewData.GetMarkData();
         sal_Bool bFlag = rMark.GetMarkingFlag();
@@ -199,20 +189,25 @@ void ScTabView::DoneBlockMode( sal_Bool bContinue )            // Default FALSE
             else
                 rMark.ResetMark();
         }
-        bIsBlockMode = SC_BLOCKMODE_NONE;			//! Variable umbenennen!
+        meBlockMode = None;
 
         rMark.SetMarking(bFlag);
         rMark.SetMarkNegative(false);
     }
 }
 
+bool ScTabView::IsBlockMode() const
+{
+    return meBlockMode != None;
+}
+
 void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
-                            sal_Bool bCols, sal_Bool bRows, sal_Bool bCellSelection )
+                            bool bCols, bool bRows, bool bCellSelection )
 {
     if (!ValidCol(nCurX)) nCurX = MAXCOL;
     if (!ValidRow(nCurY)) nCurY = MAXROW;
 
-    if (!bIsBlockMode)
+    if (!IsBlockMode())
     {
         OSL_FAIL( "MarkCursor nicht im BlockMode" );
         InitBlockMode( nCurX, nCurY, nCurZ, false, bCols, bRows );
@@ -229,13 +224,13 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
     rMark.GetMarkArea(aMarkRange);
     if (( aMarkRange.aStart.Col() != nBlockStartX && aMarkRange.aEnd.Col() != nBlockStartX ) ||
         ( aMarkRange.aStart.Row() != nBlockStartY && aMarkRange.aEnd.Row() != nBlockStartY ) ||
-        ( bIsBlockMode == SC_BLOCKMODE_OWN ))
+        ( meBlockMode == Own ))
     {
         //	Markierung ist veraendert worden
         //	(z.B. MarkToSimple, wenn per negativ alles bis auf ein Rechteck geloescht wurde)
         //	oder nach InitOwnBlockMode wird mit Shift-Klick weitermarkiert...
 
-        sal_Bool bOldShift = bMoveIsShift;
+        bool bOldShift = bMoveIsShift;
         bMoveIsShift = false;				//	wirklich umsetzen
         DoneBlockMode(false);				//!	direkt Variablen setzen? (-> kein Geflacker)
         bMoveIsShift = bOldShift;
@@ -977,12 +972,12 @@ void ScTabView::UpdateAllOverlays()
 //!	PaintBlock in zwei Methoden aufteilen: RepaintBlock und RemoveBlock o.ae.
 //!
 
-void ScTabView::PaintBlock( sal_Bool bReset )
+void ScTabView::PaintBlock( bool bReset )
 {
     ScMarkData& rMark = aViewData.GetMarkData();
     SCTAB nTab = aViewData.GetTabNo();
-    sal_Bool bMark = rMark.IsMarked();
-    sal_Bool bMulti = rMark.IsMultiMarked();
+    bool bMark = rMark.IsMarked();
+    bool bMulti = rMark.IsMultiMarked();
     if (bMark || bMulti)
     {
         ScRange aMarkRange;
@@ -1008,7 +1003,7 @@ void ScTabView::PaintBlock( sal_Bool bReset )
         nBlockEndY = aMarkRange.aEnd.Row();
         nBlockEndZ = aMarkRange.aEnd.Tab();
 
-        sal_Bool bDidReset = false;
+        bool bDidReset = false;
 
         if ( nTab>=nBlockStartZ && nTab<=nBlockEndZ )
         {
@@ -1033,7 +1028,7 @@ void ScTabView::PaintBlock( sal_Bool bReset )
     }
 }
 
-void ScTabView::SelectAll( sal_Bool bContinue )
+void ScTabView::SelectAll( bool bContinue )
 {
     ScMarkData& rMark = aViewData.GetMarkData();
     SCTAB nTab = aViewData.GetTabNo();
@@ -1427,7 +1422,7 @@ Window* ScTabView::GetParentOrChild( sal_uInt16 nChildId )
     return aViewData.GetDialogParent();
 }
 
-void ScTabView::UpdatePageBreakData( sal_Bool bForcePaint )
+void ScTabView::UpdatePageBreakData( bool bForcePaint )
 {
     ScPageBreakData* pNewData = NULL;
 
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index f6e2ba1..0eb4822 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -116,13 +116,13 @@ using namespace com::sun::star;
 // ---	Public-Funktionen
 //
 
-void ScTabView::ClickCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bControl )
+void ScTabView::ClickCursor( SCCOL nPosX, SCROW nPosY, bool bControl )
 {
     ScDocument* pDoc = aViewData.GetDocument();
     SCTAB nTab = aViewData.GetTabNo();
     pDoc->SkipOverlapped(nPosX, nPosY, nTab);
 
-    sal_Bool bRefMode = SC_MOD()->IsFormulaMode();
+    bool bRefMode = SC_MOD()->IsFormulaMode();
 
     if ( bRefMode )
     {
@@ -279,7 +279,7 @@ void ScTabView::InvalidateAttribs()
 #pragma optimize ( "", off )
 #endif
 
-void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bNew )
+void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
 {
     SCCOL nOldX = aViewData.GetCurX();
     SCROW nOldY = aViewData.GetCurY();
@@ -859,12 +859,12 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
         }
 }
 
-sal_Bool ScTabView::SelMouseButtonDown( const MouseEvent& rMEvt )
+bool ScTabView::SelMouseButtonDown( const MouseEvent& rMEvt )
 {
-    sal_Bool bRet = false;
+    bool bRet = false;
 
     // #i3875# *Hack*
-    sal_Bool bMod1Locked = aViewData.GetViewShell()->GetLockedModifiers() & KEY_MOD1 ? sal_True : false;
+    bool bMod1Locked = aViewData.GetViewShell()->GetLockedModifiers() & KEY_MOD1 ? true : false;
     aViewData.SetSelCtrlMouseClick( rMEvt.IsMod1() || bMod1Locked );
 
     if ( pSelEngine )
@@ -884,7 +884,7 @@ sal_Bool ScTabView::SelMouseButtonDown( const MouseEvent& rMEvt )
     //
 
 void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
-                                sal_Bool bShift, sal_Bool bControl, sal_Bool bKeepOld, sal_Bool bKeepSel )
+                               bool bShift, bool bControl, bool bKeepOld, bool bKeepSel )
 {
     if (!bKeepOld)
         aViewData.ResetOldCursor();
@@ -926,7 +926,7 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
             SetMarkData(aData);
         }
 
-        sal_Bool bSame = ( nCurX == aViewData.GetCurX() && nCurY == aViewData.GetCurY() );
+        bool bSame = ( nCurX == aViewData.GetCurX() && nCurY == aViewData.GetCurY() );
         bMoveIsShift = bShift;
         pSelEngine->CursorPosChanging( bShift, bControl );
         bMoveIsShift = false;
@@ -942,7 +942,7 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
 }
 
 void ScTabView::MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
-                                    sal_Bool bShift, sal_Bool bKeepSel )
+                               bool bShift, bool bKeepSel )
 {
     ScDocument* pDoc = aViewData.GetDocument();
     SCTAB nTab = aViewData.GetTabNo();
@@ -988,7 +988,7 @@ void ScTabView::MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
     MoveCursorAbs( nCurX, nCurY, eMode, bShift, false, sal_True, bKeepSel );
 }
 
-void ScTabView::MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift, sal_Bool bKeepSel )
+void ScTabView::MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
 {
     SCsCOL nPageX;
     SCsROW nPageY;
@@ -996,7 +996,7 @@ void ScTabView::MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
     MoveCursorRel( nPageX, nPageY, eMode, bShift, bKeepSel );
 }
 
-void ScTabView::MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift, sal_Bool bKeepSel )
+void ScTabView::MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
 {
     SCsCOL nNewX;
     SCsROW nNewY;
@@ -1004,7 +1004,7 @@ void ScTabView::MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
     MoveCursorRel(nNewX, nNewY, eMode, bShift, bKeepSel);
 }
 
-void ScTabView::MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift, sal_Bool bKeepSel )
+void ScTabView::MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
 {
     ScDocument* pDoc = aViewData.GetDocument();
     SCTAB nTab = aViewData.GetTabNo();
@@ -1034,7 +1034,7 @@ void ScTabView::MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, s
     MoveCursorRel( ((SCsCOL)nNewX)-(SCsCOL)nCurX, ((SCsROW)nNewY)-(SCsROW)nCurY, eMode, bShift, bKeepSel );
 }
 
-void ScTabView::MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift )
+void ScTabView::MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, bool bShift )
 {
     ScDocument* pDoc = aViewData.GetDocument();
     SCTAB nTab = aViewData.GetTabNo();
@@ -1071,12 +1071,12 @@ void ScTabView::MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode
     MoveCursorAbs( nNewX, nNewY, eMode, bShift, false, true );
 }
 
-void ScTabView::MoveCursorEnter( sal_Bool bShift )			// bShift -> hoch/runter
+void ScTabView::MoveCursorEnter( bool bShift )          // bShift -> hoch/runter
 {
     const ScInputOptions& rOpt = SC_MOD()->GetInputOptions();
     if (!rOpt.GetMoveSelection())
     {
-        aViewData.UpdateInputHandler(sal_True);
+        aViewData.UpdateInputHandler(true);
         return;
     }
 
@@ -1109,14 +1109,14 @@ void ScTabView::MoveCursorEnter( sal_Bool bShift )			// bShift -> hoch/runter
         SCTAB nTab = aViewData.GetTabNo();
 
         ScDocument* pDoc = aViewData.GetDocument();
-        pDoc->GetNextPos( nNewX,nNewY, nTab, nMoveX,nMoveY, sal_True,false, rMark );
+        pDoc->GetNextPos( nNewX,nNewY, nTab, nMoveX,nMoveY, true, false, rMark );
 
         MoveCursorRel( ((SCsCOL)nNewX)-(SCsCOL)nCurX, ((SCsROW)nNewY)-(SCsROW)nCurY,
-                            SC_FOLLOW_LINE, false, sal_True );
+                            SC_FOLLOW_LINE, false, true );
 
         //	update input line even if cursor was not moved
         if ( nNewX == nCurX && nNewY == nCurY )
-            aViewData.UpdateInputHandler(sal_True);
+            aViewData.UpdateInputHandler(true);
     }
     else
     {
@@ -1138,7 +1138,7 @@ void ScTabView::MoveCursorEnter( sal_Bool bShift )			// bShift -> hoch/runter
 }
 
 
-sal_Bool ScTabView::MoveCursorKeyInput( const KeyEvent& rKeyEvent )
+bool ScTabView::MoveCursorKeyInput( const KeyEvent& rKeyEvent )
 {
     const KeyCode& rKCode = rKeyEvent.GetKeyCode();
 
@@ -1147,7 +1147,7 @@ sal_Bool ScTabView::MoveCursorKeyInput( const KeyEvent& rKeyEvent )
             (rKCode.IsMod2() ? MOD_BOTH : MOD_CTRL) :
             (rKCode.IsMod2() ? MOD_ALT : MOD_NONE);
 
-    sal_Bool bSel = rKCode.IsShift();
+    bool bSel = rKCode.IsShift();
     sal_uInt16 nCode = rKCode.GetCode();
 
     // CURSOR keys
@@ -1171,8 +1171,8 @@ sal_Bool ScTabView::MoveCursorKeyInput( const KeyEvent& rKeyEvent )
                 // added to avoid warnings
             }
         }
-        // always sal_True to suppress changes of col/row size (ALT+CURSOR)
-        return sal_True;
+        // always true to suppress changes of col/row size (ALT+CURSOR)
+        return true;
     }
 
     // PAGEUP/PAGEDOWN
@@ -1189,7 +1189,7 @@ sal_Bool ScTabView::MoveCursorKeyInput( const KeyEvent& rKeyEvent )
                 // added to avoid warnings
             }
         }
-        return sal_True;
+        return true;
     }
 
     // HOME/END
@@ -1206,7 +1206,7 @@ sal_Bool ScTabView::MoveCursorKeyInput( const KeyEvent& rKeyEvent )
                 // added to avoid warnings
             }
         }
-        return sal_True;
+        return true;
     }
 
     return false;
@@ -1214,7 +1214,7 @@ sal_Bool ScTabView::MoveCursorKeyInput( const KeyEvent& rKeyEvent )
 
 
         // naechste/vorherige nicht geschuetzte Zelle
-void ScTabView::FindNextUnprot( sal_Bool bShift, sal_Bool bInSelection )
+void ScTabView::FindNextUnprot( bool bShift, bool bInSelection )
 {
     short nMove = bShift ? -1 : 1;
 
@@ -1229,14 +1229,14 @@ void ScTabView::FindNextUnprot( sal_Bool bShift, sal_Bool bInSelection )
     SCTAB nTab = aViewData.GetTabNo();
 
     ScDocument* pDoc = aViewData.GetDocument();
-    pDoc->GetNextPos( nNewX,nNewY, nTab, nMove,0, bMarked,sal_True, rMark );
+    pDoc->GetNextPos( nNewX,nNewY, nTab, nMove,0, bMarked, true, rMark );
 
     SCCOL nTabCol = aViewData.GetTabStartCol();
     if ( nTabCol == SC_TABSTART_NONE )
         nTabCol = nCurX;					// auf diese Spalte zurueck bei Enter
 
     MoveCursorRel( ((SCsCOL)nNewX)-(SCsCOL)nCurX, ((SCsROW)nNewY)-(SCsROW)nCurY,
-                        SC_FOLLOW_LINE, false, sal_True );
+                   SC_FOLLOW_LINE, false, true );
 
     //	in MoveCursorRel wird die TabCol zurueckgesetzt...
     aViewData.SetTabStartCol( nTabCol );
@@ -1296,7 +1296,7 @@ void ScTabView::MarkRows()
     SelectionChanged();
 }
 
-void ScTabView::MarkDataArea( sal_Bool bIncludeCursor )
+void ScTabView::MarkDataArea( bool bIncludeCursor )
 {
     ScDocument* pDoc = aViewData.GetDocument();
     SCTAB nTab = aViewData.GetTabNo();
@@ -1327,7 +1327,7 @@ void ScTabView::MarkMatrixFormula()
     }
 }
 
-void ScTabView::MarkRange( const ScRange& rRange, sal_Bool bSetCursor, sal_Bool bContinue )
+void ScTabView::MarkRange( const ScRange& rRange, bool bSetCursor, bool bContinue )
 {
     SCTAB nTab = rRange.aStart.Tab();
     SetTabNo( nTab );
@@ -1393,7 +1393,7 @@ void ScTabView::MarkDataChanged()
     UpdateSelectionOverlay();
 }
 
-void ScTabView::SelectNextTab( short nDir, sal_Bool bExtendSelection )
+void ScTabView::SelectNextTab( short nDir, bool bExtendSelection )
 {
     if (!nDir) return;
     OSL_ENSURE( nDir==-1 || nDir==1, "SelectNextTab: falscher Wert");
@@ -1730,7 +1730,7 @@ void ScTabView::UpdateEditView()
         }
 }
 
-void ScTabView::KillEditView( sal_Bool bNoPaint )
+void ScTabView::KillEditView( bool bNoPaint )
 {
     sal_uInt16 i;
     SCCOL nCol1 = aViewData.GetEditStartCol();
@@ -2221,16 +2221,16 @@ void ScTabView::PaintLeftArea( SCROW nStartRow, SCROW nEndRow )
     }
 }
 
-sal_Bool ScTabView::PaintExtras()
+bool ScTabView::PaintExtras()
 {
-    sal_Bool bRet = false;
+    bool bRet = false;
     ScDocument* pDoc = aViewData.GetDocument();
     SCTAB nTab = aViewData.GetTabNo();
     if (!pDoc->HasTable(nTab))					// Tabelle geloescht ?
     {
         SCTAB nCount = pDoc->GetTableCount();
         aViewData.SetTabNo(nCount-1);
-        bRet = sal_True;
+        bRet = true;
     }
     pTabControl->UpdateStatus();						// sal_True = active
     return bRet;
@@ -2265,7 +2265,7 @@ void ScTabView::RecalcPPT()
     }
 }
 
-void ScTabView::ActivateView( sal_Bool bActivate, sal_Bool bFirst )
+void ScTabView::ActivateView( bool bActivate, bool bFirst )
 {
     if ( bActivate == aViewData.IsActive() && !bFirst )
     {
@@ -2347,7 +2347,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
     ScSplitPos eOld = aViewData.GetActivePart();
     if ( eOld != eWhich )
     {
-        bInActivatePart = sal_True;
+        bInActivatePart = true;
 
         sal_Bool bRefMode = SC_MOD()->IsFormulaMode();
 
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index faf06bf..48a84c1 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -172,7 +172,7 @@ void ScTabView::StopRefMode()
     AlignToCursor( aViewData.GetCurX(), aViewData.GetCurY(), SC_FOLLOW_NONE );
 }
 
-void ScTabView::DoneRefMode( sal_Bool bContinue )
+void ScTabView::DoneRefMode( bool bContinue )
 {
     ScDocument* pDoc = aViewData.GetDocument();
     if ( aViewData.GetRefType() == SC_REFTYPE_REF && bContinue )
@@ -306,7 +306,7 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ )
     }
 }
 
-void ScTabView::InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType, sal_Bool bPaint )
+void ScTabView::InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType, bool bPaint )
 {
     ScDocument* pDoc = aViewData.GetDocument();
     ScMarkData& rMark = aViewData.GetMarkData();
@@ -334,7 +334,7 @@ void ScTabView::InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eT
     }
 }
 
-void ScTabView::SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, sal_Bool bLayoutRTL )
+void ScTabView::SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, bool bLayoutRTL )
 {
     if ( nVisible == 0 )
         nVisible = 1;       // #i59893# don't use visible size 0
@@ -357,7 +357,7 @@ void ScTabView::SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible,
     }
 }
 
-long ScTabView::GetScrollBarPos( ScrollBar& rScroll, sal_Bool bLayoutRTL )
+long ScTabView::GetScrollBarPos( ScrollBar& rScroll, bool bLayoutRTL )
 {
     if ( bLayoutRTL )
         return -rScroll.GetThumbPos() - rScroll.GetVisibleSize();
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index d9a1e99..658b6b0 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -373,7 +373,7 @@ void ScTabView::DrawDeselectAll()
     }
 }
 
-sal_Bool ScTabView::IsDrawTextEdit() const
+bool ScTabView::IsDrawTextEdit() const
 {
     if (pDrawView)
         return pDrawView->IsTextEdit();
@@ -386,12 +386,12 @@ SvxZoomType ScTabView::GetZoomType() const
     return aViewData.GetZoomType();
 }
 
-void ScTabView::SetZoomType( SvxZoomType eNew, sal_Bool bAll )
+void ScTabView::SetZoomType( SvxZoomType eNew, bool bAll )
 {
     aViewData.SetZoomType( eNew, bAll );
 }
 
-void ScTabView::SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool bAll )
+void ScTabView::SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll )
 {
     aViewData.SetZoom( rNewX, rNewY, bAll );
     if (pDrawView)
@@ -407,7 +407,7 @@ void ScTabView::RefreshZoom()
     ZoomChanged();
 }
 
-void ScTabView::SetPagebreakMode( sal_Bool bSet )
+void ScTabView::SetPagebreakMode( bool bSet )
 {
     aViewData.SetPagebreakMode(bSet);
     if (pDrawView)
@@ -421,7 +421,7 @@ void ScTabView::ResetDrawDragMode()
         pDrawView->SetDragMode( SDRDRAG_MOVE );
 }
 
-void ScTabView::ViewOptionsHasChanged( sal_Bool bHScrollChanged, sal_Bool bGraphicsChanged )
+void ScTabView::ViewOptionsHasChanged( bool bHScrollChanged, bool bGraphicsChanged )
 {
     //	DrawView erzeugen, wenn Gitter angezeigt werden soll
     if ( !pDrawView && aViewData.GetOptions().GetGridOptions().GetGridVisible() )
@@ -434,11 +434,11 @@ void ScTabView::ViewOptionsHasChanged( sal_Bool bHScrollChanged, sal_Bool bGraph
         DrawEnableAnim(sal_True);	// DrawEnableAnim checks the options state
 
     // if TabBar is set to visible, make sure its size is not 0
-    sal_Bool bGrow = ( aViewData.IsTabMode() && pTabControl->GetSizePixel().Width() <= 0 );
+    bool bGrow = ( aViewData.IsTabMode() && pTabControl->GetSizePixel().Width() <= 0 );
 
     // if ScrollBar is set to visible, TabBar must make room
-    sal_Bool bShrink = ( bHScrollChanged && aViewData.IsTabMode() && aViewData.IsHScrollMode() &&
-                        pTabControl->GetSizePixel().Width() > SC_TABBAR_DEFWIDTH );
+    bool bShrink = ( bHScrollChanged && aViewData.IsTabMode() && aViewData.IsHScrollMode() &&
+                     pTabControl->GetSizePixel().Width() > SC_TABBAR_DEFWIDTH );
 
     if ( bGrow || bShrink )
     {
@@ -506,7 +506,7 @@ void ScTabView::DrawMarkRect( const Rectangle& rRect )
     }
 }
 
-void ScTabView::DrawEnableAnim(sal_Bool bSet)
+void ScTabView::DrawEnableAnim(bool bSet)
 {
     sal_uInt16 i;
     if ( pDrawView )
@@ -517,7 +517,7 @@ void ScTabView::DrawEnableAnim(sal_Bool bSet)
         {
             if ( !pDrawView->IsAnimationEnabled() )
             {
-                pDrawView->SetAnimationEnabled(sal_True);
+                pDrawView->SetAnimationEnabled(true);
 
                 //	Animierte GIFs muessen wieder gestartet werden:
                 ScDocument* pDoc = aViewData.GetDocument();
@@ -637,7 +637,7 @@ void ScTabView::MakeVisible( const Rectangle& rHMMRect )
 
 //---------------------------------------------------------------
 
-void ScTabView::SetBrushDocument( ScDocument* pNew, sal_Bool bLock )
+void ScTabView::SetBrushDocument( ScDocument* pNew, bool bLock )
 {
     delete pBrushDocument;
     delete pDrawBrushSet;
@@ -650,7 +650,7 @@ void ScTabView::SetBrushDocument( ScDocument* pNew, sal_Bool bLock )
     aViewData.GetBindings().Invalidate(SID_FORMATPAINTBRUSH);
 }
 
-void ScTabView::SetDrawBrushSet( SfxItemSet* pNew, sal_Bool bLock )
+void ScTabView::SetDrawBrushSet( SfxItemSet* pNew, bool bLock )
 {
     delete pBrushDocument;
     delete pDrawBrushSet;
commit d9abdd65d2c93d0765667316c4fc56b6318cf8b6
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri May 27 21:59:09 2011 -0400

    More clean up of unnecessary code.

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 6b6b49c..c353a9b 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -244,17 +244,11 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
                         nBlockStartZ, rMark.IsMarkNegative(), bCols, bRows );
     }
 
-    SCCOL nOldBlockEndX = nBlockEndX;
-    SCROW nOldBlockEndY = nBlockEndY;
-
     if ( nCurX != nOldCurX || nCurY != nOldCurY )
     {
         // Current cursor has moved
 
-        SCTAB		nTab = nCurZ;
-
-        // Set old selection area
-        ScUpdateRect aRect( nBlockStartX, nBlockStartY, nOldBlockEndX, nOldBlockEndY );
+        SCTAB nTab = nCurZ;
 
         if ( bCellSelection )
         {
@@ -266,7 +260,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
             SCsCOL nBlockStartXOffset = 0;
             SCsROW nCurYOffset = 0;
             SCsROW nBlockStartYOffset = 0;
-            sal_Bool bBlockStartMerged = false;
+            bool bBlockStartMerged = false;
             const ScMergeAttr* pMergeAttr = NULL;
             ScDocument* pDocument = aViewData.GetDocument();
 
@@ -351,10 +345,8 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
             nBlockEndX = nCurX;
             nBlockEndY = nCurY;
         }
-        // end of "if ( bCellSelection )"
 
         // Set new selection area
-        aRect.SetNew( nBlockStartX, nBlockStartY, nBlockEndX, nBlockEndY );
         rMark.SetMarkArea( ScRange( nBlockStartX, nBlockStartY, nTab, nBlockEndX, nBlockEndY, nTab ) );
 
         UpdateSelectionOverlay();


More information about the Libreoffice-commits mailing list