diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-07-05 11:20:24 +0200 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-07-05 11:20:24 +0200 |
commit | 599bb6c7fb505044634c65983508dcaa1425ca8b (patch) | |
tree | dc442b2f926858a6e922cb0bb703c0a8307f8d39 /vcl/source/control | |
parent | 30f3d5468216a926c5380d55666d6d2d2bb6f60b (diff) |
ooo33gsl02: #i112873# change NativeWidget methods to be prepared for mapmodes
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/button.cxx | 63 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 17 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 9 | ||||
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 5 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 39 | ||||
-rw-r--r-- | vcl/source/control/scrbar.cxx | 69 | ||||
-rw-r--r-- | vcl/source/control/slider.cxx | 24 | ||||
-rw-r--r-- | vcl/source/control/spinfld.cxx | 45 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 23 |
9 files changed, 127 insertions, 167 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index d66389eee62d..edec18950dd0 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1314,7 +1314,6 @@ void PushButton::ImplDrawPushButton( bool 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; @@ -1326,7 +1325,7 @@ void PushButton::ImplDrawPushButton( bool bLayout ) 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() ); } } @@ -1338,10 +1337,8 @@ void PushButton::ImplDrawPushButton( bool bLayout ) 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; @@ -1354,7 +1351,7 @@ void PushButton::ImplDrawPushButton( bool bLayout ) 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) @@ -1373,7 +1370,7 @@ void PushButton::ImplDrawPushButton( bool bLayout ) 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) ) { @@ -1434,22 +1431,19 @@ void PushButton::ImplSetDefButton( BOOL bSet ) 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(); @@ -2334,9 +2328,8 @@ void RadioButton::ImplDrawRadioButtonState() // 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; @@ -2347,7 +2340,7 @@ void RadioButton::ImplDrawRadioButtonState() 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() ); } @@ -3198,17 +3191,16 @@ Size RadioButton::ImplGetRadioImageSize() const { 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; } } @@ -3323,16 +3315,15 @@ void RadioButton::ImplSetMinimumNWFSize() 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() ) { @@ -3509,8 +3500,8 @@ void CheckBox::ImplDrawCheckBoxState() 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; @@ -4144,17 +4135,16 @@ Size CheckBox::ImplGetCheckImageSize() const { 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; } } @@ -4234,16 +4224,15 @@ void CheckBox::ImplSetMinimumNWFSize() 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() ) { @@ -4444,8 +4433,8 @@ void DisclosureButton::ImplDrawCheckBoxState() 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; diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index f5c04b7c3cfa..8efa3404a44a 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -139,8 +139,8 @@ void ComboBox::ImplCalcEditHeight() 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, @@ -149,7 +149,7 @@ void ComboBox::ImplCalcEditHeight() 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 ); } @@ -629,10 +629,10 @@ void ComboBox::Resize() 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) ) @@ -641,7 +641,7 @@ void ComboBox::Resize() 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, @@ -651,13 +651,12 @@ void ComboBox::Resize() 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 ); } } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 0a29a627b8e3..c0e7b352642c 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2842,7 +2842,7 @@ Size Edit::CalcMinimumSize() const 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 ); @@ -2850,14 +2850,13 @@ Size Edit::CalcMinimumSize() const // 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; } diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index ebccfdc1e6bb..02c8d2b5fcb3 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -2819,7 +2819,7 @@ void ImplWin::ImplDraw( bool bLayout ) 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() ) @@ -2838,8 +2838,7 @@ void ImplWin::ImplDraw( bool bLayout ) 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() ); } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 6c7df5b106bf..eb8c20d1d803 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -129,14 +129,14 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle ) 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); } @@ -652,10 +652,10 @@ void ListBox::Resize() 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) ) @@ -665,8 +665,8 @@ void ListBox::Resize() 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, @@ -676,7 +676,6 @@ void ListBox::Resize() 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 @@ -684,11 +683,11 @@ void ListBox::Resize() // 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 ); @@ -1327,15 +1326,14 @@ Size ListBox::CalcMinimumSize() const // 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(); @@ -1347,13 +1345,12 @@ Size ListBox::CalcMinimumSize() const { 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(); } } diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 54a1e0a97eab..9c82bb096dec 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -342,8 +342,8 @@ void ScrollBar::ImplCalc( BOOL bUpdate ) 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 ) { @@ -352,8 +352,8 @@ void ScrollBar::ImplCalc( BOOL bUpdate ) GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_RIGHT, aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aBtn2Region ) ) { - maBtn1Rect = aBtn1Region.GetBoundRect(); - maBtn2Rect = aBtn2Region.GetBoundRect(); + maBtn1Rect = aBtn1Region; + maBtn2Rect = aBtn2Region; } else { @@ -366,7 +366,7 @@ void ScrollBar::ImplCalc( BOOL bUpdate ) 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() ); @@ -393,8 +393,8 @@ void ScrollBar::ImplCalc( BOOL bUpdate ) GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_DOWN, aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aBtn2Region ) ) { - maBtn1Rect = aBtn1Region.GetBoundRect(); - maBtn2Rect = aBtn2Region.GetBoundRect(); + maBtn1Rect = aBtn1Region; + maBtn2Rect = aBtn2Region; } else { @@ -407,7 +407,7 @@ void ScrollBar::ImplCalc( BOOL bUpdate ) 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() ); @@ -524,7 +524,7 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags ) { - ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 ); + ScrollbarValue scrValue; BOOL bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL); if( bNativeOK ) @@ -535,7 +535,6 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags ) 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; @@ -570,20 +569,14 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags ) } } - 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 { @@ -591,8 +584,8 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags ) { 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; @@ -613,18 +606,18 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags ) 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; @@ -655,16 +648,16 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags ) 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; @@ -683,7 +676,7 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags ) } bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, (bHorz ? PART_THUMB_HORZ : PART_THUMB_VERT), - aCtrlRegion, nState, aControlValue, rtl::OUString() ); + aCtrlRegion, nState, scrValue, rtl::OUString() ); } } } @@ -920,7 +913,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction ) BOOL bIsInside = FALSE; Point aPoint( 0, 0 ); - Region aControlRegion( Rectangle( aPoint, GetOutputSizePixel() ) ); + Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); switch ( meScrollType ) { @@ -953,7 +946,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction ) 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 ) ) { @@ -967,7 +960,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction ) 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 ) ) { @@ -1030,7 +1023,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) 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 )? @@ -1063,7 +1056,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) 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 ) @@ -1112,7 +1105,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) // 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 ) ) { @@ -1387,7 +1380,7 @@ Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt ) 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 )? @@ -1401,19 +1394,19 @@ Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt ) 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; diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 2390a8e3e9a6..daf733a57a33 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -195,15 +195,14 @@ void Slider::ImplUpdateRects( BOOL bUpdate ) 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; } } @@ -230,15 +229,14 @@ void Slider::ImplUpdateRects( BOOL bUpdate ) 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; } } @@ -388,7 +386,6 @@ void Slider::ImplDraw( USHORT nDrawFlags ) 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; @@ -402,11 +399,10 @@ void Slider::ImplDraw( USHORT nDrawFlags ) 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; diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index d18a412e31cc..754270e9012f 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -88,15 +88,12 @@ BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonVa // 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 { @@ -115,17 +112,17 @@ BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonVa 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 ); } @@ -139,12 +136,9 @@ BOOL ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbutton 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; } @@ -705,7 +699,7 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec 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 @@ -717,11 +711,11 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec // 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, @@ -740,8 +734,8 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec if( bNativeRegionOK ) { - rSpinUpArea = aContentUp.GetBoundRect(); - rSpinDownArea = aContentDown.GetBoundRect(); + rSpinUpArea = aContentUp; + rSpinDownArea = aContentDown; } else { @@ -774,11 +768,11 @@ void SpinField::Resize() 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, @@ -789,10 +783,9 @@ void SpinField::Resize() 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 { diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 95f84626b582..c892b32534ec 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -411,15 +411,14 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) 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 @@ -938,8 +937,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo 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 ) @@ -974,10 +972,9 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo 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 ) @@ -1236,7 +1233,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout ) 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; @@ -1250,10 +1247,8 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout ) 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 |