Commits

Caolán McNamara  committed 5f4a1bc

gtk3: #i111952# there's a lot to hate in the gtk themeing, but nows not the time to try and tackle it, just continue the mechanism of abusing combos

  • Participants
  • Parent commits d481a33

Comments (0)

Files changed (2)

File vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx

 class NWPixmapCache;
 struct NWFWidgetData
 {
-    GtkWidget *	gCacheWindow;
-    GtkWidget *	gDumbContainer;
-
-    GtkWidget *	gBtnWidget;
-    GtkWidget *	gRadioWidget;
-    GtkWidget *	gRadioWidgetSibling;
-    GtkWidget *	gCheckWidget;
-    GtkWidget *	gScrollHorizWidget;
-    GtkWidget *	gScrollVertWidget;
-    GtkWidget *	gArrowWidget;
-    GtkWidget *	gDropdownWidget;
-    GtkWidget *	gEditBoxWidget;
-    GtkWidget *	gSpinButtonWidget;
-    GtkWidget *	gNotebookWidget;
-    GtkWidget *	gComboBoxEntryWidget;
-    GtkWidget *	gComboBoxEntry_ButtonWidget;
-    GtkWidget *	gComboBoxEntry_EntryWidget;
-    GtkWidget *	gComboBoxWidget;
-    GtkWidget *	gScrolledWindowWidget;
+    GtkWidget * gCacheWindow;
+    GtkWidget * gDumbContainer;
+
+    GtkWidget * gBtnWidget;
+    GtkWidget * gRadioWidget;
+    GtkWidget * gRadioWidgetSibling;
+    GtkWidget * gCheckWidget;
+    GtkWidget * gScrollHorizWidget;
+    GtkWidget * gScrollVertWidget;
+    GtkWidget * gArrowWidget;
+    GtkWidget * gDropdownWidget;
+    GtkWidget * gEditBoxWidget;
+    GtkWidget * gSpinButtonWidget;
+    GtkWidget * gNotebookWidget;
+    GtkWidget * gComboBoxEntryWidget;
+    GtkWidget * gComboBoxEntry_EntryWidget;
+    GtkWidget * gComboBoxEntry_ButtonWidget;
+    GtkWidget * gComboBoxEntry_ArrowWidget;
+    GtkWidget * gComboBoxWidget;
+    GtkWidget * gComboBox_ButtonWidget;
+    GtkWidget * gComboBox_SeparatorWidget;
+    GtkWidget * gComboBox_ArrowWidget;
+    GtkWidget * gScrolledWindowWidget;
     GtkWidget * gToolbarWidget;
     GtkWidget * gToolbarButtonWidget;
     GtkWidget * gToolbarToggleWidget;
         gSpinButtonWidget( NULL ),
         gNotebookWidget( NULL ),
         gComboBoxEntryWidget( NULL ),
+        gComboBoxEntry_EntryWidget( NULL ),
         gComboBoxEntry_ButtonWidget( NULL ),
-        gComboBoxEntry_EntryWidget( NULL ),
+        gComboBoxEntry_ArrowWidget( NULL ),
+        gComboBoxWidget( NULL ),
+        gComboBox_ButtonWidget( NULL ),
+        gComboBox_SeparatorWidget( NULL ),
+        gComboBox_ArrowWidget( NULL ),
         gScrolledWindowWidget( NULL ),
         gToolbarWidget( NULL ),
         gToolbarButtonWidget( NULL ),
 // Keep a hash table of Widgets->default flags so that we can
 // easily and quickly reset each to a default state before using
 // them
-static std::hash_map<long, guint>	gWidgetDefaultFlags;
+static std::hash_map<long, guint>   gWidgetDefaultFlags;
 static std::vector<NWFWidgetData>   gWidgetData;
 
-static const GtkBorder aDefDefBorder		= { 1, 1, 1, 1 };
+static const GtkBorder aDefDefBorder        = { 1, 1, 1, 1 };
 
 // Some GTK defaults
-#define MIN_ARROW_SIZE					11
-#define BTN_CHILD_SPACING				1
-#define MIN_SPIN_ARROW_WIDTH				6
-
-
-static void NWEnsureGTKRadio			( int nScreen );
-static void NWEnsureGTKButton			( int nScreen );
-static void NWEnsureGTKCheck			( int nScreen );
-static void NWEnsureGTKScrollbars		( int nScreen );
-static void NWEnsureGTKArrow			( int nScreen );
-static void NWEnsureGTKEditBox			( int nScreen );
-static void NWEnsureGTKSpinButton		( int nScreen );
-static void NWEnsureGTKNotebook			( int nScreen );
-static void NWEnsureGTKComboBoxEntry	( int nScreen );
-static void NWEnsureGTKScrolledWindow	( int nScreen );
-static void NWEnsureGTKToolbar			( int nScreen );
+#define MIN_ARROW_SIZE                  11
+#define BTN_CHILD_SPACING               1
+#define MIN_SPIN_ARROW_WIDTH                6
+
+
+static void NWEnsureGTKRadio            ( int nScreen );
+static void NWEnsureGTKButton           ( int nScreen );
+static void NWEnsureGTKCheck            ( int nScreen );
+static void NWEnsureGTKScrollbars       ( int nScreen );
+static void NWEnsureGTKArrow            ( int nScreen );
+static void NWEnsureGTKEditBox          ( int nScreen );
+static void NWEnsureGTKSpinButton       ( int nScreen );
+static void NWEnsureGTKNotebook         ( int nScreen );
+static void NWEnsureGTKComboBoxEntry    ( int nScreen );
+static void NWEnsureGTKComboBox         ( int nScreen );
+static void NWEnsureGTKScrolledWindow   ( int nScreen );
+static void NWEnsureGTKToolbar          ( int nScreen );
 static void NWEnsureGTKMenubar          ( int nScreen );
 static void NWEnsureGTKMenu             ( int nScreen );
 static void NWEnsureGTKTooltip          ( int nScreen );
 
 //---
 static Rectangle NWGetButtonArea( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
-								const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
+                                const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
 
 //---
 static Rectangle NWGetEditBoxPixmapRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
-							const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
+                            const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
 
 static void NWPaintOneEditBox( int nScreen, GdkDrawable * gdkDrawable, GdkRectangle *gdkRect, 
                                ControlType nType, ControlPart nPart, Rectangle aEditBoxRect,
 
 //---
 static Rectangle NWGetSpinButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
-							const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
+                            const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
 
 static void NWPaintOneSpinButton( int nScreen, GdkPixmap * pixmap, ControlType nType, ControlPart nPart, Rectangle aAreaRect,
-							ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle,
-							const OUString& rCaption );
+                            ControlState nState, const ImplControlValue& aValue, SalControlHandle& rControlHandle,
+                            const OUString& rCaption );
 //---
+static Rectangle NWGetComboBoxEntryButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
+                            const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
+
 static Rectangle NWGetComboBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
-							const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
+                            const ImplControlValue& aValue, SalControlHandle& rControlHandle, const OUString& rCaption );
+
 
 static Rectangle NWGetToolbarRect( int nScreen,
                                    ControlType nType,
                                    const OUString& rCaption );
 //---
 
-static Rectangle NWGetScrollButtonRect(	int nScreen, ControlPart nPart, Rectangle aAreaRect );
+static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect );
 //---
-								
+                                
 /*********************************************************
  * PixmapCache
  *********************************************************/
         g_object_ref( m_pixmap );
 }
 
-
 NWPixmapCache::NWPixmapCache( int nScreen )
 {
     m_idx = 0;
     if( gWidgetData[m_screen].gNWPixmapCacheList )
         gWidgetData[m_screen].gNWPixmapCacheList->AddCache(this);
 } 
+
 NWPixmapCache::~NWPixmapCache()
 {
     if( gWidgetData[m_screen].gNWPixmapCacheList )
         gWidgetData[m_screen].gNWPixmapCacheList->RemoveCache(this);
     delete[] pData;
 }
+
 void NWPixmapCache::ThemeChanged()
 {
     // throw away cached pixmaps
-    int i;
-    for(i=0; i<m_size; i++)
+    for(int i=0; i<m_size; i++)
         pData[i].SetPixmap( NULL );
 }
 
-BOOL  NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
+BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
 {
     aState &= ~CTRL_CACHING_ALLOWED; // mask clipping flag
-    int i;
-    for(i=0; i<m_size; i++)
+    for(int i=0; i<m_size; i++)
     {
         if( pData[i].m_nType == aType &&
             pData[i].m_nState == aState &&    
     pData[m_idx].SetPixmap( pPixmap );
 }
 
-
 void NWPixmapCacheList::AddCache( NWPixmapCache* pCache )
 {
     mCaches.push_back( pCache );
 }
+
 void NWPixmapCacheList::RemoveCache( NWPixmapCache* pCache )
 {
     ::std::vector< NWPixmapCache* >::iterator p;
     if( p != mCaches.end() )
         mCaches.erase( p );
 }
+
 void NWPixmapCacheList::ThemeChanged( )
 {
     ::std::vector< NWPixmapCache* >::iterator p = mCaches.begin();
  *********************************************************/
 inline void NW_gtk_border_set_from_border( GtkBorder& aDst, const GtkBorder * pSrc )
 {
-	aDst.left		= pSrc->left;
-	aDst.top		= pSrc->top;
-	aDst.right	= pSrc->right;
-	aDst.bottom	= pSrc->bottom;
+    aDst.left       = pSrc->left;
+    aDst.top        = pSrc->top;
+    aDst.right  = pSrc->right;
+    aDst.bottom = pSrc->bottom;
 }
 
 
  */
 BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
 {
-	if (
-		((nType==CTRL_PUSHBUTTON)  && (nPart==PART_ENTIRE_CONTROL)) 	||
- 		((nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL))		||
-		((nType==CTRL_CHECKBOX)    && (nPart==PART_ENTIRE_CONTROL))		||
-		((nType==CTRL_SCROLLBAR) &&
-				(  (nPart==PART_DRAW_BACKGROUND_HORZ)
-				|| (nPart==PART_DRAW_BACKGROUND_VERT)
-				|| (nPart==PART_ENTIRE_CONTROL)
-                || (nPart==HAS_THREE_BUTTONS) )  				)	||
-		((nType==CTRL_EDITBOX) &&
-				(  (nPart==PART_ENTIRE_CONTROL)
-				|| (nPart==HAS_BACKGROUND_TEXTURE) ) 			)	||
-		((nType==CTRL_MULTILINE_EDITBOX) &&
-				(  (nPart==PART_ENTIRE_CONTROL)
-				|| (nPart==HAS_BACKGROUND_TEXTURE) ) 			)	||
-		((nType==CTRL_SPINBOX) &&
-				(  (nPart==PART_ENTIRE_CONTROL)
-				|| (nPart==PART_ALL_BUTTONS)
-				|| (nPart==HAS_BACKGROUND_TEXTURE) )			)	||
-		((nType==CTRL_SPINBUTTONS) &&
-				(  (nPart==PART_ENTIRE_CONTROL)
-				|| (nPart==PART_ALL_BUTTONS)	)				)	||
-		((nType==CTRL_COMBOBOX) &&
-				(  (nPart==PART_ENTIRE_CONTROL)
-				|| (nPart==HAS_BACKGROUND_TEXTURE)	)			)	||
-		(((nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) ||
-		  (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER)) &&
-				(  (nPart==PART_ENTIRE_CONTROL)
-				|| (nPart==PART_TABS_DRAW_RTL) )				)	||
+    if (
+        ((nType==CTRL_PUSHBUTTON)  && (nPart==PART_ENTIRE_CONTROL))     ||
+        ((nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL))     ||
+        ((nType==CTRL_CHECKBOX)    && (nPart==PART_ENTIRE_CONTROL))     ||
+        ((nType==CTRL_SCROLLBAR) &&
+                (  (nPart==PART_DRAW_BACKGROUND_HORZ)
+                || (nPart==PART_DRAW_BACKGROUND_VERT)
+                || (nPart==PART_ENTIRE_CONTROL)
+                || (nPart==HAS_THREE_BUTTONS) )                 )   ||
+        ((nType==CTRL_EDITBOX) &&
+                (  (nPart==PART_ENTIRE_CONTROL)
+                || (nPart==HAS_BACKGROUND_TEXTURE) )            )   ||
+        ((nType==CTRL_MULTILINE_EDITBOX) &&
+                (  (nPart==PART_ENTIRE_CONTROL)
+                || (nPart==HAS_BACKGROUND_TEXTURE) )            )   ||
+        ((nType==CTRL_SPINBOX) &&
+                (  (nPart==PART_ENTIRE_CONTROL)
+                || (nPart==PART_ALL_BUTTONS)
+                || (nPart==HAS_BACKGROUND_TEXTURE) )            )   ||
+        ((nType==CTRL_SPINBUTTONS) &&
+                (  (nPart==PART_ENTIRE_CONTROL)
+                || (nPart==PART_ALL_BUTTONS)    )               )   ||
+        ((nType==CTRL_COMBOBOX) &&
+                (  (nPart==PART_ENTIRE_CONTROL)
+                || (nPart==HAS_BACKGROUND_TEXTURE)  )           )   ||
+        (((nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) ||
+          (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER)) &&
+                (  (nPart==PART_ENTIRE_CONTROL)
+                || (nPart==PART_TABS_DRAW_RTL) )                )   ||
         ((nType==CTRL_LISTBOX) &&
                 (  (nPart==PART_ENTIRE_CONTROL)
                 || (nPart==PART_WINDOW)
                 || (nPart==HAS_BACKGROUND_TEXTURE) )            )   ||
         ((nType == CTRL_TOOLBAR) &&
-         		(	(nPart==PART_ENTIRE_CONTROL)
+                (   (nPart==PART_ENTIRE_CONTROL)
                 ||  (nPart==PART_DRAW_BACKGROUND_HORZ)
                 ||  (nPart==PART_DRAW_BACKGROUND_VERT)
                 ||  (nPart==PART_THUMB_HORZ)
                 )
         )
         )
-		return( TRUE );
-
-	return( FALSE );
+        return( TRUE );
+
+    return( FALSE );
 }
 
 
  *
  *  returns whether bIsInside was really set.
  */
-BOOL GtkSalGraphics::hitTestNativeControl( ControlType		nType,
-								ControlPart		nPart,
-								const Region&		rControlRegion,
-								const Point&		aPos,
-								SalControlHandle&,
-								BOOL&			rIsInside )
+BOOL GtkSalGraphics::hitTestNativeControl( ControlType      nType,
+                                ControlPart     nPart,
+                                const Region&       rControlRegion,
+                                const Point&        aPos,
+                                SalControlHandle&,
+                                BOOL&           rIsInside )
 {
     if ( ( nType == CTRL_SCROLLBAR ) &&
          ( ( nPart == PART_BUTTON_UP ) ||
         gboolean has_backward;
         gboolean has_backward2;
         
-	    gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward,
-									    "has-secondary-forward-stepper", &has_forward2,
-									    "has-backward-stepper", &has_backward,
-	   								    "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
+        gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward,
+                                        "has-secondary-forward-stepper", &has_forward2,
+                                        "has-backward-stepper", &has_backward,
+                                        "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
         Rectangle aForward;
         Rectangle aBackward;
 
     }
 
     if( IsNativeControlSupported(nType, nPart) )
-	{
-		rIsInside = rControlRegion.IsInside( aPos );
-		return( TRUE );
-	}
-	else
-	{
-		return( FALSE );
-	}
+    {
+        rIsInside = rControlRegion.IsInside( aPos );
+        return( TRUE );
+    }
+    else
+    {
+        return( FALSE );
+    }
 }
 
 
  *
  *  Draws the requested control described by nPart/nState.
  *
- *  rControlRegion:	The bounding region of the complete control in VCL frame coordinates.
- *  aValue:  		An optional value (tristate/numerical/string)
- *  rControlHandle:	Carries platform dependent data and is maintained by the SalFrame implementation.
- *  rCaption:  	A caption or title string (like button text etc)
+ *  rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ *  aValue:         An optional value (tristate/numerical/string)
+ *  rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation.
+ *  rCaption:   A caption or title string (like button text etc)
  */
-BOOL GtkSalGraphics::drawNativeControl(	ControlType nType,
-							ControlPart nPart,
-							const Region& rControlRegion,
-							ControlState nState,
-							const ImplControlValue& aValue,
-							SalControlHandle& rControlHandle,
-							const OUString& rCaption )
+BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
+                            ControlPart nPart,
+                            const Region& rControlRegion,
+                            ControlState nState,
+                            const ImplControlValue& aValue,
+                            SalControlHandle& rControlHandle,
+                            const OUString& rCaption )
 {
     if( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) &&
         aValue.getTristateVal() == BUTTONVALUE_MIXED )
         return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rControlHandle, rCaption );
     }
 
-	BOOL			returnVal = FALSE;
-	// get a GC with current clipping region set
+    BOOL            returnVal = FALSE;
+    // get a GC with current clipping region set
     SelectFont();
     
     
     }
     else if ( (nType == CTRL_COMBOBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_BUTTON_DOWN)) )
     {
-        returnVal = NWPaintGTKComboBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption );
+        returnVal = NWPaintGTKComboBoxEntry( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rControlHandle, rCaption );
     }
     else if ( (nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) || (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER) )
     {
         g_object_unref( pixmap );
     }
 
-	return( returnVal );
+    return( returnVal );
 }
 
-BOOL GtkSalGraphics::drawNativeMixedStateCheck(	ControlType nType,
-							                    ControlPart nPart,
+BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
+                                                ControlPart nPart,
                                                 const Region& rControlRegion,
                                                 ControlState nState,
                                                 const ImplControlValue& aValue,
     bNeedPixmapPaint = true;
     
     Rectangle aCtrlRect = rControlRegion.GetBoundRect();
-	BOOL      returnVal = FALSE;
+    BOOL      returnVal = FALSE;
     SelectFont();
 
     // draw upper half in off state
  *  OPTIONAL.  Draws the requested text for the control described by nPart/nState.
  *     Used if text not drawn by DrawNativeControl().
  *
- *  rControlRegion:	The bounding region of the complete control in VCL frame coordinates.
- *  aValue:  		An optional value (tristate/numerical/string)
- *  rControlHandle:	Carries platform dependent data and is maintained by the SalFrame implementation.
- *  rCaption:  	A caption or title string (like button text etc)
+ *  rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ *  aValue:         An optional value (tristate/numerical/string)
+ *  rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation.
+ *  rCaption:   A caption or title string (like button text etc)
  */
-BOOL GtkSalGraphics::drawNativeControlText(	ControlType,
-								ControlPart,
-								const Region&,
-								ControlState,
-								const ImplControlValue&,
-								SalControlHandle&,
-								const OUString& )
+BOOL GtkSalGraphics::drawNativeControlText( ControlType,
+                                ControlPart,
+                                const Region&,
+                                ControlState,
+                                const ImplControlValue&,
+                                SalControlHandle&,
+                                const OUString& )
 {
-	return( FALSE );
+    return( FALSE );
 }
 
 
  *  within the control that can be safely drawn into without drawing over
  *  the borders of the control.
  *
- *  rControlRegion:	The bounding region of the control in VCL frame coordinates.
- *  aValue:		An optional value (tristate/numerical/string)
- *  rControlHandle:	Carries platform dependent data and is maintained by the SalFrame implementation.
- *  rCaption:		A caption or title string (like button text etc)
+ *  rControlRegion: The bounding region of the control in VCL frame coordinates.
+ *  aValue:     An optional value (tristate/numerical/string)
+ *  rControlHandle: Carries platform dependent data and is maintained by the SalFrame implementation.
+ *  rCaption:       A caption or title string (like button text etc)
  */
 BOOL GtkSalGraphics::getNativeControlRegion(  ControlType nType,
-								ControlPart nPart,
-								const Region& rControlRegion,
-								ControlState nState,
-								const ImplControlValue& aValue,
-								SalControlHandle& rControlHandle,
-								const OUString& rCaption,
-								Region &rNativeBoundingRegion,
-								Region &rNativeContentRegion )
+                                ControlPart nPart,
+                                const Region& rControlRegion,
+                                ControlState nState,
+                                const ImplControlValue& aValue,
+                                SalControlHandle& rControlHandle,
+                                const OUString& rCaption,
+                                Region &rNativeBoundingRegion,
+                                Region &rNativeContentRegion )
 {
-	BOOL returnVal = FALSE;
+    BOOL returnVal = FALSE;
 
     if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)
         && (rControlRegion.GetBoundRect().GetWidth() > 16)
         
         returnVal = TRUE;
     }
-    if ( (nType==CTRL_COMBOBOX || nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
+    if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
+    {
+        rNativeBoundingRegion = NWGetComboBoxEntryButtonRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState,
+        aValue, rControlHandle, rCaption );
+        rNativeContentRegion = rNativeBoundingRegion;
+        
+        returnVal = TRUE;
+    }
+    if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
     {
         rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState,
         aValue, rControlHandle, rCaption );
         returnVal = TRUE;
     }
     if ( (nType==CTRL_TOOLBAR) &&
-        ((nPart==PART_DRAW_BACKGROUND_HORZ)	||
-        (nPart==PART_DRAW_BACKGROUND_VERT)	||
-        (nPart==PART_THUMB_HORZ)			||
+        ((nPart==PART_DRAW_BACKGROUND_HORZ) ||
+        (nPart==PART_DRAW_BACKGROUND_VERT)  ||
+        (nPart==PART_THUMB_HORZ)            ||
         (nPart==PART_THUMB_VERT)            ||
         (nPart==PART_BUTTON)
         ))
         returnVal = TRUE;
     }
         
-	return( returnVal );
+    return( returnVal );
 }
 
 
 BOOL GtkSalGraphics::NWPaintGTKButton(
             GdkDrawable* gdkDrawable,
             ControlType, ControlPart,
-			const Rectangle& rControlRectangle,            
+            const Rectangle& rControlRectangle,            
             const clipList& rClipList,
             ControlState nState, const ImplControlValue&,
-			SalControlHandle&, const OUString& )
+            SalControlHandle&, const OUString& )
 {
-	GtkStateType	stateType;
-	GtkShadowType	shadowType;
-	gboolean		interiorFocus;
-	gint			focusWidth;
-	gint			focusPad;
-	BOOL			bDrawFocus = TRUE;
-	gint			x, y, w, h;
-	GtkBorder		aDefBorder;
-	GtkBorder*		pBorder;
-    GdkRectangle	clipRect;
+    GtkStateType    stateType;
+    GtkShadowType   shadowType;
+    gboolean        interiorFocus;
+    gint            focusWidth;
+    gint            focusPad;
+    BOOL            bDrawFocus = TRUE;
+    gint            x, y, w, h;
+    GtkBorder       aDefBorder;
+    GtkBorder*      pBorder;
+    GdkRectangle    clipRect;
     
-	NWEnsureGTKButton( m_nScreen );
-	NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
-
-	x = rControlRectangle.Left();
+    NWEnsureGTKButton( m_nScreen );
+    NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+
+    x = rControlRectangle.Left();
     y = rControlRectangle.Top();
-	w = rControlRectangle.GetWidth();
-	h = rControlRectangle.GetHeight();
-
-	// Grab some button style attributes
-	gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget,	"focus-line-width",	&focusWidth,
-								"focus-padding", 	&focusPad,
-					 			"interior_focus",	&interiorFocus,
-								"default_border",	&pBorder,
-								(char *)NULL );
-
-	// Make sure the border values exist, otherwise use some defaults
-	if ( pBorder )
-	{
-		NW_gtk_border_set_from_border( aDefBorder, pBorder );
-		gtk_border_free( pBorder );
-	}
-	else NW_gtk_border_set_from_border( aDefBorder, &aDefDefBorder );
-
-	// If the button is too small, don't ever draw focus or grab more space
-	if ( (w < 16) || (h < 16) )
-		bDrawFocus = FALSE;
-
-	NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
+    w = rControlRectangle.GetWidth();
+    h = rControlRectangle.GetHeight();
+
+    // Grab some button style attributes
+    gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget,    "focus-line-width", &focusWidth,
+                                "focus-padding",    &focusPad,
+                                "interior_focus",   &interiorFocus,
+                                "default_border",   &pBorder,
+                                (char *)NULL );
+
+    // Make sure the border values exist, otherwise use some defaults
+    if ( pBorder )
+    {
+        NW_gtk_border_set_from_border( aDefBorder, pBorder );
+        gtk_border_free( pBorder );
+    }
+    else NW_gtk_border_set_from_border( aDefBorder, &aDefDefBorder );
+
+    // If the button is too small, don't ever draw focus or grab more space
+    if ( (w < 16) || (h < 16) )
+        bDrawFocus = FALSE;
+
+    NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
 
     gint xi = x, yi = y, wi = w, hi = h;
-	if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
-	{
-		xi += aDefBorder.left;
-		yi += aDefBorder.top;
-		wi -= aDefBorder.left + aDefBorder.right;
-		hi -= aDefBorder.top + aDefBorder.bottom;
-	}
-
-	if ( !interiorFocus && bDrawFocus )
-	{
-		xi += focusWidth + focusPad;
-		yi += focusWidth + focusPad;
-		wi -= 2 * (focusWidth + focusPad);
-		hi -= 2 * (focusWidth + focusPad);
-	}
+    if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
+    {
+        xi += aDefBorder.left;
+        yi += aDefBorder.top;
+        wi -= aDefBorder.left + aDefBorder.right;
+        hi -= aDefBorder.top + aDefBorder.bottom;
+    }
+
+    if ( !interiorFocus && bDrawFocus )
+    {
+        xi += focusWidth + focusPad;
+        yi += focusWidth + focusPad;
+        wi -= 2 * (focusWidth + focusPad);
+        hi -= 2 * (focusWidth + focusPad);
+    }
 
     for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it)
     {
         
         if ( (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief != GTK_RELIEF_NONE)
             || (nState & CTRL_STATE_PRESSED)
-		    || (nState & CTRL_STATE_ROLLOVER) )
+            || (nState & CTRL_STATE_ROLLOVER) )
         {
             gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType,
                            &clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi );
         }
     }
 #if 0 // VCL draws focus rects
-	// Draw focus rect
-	if ( (nState & CTRL_STATE_FOCUSED) && (nState & CTRL_STATE_ENABLED) && bDrawFocus )
-	{
-		if (interiorFocus)
-		{
-			x += gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad;
-			y += gWidgetData[m_nScreen].gBtnWidget->style->ythickness + focusPad;
-			w -= 2 * (gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad);
-			h -=  2 * (gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad);
-		}
-		else
-		{
-			x -= focusWidth + focusPad;
-			y -= focusWidth + focusPad;
-			w += 2 * (focusWidth + focusPad);
-			h += 2 * (focusWidth + focusPad);
-		}
-		if ( !interiorFocus )
-			gtk_paint_focus( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, &clipRect,
+    // Draw focus rect
+    if ( (nState & CTRL_STATE_FOCUSED) && (nState & CTRL_STATE_ENABLED) && bDrawFocus )
+    {
+        if (interiorFocus)
+        {
+            x += gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad;
+            y += gWidgetData[m_nScreen].gBtnWidget->style->ythickness + focusPad;
+            w -= 2 * (gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad);
+            h -=  2 * (gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad);
+        }
+        else
+        {
+            x -= focusWidth + focusPad;
+            y -= focusWidth + focusPad;
+            w += 2 * (focusWidth + focusPad);
+            h += 2 * (focusWidth + focusPad);
+        }
+        if ( !interiorFocus )
+            gtk_paint_focus( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, &clipRect,
                              gWidgetData[m_nScreen].gBtnWidget, "button", x, y, w, h );
-	}
+    }
 #endif
 
-	return( TRUE );
+    return( TRUE );
 }
 
 static Rectangle NWGetButtonArea( int nScreen,
                                   ControlType, ControlPart, Rectangle aAreaRect, ControlState nState,
-							      const ImplControlValue&, SalControlHandle&, const OUString& )
+                                  const ImplControlValue&, SalControlHandle&, const OUString& )
 {
-	gboolean		interiorFocus;
-	gint			focusWidth;
-	gint			focusPad;
-	GtkBorder		aDefBorder;
-	GtkBorder *	pBorder;
-	BOOL			bDrawFocus = TRUE;
-	Rectangle		aRect;
-	gint			x, y, w, h;
-
-	NWEnsureGTKButton( nScreen );
-	gtk_widget_style_get( gWidgetData[nScreen].gBtnWidget,
-                            	"focus-line-width",	&focusWidth,
-								"focus-padding", 	&focusPad,
-					 			"interior_focus",	&interiorFocus,
-								"default_border",	&pBorder,
-								(char *)NULL );
-
-	// Make sure the border values exist, otherwise use some defaults
-	if ( pBorder )
-	{
-		NW_gtk_border_set_from_border( aDefBorder, pBorder );
-		gtk_border_free( pBorder );
-	}
-	else NW_gtk_border_set_from_border( aDefBorder, &aDefDefBorder );
-
-	x = aAreaRect.Left();
-	y = aAreaRect.Top();
-	w = aAreaRect.GetWidth();
-	h = aAreaRect.GetHeight();
-
-	// If the button is too small, don't ever draw focus or grab more space
-	if ( (w < 16) || (h < 16) )
-		bDrawFocus = FALSE;
-
-	if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
-	{
-		x -= aDefBorder.left;
-		y -= aDefBorder.top;
-		w += aDefBorder.left + aDefBorder.right;
-		h += aDefBorder.top + aDefBorder.bottom;
-	}
+    gboolean        interiorFocus;
+    gint            focusWidth;
+    gint            focusPad;
+    GtkBorder       aDefBorder;
+    GtkBorder * pBorder;
+    BOOL            bDrawFocus = TRUE;
+    Rectangle       aRect;
+    gint            x, y, w, h;
+
+    NWEnsureGTKButton( nScreen );
+    gtk_widget_style_get( gWidgetData[nScreen].gBtnWidget,
+                                "focus-line-width", &focusWidth,
+                                "focus-padding",    &focusPad,
+                                "interior_focus",   &interiorFocus,
+                                "default_border",   &pBorder,
+                                (char *)NULL );
+
+    // Make sure the border values exist, otherwise use some defaults
+    if ( pBorder )
+    {
+        NW_gtk_border_set_from_border( aDefBorder, pBorder );
+        gtk_border_free( pBorder );
+    }
+    else NW_gtk_border_set_from_border( aDefBorder, &aDefDefBorder );
+
+    x = aAreaRect.Left();
+    y = aAreaRect.Top();
+    w = aAreaRect.GetWidth();
+    h = aAreaRect.GetHeight();
+
+    // If the button is too small, don't ever draw focus or grab more space
+    if ( (w < 16) || (h < 16) )
+        bDrawFocus = FALSE;
+
+    if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
+    {
+        x -= aDefBorder.left;
+        y -= aDefBorder.top;
+        w += aDefBorder.left + aDefBorder.right;
+        h += aDefBorder.top + aDefBorder.bottom;
+    }
 
     aRect = Rectangle( Point( x, y ), Size( w, h ) );
 
-	return( aRect );
+    return( aRect );
 }
 
 //-------------------------------------
                                       const ImplControlValue& aValue, SalControlHandle&, 
                                       const OUString& )
 {
-	GtkStateType	stateType;
-	GtkShadowType	shadowType;
-	BOOL			isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
+    GtkStateType    stateType;
+    GtkShadowType   shadowType;
+    BOOL            isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
     gint            x, y;
-    GdkRectangle	clipRect;
+    GdkRectangle    clipRect;
    
-	NWEnsureGTKButton( m_nScreen );
-	NWEnsureGTKRadio( m_nScreen );
-	NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+    NWEnsureGTKButton( m_nScreen );
+    NWEnsureGTKRadio( m_nScreen );
+    NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
 
     gint indicator_size;
     gtk_widget_style_get( gWidgetData[m_nScreen].gRadioWidget, "indicator_size", &indicator_size, (char *)NULL);
     x = rControlRectangle.Left() + (rControlRectangle.GetWidth()-indicator_size)/2;
     y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2;
     
-	// Set the shadow based on if checked or not so we get a freakin checkmark.
-	shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
-	NWSetWidgetState( gWidgetData[m_nScreen].gRadioWidget, nState, stateType );
-	NWSetWidgetState( gWidgetData[m_nScreen].gRadioWidgetSibling, nState, stateType );
-
-	// GTK enforces radio groups, so that if we don't have 2 buttons in the group,
-	// the single button will always be active.  So we have to have 2 buttons.
+    // Set the shadow based on if checked or not so we get a freakin checkmark.
+    shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
+    NWSetWidgetState( gWidgetData[m_nScreen].gRadioWidget, nState, stateType );
+    NWSetWidgetState( gWidgetData[m_nScreen].gRadioWidgetSibling, nState, stateType );
+
+    // GTK enforces radio groups, so that if we don't have 2 buttons in the group,
+    // the single button will always be active.  So we have to have 2 buttons.
     
     // #i59666# set the members directly where we should use
     // gtk_toggle_button_set_active. reason: there are animated themes
     // which are in active state only after a while leading to painting
     // intermediate states between active/inactive. Let's hope that
     // GtkToggleButtone stays binary compatible.
-	if (!isChecked)
-		GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = TRUE;
-	GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidget)->active = isChecked;
+    if (!isChecked)
+        GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = TRUE;
+    GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidget)->active = isChecked;
 
     for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
     {
                           x, y, indicator_size, indicator_size );
     }
     
-	return( TRUE );
+    return( TRUE );
 }
 
 //-------------------------------------
                                       const ImplControlValue& aValue,
                                       SalControlHandle&, const OUString& )
 {
-	GtkStateType	stateType;
-	GtkShadowType	shadowType;
-	BOOL			isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE;
-    GdkRectangle	clipRect;
-    gint			x,y;
-
-	NWEnsureGTKButton( m_nScreen );
-	NWEnsureGTKCheck( m_nScreen );
-	NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+    GtkStateType    stateType;
+    GtkShadowType   shadowType;
+    BOOL            isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE;
+    GdkRectangle    clipRect;
+    gint            x,y;
+
+    NWEnsureGTKButton( m_nScreen );
+    NWEnsureGTKCheck( m_nScreen );
+    NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
 
     gint indicator_size;
     gtk_widget_style_get( gWidgetData[m_nScreen].gCheckWidget, "indicator_size", &indicator_size, (char *)NULL);
     x = rControlRectangle.Left() + (rControlRectangle.GetWidth()-indicator_size)/2;
     y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2;
     
-	// Set the shadow based on if checked or not so we get a checkmark.
-	shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
-	NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType );
-	GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked;
+    // Set the shadow based on if checked or not so we get a checkmark.
+    shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
+    NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType );
+    GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked;
 
     for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
     {
                          x, y, indicator_size, indicator_size );
     }
 
-	return( TRUE );
+    return( TRUE );
 }
 
 //-------------------------------------
 static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow )
 {
-	// Size the arrow appropriately
+    // Size the arrow appropriately
     Size aSize( rButton.GetWidth()/2, rButton.GetHeight()/2 );
     rArrow.SetSize( aSize );
 
-	rArrow.SetPos( Point(
+    rArrow.SetPos( Point(
         rButton.Left() + ( rButton.GetWidth()  - rArrow.GetWidth()  ) / 2,
         rButton.Top() + ( rButton.GetHeight() - rArrow.GetHeight() ) / 2
         ) );
                                           const ImplControlValue& aValue, SalControlHandle&, 
                                           const OUString& )
 {
-	ScrollbarValue* pScrollbarVal = (ScrollbarValue *)(aValue.getOptionalVal());
+    ScrollbarValue* pScrollbarVal = (ScrollbarValue *)(aValue.getOptionalVal());
     GdkPixmap*      pixmap = NULL;
-	Rectangle		pixmapRect, scrollbarRect;
-	GtkStateType	stateType;
-	GtkShadowType	shadowType;
-	GtkScrollbar *	scrollbarWidget;
-	GtkStyle *	style;
-	GtkAdjustment* scrollbarValues = NULL;
-	GtkOrientation	scrollbarOrientation;
-	Rectangle		thumbRect = pScrollbarVal->maThumbRect;
-	Rectangle		button11BoundRect = pScrollbarVal->maButton1Rect;   // backward
-	Rectangle		button22BoundRect = pScrollbarVal->maButton2Rect;   // forward
-	Rectangle		button12BoundRect = pScrollbarVal->maButton1Rect;   // secondary forward
-	Rectangle		button21BoundRect = pScrollbarVal->maButton2Rect;   // secondary backward
-	GtkArrowType	button1Type;                                        // backward
-	GtkArrowType	button2Type;                                        // forward
-	gchar *		scrollbarTagH = (gchar *) "hscrollbar";
-	gchar *		scrollbarTagV = (gchar *) "vscrollbar";
-	gchar *		scrollbarTag = NULL;
-	Rectangle		arrowRect;
-	gint			slider_width = 0;
-	gint			stepper_size = 0;
-	gint			stepper_spacing = 0;
-	gint			trough_border = 0;
-	gint			min_slider_length = 0;
-	gint			vShim = 0;
-	gint			hShim = 0;
-	gint			x,y,w,h;
+    Rectangle       pixmapRect, scrollbarRect;
+    GtkStateType    stateType;
+    GtkShadowType   shadowType;
+    GtkScrollbar *  scrollbarWidget;
+    GtkStyle *  style;
+    GtkAdjustment* scrollbarValues = NULL;
+    GtkOrientation  scrollbarOrientation;
+    Rectangle       thumbRect = pScrollbarVal->maThumbRect;
+    Rectangle       button11BoundRect = pScrollbarVal->maButton1Rect;   // backward
+    Rectangle       button22BoundRect = pScrollbarVal->maButton2Rect;   // forward
+    Rectangle       button12BoundRect = pScrollbarVal->maButton1Rect;   // secondary forward
+    Rectangle       button21BoundRect = pScrollbarVal->maButton2Rect;   // secondary backward
+    GtkArrowType    button1Type;                                        // backward
+    GtkArrowType    button2Type;                                        // forward
+    gchar *     scrollbarTagH = (gchar *) "hscrollbar";
+    gchar *     scrollbarTagV = (gchar *) "vscrollbar";
+    gchar *     scrollbarTag = NULL;
+    Rectangle       arrowRect;
+    gint            slider_width = 0;
+    gint            stepper_size = 0;
+    gint            stepper_spacing = 0;
+    gint            trough_border = 0;
+    gint            min_slider_length = 0;
+    gint            vShim = 0;
+    gint            hShim = 0;
+    gint            x,y,w,h;
     
     // make controlvalue rectangles relative to area
     thumbRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() );
     button12BoundRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() );
     button21BoundRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() );
 
-	NWEnsureGTKButton( m_nScreen );
-	NWEnsureGTKScrollbars( m_nScreen );
-	NWEnsureGTKArrow( m_nScreen );
+    NWEnsureGTKButton( m_nScreen );
+    NWEnsureGTKScrollbars( m_nScreen );
+    NWEnsureGTKArrow( m_nScreen );
  
-	// Find the overall bounding rect of the control
-	pixmapRect = rControlRectangle;
+    // Find the overall bounding rect of the control
+    pixmapRect = rControlRectangle;
     pixmapRect.SetSize( Size( pixmapRect.GetWidth() + 1,
                               pixmapRect.GetHeight() + 1 ) );
-	scrollbarRect = pixmapRect;
-
-	if ( (scrollbarRect.GetWidth() <= 1) || (scrollbarRect.GetHeight() <= 1) )
-		return( TRUE );
-
-	// Grab some button style attributes
-	gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget,
+    scrollbarRect = pixmapRect;
+
+    if ( (scrollbarRect.GetWidth() <= 1) || (scrollbarRect.GetHeight() <= 1) )
+        return( TRUE );
+
+    // Grab some button style attributes
+    gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget,
                                       "slider_width", &slider_width,
-									  "stepper_size", &stepper_size,
-									  "trough_border", &trough_border,
-									  "stepper_spacing", &stepper_spacing,
-									  "min_slider_length", &min_slider_length, (char *)NULL );
+                                      "stepper_size", &stepper_size,
+                                      "trough_border", &trough_border,
+                                      "stepper_spacing", &stepper_spacing,
+                                      "min_slider_length", &min_slider_length, (char *)NULL );
     gboolean has_forward;
     gboolean has_forward2;
     gboolean has_backward;
     gboolean has_backward2;
     
-	gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward,
-									  "has-secondary-forward-stepper", &has_forward2,
-									  "has-backward-stepper", &has_backward,
-	   								  "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
-	gint magic = trough_border ? 1 : 0;
+    gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward,
+                                      "has-secondary-forward-stepper", &has_forward2,
+                                      "has-backward-stepper", &has_backward,
+                                      "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
+    gint magic = trough_border ? 1 : 0;
     gint nFirst = 0;
 
     if ( has_backward )  nFirst  += 1;
     if ( has_forward2 )  nFirst  += 1;
 
-	if ( nPart == PART_DRAW_BACKGROUND_HORZ )
-	{
-		unsigned int sliderHeight = slider_width + (trough_border * 2);
-		vShim = (pixmapRect.GetHeight() - sliderHeight) / 2;
-
-		scrollbarRect.Move( 0, vShim );
-		scrollbarRect.SetSize( Size( scrollbarRect.GetWidth(), sliderHeight ) );
-
-		scrollbarWidget = GTK_SCROLLBAR( gWidgetData[m_nScreen].gScrollHorizWidget );
-		scrollbarOrientation = GTK_ORIENTATION_HORIZONTAL;
-		scrollbarTag = scrollbarTagH;
-		button1Type = GTK_ARROW_LEFT;
-		button2Type = GTK_ARROW_RIGHT;
+    if ( nPart == PART_DRAW_BACKGROUND_HORZ )
+    {
+        unsigned int sliderHeight = slider_width + (trough_border * 2);
+        vShim = (pixmapRect.GetHeight() - sliderHeight) / 2;
+
+        scrollbarRect.Move( 0, vShim );
+        scrollbarRect.SetSize( Size( scrollbarRect.GetWidth(), sliderHeight ) );
+
+        scrollbarWidget = GTK_SCROLLBAR( gWidgetData[m_nScreen].gScrollHorizWidget );
+        scrollbarOrientation = GTK_ORIENTATION_HORIZONTAL;
+        scrollbarTag = scrollbarTagH;
+        button1Type = GTK_ARROW_LEFT;
+        button2Type = GTK_ARROW_RIGHT;
 
         if ( has_backward )
         {
         button21BoundRect.SetSize( Size( stepper_size, slider_width ) );
         button22BoundRect.SetSize( Size( stepper_size, slider_width ) );
 
-		thumbRect.Bottom() = thumbRect.Top() + slider_width - 1;
-		// Make sure the thumb is at least the default width (so we don't get tiny thumbs),
-		// but if the VCL gives us a size smaller than the theme's default thumb size,
-		// honor the VCL size
+        thumbRect.Bottom() = thumbRect.Top() + slider_width - 1;
+        // Make sure the thumb is at least the default width (so we don't get tiny thumbs),
+        // but if the VCL gives us a size smaller than the theme's default thumb size,
+        // honor the VCL size
 #if 0
-		if ( (thumbRect.GetWidth() < min_slider_length)
-			&& ((scrollbarRect.GetWidth()-button1BoundRect.GetWidth()-button2BoundRect.GetWidth()) > min_slider_length) )
-			thumbRect.SetSize( Size( min_slider_length, thumbRect.GetHeight() ) );
+        if ( (thumbRect.GetWidth() < min_slider_length)
+            && ((scrollbarRect.GetWidth()-button1BoundRect.GetWidth()-button2BoundRect.GetWidth()) > min_slider_length) )
+            thumbRect.SetSize( Size( min_slider_length, thumbRect.GetHeight() ) );
 #endif
 
         thumbRect.Right() += magic;
-		// Center vertically in the track
-		thumbRect.Move( 0, (scrollbarRect.GetHeight() - slider_width) / 2 );
-	}
-	else
-	{
-		unsigned int sliderWidth = slider_width + (trough_border * 2);
-		hShim = (pixmapRect.GetWidth() - sliderWidth) / 2;
-
-		scrollbarRect.Move( hShim, 0 );
-		scrollbarRect.SetSize( Size( sliderWidth, scrollbarRect.GetHeight() ) );
-
-		scrollbarWidget = GTK_SCROLLBAR( gWidgetData[m_nScreen].gScrollVertWidget );
-		scrollbarOrientation = GTK_ORIENTATION_VERTICAL;
-		scrollbarTag = scrollbarTagV;
-		button1Type = GTK_ARROW_UP;
-		button2Type = GTK_ARROW_DOWN;
+        // Center vertically in the track
+        thumbRect.Move( 0, (scrollbarRect.GetHeight() - slider_width) / 2 );
+    }
+    else
+    {
+        unsigned int sliderWidth = slider_width + (trough_border * 2);
+        hShim = (pixmapRect.GetWidth() - sliderWidth) / 2;
+
+        scrollbarRect.Move( hShim, 0 );
+        scrollbarRect.SetSize( Size( sliderWidth, scrollbarRect.GetHeight() ) );
+
+        scrollbarWidget = GTK_SCROLLBAR( gWidgetData[m_nScreen].gScrollVertWidget );
+        scrollbarOrientation = GTK_ORIENTATION_VERTICAL;
+        scrollbarTag = scrollbarTagV;
+        button1Type = GTK_ARROW_UP;
+        button2Type = GTK_ARROW_DOWN;
 
         if ( has_backward )
         {
         }
         button11BoundRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, trough_border );
         button11BoundRect.SetSize( Size( slider_width, stepper_size ) );
-		button12BoundRect.SetSize( Size( slider_width, stepper_size ) );
+        button12BoundRect.SetSize( Size( slider_width, stepper_size ) );
 
         if ( has_backward2 )
         {
         button21BoundRect.SetSize( Size( slider_width, stepper_size ) );
         button22BoundRect.SetSize( Size( slider_width, stepper_size ) );
 
-		thumbRect.Right() = thumbRect.Left() + slider_width - 1;
+        thumbRect.Right() = thumbRect.Left() + slider_width - 1;
 #if 0
-		// Make sure the thumb is at least the default width (so we don't get tiny thumbs),
-		// but if the VCL gives us a size smaller than the theme's default thumb size,
-		// honor the VCL size
-		if ( (thumbRect.GetHeight() < min_slider_length)
-			&& ((scrollbarRect.GetHeight()-button1BoundRect.GetHeight()-button2BoundRect.GetHeight()) > min_slider_length) )
-			thumbRect.SetSize( Size( thumbRect.GetWidth(), min_slider_length ) );
+        // Make sure the thumb is at least the default width (so we don't get tiny thumbs),
+        // but if the VCL gives us a size smaller than the theme's default thumb size,
+        // honor the VCL size
+        if ( (thumbRect.GetHeight() < min_slider_length)
+            && ((scrollbarRect.GetHeight()-button1BoundRect.GetHeight()-button2BoundRect.GetHeight()) > min_slider_length) )
+            thumbRect.SetSize( Size( thumbRect.GetWidth(), min_slider_length ) );
 #endif
 
         thumbRect.Bottom() += magic;
-		// Center horizontally in the track
-		thumbRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, 0 );
-	}
+        // Center horizontally in the track
+        thumbRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, 0 );
+    }
 
     BOOL has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 );
 
-	scrollbarValues = gtk_range_get_adjustment( GTK_RANGE(scrollbarWidget) );
-	if ( scrollbarValues == NULL )
-		scrollbarValues = GTK_ADJUSTMENT( gtk_adjustment_new(0, 0, 0, 0, 0, 0) );
-	if ( nPart == PART_DRAW_BACKGROUND_HORZ )
-	{
-		scrollbarValues->lower = pScrollbarVal->mnMin;
-		scrollbarValues->upper = pScrollbarVal->mnMax;
-		scrollbarValues->value = pScrollbarVal->mnCur;
-		scrollbarValues->page_size = scrollbarRect.GetWidth() / 2;
-	}
-	else
-	{
-		scrollbarValues->lower = pScrollbarVal->mnMin;
-		scrollbarValues->upper = pScrollbarVal->mnMax;
-		scrollbarValues->value = pScrollbarVal->mnCur;
-		scrollbarValues->page_size = scrollbarRect.GetHeight() / 2;
-	}
-	gtk_adjustment_changed( scrollbarValues );
+    scrollbarValues = gtk_range_get_adjustment( GTK_RANGE(scrollbarWidget) );
+    if ( scrollbarValues == NULL )
+        scrollbarValues = GTK_ADJUSTMENT( gtk_adjustment_new(0, 0, 0, 0, 0, 0) );
+    if ( nPart == PART_DRAW_BACKGROUND_HORZ )
+    {
+        scrollbarValues->lower = pScrollbarVal->mnMin;
+        scrollbarValues->upper = pScrollbarVal->mnMax;
+        scrollbarValues->value = pScrollbarVal->mnCur;
+        scrollbarValues->page_size = scrollbarRect.GetWidth() / 2;
+    }
+    else
+    {
+        scrollbarValues->lower = pScrollbarVal->mnMin;
+        scrollbarValues->upper = pScrollbarVal->mnMax;
+        scrollbarValues->value = pScrollbarVal->mnCur;
+        scrollbarValues->page_size = scrollbarRect.GetHeight() / 2;
+    }
+    gtk_adjustment_changed( scrollbarValues );
     
     // as multiple paints are required for the scrollbar
     // painting them directly to the window flickers
     GdkDrawable* const &gdkDrawable = GDK_DRAWABLE( pixmap );
     GdkRectangle* gdkRect = NULL; 
 
-	NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
-	NWSetWidgetState( GTK_WIDGET(scrollbarWidget), nState, stateType );
-	NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
-	style = GTK_WIDGET( scrollbarWidget )->style;
-
-	// ----------------- TROUGH
-	gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, 
+    NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+    NWSetWidgetState( GTK_WIDGET(scrollbarWidget), nState, stateType );
+    NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
+    style = GTK_WIDGET( scrollbarWidget )->style;
+
+    // ----------------- TROUGH
+    gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, 
                         GTK_STATE_NORMAL, GTK_SHADOW_NONE, gdkRect,
                         m_pWindow, "base", x, y, 
                         w, h );
-	gtk_paint_box( style, gdkDrawable, GTK_STATE_ACTIVE, GTK_SHADOW_IN, 
+    gtk_paint_box( style, gdkDrawable, GTK_STATE_ACTIVE, GTK_SHADOW_IN, 
                    gdkRect, GTK_WIDGET(scrollbarWidget), "trough",
                    x, y,
                    scrollbarRect.GetWidth(), scrollbarRect.GetHeight() );
 
-	if ( nState & CTRL_STATE_FOCUSED )
-	{
-		gtk_paint_focus( style, gdkDrawable, GTK_STATE_ACTIVE, 
+    if ( nState & CTRL_STATE_FOCUSED )
+    {
+        gtk_paint_focus( style, gdkDrawable, GTK_STATE_ACTIVE, 
                          gdkRect, GTK_WIDGET(scrollbarWidget), "trough",
                          x, y,
                          scrollbarRect.GetWidth(), scrollbarRect.GetHeight() );
-	}
-
-	// ----------------- THUMB
+    }
+
+    // ----------------- THUMB
     if ( has_slider )
     {
-	    NWConvertVCLStateToGTKState( pScrollbarVal->mnThumbState, &stateType, &shadowType );
-	    if ( pScrollbarVal->mnThumbState & CTRL_STATE_PRESSED )  stateType = GTK_STATE_PRELIGHT;
-	    gtk_paint_slider( style, gdkDrawable, stateType, GTK_SHADOW_OUT, 
+        NWConvertVCLStateToGTKState( pScrollbarVal->mnThumbState, &stateType, &shadowType );
+        if ( pScrollbarVal->mnThumbState & CTRL_STATE_PRESSED )  stateType = GTK_STATE_PRELIGHT;
+        gtk_paint_slider( style, gdkDrawable, stateType, GTK_SHADOW_OUT, 
                         gdkRect, GTK_WIDGET(scrollbarWidget), "slider",
                         x+hShim+thumbRect.Left(), y+vShim+thumbRect.Top(), 
                         thumbRect.GetWidth(), thumbRect.GetHeight(), scrollbarOrientation );
     }
-	// ----------------- BUTTON 1 //
-	if ( has_backward )
-	{
+    // ----------------- BUTTON 1 //
+    if ( has_backward )
+    {
         NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
-        if ( stateType == GTK_STATE_INSENSITIVE )	stateType = GTK_STATE_NORMAL;
+        if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
         gtk_paint_box( style, gdkDrawable, stateType, shadowType, 
                        gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
                        x+hShim+button11BoundRect.Left(), y+vShim+button11BoundRect.Top(), 
                        button11BoundRect.GetWidth(), button11BoundRect.GetHeight() );
         // ----------------- ARROW 1
-    	NWCalcArrowRect( button11BoundRect, arrowRect );
-    	gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, 
+        NWCalcArrowRect( button11BoundRect, arrowRect );
+        gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, 
                          gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
                          x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(), 
                          arrowRect.GetWidth(), arrowRect.GetHeight() );
     }
-	if ( has_forward2 )
-	{
+    if ( has_forward2 )
+    {
         NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
-        if ( stateType == GTK_STATE_INSENSITIVE )	stateType = GTK_STATE_NORMAL;
+        if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
         gtk_paint_box( style, gdkDrawable, stateType, shadowType, 
                        gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
                        x+hShim+button12BoundRect.Left(), y+vShim+button12BoundRect.Top(), 
                        button12BoundRect.GetWidth(), button12BoundRect.GetHeight() );
         // ----------------- ARROW 1
-    	NWCalcArrowRect( button12BoundRect, arrowRect );
-    	gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, 
+        NWCalcArrowRect( button12BoundRect, arrowRect );
+        gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, 
                          gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
                          x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(), 
                          arrowRect.GetWidth(), arrowRect.GetHeight() );
     }
-	// ----------------- BUTTON 2
+    // ----------------- BUTTON 2
     if ( has_backward2 )
     {
         NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
-        if ( stateType == GTK_STATE_INSENSITIVE )	stateType = GTK_STATE_NORMAL;
+        if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
         gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect, 
                        GTK_WIDGET(scrollbarWidget), "stepper",
                        x+hShim+button21BoundRect.Left(), y+vShim+button21BoundRect.Top(), 
                        button21BoundRect.GetWidth(), button21BoundRect.GetHeight() );
-    	// ----------------- ARROW 2
-    	NWCalcArrowRect( button21BoundRect, arrowRect );
+        // ----------------- ARROW 2
+        NWCalcArrowRect( button21BoundRect, arrowRect );
         gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, 
                          gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
                          x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(), 
     if ( has_forward )
     {
         NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
-        if ( stateType == GTK_STATE_INSENSITIVE )	stateType = GTK_STATE_NORMAL;
+        if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
         gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect, 
                        GTK_WIDGET(scrollbarWidget), "stepper",
                        x+hShim+button22BoundRect.Left(), y+vShim+button22BoundRect.Top(), 
                        button22BoundRect.GetWidth(), button22BoundRect.GetHeight() );
-    	// ----------------- ARROW 2
-    	NWCalcArrowRect( button22BoundRect, arrowRect );
+        // ----------------- ARROW 2
+        NWCalcArrowRect( button22BoundRect, arrowRect );
         gtk_paint_arrow( style, gdkDrawable, stateType, shadowType, 
                          gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
                          x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(), 
     }
     g_object_unref( pixmap );
  
-	return( TRUE );
+    return( TRUE );
 }
 
 //---
 
-static Rectangle NWGetScrollButtonRect(	int nScreen, ControlPart nPart, Rectangle aAreaRect )
+static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect )
 {
     gint slider_width;
     gint stepper_size;
 
     NWEnsureGTKScrollbars( nScreen );
 
-	// Grab some button style attributes
-	gtk_widget_style_get( gWidgetData[nScreen].gScrollHorizWidget,
+    // Grab some button style attributes
+    gtk_widget_style_get( gWidgetData[nScreen].gScrollHorizWidget,
                                       "slider-width", &slider_width,
-									  "stepper-size", &stepper_size,
-									  "trough-border", &trough_border,
-	   								  "stepper-spacing", &stepper_spacing, (char *)NULL );
+                                      "stepper-size", &stepper_size,
+                                      "trough-border", &trough_border,
+                                      "stepper-spacing", &stepper_spacing, (char *)NULL );
 
     gboolean has_forward;
     gboolean has_forward2;
     gboolean has_backward;
     gboolean has_backward2;
 
-	gtk_widget_style_get( gWidgetData[nScreen].gScrollHorizWidget,
+    gtk_widget_style_get( gWidgetData[nScreen].gScrollHorizWidget,
                                       "has-forward-stepper", &has_forward,
-									  "has-secondary-forward-stepper", &has_forward2,
-									  "has-backward-stepper", &has_backward,
-	   								  "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
-	gint       buttonWidth;
-	gint       buttonHeight;
-	Rectangle  buttonRect;
+                                      "has-secondary-forward-stepper", &has_forward2,
+                                      "has-backward-stepper", &has_backward,
+                                      "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
+    gint       buttonWidth;
+    gint       buttonHeight;
+    Rectangle  buttonRect;
 
     gint nFirst = 0;
     gint nSecond = 0;
 
     buttonRect.SetSize( Size( buttonWidth, buttonHeight ) );
 
-	return( buttonRect );
+    return( buttonRect );
 }
 
 //-------------------------------------
                                         const ImplControlValue& aValue, SalControlHandle& rControlHandle, 
                                         const OUString& rCaption )
 {
-	Rectangle		pixmapRect;
+    Rectangle       pixmapRect;
     GdkRectangle    clipRect;
     
-	// Find the overall bounding rect of the buttons's drawing area,
-	// plus its actual draw rect excluding adornment
-	pixmapRect = NWGetEditBoxPixmapRect( m_nScreen, nType, nPart, rControlRectangle,
-					                     nState, aValue, rControlHandle, rCaption );
+    // Find the overall bounding rect of the buttons's drawing area,
+    // plus its actual draw rect excluding adornment
+    pixmapRect = NWGetEditBoxPixmapRect( m_nScreen, nType, nPart, rControlRectangle,
+                                         nState, aValue, rControlHandle, rCaption );
     for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
     {
         clipRect.x = it->Left();
         NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rControlHandle, rCaption );
     }
 
-	return( TRUE );
+    return( TRUE );
 }
 
 
  */
 static Rectangle NWGetEditBoxPixmapRect(int nScreen,
                                         ControlType,
-								        ControlPart,
+                                        ControlPart,
                                         Rectangle aAreaRect,
                                         ControlState,
                                         const ImplControlValue&,
                                         SalControlHandle&,
                                         const OUString& )
 {
-	Rectangle		pixmapRect = aAreaRect;
-	gboolean		interiorFocus;
-	gint			focusWidth;
-
-	NWEnsureGTKEditBox( nScreen );
-
-	// Grab some entry style attributes
-	gtk_widget_style_get( gWidgetData[nScreen].gEditBoxWidget,
-                                	"focus-line-width",	&focusWidth,
-					 				"interior-focus",	&interiorFocus, (char *)NULL );
-
-	if ( !interiorFocus )
-	{
-		pixmapRect.Move( -(focusWidth), -(focusWidth) );
+    Rectangle       pixmapRect = aAreaRect;
+    gboolean        interiorFocus;
+    gint            focusWidth;
+
+    NWEnsureGTKEditBox( nScreen );
+
+    // Grab some entry style attributes
+    gtk_widget_style_get( gWidgetData[nScreen].gEditBoxWidget,
+                                    "focus-line-width", &focusWidth,
+                                    "interior-focus",   &interiorFocus, (char *)NULL );
+
+    if ( !interiorFocus )
+    {
+        pixmapRect.Move( -(focusWidth), -(focusWidth) );
         pixmapRect.SetSize( Size( pixmapRect.GetWidth() + (2*(focusWidth)),
                                   pixmapRect.GetHeight() + (2*(focusWidth)) ) );
-	}
-
-	return( pixmapRect );
+    }
+
+    return( pixmapRect );
 }
 
 
  * All coordinates should be local to the Pixmap, NOT
  * screen/window coordinates.
  */
-static void NWPaintOneEditBox(	int nScreen,
+static void NWPaintOneEditBox(  int nScreen,
                                 GdkDrawable * gdkDrawable,
-                                GdkRectangle *	gdkRect,
-                                ControlType			nType,
+                                GdkRectangle *  gdkRect,
+                                ControlType         nType,
                                 ControlPart,
-                                Rectangle				aEditBoxRect,
-                                ControlState			nState,
+                                Rectangle               aEditBoxRect,
+                                ControlState            nState,
                                 const ImplControlValue&,
                                 SalControlHandle&,
                                 const OUString& )
 {
-	GtkStateType	stateType;
-	GtkShadowType	shadowType;
-	GtkWidget      *widget;
-
-	NWEnsureGTKButton( nScreen );
-	NWEnsureGTKEditBox( nScreen );
-	NWEnsureGTKSpinButton( nScreen );
-	NWEnsureGTKComboBoxEntry( nScreen );
-	NWEnsureGTKScrolledWindow( nScreen );
-	NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+    GtkStateType    stateType;
+    GtkShadowType   shadowType;
+    GtkWidget      *widget;
+
+    NWEnsureGTKButton( nScreen );
+    NWEnsureGTKEditBox( nScreen );
+    NWEnsureGTKSpinButton( nScreen );
+    NWEnsureGTKComboBoxEntry( nScreen );
+    NWEnsureGTKScrolledWindow( nScreen );
+    NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
 
     /* border's shadowType for gtk entries is always GTK_SHADOW_IN (see gtkentry.c)
     shadowType = GTK_SHADOW_IN;
     */
     
-	switch ( nType )
-	{
-		case CTRL_SPINBOX:
-			widget = gWidgetData[nScreen].gSpinButtonWidget;
-			break;
-
+    switch ( nType )
+    {
+        case CTRL_SPINBOX:
+            widget = gWidgetData[nScreen].gSpinButtonWidget;
+            break;
         case CTRL_MULTILINE_EDITBOX:
             widget = gWidgetData[nScreen].gScrolledWindowWidget;
             break;
-		case CTRL_COMBOBOX:
-			widget = gWidgetData[nScreen].gComboBoxEntry_EntryWidget;
-			break;
-
-		default:
-			widget = gWidgetData[nScreen].gEditBoxWidget;
-			break;
-	}
-
-	if ( stateType == GTK_STATE_PRELIGHT )
-		stateType = GTK_STATE_NORMAL;
-
-	// Blueprint needs to paint entry_bg with a Button widget, not an Entry widget to get
-	// a nice white (or whatever default color) background
+        case CTRL_LISTBOX:
+        case CTRL_COMBOBOX:
+            widget = gWidgetData[nScreen].gComboBoxEntry_EntryWidget;
+            break;
+        default:
+            widget = gWidgetData[nScreen].gEditBoxWidget;
+            break;
+    }
+
+    if ( stateType == GTK_STATE_PRELIGHT )
+        stateType = GTK_STATE_NORMAL;
+
+    // Blueprint needs to paint entry_bg with a Button widget, not an Entry widget to get
+    // a nice white (or whatever default color) background
     GtkWidget* pBGWidget = widget;
     if( GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround )
     {
         NWSetWidgetState( gWidgetData[nScreen].gBtnWidget, nState, stateType );
         pBGWidget = gWidgetData[nScreen].gBtnWidget;
     }
-	NWSetWidgetState( widget, nState, stateType );
-
-	gtk_paint_flat_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE, 
+    NWSetWidgetState( widget, nState, stateType );
+
+    gtk_paint_flat_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE, 
                         gdkRect, pBGWidget, "entry_bg",
                         aEditBoxRect.Left(), aEditBoxRect.Top(), 
                         aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
-	gtk_paint_shadow( widget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, 
+    gtk_paint_shadow( widget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, 
                       gdkRect, widget, "entry",
                       aEditBoxRect.Left(), aEditBoxRect.Top(), 
                       aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
                                         const ImplControlValue& aValue,
                                         SalControlHandle& rControlHandle, const OUString& rCaption )
 {
-	GdkPixmap	*		pixmap;
-	Rectangle			pixmapRect;
-	GtkStateType		stateType;
-	GtkShadowType		shadowType;
-	SpinbuttonValue *	pSpinVal = (SpinbuttonValue *)(aValue.getOptionalVal());
-	Rectangle			upBtnRect;
-	ControlPart		upBtnPart = PART_BUTTON_UP;
-	ControlState		upBtnState = CTRL_STATE_ENABLED;
-	Rectangle			downBtnRect;
-	ControlPart		downBtnPart = PART_BUTTON_DOWN;
-	ControlState		downBtnState = CTRL_STATE_ENABLED;
-
-	NWEnsureGTKButton( m_nScreen );
-	NWEnsureGTKSpinButton( m_nScreen );
-	NWEnsureGTKArrow( m_nScreen );
-
-	NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
-
-	if ( pSpinVal )
-	{
-		upBtnPart = pSpinVal->mnUpperPart;
-		upBtnState = pSpinVal->mnUpperState;
-
-		downBtnPart = pSpinVal->mnLowerPart;
-		downBtnState = pSpinVal->mnLowerState;
-	}
-
-	// CTRL_SPINBUTTONS pass their area in pSpinVal, not in rControlRectangle
-	if ( nType == CTRL_SPINBUTTONS )
-	{
-		if ( !pSpinVal )
-		{
+    GdkPixmap   *       pixmap;
+    Rectangle           pixmapRect;
+    GtkStateType        stateType;
+    GtkShadowType       shadowType;
+    SpinbuttonValue *   pSpinVal = (SpinbuttonValue *)(aValue.getOptionalVal());
+    Rectangle           upBtnRect;
+    ControlPart     upBtnPart = PART_BUTTON_UP;
+    ControlState        upBtnState = CTRL_STATE_ENABLED;
+    Rectangle           downBtnRect;
+    ControlPart     downBtnPart = PART_BUTTON_DOWN;
+    ControlState        downBtnState = CTRL_STATE_ENABLED;
+
+    NWEnsureGTKButton( m_nScreen );
+    NWEnsureGTKSpinButton( m_nScreen );
+    NWEnsureGTKArrow( m_nScreen );
+
+    NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+
+    if ( pSpinVal )
+    {
+        upBtnPart = pSpinVal->mnUpperPart;
+        upBtnState = pSpinVal->mnUpperState;
+
+        downBtnPart = pSpinVal->mnLowerPart;
+        downBtnState = pSpinVal->mnLowerState;
+    }
+
+    // CTRL_SPINBUTTONS pass their area in pSpinVal, not in rControlRectangle
+    if ( nType == CTRL_SPINBUTTONS )
+    {
+        if ( !pSpinVal )
+        {
             std::fprintf( stderr, "Tried to draw CTRL_SPINBUTTONS, but the SpinButtons data structure didn't exist!\n" );
-			return( false );
-		}
-		pixmapRect = pSpinVal->maUpperRect;
-		pixmapRect.Union( pSpinVal->maLowerRect );
-	}
-	else
-		pixmapRect = rControlRectangle;
-
-
-	pixmap = NWGetPixmapFromScreen( pixmapRect );
-	if ( !pixmap )
-		return( FALSE );
-
-	upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rControlHandle, rCaption );
-	downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rControlHandle, rCaption );
-
-	if ( (nType==CTRL_SPINBOX) && (nPart!=PART_ALL_BUTTONS) )
-	{
-		// Draw an edit field for SpinBoxes and ComboBoxes
-		Rectangle aEditBoxRect( pixmapRect );
-		aEditBoxRect.SetSize( Size( upBtnRect.Left() - pixmapRect.Left(), aEditBoxRect.GetHeight() ) );
-		aEditBoxRect.setX( 0 );
-		aEditBoxRect.setY( 0 );
-
-		NWPaintOneEditBox( m_nScreen, pixmap, NULL, nType, nPart, aEditBoxRect, nState, aValue, rControlHandle, rCaption );
-	}
-
-	NWSetWidgetState( gWidgetData[m_nScreen].gSpinButtonWidget, nState, stateType );
-	gtk_widget_style_get( gWidgetData[m_nScreen].gSpinButtonWidget, "shadow_type", &shadowType, (char *)NULL );
-
-	if ( shadowType != GTK_SHADOW_NONE )
-	{
-		Rectangle		shadowRect( upBtnRect );
-
-		shadowRect.Union( downBtnRect );
-		gtk_paint_box( gWidgetData[m_nScreen].gSpinButtonWidget->style, pixmap, GTK_STATE_NORMAL, shadowType, NULL,
-			gWidgetData[m_nScreen].gSpinButtonWidget, "spinbutton",
-			(shadowRect.Left() - pixmapRect.Left()), (shadowRect.Top() - pixmapRect.Top()),
-			shadowRect.GetWidth(), shadowRect.GetHeight() );
-	}
-
-	NWPaintOneSpinButton( m_nScreen, pixmap, nType, upBtnPart, pixmapRect, upBtnState, aValue, rControlHandle, rCaption );
-	NWPaintOneSpinButton( m_nScreen, pixmap, nType, downBtnPart, pixmapRect, downBtnState, aValue, rControlHandle, rCaption );
-
-	if( !NWRenderPixmapToScreen(pixmap, pixmapRect) )
-	{
-		g_object_unref( pixmap );
-		return( FALSE );
-	}
-
-	g_object_unref( pixmap );
-	return( TRUE );
+            return( false );
+        }
+        pixmapRect = pSpinVal->maUpperRect;
+        pixmapRect.Union( pSpinVal->maLowerRect );
+    }
+    else
+        pixmapRect = rControlRectangle;
+
+
+    pixmap = NWGetPixmapFromScreen( pixmapRect );
+    if ( !pixmap )
+        return( FALSE );
+
+    upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rControlHandle, rCaption );
+    downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rControlHandle, rCaption );
+
+    if ( (nType==CTRL_SPINBOX) && (nPart!=PART_ALL_BUTTONS) )
+    {
+        // Draw an edit field for SpinBoxes and ComboBoxes
+        Rectangle aEditBoxRect( pixmapRect );
+        aEditBoxRect.SetSize( Size( upBtnRect.Left() - pixmapRect.Left(), aEditBoxRect.GetHeight() ) );
+        aEditBoxRect.setX( 0 );
+        aEditBoxRect.setY( 0 );
+
+        NWPaintOneEditBox( m_nScreen, pixmap, NULL, nType, nPart, aEditBoxRect, nState, aValue, rControlHandle, rCaption );
+    }
+
+    NWSetWidgetState( gWidgetData[m_nScreen].gSpinButtonWidget, nState, stateType );
+    gtk_widget_style_get( gWidgetData[m_nScreen].gSpinButtonWidget, "shadow_type", &shadowType, (char *)NULL );
+
+    if ( shadowType != GTK_SHADOW_NONE )
+    {
+        Rectangle       shadowRect( upBtnRect );
+
+        shadowRect.Union( downBtnRect );
+        gtk_paint_box( gWidgetData[m_nScreen].gSpinButtonWidget->style, pixmap, GTK_STATE_NORMAL, shadowType, NULL,
+            gWidgetData[m_nScreen].gSpinButtonWidget, "spinbutton",
+            (shadowRect.Left() - pixmapRect.Left()), (shadowRect.Top() - pixmapRect.Top()),
+            shadowRect.GetWidth(), shadowRect.GetHeight() );
+    }
+
+    NWPaintOneSpinButton( m_nScreen, pixmap, nType, upBtnPart, pixmapRect, upBtnState, aValue, rControlHandle, rCaption );
+    NWPaintOneSpinButton( m_nScreen, pixmap, nType, downBtnPart, pixmapRect, downBtnState, aValue, rControlHandle, rCaption );
+
+    if( !NWRenderPixmapToScreen(pixmap, pixmapRect) )
+    {
+        g_object_unref( pixmap );
+        return( FALSE );
+    }
+
+    g_object_unref( pixmap );
+    return( TRUE );
 }
 
 //---
 
 static Rectangle NWGetSpinButtonRect( int nScreen,
                                       ControlType,
-								      ControlPart			nPart,
-                                      Rectangle 			aAreaRect,
+                                      ControlPart           nPart,
+                                      Rectangle             aAreaRect,
                                       ControlState,
                                       const ImplControlValue&,
                                       SalControlHandle&,
                                       const OUString& )
 {
-	gint			buttonSize;
-	Rectangle		buttonRect;
-
-	NWEnsureGTKSpinButton( nScreen );
-
-	buttonSize = MAX( PANGO_PIXELS( pango_font_description_get_size(GTK_WIDGET(gWidgetData[nScreen].gSpinButtonWidget)->style->font_desc) ),
-				   MIN_SPIN_ARROW_WIDTH );
-	buttonSize -= buttonSize % 2 - 1; /* force odd */
-	buttonRect.SetSize( Size( buttonSize + 2 * gWidgetData[nScreen].gSpinButtonWidget->style->xthickness,
+    gint            buttonSize;
+    Rectangle       buttonRect;
+
+    NWEnsureGTKSpinButton( nScreen );
+
+    buttonSize = MAX( PANGO_PIXELS( pango_font_description_get_size(GTK_WIDGET(gWidgetData[nScreen].gSpinButtonWidget)->style->font_desc) ),
+                   MIN_SPIN_ARROW_WIDTH );
+    buttonSize -= buttonSize % 2 - 1; /* force odd */
+    buttonRect.SetSize( Size( buttonSize + 2 * gWidgetData[nScreen].gSpinButtonWidget->style->xthickness,
                               buttonRect.GetHeight() ) );
-	buttonRect.setX( aAreaRect.Left() + (aAreaRect.GetWidth() - buttonRect.GetWidth()) );
-	if ( nPart == PART_BUTTON_UP )
-	{
-		buttonRect.setY( aAreaRect.Top() );
-		buttonRect.Bottom() = buttonRect.Top() + (aAreaRect.GetHeight() / 2);
-	}
-	else if( nPart == PART_BUTTON_DOWN )
-	{
-		buttonRect.setY( aAreaRect.Top() + (aAreaRect.GetHeight() / 2) );
-		buttonRect.Bottom() = aAreaRect.Bottom(); // cover area completely
-	}
+    buttonRect.setX( aAreaRect.Left() + (aAreaRect.GetWidth() - buttonRect.GetWidth()) );
+    if ( nPart == PART_BUTTON_UP )
+    {
+        buttonRect.setY( aAreaRect.Top() );
+        buttonRect.Bottom() = buttonRect.Top() + (aAreaRect.GetHeight() / 2);
+    }
+    else if( nPart == PART_BUTTON_DOWN )
+    {
+        buttonRect.setY( aAreaRect.Top() + (aAreaRect.GetHeight() / 2) );
+        buttonRect.Bottom() = aAreaRect.Bottom(); // cover area completely
+    }
     else
     {
         buttonRect.Right()  = buttonRect.Left()-1;
         buttonRect.Bottom() = aAreaRect.Bottom();
     }
 
-	return( buttonRect );
+    return( buttonRect );
 }
 
 //---
 
 static void NWPaintOneSpinButton( int nScreen,
-                                  GdkPixmap*			pixmap,
-                                  ControlType			nType,
-                                  ControlPart			nPart,
-                                  Rectangle				aAreaRect,
-                                  ControlState			nState,
-                                  const ImplControlValue&	aValue,
-                                  SalControlHandle&		rControlHandle,
-                                  const OUString&				rCaption )
+                                  GdkPixmap*            pixmap,
+                                  ControlType           nType,
+                                  ControlPart           nPart,
+                                  Rectangle             aAreaRect,
+                                  ControlState          nState,
+                                  const ImplControlValue&   aValue,
+                                  SalControlHandle&     rControlHandle,
+                                  const OUString&               rCaption )
 {
-	Rectangle			buttonRect;
-	GtkStateType		stateType;
-	GtkShadowType		shadowType;
-	Rectangle			arrowRect;
-	gint				arrowSize;
-
-	NWEnsureGTKSpinButton( nScreen );
-	NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
-
-	buttonRect = NWGetSpinButtonRect( nScreen, nType, nPart, aAreaRect, nState, aValue, rControlHandle, rCaption );
-
-	NWSetWidgetState( gWidgetData[nScreen].gSpinButtonWidget, nState, stateType );
-	gtk_paint_box( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, shadowType, NULL, gWidgetData[nScreen].gSpinButtonWidget,
-			(nPart == PART_BUTTON_UP) ? "spinbutton_up" : "spinbutton_down",
-			(buttonRect.Left() - aAreaRect.Left()), (buttonRect.Top() - aAreaRect.Top()),
-			buttonRect.GetWidth(), buttonRect.GetHeight() );
-
-	arrowSize = (buttonRect.GetWidth() - (2 * gWidgetData[nScreen].gSpinButtonWidget->style->xthickness)) - 4;
-	arrowSize -= arrowSize % 2 - 1; /* force odd */
+    Rectangle           buttonRect;
+    GtkStateType        stateType;
+    GtkShadowType       shadowType;
+    Rectangle           arrowRect;
+    gint                arrowSize;
+
+    NWEnsureGTKSpinButton( nScreen );
+    NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+
+    buttonRect = NWGetSpinButtonRect( nScreen, nType, nPart, aAreaRect, nState, aValue, rControlHandle, rCaption );
+
+    NWSetWidgetState( gWidgetData[nScreen].gSpinButtonWidget, nState, stateType );
+    gtk_paint_box( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, shadowType, NULL, gWidgetData[nScreen].gSpinButtonWidget,
+            (nPart == PART_BUTTON_UP) ? "spinbutton_up" : "spinbutton_down",
+            (buttonRect.Left() - aAreaRect.Left()), (buttonRect.Top() - aAreaRect.Top()),
+            buttonRect.GetWidth(), buttonRect.GetHeight() );
+
+    arrowSize = (buttonRect.GetWidth() - (2 * gWidgetData[nScreen].gSpinButtonWidget->style->xthickness)) - 4;
+    arrowSize -= arrowSize % 2 - 1; /* force odd */
     arrowRect.SetSize( Size( arrowSize, arrowSize ) );
-	arrowRect.setX( buttonRect.Left() + (buttonRect.GetWidth() - arrowRect.GetWidth()) / 2 );
-	if ( nPart == PART_BUTTON_UP )
-		arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 + 1);
-	else
-		arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 - 1);
-
-	gtk_paint_arrow( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[nScreen].gSpinButtonWidget,
-			"spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, TRUE,
-			(arrowRect.Left() - aAreaRect.Left()), (arrowRect.Top() - aAreaRect.Top()),
-			arrowRect.GetWidth(), arrowRect.GetHeight() );
+    arrowRect.setX( buttonRect.Left() + (buttonRect.GetWidth() - arrowRect.GetWidth()) / 2 );
+    if ( nPart == PART_BUTTON_UP )
+        arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 + 1);
+    else
+        arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 - 1);
+
+    gtk_paint_arrow( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[nScreen].gSpinButtonWidget,
+            "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, TRUE,
+            (arrowRect.Left() - aAreaRect.Left()), (arrowRect.Top() - aAreaRect.Top()),
+            arrowRect.GetWidth(), arrowRect.GetHeight() );
 }
 
 
 //-------------------------------------