[Libreoffice] [PATCH] harmonized some headers with implementation regarding BOOL vs sal_Bool use.

Norbert Thiebaud nthiebaud at gmail.com
Sat Oct 2 23:40:00 PDT 2010


Some header declare a fonction as BOOL while the implementation say
sal_Bool or vice-versa

This harmonized some of these.
The goal is to prepare the code to a point where it sould be possible to
change
typedef sal_Bool BOOL
to
typedef bool BOOL
in tools/inc/solar.h



 linguistic/source/hyphdsp.cxx    |    2 +-
 xmloff/source/style/xmlnumfe.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

 svtools/inc/svtools/accessibletableprovider.hxx |    2 +-
 svtools/inc/svtools/brwbox.hxx                  |    4 ++--
 svtools/inc/svtools/svtabbx.hxx                 |    2 +-
 svtools/inc/svtools/textview.hxx                |    2 +-
 svtools/source/brwbox/brwbox1.cxx               |    2 +-
 svtools/source/brwbox/brwbox3.cxx               |    2 +-
 svtools/source/contnr/imivctl1.cxx              |    2 +-
 svtools/source/contnr/svimpicn.cxx              |    2 +-
 svtools/source/contnr/svtabbx.cxx               |    2 +-
 svtools/source/svhtml/parhtml.cxx               |    2 +-
 toolkit/inc/toolkit/awt/vclxmenu.hxx            |    2 +-
 toolkit/inc/toolkit/helper/unowrapper.hxx       |    2 +-
 toolkit/source/helper/unowrapper.cxx            |    2 +-
 vcl/source/app/unohelp.cxx                      |    2 +-
 vcl/source/window/window.cxx                    |   22 +++++++++++-----------
 vcl/unx/gtk/a11y/atkwindow.cxx                  |    4 ++--
 vcl/unx/gtk/app/gtkdata.cxx                     |    2 +-
 vcl/unx/inc/saldisp.hxx                         |    2 +-
 vcl/unx/source/app/keysymnames.cxx              |    2 +-
 vcl/unx/source/app/saldisp.cxx                  |    2 +-
 20 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index e617231..436335a 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -245,7 +245,7 @@ Sequence< Locale > SAL_CALL
HyphenatorDispatcher::getLocales()
 }


-BOOL SAL_CALL HyphenatorDispatcher::hasLocale(const Locale& rLocale)
+sal_Bool SAL_CALL HyphenatorDispatcher::hasLocale(const Locale& rLocale)
         throw(RuntimeException)
 {
     MutexGuard	aGuard( GetLinguMutex() );
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index ad3f5ab..684a466 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -976,7 +976,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const
SvNumberformat& rFormat, sal_uInt
     NfIndexTableOffset eBuiltIn = pFormatter->GetIndexTableOffset( nKey );

     short nFmtType = 0;
-    sal_Bool bThousand = sal_False;
+    BOOL bThousand = sal_False;
     sal_uInt16 nPrecision = 0;
     sal_uInt16 nLeading = 0;
     rFormat.GetNumForInfo( nPart, nFmtType, bThousand, nPrecision, nLeading);
diff --git a/svtools/inc/svtools/accessibletableprovider.hxx
b/svtools/inc/svtools/accessibletableprovider.hxx
index 17ab339..4b9c0e3 100644
--- a/svtools/inc/svtools/accessibletableprovider.hxx
+++ b/svtools/inc/svtools/accessibletableprovider.hxx
@@ -87,7 +87,7 @@ public:
     virtual sal_Bool				HasRowHeader() const = 0; //GetColumnId
     /** @return  <TRUE/>, if the object can focus a cell. */
     virtual sal_Bool				IsCellFocusable() const = 0;
-    virtual sal_Bool				GoToCell( sal_Int32 _nRow, sal_uInt16
_nColumnPos ) = 0;
+    virtual BOOL                    GoToCell( sal_Int32 _nRow,
sal_uInt16 _nColumnPos ) = 0;

     virtual void					SetNoSelection() = 0;
     virtual void					SelectAll() = 0;
diff --git a/svtools/inc/svtools/brwbox.hxx b/svtools/inc/svtools/brwbox.hxx
index f8ff110..ec6c444 100644
--- a/svtools/inc/svtools/brwbox.hxx
+++ b/svtools/inc/svtools/brwbox.hxx
@@ -369,7 +369,7 @@ protected:
         @param nRow
             nRow starts at 0
     */
-    virtual BOOL    SeekRow( long nRow ) = 0;
+    virtual sal_Bool SeekRow( long nRow ) = 0;
     virtual void    DrawCursor();
     virtual void	PaintRow( OutputDevice &rDev, const Rectangle &rRect );
     virtual void    PaintData( Window& rWin, const Rectangle& rRect );
@@ -470,7 +470,7 @@ public:
     virtual void    EndScroll();
     virtual void    Select();
     virtual void    DoubleClick( const BrowserMouseEvent& rEvt );
-    virtual BOOL	IsCursorMoveAllowed( long nNewRow, USHORT nNewColId ) const;
+    virtual sal_Bool IsCursorMoveAllowed( long nNewRow, USHORT
nNewColId ) const;
     virtual void    CursorMoved();
     virtual void    ColumnMoved( USHORT nColId );
     virtual void    ColumnResized( USHORT nColId );
diff --git a/svtools/inc/svtools/svtabbx.hxx b/svtools/inc/svtools/svtabbx.hxx
index 34d158a..5300b51 100644
--- a/svtools/inc/svtools/svtabbx.hxx
+++ b/svtools/inc/svtools/svtabbx.hxx
@@ -202,7 +202,7 @@ public:
     virtual sal_Bool				HasRowHeader() const; //GetColumnId
     /** @return  <TRUE/>, if the object can focus a cell. */
     virtual sal_Bool				IsCellFocusable() const;
-    virtual sal_Bool				GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+    virtual BOOL                    GoToCell( sal_Int32 _nRow,
sal_uInt16 _nColumn );

     virtual void					SetNoSelection();
     using SvListView::SelectAll;
diff --git a/svtools/inc/svtools/textview.hxx b/svtools/inc/svtools/textview.hxx
index a149702..09bfb47 100644
--- a/svtools/inc/svtools/textview.hxx
+++ b/svtools/inc/svtools/textview.hxx
@@ -76,7 +76,7 @@ protected:
     void                ImpShowHideSelection( BOOL bShow, const
TextSelection* pRange = NULL );

     TextSelection		ImpMoveCursor( const KeyEvent& rKeyEvent );
-    TextPaM				ImpDelete( BOOL bForward, BYTE nMode );
+    TextPaM				ImpDelete( BYTE nMode, BYTE nDelMode );
     void				ImpSetSelection( const TextSelection& rNewSel, BOOL bUI );
     BOOL 				IsInSelection( const TextPaM& rPaM );

diff --git a/svtools/source/brwbox/brwbox1.cxx
b/svtools/source/brwbox/brwbox1.cxx
index 26d25c6..6b243af 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -2594,7 +2594,7 @@ void BrowseBox::VisibleRowsChanged( long, USHORT )

 //-------------------------------------------------------------------

-BOOL BrowseBox::IsCursorMoveAllowed( long, USHORT ) const
+sal_Bool BrowseBox::IsCursorMoveAllowed( long, USHORT ) const

 /*	[Beschreibung]

diff --git a/svtools/source/brwbox/brwbox3.cxx
b/svtools/source/brwbox/brwbox3.cxx
index 631a555..7d56511 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -459,7 +459,7 @@ sal_Bool BrowseBox::IsCellFocusable() const
     return sal_True;
 }
 // -----------------------------------------------------------------------------
-sal_Bool BrowseBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
+BOOL BrowseBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
 {
     return GoToRowColumnId( _nRow, GetColumnId( _nColumn ) );
 }
diff --git a/svtools/source/contnr/imivctl1.cxx
b/svtools/source/contnr/imivctl1.cxx
index 1cf7fe8..e4076c3 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -3644,7 +3644,7 @@ void SvxIconChoiceCtrl_Impl::DrawFocusRect (
OutputDevice* pOut )
     pOut->DrawPolyLine ( aPolygon, aLineInfo );
 }

-sal_Bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar,
ULONG& rPos ) const
+BOOL SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar,
ULONG& rPos ) const
 {
     sal_Bool bRet = sal_False;
     const vcl::I18nHelper& rI18nHelper =
Application::GetSettings().GetUILocaleI18nHelper();
diff --git a/svtools/source/contnr/svimpicn.cxx
b/svtools/source/contnr/svimpicn.cxx
index ae33b3c..c3c0d09 100644
--- a/svtools/source/contnr/svimpicn.cxx
+++ b/svtools/source/contnr/svimpicn.cxx
@@ -3562,7 +3562,7 @@ void ImpIcnCursor::ExpandGrid()
     if( pGridMap )
     {
         long nNewGridRows = nGridRows + 20;
-        unsigned char* pTempMap = new unsigned char[ nNewGridRows *
nGridCols ];
+        BOOL* pTempMap = new BOOL[ nNewGridRows * nGridCols ];
         memcpy( pTempMap, pGridMap, nGridRows * nGridCols );
         delete pGridMap;
         pGridMap = pTempMap;
diff --git a/svtools/source/contnr/svtabbx.cxx
b/svtools/source/contnr/svtabbx.cxx
index a63d218..d196c52 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -841,7 +841,7 @@ sal_Bool SvHeaderTabListBox::IsCellFocusable() const
     return IsCellFocusEnabled();
 }
 // -----------------------------------------------------------------------
-sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
+BOOL SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
 {
     sal_Bool bRet = ( IsCellFocusEnabled() == TRUE );
     if ( bRet )
diff --git a/svtools/source/svhtml/parhtml.cxx
b/svtools/source/svhtml/parhtml.cxx
index c71c1f5..a47a98c 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -181,7 +181,7 @@ INT32 HTMLOption::GetSNumber() const
     return aTmp.ToInt32();
 }

-void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const
+void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const
 {
     if( rLongs.Count() )
         rLongs.Remove( 0, rLongs.Count() );
diff --git a/toolkit/inc/toolkit/awt/vclxmenu.hxx
b/toolkit/inc/toolkit/awt/vclxmenu.hxx
index 9fefbe9..590f7b8 100644
--- a/toolkit/inc/toolkit/awt/vclxmenu.hxx
+++ b/toolkit/inc/toolkit/awt/vclxmenu.hxx
@@ -70,7 +70,7 @@ protected:

     DECL_LINK( 	 	MenuEventListener, VclSimpleEvent* );

-    void			ImplCreateMenu( BOOL bPopup );
+    void			ImplCreateMenu( sal_Bool bPopup );

 public:
                     VCLXMenu();
diff --git a/toolkit/inc/toolkit/helper/unowrapper.hxx
b/toolkit/inc/toolkit/helper/unowrapper.hxx
index 0f41292..8d7adbd 100644
--- a/toolkit/inc/toolkit/helper/unowrapper.hxx
+++ b/toolkit/inc/toolkit/helper/unowrapper.hxx
@@ -60,7 +60,7 @@ public:
     virtual void				ReleaseAllGraphics( OutputDevice* pOutDev );

     // Window
-    virtual ::com::sun::star::uno::Reference<
::com::sun::star::awt::XWindowPeer> GetWindowInterface( Window*
pWindow, BOOL bCreate );
+    virtual ::com::sun::star::uno::Reference<
::com::sun::star::awt::XWindowPeer> GetWindowInterface( Window*
pWindow, sal_Bool bCreate );
     virtual void				SetWindowInterface( Window* pWindow,
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>
xIFace );

     void				WindowDestroyed( Window* pWindow );
diff --git a/toolkit/source/helper/unowrapper.cxx
b/toolkit/source/helper/unowrapper.cxx
index 827f4f7..6db061a 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -162,7 +162,7 @@ UnoWrapper::~UnoWrapper()
     return mxToolkit.get();
 }

-::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>
UnoWrapper::GetWindowInterface( Window* pWindow, BOOL bCreate )
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>
UnoWrapper::GetWindowInterface( Window* pWindow, sal_Bool bCreate )
 {
     ::com::sun::star::uno::Reference<
::com::sun::star::awt::XWindowPeer> xPeer = pWindow->GetWindowPeer();
     if ( !xPeer.is() && bCreate )
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx
index ecc69da..0ab43ba 100644
--- a/vcl/source/app/unohelp.cxx
+++ b/vcl/source/app/unohelp.cxx
@@ -190,7 +190,7 @@ uno::Reference < i18n::XCollator >
vcl::unohelper::CreateCollator()
     return xB;
 }

-::rtl::OUString vcl::unohelper::CreateLibraryName( const sal_Char*
pModName, BOOL bSUPD )
+::rtl::OUString vcl::unohelper::CreateLibraryName( const sal_Char*
pModName, sal_Bool bSUPD )
 {
     // create variable library name suffixes
     OUString aDLLSuffix = OUString::createFromAscii( STRING(DLLPOSTFIX) );
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b1049d3..4e5ac68 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -641,7 +641,7 @@ void Window::ImplInitWindowData( WindowType nType )
     mpWindowImpl->mbMenuFloatingWindow= FALSE;		// TRUE:
MenuFloatingWindow is the base class
     mpWindowImpl->mbToolbarFloatingWindow= FALSE;		// TRUE:
ImplPopupFloatWin is the base class, used for subtoolbars
     mpWindowImpl->mbSplitter			= FALSE;		// TRUE: Splitter is the base class
-    mpWindowImpl->mbVisible           = FALSE;        // TRUE: Show(
TRUE ) called
+    mpWindowImpl->mbVisible           = FALSE;        // TRUE: Show(
true ) called
     mpWindowImpl->mbOverlapVisible    = FALSE;        // TRUE: Hide
called for visible window from ImplHideAllOverlapWindow()
     mpWindowImpl->mbDisabled          = FALSE;        // TRUE:
Enable( FALSE ) called
     mpWindowImpl->mbInputDisabled     = FALSE;        // TRUE:
EnableInput( FALSE ) called
@@ -1763,7 +1763,7 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion )

     if ( mpWindowImpl->mpSysObj )
     {
-        BOOL bVisibleState = mpWindowImpl->mbReallyVisible;
+        bool bVisibleState = mpWindowImpl->mbReallyVisible;

         if ( bVisibleState )
         {
@@ -3109,7 +3109,7 @@ void Window::ImplUpdateWindowPtr()
 void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame )
 {
     BOOL bVisible = IsVisible();
-    Show( FALSE );
+    Show( false );
     ImplRemoveWindow( bNewFrame );
     Window* pRealParent = mpWindowImpl->mpRealParent;
     ImplInsertWindow( ImplGetParent() );
@@ -3130,7 +3130,7 @@ void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame )
     }

     if ( bVisible )
-        Show( TRUE );
+        Show( true );
 }

 // -----------------------------------------------------------------------
@@ -3757,7 +3757,7 @@ void Window::ImplShowAllOverlaps()
     {
         if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible )
         {
-            pOverlapWindow->Show( TRUE, SHOW_NOACTIVATE );
+            pOverlapWindow->Show( true, SHOW_NOACTIVATE );
             pOverlapWindow->mpWindowImpl->mbOverlapVisible = FALSE;
         }

@@ -3775,7 +3775,7 @@ void Window::ImplHideAllOverlaps()
         if ( pOverlapWindow->IsVisible() )
         {
             pOverlapWindow->mpWindowImpl->mbOverlapVisible = TRUE;
-            pOverlapWindow->Show( FALSE );
+            pOverlapWindow->Show( false );
         }

         pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
@@ -4785,7 +4785,7 @@ void Window::doLazyDelete()
     DockingWindow* pDockWin = dynamic_cast<DockingWindow*>(this);
     if( pSysWin || ( pDockWin && pDockWin->IsFloatingMode() ) )
     {
-        Show( FALSE );
+        Show( false );
         SetParent( ImplGetDefaultWindow() );
     }
     vcl::LazyDeletor<Window>::Delete( this );
@@ -6304,7 +6304,7 @@ void Window::SetParent( Window* pNewParent )
         mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );

     BOOL bVisible = IsVisible();
-    Show( FALSE, SHOW_NOFOCUSCHANGE );
+    Show( false, SHOW_NOFOCUSCHANGE );

     // Testen, ob sich das Overlap-Window aendert
     Window* pOldOverlapWindow;
@@ -6420,7 +6420,7 @@ void Window::SetParent( Window* pNewParent )
         ImplGetOwnerDrawList().push_back( this );

     if ( bVisible )
-        Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+        Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
 }

 // -----------------------------------------------------------------------
@@ -6448,7 +6448,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
             BOOL bOldUpdate =
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
             if ( mpWindowImpl->mbNoParentUpdate )

mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = TRUE;
-            mpWindowImpl->mpBorderWindow->Show( FALSE, nFlags );
+            mpWindowImpl->mpBorderWindow->Show( false, nFlags );
             mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate
= bOldUpdate;
         }
         else if ( mpWindowImpl->mbFrame )
@@ -6586,7 +6586,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
         }

         if ( mpWindowImpl->mpBorderWindow )
-            mpWindowImpl->mpBorderWindow->Show( TRUE, nFlags );
+            mpWindowImpl->mpBorderWindow->Show( true, nFlags );
         else if ( mpWindowImpl->mbFrame )
         {
             ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx
index bcc00bc..4c0403f 100644
--- a/vcl/unx/gtk/a11y/atkwindow.cxx
+++ b/vcl/unx/gtk/a11y/atkwindow.cxx
@@ -55,9 +55,9 @@ init_from_window( AtkObject *accessible, Window *pWindow )
     // by their parents already.
     if( aDefaultRole == ATK_ROLE_INVALID )
         aDefaultRole = atk_role_register( "redundant object" );
-
+
     AtkRole role = aDefaultRole;
-
+
     // Determine the appropriate role for the GtkWindow
     switch( pWindow->GetAccessibleRole() )
     {
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 265e52b..fd08974 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -114,7 +114,7 @@ GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event,
 void signalKeysChanged( GdkKeymap*, gpointer data )
 {
     GtkSalDisplay* pDisp = (GtkSalDisplay*)data;
-    pDisp->GetKeyboardName(TRUE);
+    pDisp->GetKeyboardName(true);
 }

 void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data )
diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx
index 4f4185a..a3bd771 100644
--- a/vcl/unx/inc/saldisp.hxx
+++ b/vcl/unx/inc/saldisp.hxx
@@ -512,7 +512,7 @@ public:
     { mpInputMethod = pInputMethod; }
     void			SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension)
     { mpKbdExtension = pKbdExtension; }
-    const char*	GetKeyboardName( BOOL bRefresh = FALSE );
+    const char*	GetKeyboardName( bool bRefresh = false );
     ::vcl_sal::WMAdaptor* getWMAdaptor() const { return m_pWMAdaptor; }
     DtIntegrator* getDtIntegrator() const { return m_pDtIntegrator; }
     bool			IsXinerama() const { return m_bXinerama; }
diff --git a/vcl/unx/source/app/keysymnames.cxx
b/vcl/unx/source/app/keysymnames.cxx
index 2f48378..7a4f984 100644
--- a/vcl/unx/source/app/keysymnames.cxx
+++ b/vcl/unx/source/app/keysymnames.cxx
@@ -597,7 +597,7 @@ static const keyboard_layout type6_layout[] =
 #include <stdio.h>
 #endif

-const char* SalDisplay::GetKeyboardName( BOOL bRefresh )
+const char* SalDisplay::GetKeyboardName( bool bRefresh )
 {
     if( bRefresh || ! m_aKeyboardName.Len() )
     {
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index 4d7fabb..a176367 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -2419,7 +2419,7 @@ long SalX11Display::Dispatch( XEvent *pEvent )
                 if( MappingModifier == pEvent->xmapping.request )
                     ModifierMapping();
                 if( MappingKeyboard == pEvent->xmapping.request ) //
refresh mapping
-                    GetKeyboardName( TRUE );
+                    GetKeyboardName( true );
             }
             break;
         case ButtonPress:


More information about the LibreOffice mailing list