Commits

Kurt Zenker  committed 5c441c5 Merge

CWS-TOOLING: integrate CWS ooo33gsl02_OOO330

  • Participants
  • Parent commits c288ba8, 61345a8

Comments (0)

Files changed (49)

File desktop/source/deployment/gui/dp_gui_dialog2.cxx

     {
         ImplControlValue aValue;
         bool bNativeOK;
-        Region aControlRegion( Rectangle( (const Point&)Point(), m_aProgressBar.GetSizePixel() ) );
-        Region aNativeControlRegion, aNativeContentRegion;
+        Rectangle aControlRegion( Point( 0, 0 ), m_aProgressBar.GetSizePixel() );
+        Rectangle aNativeControlRegion, aNativeContentRegion;
         if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
                                                  CTRL_STATE_ENABLED, aValue, rtl::OUString(),
                                                  aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
         {
-            nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight();
+            nProgressHeight = aNativeControlRegion.GetHeight();
         }
     }
 
     {
         ImplControlValue aValue;
         bool bNativeOK;
-        Region aControlRegion( Rectangle( (const Point&)Point(), m_aProgressBar.GetSizePixel() ) );
-        Region aNativeControlRegion, aNativeContentRegion;
+        Rectangle aControlRegion( Point( 0, 0 ), m_aProgressBar.GetSizePixel() );
+        Rectangle aNativeControlRegion, aNativeContentRegion;
         if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
                                                  CTRL_STATE_ENABLED, aValue, rtl::OUString(),
                                                  aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
         {
-            nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight();
+            nProgressHeight = aNativeControlRegion.GetHeight();
         }
     }
 

File desktop/source/splash/splash.cxx

         
         ImplControlValue aValue( _iProgress * _barwidth / _iMax);
         Rectangle aDrawRect( Point(_tlx, _tly), Size( _barwidth, _barheight ) );
-        Region aControlRegion( aDrawRect );
-        Region aNativeControlRegion, aNativeContentRegion;
+        Rectangle aNativeControlRegion, aNativeContentRegion;
 
-        if( GetNativeControlRegion( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+        if( GetNativeControlRegion( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
                                              CTRL_STATE_ENABLED, aValue, rtl::OUString(),
                                              aNativeControlRegion, aNativeContentRegion ) ) 
         {
-              long nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight();
+              long nProgressHeight = aNativeControlRegion.GetHeight();
               aDrawRect.Top() -= (nProgressHeight - _barheight)/2;
               aDrawRect.Bottom() += (nProgressHeight - _barheight)/2;
-              aControlRegion = Region( aDrawRect );
         }
         
-        if( (bNativeOK = DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+        if( (bNativeOK = DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
                                             CTRL_STATE_ENABLED, aValue, _sProgressText )) != FALSE ) 
         {
             return;

File sc/source/ui/cctrl/dpcontrol.cxx

     {
         SetClipRegion();
         bNativeDrawn = DrawNativeControl(
-            CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Region(aCtrlRect), CTRL_STATE_ENABLED,
+            CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED,
             ImplControlValue(), OUString());
     }
     else
     Point aPos;
     Size aSize;
     getMenuItemPosSize(nPos, aPos, aSize);
-    Region aRegion(Rectangle(aPos,aSize));
+    Rectangle aRegion(aPos,aSize);
 
     if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL))
     {
         IntersectClipRegion(Rectangle(aPos, aSize));
         Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel()); 
         DrawNativeControl(
-            CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Region(aCtrlRect), CTRL_STATE_ENABLED,
+            CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED,
             ImplControlValue(), OUString());
 
         Pop();

File svtools/source/contnr/svimpbox.cxx

     //so that SvImpLBox::DrawNet() doesn't draw anything too
  	if(pView->IsNativeControlSupported( CTRL_LISTNET, PART_ENTIRE_CONTROL)) {
         ImplControlValue	aControlValue;
-        Point aTemp(0,0);   // temporary needed for g++ 3.3.5
-        Region			  aCtrlRegion( Rectangle(aTemp, Size( 0, 0 )) );
+        Point  aTemp(0,0);   // temporary needed for g++ 3.3.5
+        Rectangle aCtrlRegion( aTemp, Size( 0, 0 ) );
         ControlState		nState = CTRL_STATE_ENABLED;
-            if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL,
-					aCtrlRegion, nState, aControlValue, rtl::OUString() ) )
-            {
-                return;
-            }
+        if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL,
+                                      aCtrlRegion, nState, aControlValue, rtl::OUString() ) )
+        {
+            return;
+        }
 
     }
 

File svtools/source/contnr/svlbitm.cxx

     if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
     {
         ImplControlValue    aControlValue;
-        Region              aCtrlRegion( Rectangle(rPos, Size(pData->Width(), pData->Height())) );
+        Rectangle           aCtrlRegion( rPos, Size(pData->Width(), pData->Height()) );
         ControlState        nState = 0;
         
         //states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented
             aControlValue.setTristateVal( BUTTONVALUE_MIXED );
 
         bNativeOK = pWin->DrawNativeControl( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL,
-                                aCtrlRegion, nState, aControlValue, rtl::OUString() );
+                                             aCtrlRegion, nState, aControlValue, rtl::OUString() );
     }
 
     if( !bNativeOK) 

File svtools/source/contnr/svtreebx.cxx

 				if ( IsNativeControlSupported( CTRL_LISTNODE, PART_ENTIRE_CONTROL) )
 				{
 					ImplControlValue	aControlValue;
-					Region			  aCtrlRegion( Rectangle(aPos,  pImg->GetSizePixel() ) );
+					Rectangle           aCtrlRegion( aPos,  pImg->GetSizePixel() );
 					ControlState		nState = 0;
 
 					if ( IsEnabled() )	nState |= CTRL_STATE_ENABLED;

File svtools/source/control/toolbarmenu.cxx

                 IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pEntry->maSize.Height() ) ) );
                 Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) );
                 DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
-                                   Region( aCtrlRect ),
+                                   aCtrlRect,
                                    CTRL_STATE_ENABLED,
                                    ImplControlValue(),
                                    OUString() );
                 {
                     bDrawItemRect = false;
                     if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
-                                                    Region( aItemRect ),
+                                                    aItemRect,
                                                     CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ),
                                                     ImplControlValue(),
                                                     OUString() ) )
     if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
     {
         ImplControlValue    aControlValue;
-        Region              aCtrlRegion( i_rRect );
         ControlState        nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED;
         
         aControlValue.setTristateVal( BUTTONVALUE_ON );
         
         bNativeOk = i_pWindow->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON, 
-                                                  aCtrlRegion, nState, aControlValue,
+                                                  i_rRect, nState, aControlValue,
                                                   rtl::OUString() );
     }
 
     rMaxWidth = rCheckHeight = rRadioHeight = 0;
     
     ImplControlValue aVal;
-    Region aNativeBounds;
-    Region aNativeContent;
+    Rectangle aNativeBounds;
+    Rectangle aNativeContent;
     Point tmp( 0, 0 );
-    Region aCtrlRegion( Rectangle( tmp, Size( 100, 15 ) ) );
+    Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
     if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK ) )
     {
         if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP),
                                           aNativeContent )
         )
         {
-            rCheckHeight = aNativeBounds.GetBoundRect().GetHeight();
-			rMaxWidth = aNativeContent.GetBoundRect().GetWidth();
+            rCheckHeight = aNativeBounds.GetHeight();
+			rMaxWidth = aNativeContent.GetWidth();
         }
     }
     if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK ) )
                                           aNativeContent )
         )
         {
-            rRadioHeight = aNativeBounds.GetBoundRect().GetHeight();
-			rMaxWidth = Max (rMaxWidth, aNativeContent.GetBoundRect().GetWidth());
+            rRadioHeight = aNativeBounds.GetHeight();
+			rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth());
         }
     }
     return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight;
 							aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
                             
 							Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );                            
-							DrawNativeControl( CTRL_MENU_POPUP, nPart, Region( aCheckRect ), nState, ImplControlValue(), OUString() );
+							DrawNativeControl( CTRL_MENU_POPUP, nPart, aCheckRect, nState, ImplControlValue(), OUString() );
 						}
 						else if ( pEntry->mbChecked ) // by default do nothing for unchecked items
 						{

File svtools/source/toolpanel/paneltabbar.cxx

         const ControlState nState( lcl_ItemToControlState( i_nItemFlags ) );
 
         TabitemValue tiValue;
-        ImplControlValue aControlValue( (void*)(&tiValue) );
 
-        Region aBoundingRegion, aContentRegion;
+        Rectangle aBoundingRegion, aContentRegion;
         bool bNativeOK = getTargetDevice().GetNativeControlRegion(
             CTRL_TAB_ITEM, PART_ENTIRE_CONTROL,
             i_rContentArea, nState,
-            aControlValue, ::rtl::OUString(),
+            tiValue, ::rtl::OUString(),
             aBoundingRegion, aContentRegion
         );
         (void)bNativeOK;
         OSL_ENSURE( bNativeOK, "NWFTabItemRenderer::calculateDecorations: GetNativeControlRegion not implemented for CTRL_TAB_ITEM?!" );
 
-        return aBoundingRegion.GetBoundRect();
+        return aBoundingRegion;
     }
 
 	//------------------------------------------------------------------------------------------------------------------
         if ( i_nItemFlags & ITEM_POSITION_LAST )
             tiValue.mnAlignment |= TABITEM_LAST_IN_GROUP;
 
-        ImplControlValue aControlValue( (void *)(&tiValue) );
 
-        bool bNativeOK = getTargetDevice().DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentRect, nState, aControlValue, rtl::OUString() );
+        bool bNativeOK = getTargetDevice().DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentRect, nState, tiValue, rtl::OUString() );
         (void)bNativeOK;
         OSL_ENSURE( bNativeOK, "NWFTabItemRenderer::preRenderItem: inconsistent NWF implementation!" );
             // IsNativeControlSupported returned true, previously, otherwise we would not be here ...

File tools/source/string/strucvt.cxx

         Append( UniString::CreateFromInt32( rResId.GetId() ) );
         AppendAscii( " not found>" );
 #endif
+        if( pResMgr )
+            pResMgr->PopContext();
     }
         
 

File unotools/source/config/fontcfg.cxx

             // try to find an exact match
             // because the list is sorted this will also find fontnames of the form searchfontname*
             std::vector< FontNameAttr >::const_iterator it = ::std::lower_bound( lang->second.aSubstAttributes.begin(), lang->second.aSubstAttributes.end(), aSearchAttr, StrictStringSort() );
-            if( it != lang->second.aSubstAttributes.end() && aSearchFont.CompareTo( it->Name, aSearchFont.Len() ) == COMPARE_EQUAL )
-                return &(*it);
+            if( it != lang->second.aSubstAttributes.end())
+            {
+                const FontNameAttr& rFoundAttr = *it;
+                // a search for "abcblack" may match with an entry for "abc"
+                // the reverse is not a good idea (e.g. #i112731# alba->albani)
+                if( rFoundAttr.Name.Len() <= aSearchFont.Len() )
+                    if( aSearchFont.CompareTo( rFoundAttr.Name, rFoundAttr.Name.Len() ) == COMPARE_EQUAL )
+                        return &rFoundAttr;
+            }
         }
         // gradually become more unspecific
         if( aLocale.Variant.getLength() )

File vcl/aqua/inc/salgdi.h

 
     CGPoint*                makeCGptArray(ULONG nPoints, const SalPoint*  pPtAry);
     // native widget rendering methods that require mirroring
-    virtual BOOL        hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+    virtual BOOL        hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
                                               const Point& aPos, BOOL& rIsInside );
-    virtual BOOL        drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+    virtual BOOL        drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
                                            ControlState nState, const ImplControlValue& aValue,
                                            const rtl::OUString& aCaption );
-    virtual BOOL        drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+    virtual BOOL        drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
                                                ControlState nState, const ImplControlValue& aValue,
                                                const rtl::OUString& aCaption );
-    virtual BOOL        getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+    virtual BOOL        getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
                                                 const ImplControlValue& aValue, const rtl::OUString& aCaption,
-                                                Region &rNativeBoundingRegion, Region &rNativeContentRegion );
+                                                Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
 
     // get device resolution
     virtual void			GetResolution( long& rDPIX, long& rDPIY );

File vcl/aqua/source/gdi/salnativewidgets.cxx

  *  aPos was or was not inside the native widget specified by the
  *  nType/nPart combination.
  */
-BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
 					    const Point& rPos, BOOL& rIsInside )
 {
     if ( nType == CTRL_SCROLLBAR )
     {
 		Rectangle aRect;
-		bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion.GetBoundRect(), aRect );
+		bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect );
 		rIsInside = bValid ? aRect.IsInside( rPos ) : FALSE;
         if( GetSalData()->mbIsScrollbarDoubleMax )
         {
  */
 BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
 					ControlPart nPart,
-					const Region& rControlRegion,
+					const Rectangle& rControlRegion,
 					ControlState nState,
 					const ImplControlValue& aValue,
 					const rtl::OUString& aCaption )
 
     CGContextSaveGState( mrContext );
 
-    Rectangle buttonRect = rControlRegion.GetBoundRect();
+    Rectangle buttonRect = rControlRegion;
 	HIRect rc = ImplGetHIRectFromRectangle(buttonRect);
 
     /** Scrollbar parts code equivalent **
             // no animation
             aPushInfo.animation.time.start = 0;
             aPushInfo.animation.time.current = 0;
-            PushButtonValue* pPBVal = (PushButtonValue*)aValue.getOptionalVal();
+            PushButtonValue* pPBVal = aValue.getType() == CTRL_PUSHBUTTON ? (PushButtonValue*)&aValue : NULL;
             int nPaintHeight = static_cast<int>(rc.size.height);
             
             if( pPBVal && pPBVal->mbBevelButton )
         
     case CTRL_SLIDER:
         {
-            SliderValue* pSLVal = (SliderValue*)aValue.getOptionalVal();
+            SliderValue* pSLVal = (SliderValue*)&aValue;
 
             HIThemeTrackDrawInfo aTrackDraw;
             aTrackDraw.kind = kThemeSliderMedium;
 
     case CTRL_SCROLLBAR:
         {
-            ScrollbarValue* pScrollbarVal = (ScrollbarValue *)(aValue.getOptionalVal());
+            ScrollbarValue* pScrollbarVal = (ScrollbarValue *)&aValue;
 
             if( nPart == PART_DRAW_BACKGROUND_VERT ||
                 nPart == PART_DRAW_BACKGROUND_HORZ )
             //first, last or middle tab
             aTabItemDrawInfo.position=kHIThemeTabPositionMiddle;
             
-            TabitemValue* pTabValue = (TabitemValue *) aValue.getOptionalVal();
+            TabitemValue* pTabValue = (TabitemValue *) &aValue;
             unsigned int nAlignment = pTabValue->mnAlignment;
             //TABITEM_LEFTALIGNED (and TABITEM_RIGHTALIGNED) for the leftmost (or rightmost) tab
             //when there are several lines of tabs because there is only one first tab and one 
                 if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal);
                 
                 //buttons:
-                SpinbuttonValue* pSpinButtonVal = (SpinbuttonValue *)(aValue.getOptionalVal());
+                SpinbuttonValue* pSpinButtonVal = (SpinbuttonValue *)&aValue;
                 ControlState nUpperState = CTRL_STATE_ENABLED;//state of the upper button
                 ControlState nLowerState = CTRL_STATE_ENABLED;//and of the lower button
                 if(pSpinButtonVal) {//pSpinButtonVal is sometimes null
  *  aValue:		An optional value (tristate/numerical/string)
  *  aCaption:	A caption or title string (like button text etc)
  */
-BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
                                                ControlState nState, const ImplControlValue& aValue,
                                                const rtl::OUString& aCaption )
 {
  *  aValue:		An optional value (tristate/numerical/string)
  *  aCaption:		A caption or title string (like button text etc)
  */
-BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
                                                const ImplControlValue& aValue, const rtl::OUString& aCaption,
-                                                Region &rNativeBoundingRegion, Region &rNativeContentRegion )
+                                                Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
 
 {
 	BOOL toReturn = FALSE;
 
-	Rectangle aCtrlBoundRect( rControlRegion.GetBoundRect() );
+	Rectangle aCtrlBoundRect( rControlRegion );
     short x = aCtrlBoundRect.Left();
     short y = aCtrlBoundRect.Top();
     short w, h;
                 {
                     w = 19; // taken from HIG
                     h = aCtrlBoundRect.GetHeight();
-                    rNativeBoundingRegion = rNativeContentRegion = Region( Rectangle( Point( x, y ), Size( w, h ) ) );
+                    rNativeBoundingRegion = rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
                     toReturn = true;
                 }
                 else if( nPart == PART_THUMB_VERT )
                 {
                     w = aCtrlBoundRect.GetWidth();
                     h = 18; // taken from HIG
-                    rNativeBoundingRegion = rNativeContentRegion = Region( Rectangle( Point( x, y ), Size( w, h ) ) );
+                    rNativeBoundingRegion = rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
                     toReturn = true;
                 }
             }

File vcl/inc/vcl/button.hxx

     SAL_DLLPRIVATE void             ImplSetSymbolAlign( SymbolAlign eAlign );
     SAL_DLLPRIVATE SymbolAlign      ImplGetSymbolAlign() const;
     SAL_DLLPRIVATE void             ImplSetSmallSymbol( BOOL bSmall = TRUE );
+    SAL_DLLPRIVATE const Rectangle& ImplGetSymbolRect() const;
+    SAL_DLLPRIVATE void             ImplSetSymbolRect(const Rectangle&);
 
 protected:
                         Button( WindowType nType );

File vcl/inc/vcl/outdev.hxx

     // Query the native control to determine if it was acted upon
     BOOL				HitTestNativeControl(   ControlType nType,
 									            ControlPart nPart,
-									            const Region& rControlRegion,
+									            const Rectangle& rControlRegion,
 									            const Point& aPos,
 									            BOOL& rIsInside );
 
     // Request rendering of a particular control and/or part
     BOOL				DrawNativeControl(  ControlType nType,
 									        ControlPart nPart,
-									        const Region& rControlRegion,
+									        const Rectangle& rControlRegion,
 									        ControlState nState,
     									    const ImplControlValue& aValue,
                                             ::rtl::OUString aCaption );
      // Request rendering of a caption string for a control
     BOOL				DrawNativeControlText(  ControlType nType,
 										        ControlPart nPart,
-										        const Region& rControlRegion,
+										        const Rectangle& rControlRegion,
 										        ControlState nState,
 										        const ImplControlValue& aValue,
                                                 ::rtl::OUString aCaption );
     // Query the native control's actual drawing region (including adornment)
     BOOL				GetNativeControlRegion( ControlType nType,
 										        ControlPart nPart,
-										        const Region& rControlRegion,
+										        const Rectangle& rControlRegion,
 										        ControlState nState,
 										        const ImplControlValue& aValue,
                                                 ::rtl::OUString aCaption,
-										        Region &rNativeBoundingRegion,
-										        Region &rNativeContentRegion );
+										        Rectangle &rNativeBoundingRegion,
+										        Rectangle &rNativeContentRegion );
 
 };
 

File vcl/inc/vcl/salgdi.hxx

     virtual BOOL		drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) = 0;
 
     // native widget rendering methods that require mirroring
-    virtual BOOL        hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+    virtual BOOL        hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
                                               const Point& aPos, BOOL& rIsInside );
-    virtual BOOL        drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+    virtual BOOL        drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
                                            ControlState nState, const ImplControlValue& aValue,
                                            const rtl::OUString& aCaption );
-    virtual BOOL        drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+    virtual BOOL        drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
                                                ControlState nState, const ImplControlValue& aValue,
                                                const rtl::OUString& aCaption );
-    virtual BOOL        getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+    virtual BOOL        getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
                                                 const ImplControlValue& aValue, const rtl::OUString& aCaption,
-                                                Region &rNativeBoundingRegion, Region &rNativeContentRegion );
+                                                Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
 
     /** Render bitmap with alpha channel
 
     // Query the native control to determine if it was acted upon
     BOOL HitTestNativeControl( ControlType nType,
 									  ControlPart nPart,
-									  const Region& rControlRegion,
+									  const Rectangle& rControlRegion,
 									  const Point& aPos,
                                       BOOL& rIsInside,
                                       const OutputDevice *pOutDev );
     // Request rendering of a particular control and/or part
     BOOL DrawNativeControl( ControlType nType,
 									ControlPart nPart,
-									const Region& rControlRegion,
+									const Rectangle& rControlRegion,
 									ControlState nState,
 									const ImplControlValue& aValue,
 									const rtl::OUString& aCaption,
     // Request rendering of a caption string for a control
     BOOL DrawNativeControlText( ControlType nType,
 										ControlPart nPart,
-										const Region& rControlRegion,
+										const Rectangle& rControlRegion,
 										ControlState nState,
 										const ImplControlValue& aValue,
 										const rtl::OUString& aCaption,
     // Query the native control's actual drawing region (including adornment)
     BOOL GetNativeControlRegion( ControlType nType,
 										 ControlPart nPart,
-										 const Region& rControlRegion,
+										 const Rectangle& rControlRegion,
 										 ControlState nState,
 										 const ImplControlValue& aValue,
 										 const rtl::OUString& aCaption,
-										 Region &rNativeBoundingRegion,
-										 Region &rNativeContentRegion,
+										 Rectangle &rNativeBoundingRegion,
+										 Rectangle &rNativeContentRegion,
                                          const OutputDevice *pOutDev );
 
     static void AddDevFontSubstitute( OutputDevice* pOutDev,

File vcl/inc/vcl/salnativewidgets.hxx

 
 typedef sal_uInt32		ControlType;
 
+// for use in general purpose ImplControlValue
+#define CTRL_GENERIC            0
+
 // Normal PushButton/Command Button
 #define CTRL_PUSHBUTTON			1
 
 	BUTTONVALUE_MIXED
 };
 
-#ifdef __cplusplus
+/* ImplControlValue:
+ *
+ *   Generic value container for all control parts.
+ */
+
+class VCL_DLLPUBLIC ImplControlValue
+{
+	friend class SalFrame;
+
+	private:
+	    ControlType     mType;
+		ButtonValue     mTristate;    // Tristate value: on, off, mixed
+		long			mNumber;      // numeric value
+    protected:
+        ImplControlValue( ControlType i_eType, ButtonValue i_eTriState, long i_nNumber )
+        : mType( i_eType )
+        , mTristate( i_eTriState )
+        , mNumber( i_nNumber )
+        {}
+
+	public:
+		explicit ImplControlValue( ButtonValue nTristate )
+			: mType( CTRL_GENERIC ), mTristate(nTristate), mNumber(0) {}
+		explicit ImplControlValue( long nNumeric )
+			: mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric) {}
+		inline ImplControlValue()
+			: mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {}
+
+		virtual ~ImplControlValue();
+		
+		ControlType getType() const { return mType; }
+
+		inline ButtonValue		getTristateVal( void ) const { return mTristate; }
+		inline void			setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
+
+		inline long			getNumericVal( void ) const { return mNumber; }
+		inline void			setNumericVal( long nNumeric ) { mNumber = nNumeric; }
+};
 
 /* ScrollbarValue:
  *
  *   Value container for scrollbars.
  */
-class VCL_DLLPUBLIC ScrollbarValue
+ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue 
 {
 	public:
 		long			mnMin;
 		ControlState	mnPage2State;
 
 		inline ScrollbarValue()
-				{
-					mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0;
-					mnButton1State = 0; mnButton2State = 0;
-					mnThumbState = 0; mnPage1State = 0; mnPage2State = 0;
-				};
-		inline ~ScrollbarValue() {};
+		: ImplControlValue( CTRL_SCROLLBAR, BUTTONVALUE_DONTKNOW, 0 )
+        {
+            mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0;
+            mnButton1State = 0; mnButton2State = 0;
+            mnThumbState = 0; mnPage1State = 0; mnPage2State = 0;
+        };
+		virtual ~ScrollbarValue();
 };
 
-class VCL_DLLPUBLIC SliderValue
+class VCL_DLLPUBLIC SliderValue : public ImplControlValue
 {
 	public:
 		long			mnMin;
 		Rectangle       maThumbRect;
 		ControlState    mnThumbState;
 		
-		SliderValue() : mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( 0 )
+		SliderValue()
+		: ImplControlValue( CTRL_SLIDER, BUTTONVALUE_DONTKNOW, 0 )
+		, mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( 0 )
 		{}
-		~SliderValue() {}
+		virtual ~SliderValue();
 };
 
 /* TabitemValue:
 #define TABITEM_FIRST_IN_GROUP 0x004   // the tabitem is the first in group of tabitems
 #define TABITEM_LAST_IN_GROUP  0x008   // the tabitem is the last in group of tabitems
 
-class VCL_DLLPUBLIC TabitemValue
+class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
 {
 	public:
         unsigned int    mnAlignment;
 
 		inline TabitemValue()
-				{
-					mnAlignment = 0;
-				};
-		inline ~TabitemValue() {};
+		: ImplControlValue( CTRL_TAB_ITEM, BUTTONVALUE_DONTKNOW, 0 )
+        {
+            mnAlignment = 0;
+        };
+		virtual ~TabitemValue();
 
-        BOOL isLeftAligned()  { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
-        BOOL isRightAligned() { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
-        BOOL isBothAligned()  { return isLeftAligned() && isRightAligned(); }
-        BOOL isNotAligned()   { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
-        BOOL isFirst()        { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
-        BOOL isLast()         { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
+        BOOL isLeftAligned() const  { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
+        BOOL isRightAligned() const { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
+        BOOL isBothAligned() const  { return isLeftAligned() && isRightAligned(); }
+        BOOL isNotAligned() const   { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
+        BOOL isFirst() const        { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
+        BOOL isLast() const         { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
 };
 
 /* SpinbuttonValue:
  *   Note: the other parameters of DrawNativeControl will have no meaning
  *         all parameters for spinbuttons are carried here
  */
-class VCL_DLLPUBLIC SpinbuttonValue
+class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
 {
 	public:
 		Rectangle		maUpperRect;
 		int			mnLowerPart;
 
 		inline SpinbuttonValue()
-				{
-					mnUpperState = mnLowerState = 0;
-				};
-		inline ~SpinbuttonValue() {};
+		: ImplControlValue( CTRL_SPINBUTTONS, BUTTONVALUE_DONTKNOW, 0 )
+        {
+            mnUpperState = mnLowerState = 0;
+        };
+		virtual ~SpinbuttonValue();
 };
 
 /*	Toolbarvalue:
  *
  *  Value container for toolbars detailing the grip position
  */
-class ToolbarValue
+class ToolbarValue : public ImplControlValue
 {
 public:
-    ToolbarValue()  { mbIsTopDockingArea = FALSE; }
+    ToolbarValue() : ImplControlValue( CTRL_TOOLBAR, BUTTONVALUE_DONTKNOW, 0 )
+    { mbIsTopDockingArea = FALSE; }
+    virtual ~ToolbarValue();
     Rectangle			maGripRect;
     BOOL                mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
                                             // adjacent to the menubar
  *
  *  Value container for menubars specifying height of adjacent docking area
  */
-class MenubarValue
+class MenubarValue : public ImplControlValue
 {
 public:
-    MenubarValue() { maTopDockingAreaHeight=0; }
+    MenubarValue() : ImplControlValue( CTRL_MENUBAR, BUTTONVALUE_DONTKNOW, 0 )
+    { maTopDockingAreaHeight=0; }
+    virtual ~MenubarValue();
     int             maTopDockingAreaHeight;
 };
 
  *
  *  Value container for pushbuttons specifying additional drawing hints
  */
-class PushButtonValue
+class PushButtonValue : public ImplControlValue
 {
 public:
-PushButtonValue() : mbBevelButton( false ), mbSingleLine( true ) {}
+    PushButtonValue()
+    : ImplControlValue( CTRL_PUSHBUTTON, BUTTONVALUE_DONTKNOW, 0 )
+    , mbBevelButton( false ), mbSingleLine( true ) {}
+    virtual ~PushButtonValue();
+    
     bool            mbBevelButton:1;
     bool            mbSingleLine:1;
 };
 
-/* ImplControlValue:
- *
- *   Generic value container for all control parts.
- */
-
-class ImplControlValue
-{
-	friend class SalFrame;
-
-	private:
-		ButtonValue	mTristate;	// Tristate value: on, off, mixed
-		rtl::OUString	mString;		// string value
-		long			mNumber;		// numeric value
-		void *		mOptionalVal;	// optional control-specific value
-
-	public:
-		inline ImplControlValue( ButtonValue nTristate, rtl::OUString sString, long nNumeric, void * aOptVal ) \
-								{ mTristate = nTristate; mString = sString; mNumber = nNumeric; mOptionalVal = aOptVal; };
-		inline ImplControlValue( ButtonValue nTristate, rtl::OUString sString, long nNumeric ) \
-								{ mTristate = nTristate; mString = sString; mNumber = nNumeric; mOptionalVal = NULL; };
-		explicit ImplControlValue( ButtonValue nTristate )
-			: mTristate(nTristate), mNumber(0), mOptionalVal(NULL) {}
-		explicit ImplControlValue( rtl::OUString& rString )
-			: mTristate(BUTTONVALUE_DONTKNOW), mString(rString), mNumber(0), mOptionalVal(NULL) {}
-		explicit ImplControlValue( long nNumeric )
-			: mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric), mOptionalVal(NULL) {}
-		explicit ImplControlValue( void* aOptVal )
-	 		: mTristate(BUTTONVALUE_DONTKNOW), mNumber(0), mOptionalVal(aOptVal) {}
-		inline ImplControlValue()
-			: mTristate(BUTTONVALUE_DONTKNOW), mNumber(0), mOptionalVal(NULL) {}
-
-		inline ~ImplControlValue() { mOptionalVal = NULL; };
-
-		inline ButtonValue		getTristateVal( void ) const { return mTristate; }
-		inline void			setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
-
-		inline const rtl::OUString&	getStringVal( void ) const { return mString; }
-		inline void			setStringVal( rtl::OUString sString ) { mString = sString; }
-
-		inline long			getNumericVal( void ) const { return mNumber; }
-		inline void			setNumericVal( long nNumeric ) { mNumber = nNumeric; }
-
-		inline void *			getOptionalVal( void ) const { return mOptionalVal; }
-		inline void			setOptionalVal( void * aOptVal ) { mOptionalVal = aOptVal; }
-};
-
-#endif	/* __cplusplus */
 
 #endif
 

File vcl/source/app/help.cxx

     if ( IsNativeControlSupported( CTRL_TOOLTIP, PART_ENTIRE_CONTROL ) )
     {
         // #i46472# workaround gcc3.3 temporary problem
-        Region aCtrlRegion = Region( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
+        Rectangle aCtrlRegion( Point( 0, 0 ), GetOutputSizePixel() );
         ImplControlValue    aControlValue;
         bNativeOK = DrawNativeControl( CTRL_TOOLTIP, PART_ENTIRE_CONTROL, aCtrlRegion,
                                        0, aControlValue, rtl::OUString() );

File vcl/source/control/button.cxx

 {
 public:
     Rectangle       maFocusRect;
+    Rectangle       maSymbolRect;
     USHORT          mnButtonState;
     BOOL            mbSmallSymbol;
 
 
 // -----------------------------------------------------------------------
 
+const Rectangle& Button::ImplGetSymbolRect() const
+{
+    return mpButtonData->maSymbolRect;
+}
+
+void Button::ImplSetSymbolRect( const Rectangle& i_rRect )
+{
+    mpButtonData->maSymbolRect = i_rRect;
+}
+
+// -----------------------------------------------------------------------
+
 USHORT Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
                                  ULONG nDrawFlags )
 {
     Size aSize = rRect.GetSize();
     Point aPos = rRect.TopLeft();
 
+    ULONG nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
+    if( nImageSep < 1 )
+        nImageSep = 1;
     if ( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
     {
         if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
             aInRect.Left()      = aInRect.Right() - nSymbolSize;
             aSize.Width()      -= ( 5 + nSymbolSize );
 
-            ImplDrawAlignedImage( pDev, aPos, aSize, bLayout,
-                                  1, nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
+            ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep,
+                                  nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
         }
         else
             ImplCalcSymbolRect( aInRect );
         if( ! bLayout )
         {
             DecorationView aDecoView( pDev );
+            long nDistance = (aInRect.GetHeight() > 10) ? 2 : 1;
+            long nX = aInRect.Left() - 2*nDistance;;
+            Point aStartPt( nX, aInRect.Top()+nDistance );
+            Point aEndPt( nX, aInRect.Bottom()-nDistance );
+            aDecoView.DrawSeparator( aStartPt, aEndPt );
             aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle );
+            aInRect.Left() -= 2*nDistance;
+            ImplSetSymbolRect( aInRect );
         }
     }
     else
     {
         Rectangle aSymbolRect;
-        ULONG nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
-        if( nImageSep < 1 )
-            nImageSep = 1;
         // FIXME: (GetStyle() & WB_FLATBUTTON) != 0 is preliminary
         // in the next major this should be replaced by "true"
         ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep, nDrawFlags,
         {
             DecorationView aDecoView( pDev );
             aDecoView.DrawSymbol( aSymbolRect, meSymbol, aColor, nStyle );
+            ImplSetSymbolRect( aSymbolRect );
         }
 
         if ( mnDDStyle == PUSHBUTTON_DROPDOWN_TOOLBOX && !bLayout )
                 // for CTRL_LISTBOX/PART_BUTTON_DOWN and CTRL_COMBOBOX/PART_BUTTON_DOWN
 
                 ImplControlValue    aControlValue;
-                Region              aCtrlRegion( aInRect );
                 ControlState        nState = 0;
 
                 if ( mbPressed ) 						nState |= CTRL_STATE_PRESSED;
                 if ( IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ) )
                     nState |= CTRL_STATE_ROLLOVER;
 
-                bNativeOK = DrawNativeControl( aCtrlType, PART_BUTTON_DOWN, aCtrlRegion, nState,
+                bNativeOK = DrawNativeControl( aCtrlType, PART_BUTTON_DOWN, aInRect, nState,
                                                 aControlValue, rtl::OUString() );
             }
         }
     bool bRollOver = (IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ));
     if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
     {
-        PushButtonValue aPBVal;
-        ImplControlValue aControlValue;
-        aControlValue.setOptionalVal( &aPBVal );
-        Region			 aCtrlRegion( aInRect );
+        PushButtonValue aControlValue;
+        Rectangle		 aCtrlRegion( aInRect );
         ControlState	 nState = 0;
 
         if ( mbPressed || IsChecked() )                   nState |= CTRL_STATE_PRESSED;
             nState |= CTRL_STATE_ROLLOVER;
         
         if( GetStyle() & WB_BEVELBUTTON )
-            aPBVal.mbBevelButton = true;
+            aControlValue.mbBevelButton = true;
 
         // draw frame into invisible window to have aInRect modified correctly
         // but do not shift the inner rect for pressed buttons (ie remove BUTTON_DRAW_PRESSED)
         Size aFontSize( Application::GetSettings().GetStyleSettings().GetPushButtonFont().GetSize() );
         aFontSize = LogicToPixel( aFontSize, MapMode( MAP_POINT ) );
         Size aInRectSize( LogicToPixel( Size( aInRect.GetWidth(), aInRect.GetHeight() ) ) );
-        aPBVal.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height() );
+        aControlValue.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height() );
 
         if( ((nState & CTRL_STATE_ROLLOVER)) || ! (GetStyle() & WB_FLATBUTTON) )
         {
 
     if ( (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
     {
-        Region aBoundingRgn, aContentRgn;
+        Rectangle aBound, aCont;
         Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating
                                              // will not work if the theme has dynamic adornment sizes
         ImplControlValue aControlValue;
-        Region			 aCtrlRegion( aCtrlRect );
+        Rectangle		 aCtrlRegion( aCtrlRect );
         ControlState	 nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
 
         // get native size of a 'default' button
         // and adjust the VCL button if more space for adornment is required
         if( GetNativeControlRegion( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
                                 nState, aControlValue, rtl::OUString(),
-								aBoundingRgn, aContentRgn ) )
+								aBound, aCont ) )
         {
-            Rectangle aCont(aContentRgn.GetBoundRect());
-            Rectangle aBound(aBoundingRgn.GetBoundRect());
-
             dLeft = aCont.Left() - aBound.Left();
             dTop = aCont.Top() - aBound.Top();
             dRight = aBound.Right() - aCont.Right();
             aSize = Size( 16, 12 );
         else
             aSize = Size( 26, 24 );
+        if( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
+            aSize.Width() += 4;
     }
 	else if ( IsImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) )
 		aSize = GetModeImage().GetSizePixel();
     // no native drawing for image radio buttons
     if ( !maImage && (bNativeOK=IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
     {
-        ImplControlValue		    aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF, rtl::OUString(), 0 );
+        ImplControlValue		    aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
         Rectangle					aCtrlRect( maStateRect.TopLeft(), maStateRect.GetSize() );
-        Region						aCtrlRegion( aCtrlRect );
         ControlState				nState = 0;
 
         if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED )	nState |= CTRL_STATE_PRESSED;
         if ( IsMouseOver() && maMouseRect.IsInside( GetPointerPosPixel() ) )
             nState |= CTRL_STATE_ROLLOVER;
 
-        bNativeOK = DrawNativeControl( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
+        bNativeOK = DrawNativeControl( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRect, nState,
                     aControlValue,rtl::OUString() );
 
     }
     {
         ImplControlValue aControlValue;
         // #i45896# workaround gcc3.3 temporary problem
-        Region			 aCtrlRegion = Region( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+        Rectangle		 aCtrlRegion( Point( 0, 0 ), GetSizePixel() );
         ControlState	 nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
-        Region aBoundingRgn, aContentRgn;
+        Rectangle aBoundingRgn, aContentRgn;
 
         // get native size of a radio button
         if( pThis->GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
                                            nState, aControlValue, rtl::OUString(),
                                            aBoundingRgn, aContentRgn ) )
         {
-            Rectangle aCont(aContentRgn.GetBoundRect());
-            aSize = aCont.GetSize();
+            aSize = aContentRgn.GetSize();
             bDefaultSize = false;
         }
     }
 
     ImplControlValue aControlValue;
     Size aCurSize( GetSizePixel() );
-    Region aCtrlRegion = Region( Rectangle( Point( 0, 0 ), aCurSize ) );
-    Region aBoundingRgn, aContentRgn;
+    Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize );
+    Rectangle aBoundingRgn, aContentRgn;
     
     // get native size of a radiobutton
     if( GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
                                 CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
                                 aBoundingRgn, aContentRgn ) )
     {
-        Rectangle aCont(aContentRgn.GetBoundRect());
-        Size aSize = aCont.GetSize();
+        Size aSize = aContentRgn.GetSize();
         
         if( aSize.Height() > aCurSize.Height() )
         {
 
     if ( (bNativeOK=IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)) == TRUE )
     {
-        ImplControlValue    aControlValue( meState == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF, rtl::OUString(), 0 );
-        Region              aCtrlRegion( maStateRect );
+        ImplControlValue    aControlValue( meState == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
+        Rectangle           aCtrlRegion( maStateRect );
         ControlState        nState = 0;
 
         if ( HasFocus() ) 						nState |= CTRL_STATE_FOCUSED;
     {
         ImplControlValue aControlValue;
         // #i45896# workaround gcc3.3 temporary problem
-        Region			 aCtrlRegion = Region( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+        Rectangle		 aCtrlRegion( Point( 0, 0 ), GetSizePixel() );
         ControlState	 nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
-        Region aBoundingRgn, aContentRgn;
+        Rectangle aBoundingRgn, aContentRgn;
         
         // get native size of a check box
         if( pThis->GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
                                            nState, aControlValue, rtl::OUString(),
                                            aBoundingRgn, aContentRgn ) )
         {
-            Rectangle aCont(aContentRgn.GetBoundRect());
-            aSize = aCont.GetSize();
+            aSize = aContentRgn.GetSize();
             bDefaultSize = false;
         }
     }
 
     ImplControlValue aControlValue;
     Size aCurSize( GetSizePixel() );
-    Region aCtrlRegion = Region( Rectangle( Point( 0, 0 ), aCurSize ) );
-    Region aBoundingRgn, aContentRgn;
+    Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize );
+    Rectangle aBoundingRgn, aContentRgn;
     
     // get native size of a radiobutton
     if( GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
                                 CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
                                 aBoundingRgn, aContentRgn ) )
     {
-        Rectangle aCont(aContentRgn.GetBoundRect());
-        Size aSize = aCont.GetSize();
+        Size aSize = aContentRgn.GetSize();
         
         if( aSize.Height() > aCurSize.Height() )
         {
     
     Rectangle aStateRect( GetStateRect() );
     
-    ImplControlValue    aControlValue( GetState() == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF, rtl::OUString(), 0 );
-    Region              aCtrlRegion( aStateRect );
+    ImplControlValue    aControlValue( GetState() == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
+    Rectangle           aCtrlRegion( aStateRect );
     ControlState        nState = 0;
 
     if ( HasFocus() )						nState |= CTRL_STATE_FOCUSED;

File vcl/source/control/combobox.cxx

 	if ( !IsDropDownBox() )
 		mnDDHeight += 4;
 
-    Region aCtrlRegion( Rectangle( (const Point&)Point(), Size( 10, 10 ) ) );
-    Region aBoundRegion, aContentRegion;
+    Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) );
+    Rectangle aBoundRegion, aContentRegion;
     ImplControlValue aControlValue;
     ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX;
     if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL,
                                 aControlValue, rtl::OUString(),
                                 aBoundRegion, aContentRegion ) )
     {
-        const long nNCHeight = aBoundRegion.GetBoundRect().GetHeight();
+        const long nNCHeight = aBoundRegion.GetHeight();
         if( mnDDHeight < nNCHeight )
             mnDDHeight = sal::static_int_cast<USHORT>( nNCHeight );
     }
         Window *pBorder = GetWindow( WINDOW_BORDER );
 		ImplControlValue aControlValue;
 		Point aPoint;
-		Region aContent, aBound;
+		Rectangle aContent, aBound;
 
         // use the full extent of the control
-		Region aArea( Rectangle(aPoint, pBorder->GetOutputSizePixel()) );
+		Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
 
 		if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN,
 				aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
             aPoint = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aPoint ) );
             aContent.Move(-aPoint.X(), -aPoint.Y());
 
-		    mpBtn->SetPosSizePixel( aContent.GetBoundRect().Left(), nTop, aContent.GetBoundRect().getWidth(), (nBottom-nTop) );
+		    mpBtn->SetPosSizePixel( aContent.Left(), nTop, aContent.getWidth(), (nBottom-nTop) );
 
             // adjust the size of the edit field
             if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_SUB_EDIT,
                 aContent.Move(-aPoint.X(), -aPoint.Y());
 
                 // use the themes drop down size
-                Rectangle aContentRect = aContent.GetBoundRect();
-                mpSubEdit->SetPosSizePixel( aContentRect.TopLeft(), aContentRect.GetSize() );
+                mpSubEdit->SetPosSizePixel( aContent.TopLeft(), aContent.GetSize() );
             }
             else
             {
                 // use the themes drop down size for the button
-                aOutSz.Width() -= aContent.GetBoundRect().getWidth();
+                aOutSz.Width() -= aContent.getWidth();
                 mpSubEdit->SetSizePixel( aOutSz );
             }
 		}

File vcl/source/control/edit.cxx

     Size aMinSize ( CalcSize( 3 ) );
     if( aSize.Width() < aMinSize.Width() )
         aSize.Width() = aMinSize.Width();
-    // add some space between text entry an border
+    // add some space between text entry and border
     aSize.Height() += 4;
     
 	aSize = CalcWindowSize( aSize );
     // ask NWF what if it has an opinion, too
     ImplControlValue aControlValue;
     Rectangle aRect( Point( 0, 0 ), aSize );
-    Region aContent, aBound;
+    Rectangle aContent, aBound;
     if( const_cast<Edit*>(this)->GetNativeControlRegion(
                    CTRL_EDITBOX, PART_ENTIRE_CONTROL,
                    aRect, 0, aControlValue, rtl::OUString(), aBound, aContent) )
     {
-        Rectangle aBoundRect( aContent.GetBoundRect() );
-        if( aBoundRect.GetHeight() > aSize.Height() )
-            aSize.Height() = aBoundRect.GetHeight();
+        if( aBound.GetHeight() > aSize.Height() )
+            aSize.Height() = aBound.GetHeight();
     }
     return aSize;
 }

File vcl/source/control/ilstbox.cxx

 	        sal_Int32 nLeft, nTop, nRight, nBottom;
 	        pWin->GetBorder( nLeft, nTop, nRight, nBottom );
 	        Point aPoint( -nLeft, -nTop );
-	        Region aCtrlRegion( Rectangle( aPoint - GetPosPixel(), pWin->GetSizePixel() ) );
+	        Rectangle aCtrlRegion( aPoint - GetPosPixel(), pWin->GetSizePixel() );
 
             BOOL bMouseOver = FALSE;
             if( GetParent() )
             if( ! (nParentStyle & WB_BORDER) || (nParentStyle & WB_NOBORDER) )
             {
                 Rectangle aParentRect( Point( 0, 0 ), pWin->GetSizePixel() );
-                Region aParentReg( aParentRect );
-                pWin->DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aParentReg,
+                pWin->DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aParentRect,
                                          nState, aControlValue, rtl::OUString() );
             }
             

File vcl/source/control/lstbox.cxx

             IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
         {
                 ImplControlValue aControlValue;
-                Region aCtrlRegion( Rectangle( (const Point&)Point(), Size( 20, mnDDHeight ) ) );
-                Region aBoundingRgn( aCtrlRegion );
-                Region aContentRgn( aCtrlRegion );
+                Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) );
+                Rectangle aBoundingRgn( aCtrlRegion );
+                Rectangle aContentRgn( aCtrlRegion );
                 if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
                                             CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
                                             aBoundingRgn, aContentRgn ) )
                 {
-                    sal_Int32 nHeight = aBoundingRgn.GetBoundRect().GetHeight();
+                    sal_Int32 nHeight = aBoundingRgn.GetHeight();
                     if( nHeight > mnDDHeight )
                         mnDDHeight = static_cast<USHORT>(nHeight);
                 }
 		Window *pBorder = GetWindow( WINDOW_BORDER );
 		ImplControlValue aControlValue;
 		Point aPoint;
-		Region aContent, aBound;
+		Rectangle aContent, aBound;
 
 		// use the full extent of the control
-		Region aArea( Rectangle(aPoint, pBorder->GetOutputSizePixel()) );
+		Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
 
 		if ( GetNativeControlRegion( CTRL_LISTBOX, PART_BUTTON_DOWN,
 					aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
 			aContent.Move( -aPoint.X(), -aPoint.Y() );
 
 			// use the themes drop down size for the button
-			aOutSz.Width() = aContent.GetBoundRect().Left();
-			mpBtn->SetPosSizePixel( aContent.GetBoundRect().Left(), nTop, aContent.GetBoundRect().Right(), (nBottom-nTop) );
+			aOutSz.Width() = aContent.Left();
+			mpBtn->SetPosSizePixel( aContent.Left(), nTop, aContent.Right(), (nBottom-nTop) );
 
 			// adjust the size of the edit field
 			if ( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT,
 				aContent.Move( -aPoint.X(), -aPoint.Y() );
 
 				// use the themes drop down size
-				Rectangle aContentRect = aContent.GetBoundRect();
                 if( ! (GetStyle() & WB_BORDER) && ImplGetSVData()->maNWFData.mbNoFocusRects )
                 {
                     // no border but focus ring behavior -> we have a problem; the
                     // let's do the best we can and center vertically, so it doesn't look
                     // completely wrong.
                     Size aSz( GetOutputSizePixel() );
-                    long nDiff = aContentRect.Top() - (aSz.Height() - aContentRect.GetHeight())/2;
-                    aContentRect.Top() -= nDiff;
-                    aContentRect.Bottom() -= nDiff;
+                    long nDiff = aContent.Top() - (aSz.Height() - aContent.GetHeight())/2;
+                    aContent.Top() -= nDiff;
+                    aContent.Bottom() -= nDiff;
                 }
-                mpImplWin->SetPosSizePixel( aContentRect.TopLeft(), aContentRect.GetSize() );
+                mpImplWin->SetPosSizePixel( aContent.TopLeft(), aContent.GetSize() );
 			}
 			else
 				mpImplWin->SetSizePixel( aOutSz );
         // see how large the edit area inside is to estimate what is needed for the dropdown
 		ImplControlValue aControlValue;
 		Point aPoint;
-		Region aContent, aBound;
+		Rectangle aContent, aBound;
         Size aTestSize( 100, 20 );
-		Region aArea( Rectangle( aPoint, aTestSize ) );
+		Rectangle aArea( aPoint, aTestSize );
         if( const_cast<ListBox*>(this)->GetNativeControlRegion(
                        CTRL_LISTBOX, PART_SUB_EDIT, aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
         {
             // use the themes drop down size
-            Rectangle aContentRect = aContent.GetBoundRect();
-            aSz.Width() += aTestSize.Width() - aContentRect.GetWidth();
+            aSz.Width() += aTestSize.Width() - aContent.GetWidth();
         }
         else
             aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize();
     {
         ImplControlValue aControlValue;
         Rectangle aRect( Point( 0, 0 ), aSz );
-        Region aContent, aBound;
+        Rectangle aContent, aBound;
         if( const_cast<ListBox*>(this)->GetNativeControlRegion(
                        CTRL_LISTBOX, PART_ENTIRE_CONTROL, aRect, 0, aControlValue, rtl::OUString(), aBound, aContent) )
         {
-            Rectangle aBoundRect( aBound.GetBoundRect() );
-            if( aBoundRect.GetHeight() > aSz.Height() )
-                aSz.Height() = aBoundRect.GetHeight();
+            if( aBound.GetHeight() > aSz.Height() )
+                aSz.Height() = aBound.GetHeight();
         }
     }
     

File vcl/source/control/menubtn.cxx

 
 void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
 {
+    bool bExecute = true;
 	if ( mnMenuMode & MENUBUTTON_MENUMODE_TIMED )
 	{
-		if ( !mpMenuTimer )
-		{
-			mpMenuTimer = new Timer;
-			mpMenuTimer->SetTimeoutHdl( LINK( this, MenuButton, ImplMenuTimeoutHdl ) );
-		}
-
-		mpMenuTimer->SetTimeout( GetSettings().GetMouseSettings().GetActionDelay() );
-		mpMenuTimer->Start();
-
-		PushButton::MouseButtonDown( rMEvt );
+	    // if the separated dropdown symbol is hit,
+	    // execute the popup immediately
+	    if( ! ImplGetSymbolRect().IsInside( rMEvt.GetPosPixel() ) )
+	    {
+            if ( !mpMenuTimer )
+            {
+                mpMenuTimer = new Timer;
+                mpMenuTimer->SetTimeoutHdl( LINK( this, MenuButton, ImplMenuTimeoutHdl ) );
+            }
+    
+            mpMenuTimer->SetTimeout( GetSettings().GetMouseSettings().GetActionDelay() );
+            mpMenuTimer->Start();
+    
+            PushButton::MouseButtonDown( rMEvt );
+            bExecute = false;
+        }
 	}
-	else
+	if( bExecute )
 	{
 		if ( PushButton::ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) )
 		{

File vcl/source/control/scrbar.cxx

 	Rectangle& maTrackRect = mpData->maTrackRect;  // TODO: remove when maTrackRect is no longer in mpData
     if ( mbCalcSize )
     {
-        const Region aControlRegion( Rectangle( (const Point&)Point(0,0), aSize ) );
-        Region aBtn1Region, aBtn2Region, aTrackRegion, aBoundingRegion;
+        const Rectangle aControlRegion( Point(0,0), aSize );
+        Rectangle aBtn1Region, aBtn2Region, aTrackRegion, aBoundingRegion;
 
         if ( GetStyle() & WB_HORZ )
         {
                  GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_RIGHT,
                         aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aBtn2Region ) )
             {
-                maBtn1Rect = aBtn1Region.GetBoundRect();
-                maBtn2Rect = aBtn2Region.GetBoundRect();
+                maBtn1Rect = aBtn1Region;
+                maBtn2Rect = aBtn2Region;
             }
             else
             {
 
             if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_HORZ_AREA,
 	                 aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aTrackRegion ) )
-                maTrackRect = aTrackRegion.GetBoundRect();
+                maTrackRect = aTrackRegion;
             else
                 maTrackRect = Rectangle( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() );
 
                  GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_DOWN,
                         aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aBtn2Region ) )
             {
-                maBtn1Rect = aBtn1Region.GetBoundRect();
-                maBtn2Rect = aBtn2Region.GetBoundRect();
+                maBtn1Rect = aBtn1Region;
+                maBtn2Rect = aBtn2Region;
             }
             else
             {
 
             if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_VERT_AREA,
 	                 aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aTrackRegion ) )
-                maTrackRect = aTrackRegion.GetBoundRect();
+                maTrackRect = aTrackRegion;
 			else
 				maTrackRect = Rectangle( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() );
 
 
 BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
 {
-    ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
+    ScrollbarValue scrValue;
 
     BOOL bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
     if( bNativeOK )
         if( IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT) )
         {
             ControlState		nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 );
-            ScrollbarValue	scrValue;
 
             scrValue.mnMin = mnMinRange;
             scrValue.mnMax = mnMaxRange;
                 }
             }
 
-            aControlValue.setOptionalVal( (void *)(&scrValue) );
-
-#if 1
-            Region aCtrlRegion;
+            Rectangle aCtrlRegion;
             aCtrlRegion.Union( maBtn1Rect );
             aCtrlRegion.Union( maBtn2Rect );
             aCtrlRegion.Union( maPage1Rect );
             aCtrlRegion.Union( maPage2Rect );
             aCtrlRegion.Union( maThumbRect );
-#else
-			const Region aCtrlRegion( Rectangle( Point(0,0), GetOutputSizePixel() ) );
-#endif
             bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT),
-                            aCtrlRegion, nState, aControlValue, rtl::OUString() );
+                            aCtrlRegion, nState, scrValue, rtl::OUString() );
         }
         else
       {
         {
             sal_uInt32	part1 = bHorz ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER;
             sal_uInt32	part2 = bHorz ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER;
-            Region  	aCtrlRegion1( maPage1Rect );
-            Region  	aCtrlRegion2( maPage2Rect );
+            Rectangle   aCtrlRegion1( maPage1Rect );
+            Rectangle   aCtrlRegion2( maPage2Rect );
             ControlState nState1 = (IsEnabled() ? CTRL_STATE_ENABLED : 0) | (HasFocus() ? CTRL_STATE_FOCUSED : 0);
             ControlState nState2 = nState1;
 
 
             if ( nDrawFlags & SCRBAR_DRAW_PAGE1 )
                 bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1, 
-                                aControlValue, rtl::OUString() );
+                                scrValue, rtl::OUString() );
 
             if ( nDrawFlags & SCRBAR_DRAW_PAGE2 )
                 bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2, 
-                                aControlValue, rtl::OUString() );
+                                scrValue, rtl::OUString() );
         }
         if ( (nDrawFlags & SCRBAR_DRAW_BTN1) || (nDrawFlags & SCRBAR_DRAW_BTN2) )
         {
             sal_uInt32	part1 = bHorz ? PART_BUTTON_LEFT : PART_BUTTON_UP;
             sal_uInt32	part2 = bHorz ? PART_BUTTON_RIGHT : PART_BUTTON_DOWN;
-            Region  	aCtrlRegion1( maBtn1Rect );
-            Region  	aCtrlRegion2( maBtn2Rect );
+            Rectangle  	aCtrlRegion1( maBtn1Rect );
+            Rectangle  	aCtrlRegion2( maBtn2Rect );
             ControlState nState1 = HasFocus() ? CTRL_STATE_FOCUSED : 0;
             ControlState nState2 = nState1;
 
 
             if ( nDrawFlags & SCRBAR_DRAW_BTN1 )
                 bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1, 
-                                aControlValue, rtl::OUString() );
+                                scrValue, rtl::OUString() );
 
             if ( nDrawFlags & SCRBAR_DRAW_BTN2 )
                 bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2, 
-                                aControlValue, rtl::OUString() );
+                                scrValue, rtl::OUString() );
         }
         if ( (nDrawFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty() )
         {
             ControlState	nState = IsEnabled() ? CTRL_STATE_ENABLED : 0;
-            Region		aCtrlRegion( maThumbRect );
+            Rectangle		aCtrlRegion( maThumbRect );
 
             if ( mnStateFlags & SCRBAR_STATE_THUMB_DOWN )
                 nState |= CTRL_STATE_PRESSED;
             }
 
             bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, (bHorz ? PART_THUMB_HORZ : PART_THUMB_VERT),
-                    aCtrlRegion, nState, aControlValue, rtl::OUString() );
+                    aCtrlRegion, nState, scrValue, rtl::OUString() );
         }
       }
     }
     BOOL    bIsInside = FALSE;
 
     Point aPoint( 0, 0 );
-    Region aControlRegion( Rectangle( aPoint, GetOutputSizePixel() ) );
+    Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
 
     switch ( meScrollType )
     {
         case SCROLL_PAGEUP:
             // HitTestNativeControl, see remark at top of file
             if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT: PART_TRACK_VERT_UPPER,
-                                       Region( maPage1Rect ), rMousePos, bIsInside )?
+                                       maPage1Rect, rMousePos, bIsInside )?
                     bIsInside:
                     maPage1Rect.IsInside( rMousePos ) )
             {
         case SCROLL_PAGEDOWN:
             // HitTestNativeControl, see remark at top of file
             if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_RIGHT: PART_TRACK_VERT_LOWER,
-                                       Region( maPage2Rect ), rMousePos, bIsInside )?
+                                       maPage2Rect, rMousePos, bIsInside )?
                     bIsInside:
                     maPage2Rect.IsInside( rMousePos ) )
             {
         BOOL            bDragToMouse = FALSE;
 
         Point aPoint( 0, 0 );
-        Region aControlRegion( Rectangle( aPoint, GetOutputSizePixel() ) );
+        Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
 
         if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_BUTTON_LEFT: PART_BUTTON_UP,
                     aControlRegion, rMousePos, bIsInside )?
         else
         {
             bool bThumbHit = HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_THUMB_HORZ : PART_THUMB_VERT,
-                                                   Region( maThumbRect ), rMousePos, bIsInside )
+                                                   maThumbRect, rMousePos, bIsInside )
                              ? bIsInside : maThumbRect.IsInside( rMousePos );
             bool bDragHandling = rMEvt.IsMiddle() || bThumbHit || ImplGetSVData()->maNWFData.mbScrollbarJumpPage;
             if( bDragHandling )
     
                 // HitTestNativeControl, see remark at top of file
                 if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
-                                           Region( maPage1Rect ), rMousePos, bIsInside )?
+                                           maPage1Rect, rMousePos, bIsInside )?
                     bIsInside:                
                     maPage1Rect.IsInside( rMousePos ) )
                 {
     BOOL    bIsInside = FALSE;
 
     Point aPoint( 0, 0 );
-    Region aControlRegion( Rectangle( aPoint, GetOutputSizePixel() ) );
+    Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
 
     if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_BUTTON_LEFT: PART_BUTTON_UP,
                 aControlRegion, rPt, bIsInside )?
         return &maBtn2Rect;
     // HitTestNativeControl, see remark at top of file
     else if( HitTestNativeControl( CTRL_SCROLLBAR,  bHorizontal ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
-                Region( maPage1Rect ), rPt, bIsInside)?
+                maPage1Rect, rPt, bIsInside)?
             bIsInside:
             maPage1Rect.IsInside( rPt ) )
         return &maPage1Rect;
     // HitTestNativeControl, see remark at top of file
     else if( HitTestNativeControl( CTRL_SCROLLBAR,  bHorizontal ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER,
-                Region( maPage2Rect ), rPt, bIsInside)?
+                maPage2Rect, rPt, bIsInside)?
             bIsInside:
             maPage2Rect.IsInside( rPt ) )
         return &maPage2Rect;
     // HitTestNativeControl, see remark at top of file
     else if( HitTestNativeControl( CTRL_SCROLLBAR,  bHorizontal ? PART_THUMB_HORZ : PART_THUMB_VERT,
-                Region( maThumbRect ), rPt, bIsInside)?
+                maThumbRect, rPt, bIsInside)?
              bIsInside:
              maThumbRect.IsInside( rPt ) )
         return &maThumbRect;

File vcl/source/control/slider.cxx

 			else
 				maChannel2Rect.SetEmpty();
 			
-			const Region aControlRegion( Rectangle( Point(0,0), Size( SLIDER_THUMB_SIZE, 10 ) ) );
-			Region aThumbBounds, aThumbContent;
+			const Rectangle aControlRegion( Rectangle( Point(0,0), Size( SLIDER_THUMB_SIZE, 10 ) ) );
+			Rectangle aThumbBounds, aThumbContent;
             if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_HORZ,
                                          aControlRegion, 0, ImplControlValue(), rtl::OUString(),
                                          aThumbBounds, aThumbContent ) )
             {
-                Rectangle aRect( aThumbBounds.GetBoundRect() );
-                maThumbRect.Left() = mnThumbPixPos - aRect.GetWidth()/2;
-                maThumbRect.Right() = maThumbRect.Left() + aRect.GetWidth() - 1;
+                maThumbRect.Left() = mnThumbPixPos - aThumbBounds.GetWidth()/2;
+                maThumbRect.Right() = maThumbRect.Left() + aThumbBounds.GetWidth() - 1;
                 bInvalidateAll = true;
             }
 		}
 			else
 				maChannel2Rect.SetEmpty();
 
-			const Region aControlRegion( Rectangle( Point(0,0), Size( 10, SLIDER_THUMB_SIZE ) ) );
-			Region aThumbBounds, aThumbContent;
+			const Rectangle aControlRegion( Rectangle( Point(0,0), Size( 10, SLIDER_THUMB_SIZE ) ) );
+			Rectangle aThumbBounds, aThumbContent;
             if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_VERT,
                                          aControlRegion, 0, ImplControlValue(), rtl::OUString(),
                                          aThumbBounds, aThumbContent ) )
             {
-                Rectangle aRect( aThumbBounds.GetBoundRect() );
-                maThumbRect.Top() = mnThumbPixPos - aRect.GetHeight()/2;
-                maThumbRect.Bottom() = maThumbRect.Top() + aRect.GetHeight() - 1;
+                maThumbRect.Top() = mnThumbPixPos - aThumbBounds.GetHeight()/2;
+                maThumbRect.Bottom() = maThumbRect.Top() + aThumbBounds.GetHeight() - 1;
                 bInvalidateAll = true;
             }
 		}
 		ImplCalc( FALSE );
 
     ControlPart nPart = (GetStyle() & WB_HORZ) ? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA;
-    ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
     ControlState   nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 );
     SliderValue    sldValue;
     
         if( maThumbRect.IsInside( GetPointerPosPixel() ) )
             sldValue.mnThumbState |= CTRL_STATE_ROLLOVER;
     }
-    aControlValue.setOptionalVal( (void *)(&sldValue) );
 
-    const Region aCtrlRegion( Rectangle( Point(0,0), GetOutputSizePixel() ) );
+    const Rectangle aCtrlRegion( Point(0,0), GetOutputSizePixel() );
     bool bNativeOK = DrawNativeControl( CTRL_SLIDER, nPart,
-                                        aCtrlRegion, nState, aControlValue, rtl::OUString() );
+                                        aCtrlRegion, nState, sldValue, rtl::OUString() );
     if( bNativeOK )
         return;
 

File vcl/source/control/spinfld.cxx

         // there is just no useful native support for spinfields with dropdown
         !(pWin->GetStyle() & WB_DROPDOWN) )
     {
-        ImplControlValue aControlValue;
-        aControlValue.setOptionalVal( (void*) &rSpinbuttonValue );
-
         if( pWin->IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnUpperPart) && 
             pWin->IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnLowerPart) )
         {
             // only paint the embedded spin buttons, all buttons are painted at once
-            bNativeOK = pWin->DrawNativeControl( CTRL_SPINBOX, PART_ALL_BUTTONS, Region(), CTRL_STATE_ENABLED,
-                        aControlValue, rtl::OUString() );
+            bNativeOK = pWin->DrawNativeControl( CTRL_SPINBOX, PART_ALL_BUTTONS, Rectangle(), CTRL_STATE_ENABLED,
+                        rSpinbuttonValue, rtl::OUString() );
         }
         else
         {
 
             Point aPt;
             Size aSize( pBorder->GetOutputSizePixel() );    // the size of the border window, i.e., the whole control
-            Region aBound, aContent;
-            Region aNatRgn( Rectangle( aPt, aSize ) );
+            Rectangle aBound, aContent;
+            Rectangle aNatRgn( aPt, aSize );
             if( pBorder->GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL,
-                    aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
+                    aNatRgn, 0, rSpinbuttonValue, rtl::OUString(), aBound, aContent) )
             {
-                aSize = aContent.GetBoundRect().GetSize();
+                aSize = aContent.GetSize();
             }
             
-            Region aRgn( Rectangle( aPt, aSize ) );
+            Rectangle aRgn( aPt, aSize );
             bNativeOK = pBorder->DrawNativeControl( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, CTRL_STATE_ENABLED,
-                        aControlValue, rtl::OUString() );
+                        rSpinbuttonValue, rtl::OUString() );
 
             pBorder->SetClipRegion( oldRgn );
         }
 
     if( pWin->IsNativeControlSupported(CTRL_SPINBUTTONS, PART_ENTIRE_CONTROL) )
     {
-        ImplControlValue aControlValue;
-        aControlValue.setOptionalVal( (void*) &rSpinbuttonValue );
-
         // only paint the standalone spin buttons, all buttons are painted at once
-        bNativeOK = pWin->DrawNativeControl( CTRL_SPINBUTTONS, PART_ALL_BUTTONS, Region(), CTRL_STATE_ENABLED,
-                    aControlValue, rtl::OUString() );
+        bNativeOK = pWin->DrawNativeControl( CTRL_SPINBUTTONS, PART_ALL_BUTTONS, Rectangle(), CTRL_STATE_ENABLED,
+                    rSpinbuttonValue, rtl::OUString() );
     }
     return bNativeOK;
 }
 			nBottom1--;
 
         BOOL bNativeRegionOK = FALSE;
-        Region aContentUp, aContentDown;
+        Rectangle aContentUp, aContentDown;
 
 		if ( (pDev->GetOutDevType() == OUTDEV_WINDOW) &&
             // there is just no useful native support for spinfields with dropdown
 
             // get the system's spin button size
 		    ImplControlValue aControlValue;
-		    Region aBound;
+		    Rectangle aBound;
 		    Point aPoint;
 
             // use the full extent of the control
-		    Region aArea( Rectangle( aPoint, pBorder->GetOutputSizePixel() ) );
+		    Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
 
 		    bNativeRegionOK = 
                 pWin->GetNativeControlRegion(CTRL_SPINBOX, PART_BUTTON_UP,
 
         if( bNativeRegionOK )
         {
-		    rSpinUpArea = aContentUp.GetBoundRect();
-		    rSpinDownArea = aContentDown.GetBoundRect();
+		    rSpinUpArea = aContentUp;
+		    rSpinDownArea = aContentDown;
         }
         else
         {
 
             ImplControlValue aControlValue;
             Point aPoint;
-            Region aContent, aBound;
+            Rectangle aContent, aBound;
     
             // use the full extent of the control
             Window *pBorder = GetWindow( WINDOW_BORDER );
-            Region aArea( Rectangle(aPoint, pBorder->GetOutputSizePixel()) );
+            Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
 
             // adjust position and size of the edit field
             if ( GetNativeControlRegion(CTRL_SPINBOX, PART_SUB_EDIT,
                 aContent.Move(-aPoint.X(), -aPoint.Y());
 
                 // use the themes drop down size
-                Rectangle aContentRect = aContent.GetBoundRect();
-                mpEdit->SetPosPixel( aContentRect.TopLeft() );
+                mpEdit->SetPosPixel( aContent.TopLeft() );
                 bSubEditPositioned = true;
-                aSize = aContentRect.GetSize();
+                aSize = aContent.GetSize();
             }
             else
             {

File vcl/source/control/tabctrl.cxx

     aSize.Width()  += TAB_TABOFFSET_X*2;
     aSize.Height() += TAB_TABOFFSET_Y*2;
 
-    Region aCtrlRegion(  Rectangle( (const Point&)Point( 0, 0 ), aSize ) );
-    Region aBoundingRgn, aContentRgn;
-    const ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
+    Rectangle aCtrlRegion( Point( 0, 0 ), aSize );
+    Rectangle aBoundingRgn, aContentRgn;
+    const ImplControlValue aControlValue;
     if(GetNativeControlRegion( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, aCtrlRegion,
                                            CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
                                            aBoundingRgn, aContentRgn ) )
     {
-        Rectangle aCont(aContentRgn.GetBoundRect());
-        return aCont.GetSize();
+        return aContentRgn.GetSize();
     }
 
     // For systems without synthetic bold support
 
     if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) == TRUE )
     {
-        ImplControlValue		aControlValue;
-        Region				aCtrlRegion( pItem->maRect );
+        Rectangle           aCtrlRegion( pItem->maRect );
         ControlState		nState = 0;
 
         if( pItem->mnId == mnCurPageId )
             tiValue.mnAlignment |= TABITEM_FIRST_IN_GROUP;
         if ( bLastInGroup )
             tiValue.mnAlignment |= TABITEM_LAST_IN_GROUP;
-        aControlValue.setOptionalVal( (void *)(&tiValue) );
 
         bNativeOK = DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
-                    aControlValue, rtl::OUString() );
+                    tiValue, rtl::OUString() );
     }
 
     if( ! bLayout && !bNativeOK )
     BOOL bNativeOK = FALSE;
     if( ! bLayout && (bNativeOK = IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) == TRUE )
     {
-        const ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
+        const ImplControlValue aControlValue;
 
         ControlState nState = CTRL_STATE_ENABLED;
         int part = PART_ENTIRE_CONTROL;
         if( !rRect.IsEmpty() )
             aClipRgn.Intersect( rRect );
 
-        Region aCtrlRegion( aRect );
-        Rectangle aClipRect( aClipRgn.GetBoundRect() );
-        if( !aClipRgn.IsEmpty() ) //&& aClipRect.getHeight() && aClipRect.getWidth() )
-            bNativeOK = DrawNativeControl( CTRL_TAB_PANE, part, aCtrlRegion, nState,
+        if( !aClipRgn.IsEmpty() )
+            bNativeOK = DrawNativeControl( CTRL_TAB_PANE, part, aRect, nState,
                 aControlValue, rtl::OUString() );
     }
     else

File vcl/source/gdi/makefile.mk

 EXCEPTIONSFILES=	$(SLO)$/salmisc.obj 	\
                     $(SLO)$/outdev.obj		\
 					$(SLO)$/outdev3.obj 	\
+					$(SLO)$/outdevnative.obj 	\
 					$(SLO)$/gfxlink.obj		\
 					$(SLO)$/print.obj		\
                     $(SLO)$/print2.obj		\
 			$(SLO)$/outdev4.obj 	\
 			$(SLO)$/outdev5.obj 	\
 			$(SLO)$/outdev6.obj 	\
-			$(SLO)$/outdevnative.obj 	\
 			$(SLO)$/regband.obj 	\
 			$(SLO)$/region.obj		\
 			$(SLO)$/wall.obj		\

File vcl/source/gdi/outdev3.cxx