[Libreoffice-commits] core.git: sc/source

Rodolfo Ribeiro Gomes rodolforg at gmail.com
Tue Oct 29 01:50:26 CET 2013


 sc/source/ui/inc/colrowba.hxx  |   18 +++++------
 sc/source/ui/inc/hdrcont.hxx   |   31 +++++++++----------
 sc/source/ui/view/colrowba.cxx |   18 +++++------
 sc/source/ui/view/hdrcont.cxx  |   66 ++++++++++++++++++++---------------------
 4 files changed, 66 insertions(+), 67 deletions(-)

New commits:
commit 8a82cacc668268be2fd5471fe4357d52c4372241
Author: Rodolfo Ribeiro Gomes <rodolforg at gmail.com>
Date:   Mon Oct 28 21:15:56 2013 -0200

    sal_Bool to bool in ScHeaderControl
    
    Change-Id: I8f5b9207f5634e3ff2c55d7cf9372c8caad0ed23
    Reviewed-on: https://gerrit.libreoffice.org/6471
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/inc/colrowba.hxx b/sc/source/ui/inc/colrowba.hxx
index a9b2b14..2a0e976 100644
--- a/sc/source/ui/inc/colrowba.hxx
+++ b/sc/source/ui/inc/colrowba.hxx
@@ -44,21 +44,21 @@ public:
     virtual sal_uInt16  GetEntrySize( SCCOLROW nEntryNo );
     virtual OUString    GetEntryText( SCCOLROW nEntryNo );
 
-    virtual sal_Bool        IsLayoutRTL();                      // only for columns
+    virtual bool        IsLayoutRTL();                      // only for columns
 
     virtual void        SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize );
     virtual void        HideEntries( SCCOLROW nStart, SCCOLROW nEnd );
 
-    virtual void        SetMarking( sal_Bool bSet );
+    virtual void        SetMarking( bool bSet );
     virtual void        SelectWindow();
-    virtual sal_Bool        IsDisabled();
-    virtual sal_Bool        ResizeAllowed();
+    virtual bool        IsDisabled();
+    virtual bool        ResizeAllowed();
 
     virtual void        DrawInvert( long nDragPos );
 
     virtual OUString    GetDragHelp( long nVal );
 
-            sal_Bool        UseNumericHeader() const;
+            bool        UseNumericHeader() const;
 };
 
 
@@ -77,16 +77,16 @@ public:
     virtual sal_uInt16  GetEntrySize( SCCOLROW nEntryNo );
     virtual OUString    GetEntryText( SCCOLROW nEntryNo );
 
-    virtual sal_Bool        IsMirrored();                       // only for columns
+    virtual bool        IsMirrored();                       // only for columns
     virtual SCROW       GetHiddenCount( SCROW nEntryNo );   // only for columns
 
     virtual void        SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize );
     virtual void        HideEntries( SCCOLROW nStart, SCCOLROW nEnd );
 
-    virtual void        SetMarking( sal_Bool bSet );
+    virtual void        SetMarking( bool bSet );
     virtual void        SelectWindow();
-    virtual sal_Bool        IsDisabled();
-    virtual sal_Bool        ResizeAllowed();
+    virtual bool        IsDisabled();
+    virtual bool        ResizeAllowed();
 
     virtual void        DrawInvert( long nDragPos );
 
diff --git a/sc/source/ui/inc/hdrcont.hxx b/sc/source/ui/inc/hdrcont.hxx
index 31a4bf6..3846cf8 100644
--- a/sc/source/ui/inc/hdrcont.hxx
+++ b/sc/source/ui/inc/hdrcont.hxx
@@ -26,8 +26,7 @@
 
 #define HDR_SIZE_OPTIMUM    0xFFFF
 
-
-                                    // Size of the sliders
+// Size of the sliders
 #define HDR_SLIDERSIZE      2
 
 class ScHeaderControl : public Window
@@ -36,9 +35,9 @@ private:
     SelectionEngine*    pSelEngine;
     Font                aNormFont;
     Font                aBoldFont;
-    sal_Bool                bBoldSet;
+    bool                bBoldSet;
 
-    sal_Bool            bVertical;              // Vertical = Row header
+    bool            bVertical;              // Vertical = Row header
 
     long            nWidth;
     long            nSmallWidth;
@@ -48,18 +47,18 @@ private:
 
     SCCOLROW        nMarkStart;
     SCCOLROW        nMarkEnd;
-    sal_Bool            bMarkRange;
+    bool            bMarkRange;
 
-    sal_Bool            bDragging;              // Change size
+    bool            bDragging;              // Change size
     SCCOLROW        nDragNo;
     long            nDragStart;
     long            nDragPos;
-    sal_Bool            bDragMoved;
+    bool            bDragMoved;
 
-    sal_Bool            bIgnoreMove;
+    bool            bIgnoreMove;
 
     long            GetScrPos( SCCOLROW nEntryNo );
-    SCCOLROW        GetMousePos( const MouseEvent& rMEvt, sal_Bool& rBorder );
+    SCCOLROW        GetMousePos( const MouseEvent& rMEvt, bool& rBorder );
     bool            IsSelectionAllowed(SCCOLROW nPos) const;
     void            ShowDragHelp();
 
@@ -86,16 +85,16 @@ protected:
     virtual OUString  GetEntryText( SCCOLROW nEntryNo ) = 0;
 
     virtual SCCOLROW GetHiddenCount( SCCOLROW nEntryNo );
-    virtual sal_Bool    IsLayoutRTL();
-    virtual sal_Bool    IsMirrored();
+    virtual bool     IsLayoutRTL();
+    virtual bool     IsMirrored();
 
     virtual void    SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewWidth ) = 0;
     virtual void    HideEntries( SCCOLROW nStart, SCCOLROW nEnd ) = 0;
 
-    virtual void    SetMarking( sal_Bool bSet );
+    virtual void    SetMarking( bool bSet );
     virtual void    SelectWindow();
-    virtual sal_Bool    IsDisabled();
-    virtual sal_Bool    ResizeAllowed();
+    virtual bool    IsDisabled();
+    virtual bool    ResizeAllowed();
     virtual OUString  GetDragHelp( long nVal );
 
     virtual void    DrawInvert( long nDragPos );
@@ -106,11 +105,11 @@ public:
                                 SCCOLROW nNewSize, bool bNewVertical );
             ~ScHeaderControl();
 
-    void    SetIgnoreMove(sal_Bool bSet)            { bIgnoreMove = bSet; }
+    void    SetIgnoreMove(bool bSet)            { bIgnoreMove = bSet; }
 
     void    StopMarking();
 
-    void    SetMark( sal_Bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd );
+    void    SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd );
 
     long    GetWidth() const                    { return nWidth; }
     long    GetSmallWidth() const               { return nSmallWidth; }
diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx
index 0c2f351..731c79b 100644
--- a/sc/source/ui/view/colrowba.cxx
+++ b/sc/source/ui/view/colrowba.cxx
@@ -69,7 +69,7 @@ ScColBar::~ScColBar()
 {
 }
 
-inline sal_Bool ScColBar::UseNumericHeader() const
+inline bool ScColBar::UseNumericHeader() const
 {
     return pViewData->GetDocument()->GetAddressConvention() == formula::FormulaGrammar::CONV_XL_R1C1;
 }
@@ -156,7 +156,7 @@ void ScColBar::HideEntries( SCCOLROW nStart, SCCOLROW nEnd )
     pViewData->GetView()->SetWidthOrHeight( sal_True, 1, nRange, SC_SIZE_DIRECT, 0 );
 }
 
-void ScColBar::SetMarking( sal_Bool bSet )
+void ScColBar::SetMarking( bool bSet )
 {
     pViewData->GetMarkData().SetMarking( bSet );
     if (!bSet)
@@ -191,13 +191,13 @@ void ScColBar::SelectWindow()
     pViewSh->ActiveGrabFocus();
 }
 
-sal_Bool ScColBar::IsDisabled()
+bool ScColBar::IsDisabled()
 {
     ScModule* pScMod = SC_MOD();
     return pScMod->IsFormulaMode() || pScMod->IsModalMode();
 }
 
-sal_Bool ScColBar::ResizeAllowed()
+bool ScColBar::ResizeAllowed()
 {
     return !pViewData->HasEditView( pViewData->GetActivePart() );
 }
@@ -217,7 +217,7 @@ OUString ScColBar::GetDragHelp( long nVal )
     return lcl_MetricString( nTwips, ScGlobal::GetRscString(STR_TIP_WIDTH) );
 }
 
-sal_Bool ScColBar::IsLayoutRTL()        // overloaded only for columns
+bool ScColBar::IsLayoutRTL()        // overloaded only for columns
 {
     return pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
 }
@@ -320,7 +320,7 @@ void ScRowBar::HideEntries( SCCOLROW nStart, SCCOLROW nEnd )
     pViewData->GetView()->SetWidthOrHeight( false, 1, nRange, SC_SIZE_DIRECT, 0 );
 }
 
-void ScRowBar::SetMarking( sal_Bool bSet )
+void ScRowBar::SetMarking( bool bSet )
 {
     pViewData->GetMarkData().SetMarking( bSet );
     if (!bSet)
@@ -355,13 +355,13 @@ void ScRowBar::SelectWindow()
     pViewSh->ActiveGrabFocus();
 }
 
-sal_Bool ScRowBar::IsDisabled()
+bool ScRowBar::IsDisabled()
 {
     ScModule* pScMod = SC_MOD();
     return pScMod->IsFormulaMode() || pScMod->IsModalMode();
 }
 
-sal_Bool ScRowBar::ResizeAllowed()
+bool ScRowBar::ResizeAllowed()
 {
     return !pViewData->HasEditView( pViewData->GetActivePart() );
 }
@@ -388,7 +388,7 @@ SCROW ScRowBar::GetHiddenCount( SCROW nEntryNo )   // overloaded only for rows
     return pDoc->GetHiddenRowCount( nEntryNo, nTab );
 }
 
-sal_Bool ScRowBar::IsMirrored()         // overloaded only for rows
+bool ScRowBar::IsMirrored()         // overloaded only for rows
 {
     return pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
 }
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 2acfd95..e05d2bd 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -72,7 +72,7 @@ ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEn
     aBoldFont.SetWeight( WEIGHT_BOLD );
 
     SetFont(aBoldFont);
-    bBoldSet = sal_True;
+    bBoldSet = true;
 
     Size aSize = LogicToPixel( Size(
         GetTextWidth(OUString("8888")),
@@ -107,7 +107,7 @@ ScHeaderControl::~ScHeaderControl()
 
 void ScHeaderControl::DoPaint( SCCOLROW nStart, SCCOLROW nEnd )
 {
-    sal_Bool bLayoutRTL = IsLayoutRTL();
+    bool bLayoutRTL = IsLayoutRTL();
     long nLayoutSign = bLayoutRTL ? -1 : 1;
 
     Rectangle aRect( Point(0,0), GetOutputSizePixel() );
@@ -124,17 +124,17 @@ void ScHeaderControl::DoPaint( SCCOLROW nStart, SCCOLROW nEnd )
     Invalidate(aRect);
 }
 
-void ScHeaderControl::SetMark( sal_Bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd )
+void ScHeaderControl::SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd )
 {
-    sal_Bool bEnabled = SC_MOD()->GetInputOptions().GetMarkHeader();    //! cachen?
+    bool bEnabled = SC_MOD()->GetInputOptions().GetMarkHeader();    //! cachen?
     if (!bEnabled)
         bNewSet = false;
 
     //  Variablen setzen
 
-    sal_Bool bOldSet     = bMarkRange;
+    bool bOldSet       = bMarkRange;
     SCCOLROW nOldStart = nMarkStart;
-    SCCOLROW nOldEnd     = nMarkEnd;
+    SCCOLROW nOldEnd   = nMarkEnd;
     PutInOrder( nNewStart, nNewEnd );
     bMarkRange = bNewSet;
     nMarkStart = nNewStart;
@@ -249,8 +249,8 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
     //  Linien zusammengefasst
 
     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-    sal_Bool bHighContrast = rStyleSettings.GetHighContrastMode();
-    sal_Bool bDark = rStyleSettings.GetFaceColor().IsDark();
+    bool bHighContrast = rStyleSettings.GetHighContrastMode();
+    bool bDark = rStyleSettings.GetFaceColor().IsDark();
     // Use the same distinction for bDark as in Window::DrawSelectionBackground
 
     Color aTextColor = rStyleSettings.GetButtonTextColor();
@@ -266,9 +266,9 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
     Color aSelLineColor = rStyleSettings.GetHighlightColor();
     aSelLineColor.Merge( aBlack, 0xe0 );        // darken just a little bit
 
-    sal_Bool bLayoutRTL = IsLayoutRTL();
+    bool bLayoutRTL = IsLayoutRTL();
     long nLayoutSign = bLayoutRTL ? -1 : 1;
-    sal_Bool bMirrored = IsMirrored();
+    bool bMirrored = IsMirrored();
 
     OUString            aString;
     sal_uInt16          nBarSize;
@@ -498,8 +498,8 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
                     else
                         aEndPos = Point( aScrPos.X()+(nSizePix-1)*nLayoutSign, aScrPos.Y()+nBarSize-1 );
 
-                    sal_Bool bMark = bMarkRange && nEntryNo >= nMarkStart && nEntryNo <= nMarkEnd;
-                    sal_Bool bNextToMark = bMarkRange && nEntryNo + 1 >= nMarkStart && nEntryNo <= nMarkEnd;
+                    bool bMark = bMarkRange && nEntryNo >= nMarkStart && nEntryNo <= nMarkEnd;
+                    bool bNextToMark = bMarkRange && nEntryNo + 1 >= nMarkStart && nEntryNo <= nMarkEnd;
 
                     switch ( nPass )
                     {
@@ -577,9 +577,9 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
 //      Maus - Handling
 //
 
-SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, sal_Bool& rBorder )
+SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, bool& rBorder )
 {
-    sal_Bool    bFound=false;
+    bool        bFound = false;
     SCCOLROW    nCount = 1;
     SCCOLROW    nPos = GetPos();
     SCCOLROW    nHitNo = nPos;
@@ -589,7 +589,7 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, sal_Bool& rBorde
     Size    aSize = GetOutputSizePixel();
     long    nWinSize = bVertical ? aSize.Height() : aSize.Width();
 
-    sal_Bool bLayoutRTL = IsLayoutRTL();
+    bool bLayoutRTL = IsLayoutRTL();
     long nLayoutSign = bLayoutRTL ? -1 : 1;
     long nEndPos = bLayoutRTL ? -1 : nWinSize;
 
@@ -606,7 +606,7 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, sal_Bool& rBorde
         nDif = nMousePos - nScrPos;
         if (nDif >= -2 && nDif <= 2 && nCount > 0)
         {
-            bFound=sal_True;
+            bFound = true;
             nHitNo=nEntryNo-1;
         }
         else if (nDif * nLayoutSign >= 0 && nEntryNo < nSize)
@@ -666,7 +666,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
     bIgnoreMove = false;
     SelectWindow();
 
-    sal_Bool bFound;
+    bool bFound;
     SCCOLROW nHitNo = GetMousePos( rMEvt, bFound );
     if (!IsSelectionAllowed(nHitNo))
         return;
@@ -691,7 +691,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
             DrawInvert( nDragPos );
 
             StartTracking();
-            bDragging = sal_True;
+            bDragging = true;
             bDragMoved = false;
         }
     }
@@ -706,7 +706,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
             aVis.Top() = LONG_MIN, aVis.Bottom() = LONG_MAX;
         pSelEngine->SetVisibleArea( aVis );
 
-        SetMarking( sal_True );     //  muss vor SelMouseButtonDown sein
+        SetMarking( true );     //  muss vor SelMouseButtonDown sein
         pSelEngine->SelMouseButtonDown( rMEvt );
 
         //  In column/row headers a simple click already is a selection.
@@ -736,11 +736,11 @@ void ScHeaderControl::MouseButtonUp( const MouseEvent& rMEvt )
     {
         DrawInvert( nDragPos );
         ReleaseMouse();
-        bDragging   = false;
+        bDragging = false;
 
         long nScrPos    = GetScrPos( nDragNo );
         long nMousePos  = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
-        sal_Bool bLayoutRTL = IsLayoutRTL();
+        bool bLayoutRTL = IsLayoutRTL();
         long nNewWidth  = bLayoutRTL ? ( nScrPos - nMousePos + 1 )
                                      : ( nMousePos + 2 - nScrPos );
 
@@ -782,7 +782,7 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt )
         return;
     }
 
-    sal_Bool bFound;
+    bool bFound;
     (void)GetMousePos( rMEvt, bFound );
 
     if ( bDragging )
@@ -796,7 +796,7 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt )
             DrawInvert( nDragPos );
 
             if (nDragPos <= nDragStart-SC_DRAG_MIN || nDragPos >= nDragStart+SC_DRAG_MIN)
-                bDragMoved = sal_True;
+                bDragMoved = true;
         }
     }
     else
@@ -847,7 +847,7 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
                     SC_MOD()->InputEnterHandler();  // always end edit mode
 
                 MouseEvent aMEvt( rCEvt.GetMousePosPixel() );
-                sal_Bool bBorder;
+                bool bBorder;
                 SCCOLROW nPos = GetMousePos( aMEvt, bBorder );
                 if (!IsSelectionAllowed(nPos))
                     // Selecting this cell is not allowed, neither is context menu.
@@ -891,7 +891,7 @@ void ScHeaderControl::StopMarking()
     }
 
     SetMarking( false );
-    bIgnoreMove = sal_True;
+    bIgnoreMove = true;
 
     //  don't call pSelEngine->Reset, so selection across the parts of
     //  a split/frozen view is possible
@@ -904,7 +904,7 @@ void ScHeaderControl::ShowDragHelp()
     if (Help::IsQuickHelpEnabled())
     {
         long nScrPos    = GetScrPos( nDragNo );
-        sal_Bool bLayoutRTL = IsLayoutRTL();
+        bool bLayoutRTL = IsLayoutRTL();
         long nVal = bLayoutRTL ? ( nScrPos - nDragPos + 1 )
                                : ( nDragPos + 2 - nScrPos );
 
@@ -943,7 +943,7 @@ void ScHeaderControl::RequestHelp( const HelpEvent& rHEvt )
     //  Wenn eigene QuickHelp angezeigt wird, nicht durch RequestHelp
     //  wieder wegnehmen lassen
 
-    sal_Bool bOwn = bDragging && Help::IsQuickHelpEnabled();
+    bool bOwn = bDragging && Help::IsQuickHelpEnabled();
     if (!bOwn)
         Window::RequestHelp(rHEvt);
 }
@@ -963,24 +963,24 @@ SCCOLROW ScHeaderControl::GetHiddenCount( SCCOLROW nEntryNo )
     return nHidden;
 }
 
-sal_Bool ScHeaderControl::IsLayoutRTL()
+bool ScHeaderControl::IsLayoutRTL()
 {
     return false;
 }
 
-sal_Bool ScHeaderControl::IsMirrored()
+bool ScHeaderControl::IsMirrored()
 {
     return false;
 }
 
-sal_Bool ScHeaderControl::IsDisabled()
+bool ScHeaderControl::IsDisabled()
 {
     return false;
 }
 
-sal_Bool ScHeaderControl::ResizeAllowed()
+bool ScHeaderControl::ResizeAllowed()
 {
-    return sal_True;
+    return true;
 }
 
 void ScHeaderControl::SelectWindow()
@@ -996,7 +996,7 @@ OUString ScHeaderControl::GetDragHelp( long /* nVal */ )
     return EMPTY_OUSTRING;
 }
 
-void ScHeaderControl::SetMarking( sal_Bool /* bSet */ )
+void ScHeaderControl::SetMarking( bool /* bSet */ )
 {
 }
 


More information about the Libreoffice-commits mailing list