[Libreoffice-commits] core.git: 3 commits - vcl/source

Takeshi Abe tabe at fixedpoint.jp
Wed Jun 19 06:56:48 PDT 2013


 vcl/source/window/dlgctrl.cxx  |    6 +++---
 vcl/source/window/dockmgr.cxx  |   34 +++++++++++++++++-----------------
 vcl/source/window/dockwin.cxx  |   12 ++++++------
 vcl/source/window/floatwin.cxx |   16 ++++++++--------
 vcl/source/window/keycod.cxx   |    2 +-
 vcl/source/window/layout.cxx   |    4 ++--
 vcl/source/window/menu.cxx     |    4 ++--
 vcl/source/window/mnemonic.cxx |    4 ++--
 vcl/source/window/scrwnd.cxx   |   14 +++++++-------
 9 files changed, 48 insertions(+), 48 deletions(-)

New commits:
commit 1ae19c8e6a1651748eb47cc0b8de3c58503cc7eb
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Jun 19 22:39:34 2013 +0900

    Mark as static
    
    Change-Id: I09a76b4c6ad0e63663c2628e5ad957d203e0283c

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 78d7e82..be28fff 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -603,9 +603,9 @@ struct ButtonOrder
     int m_nPriority;
 };
 
-int getButtonPriority(const OString &rType)
+static int getButtonPriority(const OString &rType)
 {
-    const size_t N_TYPES = 3;
+    static const size_t N_TYPES = 3;
     static const ButtonOrder aDiscardCancelSave[N_TYPES] =
     {
         { "/discard", 0 },
commit 913d6fb1cc0f9fa879b330d1322f8a19dfc050aa
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Jun 19 22:38:50 2013 +0900

    Mark as const
    
    Change-Id: Ib7f8aeeca64868fa2037145613023a6abfef7648

diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index 77c38ae..0751697 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -29,7 +29,7 @@
 
 
 // =======================================================================
-static sal_uInt16 aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
+static const sal_uInt16 aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
 {
     0, 0, 0, 0,                                                    // KEYFUNC_DONTKNOW
     KEY_N | KEY_MOD1, 0, 0, 0,                                     // KEYFUNC_NEW
diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx
index 45ceac4..78afb46 100644
--- a/vcl/source/window/mnemonic.cxx
+++ b/vcl/source/window/mnemonic.cxx
@@ -279,14 +279,14 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
                     nIndex = rKey.Len();
                     if( nIndex >= 2 )
                     {
-                        static sal_Unicode cGreaterGreater[] = { 0xFF1E, 0xFF1E };
+                        static const sal_Unicode cGreaterGreater[] = { 0xFF1E, 0xFF1E };
                         if ( rKey.EqualsAscii( ">>", nIndex-2, 2 ) ||
                             rKey.Equals( cGreaterGreater, nIndex-2, 2 ) )
                             nIndex -= 2;
                     }
                     if( nIndex >= 3 )
                     {
-                        static sal_Unicode cDotDotDot[] = { 0xFF0E, 0xFF0E, 0xFF0E };
+                        static const sal_Unicode cDotDotDot[] = { 0xFF0E, 0xFF0E, 0xFF0E };
                         if ( rKey.EqualsAscii( "...", nIndex-3, 3 ) ||
                             rKey.Equals( cDotDotDot, nIndex-3, 3 ) )
                             nIndex -= 3;
commit c974471918bd5aa5719ec703564bdb22c5a33a6e
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Jun 19 22:30:49 2013 +0900

    sal_Bool to bool
    
    Change-Id: Ic0597f42b6f0a637e0a3fdfa7972cbe67272c65d

diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 11d3739..ad3dc48 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -746,7 +746,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
                 sal_uInt16  nType;
                 sal_uInt16  nGetFocusFlags = GETFOCUS_TAB;
                 sal_uInt16  nNewIndex;
-                sal_Bool    bFormular = sal_False;
+                bool        bFormular = false;
 
                 // Bei Ctrl-Tab erstmal testen, ob zwischen Formularen
                 // gesprungen werden soll
@@ -763,7 +763,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
                         if ( pTempWindow->ImplGetWindow()->IsDialogControlStart() )
                         {
                             if ( iTemp != 0 )
-                                bFormular = sal_True;
+                                bFormular = true;
                             if ( aKeyCode.IsShift() )
                             {
                                 if ( iTemp <= nIndex )
@@ -1140,7 +1140,7 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
     {
         // #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
         // See tools/options/print for example.
-        sal_Bool bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
+        bool bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
         // get index, form start and form end
         sal_uInt16 nIndex=0, nFormStart=0, nFormEnd=0;
         Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index c48a7f8..dc1cc0c 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -54,7 +54,7 @@ private:
     Timer           maEndDockTimer;
     Point           maDockPos;
     Rectangle       maDockRect;
-    sal_Bool            mbInMove;
+    bool            mbInMove;
     sal_uLong           mnLastUserEvent;
 
     DECL_LINK(DockingHdl, void *);
@@ -87,7 +87,7 @@ ImplDockFloatWin2::ImplDockFloatWin2( Window* pParent, WinBits nWinBits,
         FloatingWindow( pParent, nWinBits ),
         mpDockWin( pDockingWin ),
         mnLastTicks( Time::GetSystemTicks() ),
-        mbInMove( sal_False ),
+        mbInMove( false ),
         mnLastUserEvent( 0 )
 {
     // Daten vom DockingWindow uebernehmen
@@ -175,7 +175,7 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl)
     Window *pDockingArea = mpDockWin->GetWindow()->GetParent();
     PointerState aState = pDockingArea->GetPointerState();
 
-    sal_Bool bRealMove = sal_True;
+    bool bRealMove = true;
     if( GetStyle() & WB_OWNERDRAWDECORATION )
     {
         // for windows with ownerdraw decoration
@@ -196,9 +196,9 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl)
 
             PointerState aBorderState = pBorder->GetPointerState();
             if( aBorderRect.IsInside( aBorderState.maPos ) )
-                bRealMove = sal_True;
+                bRealMove = true;
             else
-                bRealMove = sal_False;
+                bRealMove = false;
         }
     }
 
@@ -236,7 +236,7 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl)
             EndDockTimerHdl( this );
         }
     }
-    mbInMove = sal_False;
+    mbInMove = false;
     return 0;
 }
 // -----------------------------------------------------------------------
@@ -246,7 +246,7 @@ void ImplDockFloatWin2::Move()
     if( mbInMove )
         return;
 
-    mbInMove = sal_True;
+    mbInMove = true;
     FloatingWindow::Move();
     mpDockWin->GetWindow()->Move();
 
@@ -518,8 +518,8 @@ class ImplPopupFloatWin : public FloatingWindow
 {
 private:
     ImplDockingWindowWrapper*   mpDockingWin;
-    sal_Bool                        mbHighlight;
-    sal_Bool                        mbMoving;
+    bool                        mbHighlight;
+    bool                        mbMoving;
     bool                        mbTrackingEnabled;
     Point                       maDelta;
     Point                       maTearOffPosition;
@@ -555,8 +555,8 @@ ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper*
     mpWindowImpl->mbToolbarFloatingWindow = sal_True;   // indicate window type, required for accessibility
                                                     // which should not see this window as a toplevel window
     mpDockingWin = pDockingWin;
-    mbHighlight = sal_False;
-    mbMoving = sal_False;
+    mbHighlight = false;
+    mbMoving = false;
     mbTrackingEnabled = sal_False;
     mbGripAtBottom = sal_True;
     mbHasGrip = bHasGrip;
@@ -772,18 +772,18 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt )
         if( mbTrackingEnabled && rMEvt.IsLeft() && GetDragRect().IsInside( aMousePos ) )
         {
             // start window move
-            mbMoving = sal_True;
+            mbMoving = true;
             StartTracking( STARTTRACK_NOKEYCANCEL );
             return;
         }
         if( !mbHighlight && GetDragRect().IsInside( aMousePos ) )
         {
-            mbHighlight = sal_True;
+            mbHighlight = true;
             DrawGrip();
         }
         if( mbHighlight && ( rMEvt.IsLeaveWindow() || !GetDragRect().IsInside( aMousePos ) ) )
         {
-            mbHighlight = sal_False;
+            mbHighlight = false;
             DrawGrip();
         }
     }
@@ -820,7 +820,7 @@ void ImplPopupFloatWin::Tracking( const TrackingEvent& rTEvt )
     {
         if ( rTEvt.IsTrackingEnded() )
         {
-            mbMoving = sal_False;
+            mbMoving = false;
             EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF );
         }
         else if ( !rTEvt.GetMouseEvent().IsSynthetic() )
@@ -1062,12 +1062,12 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, sal_Bool bFlo
 
     if ( !IsDockingCanceled() )
     {
-        sal_Bool bShow = sal_False;
+        bool bShow = false;
         if ( bFloatMode != IsFloatingMode() )
         {
             GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
             SetFloatingMode( bFloatMode );
-            bShow = sal_True;
+            bShow = true;
             if ( bFloatMode )
             {
                 // #i44800# always use outputsize - as in all other places
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 42954e6..966b6c3 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -72,7 +72,7 @@ private:
     Timer           maDockTimer;
     Point           maDockPos;
     Rectangle       maDockRect;
-    sal_Bool            mbInMove;
+    bool            mbInMove;
     sal_uLong           mnLastUserEvent;
 
     DECL_LINK(DockingHdl, void *);
@@ -100,7 +100,7 @@ ImplDockFloatWin::ImplDockFloatWin( Window* pParent, WinBits nWinBits,
         FloatingWindow( pParent, nWinBits ),
         mpDockWin( pDockingWin ),
         mnLastTicks( Time::GetSystemTicks() ),
-        mbInMove( sal_False ),
+        mbInMove( false ),
         mnLastUserEvent( 0 )
 {
     // Daten vom DockingWindow uebernehmen
@@ -192,7 +192,7 @@ IMPL_LINK_NOARG(ImplDockFloatWin, DockingHdl)
             mpDockWin->EndDocking( maDockRect, sal_True );
         }
     }
-    mbInMove = sal_False;
+    mbInMove = false;
     return 0;
 }
 // -----------------------------------------------------------------------
@@ -202,7 +202,7 @@ void ImplDockFloatWin::Move()
     if( mbInMove )
         return;
 
-    mbInMove = sal_True;
+    mbInMove = true;
     FloatingWindow::Move();
     mpDockWin->Move();
 
@@ -668,12 +668,12 @@ void DockingWindow::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
 {
     if ( !IsDockingCanceled() )
     {
-        sal_Bool bShow = sal_False;
+        bool bShow = false;
         if ( bFloatMode != IsFloatingMode() )
         {
             Show( sal_False, SHOW_NOFOCUSCHANGE );
             SetFloatingMode( bFloatMode );
-            bShow = sal_True;
+            bShow = true;
             if ( bFloatMode && mpFloatWin )
                 mpFloatWin->SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() );
         }
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 92ce317..10f1e97 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -268,7 +268,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
 
     sal_uInt16      nArrangeAry[5];
     sal_uInt16      nArrangeIndex;
-    sal_Bool        bBreak;
+    bool        bBreak;
     Point       e1,e2;  // the common edge between the item rect and the floating window
 
     if ( nFlags & FLOATWIN_POPUPMODE_LEFT )
@@ -310,7 +310,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
 
     for ( ; nArrangeIndex < 5; nArrangeIndex++ )
     {
-        bBreak = sal_True;
+        bBreak = true;
         switch ( nArrangeAry[nArrangeIndex] )
         {
 
@@ -321,12 +321,12 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
                 if( bRTL ) // --- RTL --- we're comparing screen coordinates here
                 {
                     if( (devRectRTL.Right()+aSize.Width()) > aScreenRect.Right() )
-                        bBreak = sal_False;
+                        bBreak = false;
                 }
                 else
                 {
                     if ( aPos.X() < aScreenRect.Left() )
-                        bBreak = sal_False;
+                        bBreak = false;
                 }
                 if( bBreak )
                 {
@@ -345,12 +345,12 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
                 if( bRTL ) // --- RTL --- we're comparing screen coordinates here
                 {
                     if( (devRectRTL.Left() - aSize.Width()) < aScreenRect.Left() )
-                        bBreak = sal_False;
+                        bBreak = false;
                 }
                 else
                 {
                     if ( aPos.X()+aSize.Width() > aScreenRect.Right() )
-                        bBreak = sal_False;
+                        bBreak = false;
                 }
                 if( bBreak )
                 {
@@ -367,7 +367,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
                 aPos.X() = devRect.Left();
                 aPos.Y() = devRect.Top()-aSize.Height()+1;
                 if ( aPos.Y() < aScreenRect.Top() )
-                    bBreak = sal_False;
+                    bBreak = false;
                 if( bBreak )
                 {
                     e1 = devRect.TopLeft();
@@ -382,7 +382,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
             case FLOATWIN_POPUPMODE_DOWN:
                 aPos = devRect.BottomLeft();
                 if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() )
-                    bBreak = sal_False;
+                    bBreak = false;
                 if( bBreak )
                 {
                     e1 = devRect.BottomLeft();
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index aeb2d3d..b896a7d 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -91,7 +91,7 @@ DBG_NAME( Menu )
 // document closer
 #define IID_DOCUMENTCLOSE 1
 
-static sal_Bool ImplAccelDisabled()
+static bool ImplAccelDisabled()
 {
     // display of accelerator strings may be suppressed via configuration
     static int nAccelDisabled = -1;
@@ -103,7 +103,7 @@ static sal_Bool ImplAccelDisabled()
             getValue( "Menu", "SuppressAccelerators" );
         nAccelDisabled = aStr.equalsIgnoreAsciiCase("true") ? 1 : 0;
     }
-    return (nAccelDisabled == 1) ? sal_True : sal_False;
+    return nAccelDisabled == 1;
 }
 
 struct MenuItemData
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index 61744e1..9fd833c 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -51,8 +51,8 @@ ImplWheelWindow::ImplWheelWindow( Window* pParent ) :
 
     const Size      aSize( pParent->GetOutputSizePixel() );
     const sal_uInt16    nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
-    const sal_Bool      bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
-    const sal_Bool      bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+    const bool      bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+    const bool      bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
 
     // calculate maximum speed distance
     mnMaxWidth = (sal_uLong) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) );
@@ -217,8 +217,8 @@ PointerStyle ImplWheelWindow::ImplGetMousePointer( long nDistX, long nDistY )
 {
     PointerStyle    eStyle;
     const sal_uInt16    nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
-    const sal_Bool      bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
-    const sal_Bool      bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+    const bool      bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+    const bool      bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
 
     if( bHorz || bVert )
     {
@@ -296,9 +296,9 @@ void ImplWheelWindow::MouseMove( const MouseEvent& rMEvt )
 
     const PointerStyle  eActStyle = ImplGetMousePointer( nDistX, nDistY );
     const sal_uInt16        nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
-    const sal_Bool          bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
-    const sal_Bool          bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
-    const sal_Bool          bOuter = mnActDist > WHEEL_RADIUS;
+    const bool          bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+    const bool          bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+    const bool          bOuter = mnActDist > WHEEL_RADIUS;
 
     if( bOuter && ( maLastMousePos != aMousePos ) )
     {


More information about the Libreoffice-commits mailing list