diff options
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/button.cxx | 156 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 28 | ||||
-rw-r--r-- | vcl/source/control/ctrl.cxx | 22 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 38 | ||||
-rw-r--r-- | vcl/source/control/fixed.cxx | 20 | ||||
-rw-r--r-- | vcl/source/control/fixedhyper.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/group.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/imgctrl.cxx | 12 | ||||
-rw-r--r-- | vcl/source/control/imp_listbox.cxx | 36 | ||||
-rw-r--r-- | vcl/source/control/listbox.cxx | 38 | ||||
-rw-r--r-- | vcl/source/control/menubtn.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/morebtn.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/notebookbar.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/prgsbar.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/scrbar.cxx | 50 | ||||
-rw-r--r-- | vcl/source/control/slider.cxx | 22 | ||||
-rw-r--r-- | vcl/source/control/spinbtn.cxx | 30 | ||||
-rw-r--r-- | vcl/source/control/spinfld.cxx | 68 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 104 |
19 files changed, 323 insertions, 323 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index e94df630f4db..64c078e070fa 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -73,7 +73,7 @@ class ImplCommonButtonData public: ImplCommonButtonData(); - Rectangle maFocusRect; + tools::Rectangle maFocusRect; long mnSeparatorX; DrawButtonFlags mnButtonState; bool mbSmallSymbol; @@ -200,7 +200,7 @@ ImageAlign Button::GetImageAlign() const return mpButtonData->meImageAlign; } -void Button::SetFocusRect( const Rectangle& rFocusRect ) +void Button::SetFocusRect( const tools::Rectangle& rFocusRect ) { ImplSetFocusRect( rFocusRect ); } @@ -247,7 +247,7 @@ DrawTextFlags Button::ImplGetTextStyle(OUString& rText, WinBits nWinStyle, DrawF void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Size& rSize, sal_uLong nImageSep, DrawFlags nDrawFlags, - DrawTextFlags nTextStyle, Rectangle *pSymbolRect, + DrawTextFlags nTextStyle, tools::Rectangle *pSymbolRect, bool bAddImageSep) { OUString aText(GetText()); @@ -260,7 +260,7 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, return; WinBits nWinStyle = GetStyle(); - Rectangle aOutRect( rPos, rSize ); + tools::Rectangle aOutRect( rPos, rSize ); ImageAlign eImageAlign = mpButtonData->meImageAlign; Size aImageSize = mpButtonData->maImage.GetSizePixel(); @@ -300,8 +300,8 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Size aMax; Point aImagePos = rPos; Point aTextPos = rPos; - Rectangle aUnion = Rectangle(aImagePos, aImageSize); - Rectangle aSymbol; + tools::Rectangle aUnion = tools::Rectangle(aImagePos, aImageSize); + tools::Rectangle aSymbol; long nSymbolHeight = 0; if (bDrawText || bHasSymbol) @@ -309,7 +309,7 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, // Get the size of the text output area ( the symbol will be drawn in // this area as well, so the symbol rectangle will be calculated here, too ) - Rectangle aRect = Rectangle(Point(), rSize); + tools::Rectangle aRect = tools::Rectangle(Point(), rSize); Size aTSSize; if (bHasSymbol) @@ -320,14 +320,14 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, if (mpButtonData->mbSmallSymbol) nSymbolHeight = nSymbolHeight * 3 / 4; - aSymbol = Rectangle(Point(), Size(nSymbolHeight, nSymbolHeight)); + aSymbol = tools::Rectangle(Point(), Size(nSymbolHeight, nSymbolHeight)); ImplCalcSymbolRect(aSymbol); aRect.Left() += 3 * nSymbolHeight / 2; aTSSize.Width() = 3 * nSymbolHeight / 2; } else { - aSymbol = Rectangle(Point(), rSize); + aSymbol = tools::Rectangle(Point(), rSize); ImplCalcSymbolRect(aSymbol); aTSSize.Width() = aSymbol.GetWidth(); } @@ -433,8 +433,8 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, aTextPos.X() = rPos.X() + (aMax.Width() - aTSSize.Width()) / 2; aTextPos.Y() = rPos.Y() + (aMax.Height() - aTSSize.Height()) / 2; } - aUnion = Rectangle(aImagePos, aImageSize); - aUnion.Union(Rectangle(aTextPos, aTSSize)); + aUnion = tools::Rectangle(aImagePos, aImageSize); + aUnion.Union(tools::Rectangle(aTextPos, aTSSize)); } // Now place the combination of text and image in the output area of the button @@ -479,11 +479,11 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, if (mpButtonData->meSymbolAlign == SymbolAlign::RIGHT) { Point aRightPos = Point(aTextPos.X() + aTextSize.Width() + aSymbolSize.Width() / 2, aTextPos.Y()); - *pSymbolRect = Rectangle(aRightPos, aSymbolSize); + *pSymbolRect = tools::Rectangle(aRightPos, aSymbolSize); } else { - *pSymbolRect = Rectangle(aTextPos, aSymbolSize); + *pSymbolRect = tools::Rectangle(aTextPos, aSymbolSize); aTextPos.X() += 3 * nSymbolHeight / 2; } if (mpButtonData->mbSmallSymbol) @@ -508,20 +508,20 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, if (bDrawText) { - const Rectangle aTOutRect(aTextPos, aTextSize); + const tools::Rectangle aTOutRect(aTextPos, aTextSize); ImplSetFocusRect(aTOutRect); DrawControlText(*pDev, aTOutRect, aText, nTextStyle, nullptr, nullptr, &aDeviceTextSize); } else { - ImplSetFocusRect(Rectangle(aImagePos, aImageSize)); + ImplSetFocusRect(tools::Rectangle(aImagePos, aImageSize)); } } -void Button::ImplSetFocusRect(const Rectangle &rFocusRect) +void Button::ImplSetFocusRect(const tools::Rectangle &rFocusRect) { - Rectangle aFocusRect = rFocusRect; - Rectangle aOutputRect = Rectangle(Point(), GetOutputSizePixel()); + tools::Rectangle aFocusRect = rFocusRect; + tools::Rectangle aOutputRect = tools::Rectangle(Point(), GetOutputSizePixel()); if (!aFocusRect.IsEmpty()) { @@ -543,7 +543,7 @@ void Button::ImplSetFocusRect(const Rectangle &rFocusRect) mpButtonData->maFocusRect = aFocusRect; } -const Rectangle& Button::ImplGetFocusRect() const +const tools::Rectangle& Button::ImplGetFocusRect() const { return mpButtonData->maFocusRect; } @@ -726,7 +726,7 @@ void PushButton::ImplInitSettings( bool bFont, } void PushButton::ImplDrawPushButtonFrame(vcl::RenderContext& rRenderContext, - Rectangle& rRect, DrawButtonFlags nStyle) + tools::Rectangle& rRect, DrawButtonFlags nStyle) { if (!(GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE))) { @@ -759,7 +759,7 @@ bool PushButton::ImplHitTestPushButton( vcl::Window* pDev, const Point& rPos ) { Point aTempPoint; - Rectangle aTestRect( aTempPoint, pDev->GetOutputSizePixel() ); + tools::Rectangle aTestRect( aTempPoint, pDev->GetOutputSizePixel() ); return aTestRect.IsInside( rPos ); } @@ -811,25 +811,25 @@ static void ImplDrawBtnDropDownArrow( OutputDevice* pDev, pDev->SetFillColor( Color( COL_BLACK ) ); else pDev->SetFillColor( rColor ); - pDev->DrawRect( Rectangle( nX+0, nY+0, nX+6, nY+0 ) ); - pDev->DrawRect( Rectangle( nX+1, nY+1, nX+5, nY+1 ) ); - pDev->DrawRect( Rectangle( nX+2, nY+2, nX+4, nY+2 ) ); - pDev->DrawRect( Rectangle( nX+3, nY+3, nX+3, nY+3 ) ); + pDev->DrawRect( tools::Rectangle( nX+0, nY+0, nX+6, nY+0 ) ); + pDev->DrawRect( tools::Rectangle( nX+1, nY+1, nX+5, nY+1 ) ); + pDev->DrawRect( tools::Rectangle( nX+2, nY+2, nX+4, nY+2 ) ); + pDev->DrawRect( tools::Rectangle( nX+3, nY+3, nX+3, nY+3 ) ); if ( bBlack ) { pDev->SetFillColor( rColor ); - pDev->DrawRect( Rectangle( nX+2, nY+1, nX+4, nY+1 ) ); - pDev->DrawRect( Rectangle( nX+3, nY+2, nX+3, nY+2 ) ); + pDev->DrawRect( tools::Rectangle( nX+2, nY+1, nX+4, nY+1 ) ); + pDev->DrawRect( tools::Rectangle( nX+3, nY+2, nX+3, nY+2 ) ); } pDev->SetLineColor( aOldLineColor ); pDev->SetFillColor( aOldFillColor ); } void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFlags, - const Rectangle& rRect, bool bMenuBtnSep) + const tools::Rectangle& rRect, bool bMenuBtnSep) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - Rectangle aInRect = rRect; + tools::Rectangle aInRect = rRect; Color aColor; OUString aText = PushButton::GetText(); // PushButton:: because of MoreButton DrawTextFlags nTextStyle = ImplGetTextStyle( nDrawFlags ); @@ -869,7 +869,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl mnDDStyle == PushButtonDropdownStyle::SplitMenuButton ) { long nSeparatorX = 0; - Rectangle aSymbolRect = aInRect; + tools::Rectangle aSymbolRect = aInRect; if ( !aText.isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) ) { // calculate symbol size @@ -903,7 +903,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl } else { - Rectangle aSymbolRect; + tools::Rectangle aSymbolRect; ImplDrawAlignedImage( pDev, aPos, aSize, nImageSep, nDrawFlags, nTextStyle, IsSymbol() ? &aSymbolRect : nullptr, true ); @@ -944,8 +944,8 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) DrawButtonFlags nButtonStyle = ImplGetButtonState(); Point aPoint; Size aOutSz(GetOutputSizePixel()); - Rectangle aRect(aPoint, aOutSz); - Rectangle aInRect = aRect; + tools::Rectangle aRect(aPoint, aOutSz); + tools::Rectangle aInRect = aRect; bool bNativeOK = false; // adjust style if button should be rendered 'pressed' @@ -1042,7 +1042,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) if (bNativeOK) { PushButtonValue aControlValue; - Rectangle aCtrlRegion(aInRect); + tools::Rectangle aCtrlRegion(aInRect); ControlState nState = ControlState::NONE; if (mbPressed || IsChecked() || mbIsActive) @@ -1107,7 +1107,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) // draw PushButtonFrame, aInRect has content size afterwards if (GetStyle() & WB_FLATBUTTON) { - Rectangle aTempRect(aInRect); + tools::Rectangle aTempRect(aInRect); if (bRollOver) ImplDrawPushButtonFrame(rRenderContext, aTempRect, nButtonStyle); aInRect.Left() += 2; @@ -1139,11 +1139,11 @@ void PushButton::ImplSetDefButton( bool bSet ) if ( IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire) ) { - Rectangle aBound, aCont; - Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating + tools::Rectangle aBound, aCont; + tools::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; - Rectangle aCtrlRegion( aCtrlRect ); + tools::Rectangle aCtrlRegion( aCtrlRect ); ControlState nState = ControlState::DEFAULT|ControlState::ENABLED; // get native size of a 'default' button @@ -1354,7 +1354,7 @@ void PushButton::FillLayoutData() const const_cast<PushButton*>(this)->Invalidate(); } -void PushButton::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) +void PushButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { ImplDrawPushButton(rRenderContext); } @@ -1364,7 +1364,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); - Rectangle aRect( aPos, aSize ); + tools::Rectangle aRect( aPos, aSize ); vcl::Font aFont = GetDrawPixelFont( pDev ); pDev->Push(); @@ -1527,7 +1527,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt ) { // only paint the button part to avoid flickering of the combobox text Point aPt; - Rectangle aClipRect( aPt, GetOutputSizePixel() ); + tools::Rectangle aClipRect( aPt, GetOutputSizePixel() ); aClipRect.SetPos(pBorder->ScreenToOutputPixel(OutputToScreenPixel(aClipRect.TopLeft()))); pBorder->Invalidate( aClipRect ); } @@ -1648,7 +1648,7 @@ Size PushButton::CalcMinimumSize() const } if ( !PushButton::GetText().isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) ) { - Size textSize = GetTextRect( Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), + Size textSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), PushButton::GetText(), ImplGetTextStyle( DrawFlags::NONE ) ).GetSize(); aSize.Width() += textSize.Width(); aSize.Height() = std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ); @@ -1684,12 +1684,12 @@ bool PushButton::set_property(const OString &rKey, const OString &rValue) return true; } -void PushButton::ShowFocus(const Rectangle& rRect) +void PushButton::ShowFocus(const tools::Rectangle& rRect) { if (IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus)) { ImplControlValue aControlValue; - Rectangle aInRect(Point(), GetOutputSizePixel()); + tools::Rectangle aInRect(Point(), GetOutputSizePixel()); GetOutDev()->DrawNativeControl(ControlType::Pushbutton, ControlPart::Focus, aInRect, ControlState::FOCUSED, aControlValue, OUString()); } @@ -1909,7 +1909,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) if (!maImage && rRenderContext.IsNativeControlSupported(ControlType::Radiobutton, ControlPart::Entire)) { ImplControlValue aControlValue( mbChecked ? ButtonValue::On : ButtonValue::Off ); - Rectangle aCtrlRect(maStateRect.TopLeft(), maStateRect.GetSize()); + tools::Rectangle aCtrlRect(maStateRect.TopLeft(), maStateRect.GetSize()); ControlState nState = ControlState::NONE; if (ImplGetButtonState() & DrawButtonFlags::Pressed) @@ -1949,7 +1949,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) DecorationView aDecoView(&rRenderContext); const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - Rectangle aImageRect = maStateRect; + tools::Rectangle aImageRect = maStateRect; Size aImageSize = maImage.GetSizePixel(); bool bEnabled = IsEnabled(); DrawFrameStyle nButtonStyle = DrawFrameStyle::DoubleIn; @@ -2015,14 +2015,14 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, const Point& rPos, const Size& rSize, - const Size& rImageSize, Rectangle& rStateRect, - Rectangle& rMouseRect ) + const Size& rImageSize, tools::Rectangle& rStateRect, + tools::Rectangle& rMouseRect ) { WinBits nWinStyle = GetStyle(); OUString aText( GetText() ); pDev->Push( PushFlags::CLIPREGION ); - pDev->IntersectClipRegion( Rectangle( rPos, rSize ) ); + pDev->IntersectClipRegion( tools::Rectangle( rPos, rSize ) ); // no image radio button if ( !maImage ) @@ -2050,7 +2050,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, ImplDrawAlignedImage( pDev, aPos, aSize, 1, nDrawFlags, nTextStyle ); - rMouseRect = Rectangle( aPos, aSize ); + rMouseRect = tools::Rectangle( aPos, aSize ); rMouseRect.Left() = rPos.X(); rStateRect.Left() = rPos.X(); @@ -2105,7 +2105,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, { bool bTopImage = (nWinStyle & WB_TOP) != 0; Size aImageSize = maImage.GetSizePixel(); - Rectangle aImageRect( rPos, rSize ); + tools::Rectangle aImageRect( rPos, rSize ); long nTextHeight = pDev->GetTextHeight(); long nTextWidth = pDev->GetCtrlTextWidth( aText ); @@ -2422,7 +2422,7 @@ void RadioButton::FillLayoutData() const const_cast<RadioButton*>(this)->Invalidate(); } -void RadioButton::Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) +void RadioButton::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) { ImplDrawRadioButton(rRenderContext); } @@ -2439,8 +2439,8 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize Size aBrd1Size = pDev->LogicToPixel( Size( 20, 20 ), aResMapMode ); Size aBrd2Size = pDev->LogicToPixel( Size( 60, 60 ), aResMapMode ); vcl::Font aFont = GetDrawPixelFont( pDev ); - Rectangle aStateRect; - Rectangle aMouseRect; + tools::Rectangle aStateRect; + tools::Rectangle aMouseRect; aImageSize.Width() = CalcZoom( aImageSize.Width() ); aImageSize.Height() = CalcZoom( aImageSize.Height() ); @@ -2722,9 +2722,9 @@ Size RadioButton::ImplGetRadioImageSize() const if( IsNativeControlSupported( ControlType::Radiobutton, ControlPart::Entire ) ) { ImplControlValue aControlValue; - Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() ); + tools::Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() ); ControlState nState = ControlState::DEFAULT|ControlState::ENABLED; - Rectangle aBoundingRgn, aContentRgn; + tools::Rectangle aBoundingRgn, aContentRgn; // get native size of a radio button if( GetNativeControlRegion( ControlType::Radiobutton, ControlPart::Entire, aCtrlRegion, @@ -2836,8 +2836,8 @@ void RadioButton::ImplSetMinimumNWFSize() ImplControlValue aControlValue; Size aCurSize( GetSizePixel() ); - Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize ); - Rectangle aBoundingRgn, aContentRgn; + tools::Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize ); + tools::Rectangle aBoundingRgn, aContentRgn; // get native size of a radiobutton if( GetNativeControlRegion( ControlType::Radiobutton, ControlPart::Entire, aCtrlRegion, @@ -2873,7 +2873,7 @@ Size RadioButton::CalcMinimumSize() const { bool bTopImage = (GetStyle() & WB_TOP) != 0; - Size aTextSize = GetTextRect( Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), + Size aTextSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), aText, FixedText::ImplGetTextStyle( GetStyle() ) ).GetSize(); aSize.Width()+=2; // for focus rect @@ -2902,12 +2902,12 @@ Size RadioButton::GetOptimalSize() const return CalcMinimumSize(); } -void RadioButton::ShowFocus(const Rectangle& rRect) +void RadioButton::ShowFocus(const tools::Rectangle& rRect) { if (IsNativeControlSupported(ControlType::Radiobutton, ControlPart::Focus)) { ImplControlValue aControlValue; - Rectangle aInRect(Point(0, 0), GetSizePixel()); + tools::Rectangle aInRect(Point(0, 0), GetSizePixel()); aInRect.Left() = rRect.Left(); // exclude the radio element itself from the focusrect @@ -3001,7 +3001,7 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) if (bNativeOK) { ImplControlValue aControlValue(meState == TRISTATE_TRUE ? ButtonValue::On : ButtonValue::Off); - Rectangle aCtrlRegion(maStateRect); + tools::Rectangle aCtrlRegion(maStateRect); ControlState nState = ControlState::NONE; if (HasFocus()) @@ -3044,14 +3044,14 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, const Point& rPos, const Size& rSize, - const Size& rImageSize, Rectangle& rStateRect, - Rectangle& rMouseRect ) + const Size& rImageSize, tools::Rectangle& rStateRect, + tools::Rectangle& rMouseRect ) { WinBits nWinStyle = GetStyle(); OUString aText( GetText() ); pDev->Push( PushFlags::CLIPREGION | PushFlags::LINECOLOR ); - pDev->IntersectClipRegion( Rectangle( rPos, rSize ) ); + pDev->IntersectClipRegion( tools::Rectangle( rPos, rSize ) ); long nLineY = rPos.Y() + (rSize.Height()-1)/2; if ( ( !aText.isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) ) || @@ -3078,7 +3078,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, ImplDrawAlignedImage( pDev, aPos, aSize, 1, nDrawFlags, nTextStyle ); nLineY = aPos.Y() + aSize.Height()/2; - rMouseRect = Rectangle( aPos, aSize ); + rMouseRect = tools::Rectangle( aPos, aSize ); rMouseRect.Left() = rPos.X(); rStateRect.Left() = rPos.X(); rStateRect.Top() = rMouseRect.Top(); @@ -3292,7 +3292,7 @@ void CheckBox::FillLayoutData() const const_cast<CheckBox*>(this)->Invalidate(); } -void CheckBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) +void CheckBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { ImplDrawCheckBox(rRenderContext); } @@ -3308,8 +3308,8 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Size aBrd2Size = pDev->LogicToPixel( Size( 30, 30 ), aResMapMode ); long nCheckWidth = pDev->LogicToPixel( Size( 20, 20 ), aResMapMode ).Width(); vcl::Font aFont = GetDrawPixelFont( pDev ); - Rectangle aStateRect; - Rectangle aMouseRect; + tools::Rectangle aStateRect; + tools::Rectangle aMouseRect; aImageSize.Width() = CalcZoom( aImageSize.Width() ); aImageSize.Height() = CalcZoom( aImageSize.Height() ); @@ -3587,9 +3587,9 @@ Size CheckBox::ImplGetCheckImageSize() const if( IsNativeControlSupported( ControlType::Checkbox, ControlPart::Entire ) ) { ImplControlValue aControlValue; - Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() ); + tools::Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() ); ControlState nState = ControlState::DEFAULT|ControlState::ENABLED; - Rectangle aBoundingRgn, aContentRgn; + tools::Rectangle aBoundingRgn, aContentRgn; // get native size of a check box if( GetNativeControlRegion( ControlType::Checkbox, ControlPart::Entire, aCtrlRegion, @@ -3682,8 +3682,8 @@ void CheckBox::ImplSetMinimumNWFSize() ImplControlValue aControlValue; Size aCurSize( GetSizePixel() ); - Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize ); - Rectangle aBoundingRgn, aContentRgn; + tools::Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize ); + tools::Rectangle aBoundingRgn, aContentRgn; // get native size of a radiobutton if( GetNativeControlRegion( ControlType::Checkbox, ControlPart::Entire, aCtrlRegion, @@ -3714,7 +3714,7 @@ Size CheckBox::CalcMinimumSize( long nMaxWidth ) const nMaxWidth-=2; nMaxWidth -= ImplGetImageToTextDistance(); - Size aTextSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth > 0 ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ), + Size aTextSize = GetTextRect( tools::Rectangle( Point(), Size( nMaxWidth > 0 ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ), aText, FixedText::ImplGetTextStyle( GetStyle() ) ).GetSize(); aSize.Width()+=2; // for focus rect aSize.Width() += ImplGetImageToTextDistance(); @@ -3740,12 +3740,12 @@ Size CheckBox::GetOptimalSize() const return CalcMinimumSize(); } -void CheckBox::ShowFocus(const Rectangle& rRect) +void CheckBox::ShowFocus(const tools::Rectangle& rRect) { if (IsNativeControlSupported(ControlType::Checkbox, ControlPart::Focus)) { ImplControlValue aControlValue; - Rectangle aInRect(Point(0, 0), GetSizePixel()); + tools::Rectangle aInRect(Point(0, 0), GetSizePixel()); aInRect.Left() = rRect.Left(); // exclude the checkbox itself from the focusrect @@ -3810,10 +3810,10 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) for ControlType::ListNode would have to be implemented and taken into account */ - Rectangle aStateRect(GetStateRect()); + tools::Rectangle aStateRect(GetStateRect()); ImplControlValue aControlValue(GetState() == TRISTATE_TRUE ? ButtonValue::On : ButtonValue::Off); - Rectangle aCtrlRegion(aStateRect); + tools::Rectangle aCtrlRegion(aStateRect); ControlState nState = ControlState::NONE; if (HasFocus()) diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 84d1edcf9e5c..01eac4eb3d07 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -151,8 +151,8 @@ void ComboBox::ImplCalcEditHeight() if ( !IsDropDownBox() ) m_pImpl->m_nDDHeight += 4; - Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) ); - Rectangle aBoundRegion, aContentRegion; + tools::Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) ); + tools::Rectangle aBoundRegion, aContentRegion; ImplControlValue aControlValue; ControlType aType = IsDropDownBox() ? ControlType::Combobox : ControlType::Editbox; if( GetNativeControlRegion( aType, ControlPart::Entire, @@ -1005,10 +1005,10 @@ long ComboBox::getMaxWidthScrollBarAndDownButton() const vcl::Window *pBorder = GetWindow( GetWindowType::Border ); ImplControlValue aControlValue; Point aPoint; - Rectangle aContent, aBound; + tools::Rectangle aContent, aBound; // use the full extent of the control - Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); + tools::Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); if ( GetNativeControlRegion(ControlType::Combobox, ControlPart::ButtonDown, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) @@ -1161,7 +1161,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, D bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground(); if ( bBorder || bBackground ) { - Rectangle aRect( aPos, aSize ); + tools::Rectangle aRect( aPos, aSize ); // aRect.Top() += nEditHeight; if ( bBorder ) { @@ -1210,14 +1210,14 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, D } } - Rectangle aClip( aPos, aSize ); + tools::Rectangle aClip( aPos, aSize ); pDev->IntersectClipRegion( aClip ); sal_Int32 nLines = static_cast<sal_Int32>( nTextHeight > 0 ? (aSize.Height()-nEditHeight)/nTextHeight : 1 ); if ( !nLines ) nLines = 1; const sal_Int32 nTEntry = IsReallyVisible() ? m_pImpl->m_pImplLB->GetTopEntry() : 0; - Rectangle aTextRect( aPos, aSize ); + tools::Rectangle aTextRect( aPos, aSize ); aTextRect.Left() += 3*nOnePixel; aTextRect.Right() -= 3*nOnePixel; @@ -1323,11 +1323,11 @@ void ComboBox::SetProminentEntryType( ProminentEntry eType ) m_pImpl->m_pImplLB->SetProminentEntryType( eType ); } -Rectangle ComboBox::GetDropDownPosSizePixel() const +tools::Rectangle ComboBox::GetDropDownPosSizePixel() const { return m_pImpl->m_pFloatWin ? m_pImpl->m_pFloatWin->GetWindowExtentsRelative(const_cast<ComboBox*>(this)) - : Rectangle(); + : tools::Rectangle(); } const Wallpaper& ComboBox::GetDisplayBackground() const @@ -1380,10 +1380,10 @@ void ComboBox::SetNoSelection() m_pImpl->m_pSubEdit->SetText( OUString() ); } -Rectangle ComboBox::GetBoundingRectangle( sal_Int32 nItem ) const +tools::Rectangle ComboBox::GetBoundingRectangle( sal_Int32 nItem ) const { - Rectangle aRect = m_pImpl->m_pImplLB->GetMainWindow()->GetBoundingRectangle( nItem ); - Rectangle aOffset = m_pImpl->m_pImplLB->GetMainWindow()->GetWindowExtentsRelative( static_cast<vcl::Window*>(const_cast<ComboBox *>(this)) ); + tools::Rectangle aRect = m_pImpl->m_pImplLB->GetMainWindow()->GetBoundingRectangle( nItem ); + tools::Rectangle aOffset = m_pImpl->m_pImplLB->GetMainWindow()->GetWindowExtentsRelative( static_cast<vcl::Window*>(const_cast<ComboBox *>(this)) ); aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() ); return aRect; } @@ -1443,10 +1443,10 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds( vcl::Window *pBorder = m_rThis.GetWindow( GetWindowType::Border ); ImplControlValue aControlValue; Point aPoint; - Rectangle aContent, aBound; + tools::Rectangle aContent, aBound; // use the full extent of the control - Rectangle aArea( aPoint, rBorderOutSz ); + tools::Rectangle aArea( aPoint, rBorderOutSz ); if (m_rThis.GetNativeControlRegion(ControlType::Combobox, ControlPart::ButtonDown, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index aadff32a5953..229051b58ae6 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -106,16 +106,16 @@ ControlLayoutData::ControlLayoutData() : m_pParent( nullptr ) { } -Rectangle ControlLayoutData::GetCharacterBounds( long nIndex ) const +tools::Rectangle ControlLayoutData::GetCharacterBounds( long nIndex ) const { - return (nIndex >= 0 && nIndex < (long) m_aUnicodeBoundRects.size()) ? m_aUnicodeBoundRects[ nIndex ] : Rectangle(); + return (nIndex >= 0 && nIndex < (long) m_aUnicodeBoundRects.size()) ? m_aUnicodeBoundRects[ nIndex ] : tools::Rectangle(); } -Rectangle Control::GetCharacterBounds( long nIndex ) const +tools::Rectangle Control::GetCharacterBounds( long nIndex ) const { if( !HasLayoutData() ) FillLayoutData(); - return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetCharacterBounds( nIndex ) : Rectangle(); + return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetCharacterBounds( nIndex ) : tools::Rectangle(); } long ControlLayoutData::GetIndexForPoint( const Point& rPoint ) const @@ -289,10 +289,10 @@ void Control::AppendLayoutData( const Control& rSubControl ) const for( n = 1; n < nLines; n++ ) mpControlData->mpLayoutData->m_aLineIndices.push_back( rSubControl.mpControlData->mpLayoutData->m_aLineIndices[n] + nCurrentIndex ); int nRectangles = rSubControl.mpControlData->mpLayoutData->m_aUnicodeBoundRects.size(); - Rectangle aRel = const_cast<Control&>(rSubControl).GetWindowExtentsRelative( const_cast<Control*>(this) ); + tools::Rectangle aRel = const_cast<Control&>(rSubControl).GetWindowExtentsRelative( const_cast<Control*>(this) ); for( n = 0; n < nRectangles; n++ ) { - Rectangle aRect = rSubControl.mpControlData->mpLayoutData->m_aUnicodeBoundRects[n]; + tools::Rectangle aRect = rSubControl.mpControlData->mpLayoutData->m_aUnicodeBoundRects[n]; aRect.Move( aRel.Left(), aRel.Top() ); mpControlData->mpLayoutData->m_aUnicodeBoundRects.push_back( aRect ); } @@ -329,7 +329,7 @@ void Control::ImplClearLayoutData() const mpControlData->mpLayoutData.reset(); } -void Control::ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect ) +void Control::ImplDrawFrame( OutputDevice* pDev, tools::Rectangle& rRect ) { // use a deco view to draw the frame // However, since there happens a lot of magic there, we need to fake some (style) settings @@ -413,7 +413,7 @@ void Control::ImplInitSettings(const bool, const bool) ApplySettings(*this); } -Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const Rectangle& rRect, const OUString& _rStr, +tools::Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const tools::Rectangle& rRect, const OUString& _rStr, DrawTextFlags _nStyle, MetricVector* _pVector, OUString* _pDisplayText, const Size* i_pDeviceSize ) const { OUString rPStr = _rStr; @@ -430,7 +430,7 @@ Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const Rectangl if ( !mpControlData->mpReferenceDevice || ( mpControlData->mpReferenceDevice == &_rTargetDevice ) ) { - const Rectangle aRet = _rTargetDevice.GetTextRect(rRect, rPStr, nPStyle); + const tools::Rectangle aRet = _rTargetDevice.GetTextRect(rRect, rPStr, nPStyle); _rTargetDevice.DrawText(aRet, rPStr, nPStyle, _pVector, _pDisplayText); return aRet; } @@ -439,7 +439,7 @@ Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const Rectangl return aRenderer.DrawText(rRect, rPStr, nPStyle, _pVector, _pDisplayText, i_pDeviceSize); } -Rectangle Control::GetControlTextRect( OutputDevice& _rTargetDevice, const Rectangle & rRect, +tools::Rectangle Control::GetControlTextRect( OutputDevice& _rTargetDevice, const tools::Rectangle & rRect, const OUString& _rStr, DrawTextFlags _nStyle, Size* o_pDeviceSize ) const { OUString rPStr = _rStr; @@ -456,7 +456,7 @@ Rectangle Control::GetControlTextRect( OutputDevice& _rTargetDevice, const Recta if ( !mpControlData->mpReferenceDevice || ( mpControlData->mpReferenceDevice == &_rTargetDevice ) ) { - Rectangle aRet = _rTargetDevice.GetTextRect( rRect, rPStr, nPStyle ); + tools::Rectangle aRet = _rTargetDevice.GetTextRect( rRect, rPStr, nPStyle ); if (o_pDeviceSize) { *o_pDeviceSize = aRet.GetSize(); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 95dc4d916c10..fa559c150117 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -473,7 +473,7 @@ long Edit::ImplGetTextYPosition() const return ( GetOutputSizePixel().Height() - GetTextHeight() ) / 2; } -void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRectangle) +void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRectangle) { if (!IsReallyVisible()) return; @@ -522,7 +522,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec rRenderContext.Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR); rRenderContext.SetLineColor(); rRenderContext.SetFillColor(GetControlBackground()); - rRenderContext.DrawRect(Rectangle(aPos, Size(GetOutputSizePixel().Width() - 2 * mnXOffset, GetOutputSizePixel().Height()))); + rRenderContext.DrawRect(tools::Rectangle(aPos, Size(GetOutputSizePixel().Width() - 2 * mnXOffset, GetOutputSizePixel().Height()))); rRenderContext.Pop(); rRenderContext.SetTextFillColor(GetControlBackground()); @@ -557,7 +557,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec // selection is highlighted for(sal_Int32 i = 0; i < nLen; ++i) { - Rectangle aRect(aPos, Size(10, nTH)); + tools::Rectangle aRect(aPos, Size(10, nTH)); aRect.Left() = pDX[2 * i] + mnXOffset + ImplGetExtraXOffset(); aRect.Right() = pDX[2 * i + 1] + mnXOffset + ImplGetExtraXOffset(); aRect.Justify(); @@ -635,7 +635,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec int nIndex = i; while (nIndex < mpIMEInfos->nLen && mpIMEInfos->pAttribs[nIndex] == nAttr) // #112631# check nIndex before using it { - Rectangle aRect( aPos, Size( 10, nTH ) ); + tools::Rectangle aRect( aPos, Size( 10, nTH ) ); aRect.Left() = pDX[2 * (nIndex + mpIMEInfos->nPos)] + mnXOffset + ImplGetExtraXOffset(); aRect.Right() = pDX[2 * (nIndex + mpIMEInfos->nPos) + 1] + mnXOffset + ImplGetExtraXOffset(); aRect.Justify(); @@ -983,13 +983,13 @@ ControlType Edit::ImplGetNativeControlType() const return nCtrl; } -void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, const Rectangle& rRectangle, long nXStart, long nXEnd ) +void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRectangle, long nXStart, long nXEnd ) { /* * note: at this point the cursor must be switched off already */ Point aTmpPoint; - Rectangle aRect(aTmpPoint, GetOutputSizePixel()); + tools::Rectangle aRect(aTmpPoint, GetOutputSizePixel()); aRect.Left() = nXStart; aRect.Right() = nXEnd; @@ -1011,7 +1011,7 @@ void Edit::ImplPaintBorder(vcl::RenderContext& rRenderContext, long nXStart, lon return; Point aTmpPoint; - Rectangle aRect(aTmpPoint, GetOutputSizePixel()); + tools::Rectangle aRect(aTmpPoint, GetOutputSizePixel()); aRect.Left() = nXStart; aRect.Right() = nXEnd; @@ -1040,7 +1040,7 @@ void Edit::ImplPaintBorder(vcl::RenderContext& rRenderContext, long nXStart, lon // need to mirror in case border is not RTL but edit is (or vice versa) // mirror - Rectangle aBounds(aClipRgn.GetBoundRect()); + tools::Rectangle aBounds(aClipRgn.GetBoundRect()); int xNew = GetOutputSizePixel().Width() - aBounds.GetWidth() - aBounds.Left(); aClipRgn.Move(xNew - aBounds.Left(), 0); @@ -1060,13 +1060,13 @@ void Edit::ImplPaintBorder(vcl::RenderContext& rRenderContext, long nXStart, lon vcl::Region oldRgn(pBorder->GetClipRegion()); pBorder->SetClipRegion(aClipRgn); - pBorder->Paint(*pBorder, Rectangle()); + pBorder->Paint(*pBorder, tools::Rectangle()); pBorder->SetClipRegion(oldRgn); } else { - pBorder->Paint(*pBorder, Rectangle()); + pBorder->Paint(*pBorder, tools::Rectangle()); } } } @@ -1719,7 +1719,7 @@ void Edit::FillLayoutData() const const_cast<Edit*>(this)->Invalidate(); } -void Edit::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRectangle) +void Edit::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRectangle) { if (!mpSubEdit) ImplRepaint(rRenderContext, rRectangle); @@ -1759,7 +1759,7 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawF bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground(); if ( bBorder || bBackground ) { - Rectangle aRect( aPos, aSize ); + tools::Rectangle aRect( aPos, aSize ); if ( bBorder ) { ImplDrawFrame( pDev, aRect ); @@ -1790,7 +1790,7 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawF const long nOnePixel = GetDrawPixel( pDev, 1 ); const long nOffX = 3*nOnePixel; DrawTextFlags nTextStyle = DrawTextFlags::VCenter; - Rectangle aTextRect( aPos, aSize ); + tools::Rectangle aTextRect( aPos, aSize ); if ( GetStyle() & WB_CENTER ) nTextStyle |= DrawTextFlags::Center; @@ -1812,7 +1812,7 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawF ((nOffY+nTextHeight) > aSize.Height()) || ((nOffX+nTextWidth) > aSize.Width()) ) { - Rectangle aClip( aPos, aSize ); + tools::Rectangle aClip( aPos, aSize ); if ( nTextHeight > aSize.Height() ) aClip.Bottom() += nTextHeight-aSize.Height()+1; // prevent HP printers from 'optimizing' pDev->IntersectClipRegion( aClip ); @@ -2146,10 +2146,10 @@ void Edit::Command( const CommandEvent& rCEvt ) long nTH = GetTextHeight(); Point aPos( mnXOffset, ImplGetTextYPosition() ); - std::unique_ptr<Rectangle[]> aRects(new Rectangle[ mpIMEInfos->nLen ]); + std::unique_ptr<tools::Rectangle[]> aRects(new tools::Rectangle[ mpIMEInfos->nLen ]); for ( int nIndex = 0; nIndex < mpIMEInfos->nLen; ++nIndex ) { - Rectangle aRect( aPos, Size( 10, nTH ) ); + tools::Rectangle aRect( aPos, Size( 10, nTH ) ); aRect.Left() = pDX[2*(nIndex+mpIMEInfos->nPos)] + mnXOffset + ImplGetExtraXOffset(); aRects[ nIndex ] = aRect; } @@ -2282,7 +2282,7 @@ void Edit::ImplShowDDCursor() { long nTextWidth = GetTextWidth( maText.toString(), 0, mpDDInfo->nDropPos ); long nTextHeight = GetTextHeight(); - Rectangle aCursorRect( Point( nTextWidth + mnXOffset, (GetOutputSize().Height()-nTextHeight)/2 ), Size( 2, nTextHeight ) ); + tools::Rectangle aCursorRect( Point( nTextWidth + mnXOffset, (GetOutputSize().Height()-nTextHeight)/2 ), Size( 2, nTextHeight ) ); mpDDInfo->aCursor.SetWindow( this ); mpDDInfo->aCursor.SetPos( aCursorRect.TopLeft() ); mpDDInfo->aCursor.SetSize( aCursorRect.GetSize() ); @@ -2725,8 +2725,8 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const // ask NWF what if it has an opinion, too ImplControlValue aControlValue; - Rectangle aRect( Point( 0, 0 ), aSize ); - Rectangle aContent, aBound; + tools::Rectangle aRect( Point( 0, 0 ), aSize ); + tools::Rectangle aContent, aBound; if (GetNativeControlRegion(eCtrlType, ControlPart::Entire, aRect, ControlState::NONE, aControlValue, OUString(), aBound, aContent)) { diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index da3202945acf..42b6cc1ef1ab 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -182,7 +182,7 @@ void FixedText::ImplDraw(OutputDevice* pDev, DrawFlags nDrawFlags, if( bFillLayout ) (mpControlData->mpLayoutData->m_aDisplayText).clear(); - const Rectangle aRect(aPos, rSize); + const tools::Rectangle aRect(aPos, rSize); DrawControlText(*pDev, aRect, aText, nTextStyle, bFillLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : nullptr, bFillLayout ? &mpControlData->mpLayoutData->m_aDisplayText : nullptr); @@ -213,7 +213,7 @@ void FixedText::ApplySettings(vcl::RenderContext& rRenderContext) } } -void FixedText::Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) +void FixedText::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) { ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel()); } @@ -240,7 +240,7 @@ void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground(); if ( bBorder || bBackground ) { - Rectangle aRect( aPos, aSize ); + tools::Rectangle aRect( aPos, aSize ); if ( bBorder ) { ImplDrawFrame( pDev, aRect ); @@ -321,7 +321,7 @@ Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt, if ( !( pControl->GetStyle() & WB_NOLABEL ) ) nStyle |= DrawTextFlags::Mnemonic; - return pControl->GetTextRect(Rectangle( Point(), Size(nMaxWidth, 0x7fffffff)), + return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, 0x7fffffff)), rTxt, nStyle).GetSize(); } @@ -545,7 +545,7 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext) else { DrawTextFlags nStyle = DrawTextFlags::Mnemonic | DrawTextFlags::Left | DrawTextFlags::VCenter | DrawTextFlags::EndEllipsis; - Rectangle aRect(0, 0, aOutSize.Width(), aOutSize.Height()); + tools::Rectangle aRect(0, 0, aOutSize.Width(), aOutSize.Height()); const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); if (nWinStyle & WB_CENTER) nStyle |= DrawTextFlags::Center; @@ -604,7 +604,7 @@ void FixedLine::ApplySettings(vcl::RenderContext& rRenderContext) } } -void FixedLine::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) +void FixedLine::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { ImplDraw(rRenderContext); } @@ -736,7 +736,7 @@ void FixedBitmap::ApplySettings(vcl::RenderContext& rRenderContext) } } -void FixedBitmap::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) +void FixedBitmap::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel()); } @@ -746,7 +746,7 @@ void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); - Rectangle aRect( aPos, aSize ); + tools::Rectangle aRect( aPos, aSize ); pDev->Push(); pDev->SetMapMode(); @@ -881,7 +881,7 @@ void FixedImage::ApplySettings(vcl::RenderContext& rRenderContext) } -void FixedImage::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) +void FixedImage::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel()); } @@ -896,7 +896,7 @@ void FixedImage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); - Rectangle aRect( aPos, aSize ); + tools::Rectangle aRect( aPos, aSize ); pDev->Push(); pDev->SetMapMode(); diff --git a/vcl/source/control/fixedhyper.cxx b/vcl/source/control/fixedhyper.cxx index 6843485e14f1..052973d92ef4 100644 --- a/vcl/source/control/fixedhyper.cxx +++ b/vcl/source/control/fixedhyper.cxx @@ -102,14 +102,14 @@ void FixedHyperlink::RequestHelp( const HelpEvent& rHEvt ) void FixedHyperlink::GetFocus() { SetTextColor( Color( COL_LIGHTRED ) ); - Invalidate(Rectangle(Point(), GetSizePixel())); - ShowFocus( Rectangle( Point( 1, 1 ), Size( m_nTextLen + 4, GetSizePixel().Height() - 2 ) ) ); + Invalidate(tools::Rectangle(Point(), GetSizePixel())); + ShowFocus( tools::Rectangle( Point( 1, 1 ), Size( m_nTextLen + 4, GetSizePixel().Height() - 2 ) ) ); } void FixedHyperlink::LoseFocus() { SetTextColor( GetControlForeground() ); - Invalidate(Rectangle(Point(), GetSizePixel())); + Invalidate(tools::Rectangle(Point(), GetSizePixel())); HideFocus(); } diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx index 48d3ffdbdfc6..9d8070cc9b01 100644 --- a/vcl/source/control/group.cxx +++ b/vcl/source/control/group.cxx @@ -99,7 +99,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, long nTextOff; const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); OUString aText( GetText() ); - Rectangle aRect( rPos, rSize ); + tools::Rectangle aRect( rPos, rSize ); DrawTextFlags nTextStyle = DrawTextFlags::Left | DrawTextFlags::Top | DrawTextFlags::EndEllipsis | DrawTextFlags::Mnemonic; if ( GetStyle() & WB_NOLABEL ) @@ -188,7 +188,7 @@ void GroupBox::FillLayoutData() const const_cast<GroupBox*>(this)->ImplDraw( const_cast<GroupBox*>(this), DrawFlags::NONE, Point(), GetOutputSizePixel(), true ); } -void GroupBox::Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) +void GroupBox::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) { ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel()); } diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx index 625706f13a4a..f3d1942eabd6 100644 --- a/vcl/source/control/imgctrl.cxx +++ b/vcl/source/control/imgctrl.cxx @@ -47,7 +47,7 @@ void ImageControl::Resize() namespace { - Size lcl_calcPaintSize( const Rectangle& _rPaintRect, const Size& _rBitmapSize ) + Size lcl_calcPaintSize( const tools::Rectangle& _rPaintRect, const Size& _rBitmapSize ) { const Size aPaintSize = _rPaintRect.GetSize(); @@ -58,7 +58,7 @@ namespace return Size( long( _rBitmapSize.Width() * nRatioMin ), long( _rBitmapSize.Height() * nRatioMin ) ); } - Point lcl_centerWithin( const Rectangle& _rArea, const Size& _rObjectSize ) + Point lcl_centerWithin( const tools::Rectangle& _rArea, const Size& _rObjectSize ) { Point aPos( _rArea.TopLeft() ); aPos.X() += ( _rArea.GetWidth() - _rObjectSize.Width() ) / 2; @@ -77,7 +77,7 @@ void ImageControl::ImplDraw(OutputDevice& rDev, DrawFlags nDrawFlags, const Poin } const Image& rImage( GetModeImage() ); - const Rectangle aDrawRect( rPos, rSize ); + const tools::Rectangle aDrawRect( rPos, rSize ); if (!rImage) { OUString sText( GetText() ); @@ -127,7 +127,7 @@ void ImageControl::ImplDraw(OutputDevice& rDev, DrawFlags nDrawFlags, const Poin } // switch ( mnScaleMode ) } -void ImageControl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/) +void ImageControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) { ImplDraw(rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel()); @@ -136,7 +136,7 @@ void ImageControl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /* vcl::Window* pBorderWindow = GetWindow(GetWindowType::Border); bool bFlat = (GetBorderStyle() == WindowBorderStyle::MONO); - Rectangle aRect(Point(0,0), pBorderWindow->GetOutputSizePixel()); + tools::Rectangle aRect(Point(0,0), pBorderWindow->GetOutputSizePixel()); Color oldLineCol = pBorderWindow->GetLineColor(); Color oldFillCol = pBorderWindow->GetFillColor(); pBorderWindow->SetFillColor(); @@ -157,7 +157,7 @@ void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSiz { const Point aPos = pDev->LogicToPixel( rPos ); const Size aSize = pDev->LogicToPixel( rSize ); - Rectangle aRect( aPos, aSize ); + tools::Rectangle aRect( aPos, aSize ); pDev->Push(); pDev->SetMapMode(); diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index c824c628b896..96baf7ac1a4f 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -628,7 +628,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry ) // set the current size to a large number // GetTextRect should shrink it to the actual size aCurSize.Height() = 0x7fffff; - Rectangle aTextRect( Point( 0, 0 ), aCurSize ); + tools::Rectangle aTextRect( Point( 0, 0 ), aCurSize ); aTextRect = GetTextRect( aTextRect, rEntry.maStr, DrawTextFlags::WordBreak | DrawTextFlags::MultiLine ); aMetrics.nTextWidth = aTextRect.GetWidth(); if( aMetrics.nTextWidth > mnMaxTxtWidth ) @@ -895,7 +895,7 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt ) else if ( ( ( !mbMulti && IsMouseMoveSelect() ) || mbStackMode ) && mpEntryList->GetEntryCount() ) { Point aPoint; - Rectangle aRect( aPoint, GetOutputSizePixel() ); + tools::Rectangle aRect( aPoint, GetOutputSizePixel() ); if( aRect.IsInside( rMEvt.GetPosPixel() ) ) { if ( IsMouseMoveSelect() ) @@ -1166,7 +1166,7 @@ bool ImplListBoxWindow::SelectEntries( sal_Int32 nSelect, LB_EVENT_TYPE eLET, bo void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt ) { Point aPoint; - Rectangle aRect( aPoint, GetOutputSizePixel() ); + tools::Rectangle aRect( aPoint, GetOutputSizePixel() ); bool bInside = aRect.IsInside( rTEvt.GetMouseEvent().GetPosPixel() ); if( rTEvt.IsTrackingCanceled() || rTEvt.IsTrackingEnded() ) // MouseButtonUp @@ -1700,7 +1700,7 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 long nWidth = GetOutputSizePixel().Width(); long nY = mpEntryList->GetAddedHeight(nPos, mnTop); - Rectangle aRect(Point(0, nY), Size(nWidth, pEntry->mnHeight)); + tools::Rectangle aRect(Point(0, nY), Size(nWidth, pEntry->mnHeight)); if (mpEntryList->IsEntryPosSelected(nPos)) { @@ -1806,7 +1806,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 if ((pEntry->mnFlags & ListBoxEntryFlags::MultiLine)) nMaxWidth = GetOutputSizePixel().Width() - 2 * mnBorder; - Rectangle aTextRect(Point(mnBorder - mnLeft, nY), + tools::Rectangle aTextRect(Point(mnBorder - mnLeft, nY), Size(nMaxWidth, pEntry->mnHeight)); if (!bDrawTextAtImagePos && (mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled())) @@ -1852,10 +1852,10 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 void ImplListBoxWindow::FillLayoutData() const { mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData ); - const_cast<ImplListBoxWindow*>(this)->Invalidate(Rectangle(Point(0, 0), GetOutputSize())); + const_cast<ImplListBoxWindow*>(this)->Invalidate(tools::Rectangle(Point(0, 0), GetOutputSize())); } -void ImplListBoxWindow::ImplDoPaint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) +void ImplListBoxWindow::ImplDoPaint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { sal_Int32 nCount = mpEntryList->GetEntryCount(); @@ -1885,7 +1885,7 @@ void ImplListBoxWindow::ImplDoPaint(vcl::RenderContext& rRenderContext, const Re ImplShowFocusRect(); } -void ImplListBoxWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) +void ImplListBoxWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { ImplDoPaint(rRenderContext, rRect); } @@ -2030,12 +2030,12 @@ Size ImplListBoxWindow::CalcSize(sal_Int32 nMaxLines) const return aSz; } -Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_Int32 nItem ) const +tools::Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_Int32 nItem ) const { const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nItem ); Size aSz( GetSizePixel().Width(), pEntry ? pEntry->mnHeight : GetEntryHeight() ); long nY = mpEntryList->GetAddedHeight( nItem, GetTopEntry() ) + GetEntryList()->GetMRUCount()*GetEntryHeight(); - Rectangle aRect( Point( 0, nY ), aSz ); + tools::Rectangle aRect( Point( 0, nY ), aSz ); return aRect; } @@ -2644,7 +2644,7 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout) sal_Int32 nLeft, nTop, nRight, nBottom; pWin->GetBorder( nLeft, nTop, nRight, nBottom ); Point aPoint( -nLeft, -nTop ); - Rectangle aCtrlRegion( aPoint - GetPosPixel(), pWin->GetSizePixel() ); + tools::Rectangle aCtrlRegion( aPoint - GetPosPixel(), pWin->GetSizePixel() ); bool bMouseOver = false; vcl::Window *pChild = pWin->GetWindow( GetWindowType::FirstChild ); @@ -2658,7 +2658,7 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout) WinBits nParentStyle = pWin->GetStyle(); if( ! (nParentStyle & WB_BORDER) || (nParentStyle & WB_NOBORDER) ) { - Rectangle aParentRect( Point( 0, 0 ), pWin->GetSizePixel() ); + tools::Rectangle aParentRect( Point( 0, 0 ), pWin->GetSizePixel() ); pWin->DrawNativeControl( ControlType::Listbox, ControlPart::Entire, aParentRect, nState, aControlValue, OUString() ); } @@ -2751,7 +2751,7 @@ void ImplWin::ApplySettings(vcl::RenderContext& rRenderContext) rRenderContext.SetBackground(rStyleSettings.GetFieldColor()); } -void ImplWin::Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) +void ImplWin::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) { ImplDraw(rRenderContext); } @@ -2812,7 +2812,7 @@ void ImplWin::DrawEntry(vcl::RenderContext& rRenderContext, bool bDrawImage, boo else nTextStyle |= DrawTextFlags::Left; - Rectangle aTextRect( Point( nBorder, 0 ), Size( aOutSz.Width()-2*nBorder, aOutSz.Height() ) ); + tools::Rectangle aTextRect( Point( nBorder, 0 ), Size( aOutSz.Width()-2*nBorder, aOutSz.Height() ) ); if ( !bDrawTextAtImagePos && ( bImage || IsUserDrawEnabled() ) ) { @@ -2869,14 +2869,14 @@ void ImplWin::LoseFocus() Control::LoseFocus(); } -void ImplWin::ShowFocus(const Rectangle& rRect) +void ImplWin::ShowFocus(const tools::Rectangle& rRect) { if (IsNativeControlSupported(ControlType::Listbox, ControlPart::Focus)) { ImplControlValue aControlValue; vcl::Window *pWin = GetParent(); - Rectangle aParentRect(Point(0, 0), pWin->GetSizePixel()); + tools::Rectangle aParentRect(Point(0, 0), pWin->GetSizePixel()); pWin->DrawNativeControl(ControlType::Listbox, ControlPart::Focus, aParentRect, ControlState::FOCUSED, aControlValue, OUString()); } @@ -2962,7 +2962,7 @@ void ImplListBoxFloatingWindow::setPosSizePixel( long nX, long nY, long nWidth, aPos.Y() = nY; sal_uInt16 nIndex; - SetPosPixel( ImplCalcPos( this, Rectangle( aPos, GetParent()->GetSizePixel() ), FloatWinPopupFlags::Down, nIndex ) ); + SetPosPixel( ImplCalcPos( this, tools::Rectangle( aPos, GetParent()->GetSizePixel() ), FloatWinPopupFlags::Down, nIndex ) ); } // if( !IsReallyVisible() ) @@ -3082,7 +3082,7 @@ void ImplListBoxFloatingWindow::StartFloat( bool bStartTracking ) aSz.Width() -= nLeft + nRight; aSz.Height() -= nTop + nBottom; } - Rectangle aRect( aPos, aSz ); + tools::Rectangle aRect( aPos, aSz ); // check if the control's parent is un-mirrored which is the case for form controls in a mirrored UI // where the document is unmirrored diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index eedb2cbe4110..c05c63b8dea2 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -106,9 +106,9 @@ void ListBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) IsNativeControlSupported( ControlType::Listbox, ControlPart::Entire ) ) { ImplControlValue aControlValue; - Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) ); - Rectangle aBoundingRgn( aCtrlRegion ); - Rectangle aContentRgn( aCtrlRegion ); + tools::Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) ); + tools::Rectangle aBoundingRgn( aCtrlRegion ); + tools::Rectangle aContentRgn( aCtrlRegion ); if( GetNativeControlRegion( ControlType::Listbox, ControlPart::Entire, aCtrlRegion, ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) @@ -347,7 +347,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground(); if ( bBorder || bBackground ) { - Rectangle aRect( aPos, aSize ); + tools::Rectangle aRect( aPos, aSize ); if ( bBorder ) { ImplDrawFrame( pDev, aRect ); @@ -380,7 +380,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr const long nOnePixel = GetDrawPixel( pDev, 1 ); const long nOffX = 3*nOnePixel; DrawTextFlags nTextStyle = DrawTextFlags::VCenter; - Rectangle aTextRect( aPos, aSize ); + tools::Rectangle aTextRect( aPos, aSize ); if ( GetStyle() & WB_CENTER ) nTextStyle |= DrawTextFlags::Center; @@ -404,7 +404,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr ((nOffY+nTextHeight) > aSize.Height()) || ((nOffX+nTextWidth) > aSize.Width()) ) { - Rectangle aClip( aPos, aSize ); + tools::Rectangle aClip( aPos, aSize ); if ( nTextHeight > aSize.Height() ) aClip.Bottom() += nTextHeight-aSize.Height()+1; // So that HP Printers don't optimize this away pDev->IntersectClipRegion( aClip ); @@ -416,7 +416,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr { long nTextHeight = pDev->GetTextHeight(); sal_uInt16 nLines = ( nTextHeight > 0 ) ? (sal_uInt16)(aSize.Height() / nTextHeight) : 1; - Rectangle aClip( aPos, aSize ); + tools::Rectangle aClip( aPos, aSize ); pDev->IntersectClipRegion( aClip ); @@ -430,7 +430,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr if ( bSelected ) { pDev->SetFillColor( COL_BLACK ); - pDev->DrawRect( Rectangle( Point( aPos.X(), aPos.Y() + n*nTextHeight ), + pDev->DrawRect( tools::Rectangle( Point( aPos.X(), aPos.Y() + n*nTextHeight ), Point( aPos.X() + aSize.Width(), aPos.Y() + (n+1)*nTextHeight + 2*nOnePixel ) ) ); pDev->SetFillColor(); pDev->SetTextColor( COL_WHITE ); @@ -580,10 +580,10 @@ void ListBox::Resize() vcl::Window *pBorder = GetWindow( GetWindowType::Border ); ImplControlValue aControlValue; Point aPoint; - Rectangle aContent, aBound; + tools::Rectangle aContent, aBound; // Use the full extent of the control - Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); + tools::Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); if ( GetNativeControlRegion( ControlType::Listbox, ControlPart::ButtonDown, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) @@ -1125,10 +1125,10 @@ bool ListBox::IsInDropDown() const return mpFloatWin && mpFloatWin->IsInPopupMode(); } -Rectangle ListBox::GetBoundingRectangle( sal_Int32 nItem ) const +tools::Rectangle ListBox::GetBoundingRectangle( sal_Int32 nItem ) const { - Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem ); - Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( static_cast<vcl::Window*>(const_cast<ListBox *>(this)) ); + tools::Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem ); + tools::Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( static_cast<vcl::Window*>(const_cast<ListBox *>(this)) ); aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() ); return aRect; } @@ -1184,9 +1184,9 @@ Size ListBox::CalcMinimumSize() const // See how large the edit area inside is to estimate what is needed for the dropdown ImplControlValue aControlValue; Point aPoint; - Rectangle aContent, aBound; + tools::Rectangle aContent, aBound; Size aTestSize( 100, 20 ); - Rectangle aArea( aPoint, aTestSize ); + tools::Rectangle aArea( aPoint, aTestSize ); if( GetNativeControlRegion( ControlType::Listbox, ControlPart::SubEdit, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { @@ -1202,8 +1202,8 @@ Size ListBox::CalcMinimumSize() const if (IsDropDownBox()) // Check minimum height of dropdown box { ImplControlValue aControlValue; - Rectangle aRect( Point( 0, 0 ), aSz ); - Rectangle aContent, aBound; + tools::Rectangle aRect( Point( 0, 0 ), aSz ); + tools::Rectangle aContent, aBound; if( GetNativeControlRegion( ControlType::Listbox, ControlPart::Entire, aRect, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { @@ -1388,9 +1388,9 @@ void ListBox::EnableMirroring() mpImplLB->EnableMirroring(); } -Rectangle ListBox::GetDropDownPosSizePixel() const +tools::Rectangle ListBox::GetDropDownPosSizePixel() const { - return mpFloatWin ? mpFloatWin->GetWindowExtentsRelative( const_cast<ListBox*>(this) ) : Rectangle(); + return mpFloatWin ? mpFloatWin->GetWindowExtentsRelative( const_cast<ListBox*>(this) ) : tools::Rectangle(); } const Wallpaper& ListBox::GetDisplayBackground() const diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index cc30eb548cc5..79d09a6687f9 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -49,13 +49,13 @@ void MenuButton::ExecuteMenu() if (mpMenu) { Point aPos(0, 1); - Rectangle aRect(aPos, aSize ); + tools::Rectangle aRect(aPos, aSize ); mnCurItemId = mpMenu->Execute(this, aRect, PopupMenuFlags::ExecuteDown); } else { Point aPos(GetParent()->OutputToScreenPixel(GetPosPixel())); - Rectangle aRect(aPos, aSize ); + tools::Rectangle aRect(aPos, aSize ); mpFloatingWindow->StartPopupMode(aRect, FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus); } SetPressed(false); diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index 9509e152e21f..cb66fcd005c1 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -108,7 +108,7 @@ void MoreButton::Click() // Adapt dialogbox Point aPos( pParent->GetPosPixel() ); - Rectangle aDeskRect( pParent->ImplGetFrameWindow()->GetDesktopRectPixel() ); + tools::Rectangle aDeskRect( pParent->ImplGetFrameWindow()->GetDesktopRectPixel() ); aSize.Height() += nDeltaPixel; if ( (aPos.Y()+aSize.Height()) > aDeskRect.Bottom() ) diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index a96a86d1ac27..3706c090a703 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -175,7 +175,7 @@ void NotebookBar::UpdateBackground() else SetBackground(rStyleSettings.GetMenuBarColor()); - Invalidate(Rectangle(Point(0,0), GetSizePixel())); + Invalidate(tools::Rectangle(Point(0,0), GetSizePixel())); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx index 67619d8d85a7..240756b921d5 100644 --- a/vcl/source/control/prgsbar.cxx +++ b/vcl/source/control/prgsbar.cxx @@ -147,10 +147,10 @@ void ProgressBar::ImplDrawProgress(vcl::RenderContext& rRenderContext, sal_uInt1 ::DrawProgress(this, rRenderContext, maPos, PROGRESSBAR_OFFSET, mnPrgsWidth, mnPrgsHeight, nOldPerc * 100, nNewPerc * 100, mnPercentCount, - Rectangle(Point(), GetSizePixel())); + tools::Rectangle(Point(), GetSizePixel())); } -void ProgressBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/) +void ProgressBar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) { ImplDrawProgress(rRenderContext, mnPreviousPercent, mnPercent); } diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 85207710d4b6..40dfd14aa0f8 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -241,8 +241,8 @@ void ScrollBar::ImplCalc( bool bUpdate ) { Size aOldSize = getCurrentCalcSize(); - const Rectangle aControlRegion( Point(0,0), aSize ); - Rectangle aBtn1Region, aBtn2Region, aTrackRegion, aBoundingRegion; + const tools::Rectangle aControlRegion( Point(0,0), aSize ); + tools::Rectangle aBtn1Region, aBtn2Region, aTrackRegion, aBoundingRegion; if ( GetStyle() & WB_HORZ ) { @@ -267,7 +267,7 @@ void ScrollBar::ImplCalc( bool bUpdate ) aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) maTrackRect = aTrackRegion; else - maTrackRect = Rectangle( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() ); + maTrackRect = tools::Rectangle( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() ); // Check if available space is big enough for thumb ( min thumb size = ScrBar width/height ) mnThumbPixRange = maTrackRect.Right() - maTrackRect.Left(); @@ -308,7 +308,7 @@ void ScrollBar::ImplCalc( bool bUpdate ) aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) maTrackRect = aTrackRegion; else - maTrackRect = Rectangle( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() ); + maTrackRect = tools::Rectangle( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() ); // Check if available space is big enough for thumb mnThumbPixRange = maTrackRect.Bottom() - maTrackRect.Top(); @@ -454,7 +454,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD if (IsMouseOver()) { - Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel()); + tools::Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel()); if (pRect) { if (pRect == &maThumbRect) @@ -470,14 +470,14 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD } } - Rectangle aCtrlRegion; + tools::Rectangle aCtrlRegion; aCtrlRegion.Union(maBtn1Rect); aCtrlRegion.Union(maBtn2Rect); aCtrlRegion.Union(maPage1Rect); aCtrlRegion.Union(maPage2Rect); aCtrlRegion.Union(maThumbRect); - Rectangle aRequestedRegion(Point(0,0), GetOutputSizePixel()); + tools::Rectangle aRequestedRegion(Point(0,0), GetOutputSizePixel()); // if the actual native control region is smaller then the region that // we requested the control to draw in, then draw a background rectangle // to avoid drawing artifacts in the uncovered region @@ -499,8 +499,8 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD { ControlPart part1 = bHorz ? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper; ControlPart part2 = bHorz ? ControlPart::TrackHorzRight : ControlPart::TrackVertLower; - Rectangle aCtrlRegion1(maPage1Rect); - Rectangle aCtrlRegion2(maPage2Rect); + tools::Rectangle aCtrlRegion1(maPage1Rect); + tools::Rectangle aCtrlRegion2(maPage2Rect); ControlState nState1 = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE) | (HasFocus() ? ControlState::FOCUSED : ControlState::NONE); ControlState nState2 = nState1; @@ -510,7 +510,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD if (IsMouseOver()) { - Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel()); + tools::Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel()); if (pRect) { if (pRect == &maPage1Rect) @@ -530,8 +530,8 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD { ControlPart part1 = bHorz ? ControlPart::ButtonLeft : ControlPart::ButtonUp; ControlPart part2 = bHorz ? ControlPart::ButtonRight : ControlPart::ButtonDown; - Rectangle aCtrlRegion1(maBtn1Rect); - Rectangle aCtrlRegion2(maBtn2Rect); + tools::Rectangle aCtrlRegion1(maBtn1Rect); + tools::Rectangle aCtrlRegion2(maBtn2Rect); ControlState nState1 = HasFocus() ? ControlState::FOCUSED : ControlState::NONE; ControlState nState2 = nState1; @@ -550,7 +550,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD if (IsMouseOver()) { - Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel()); + tools::Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel()); if (pRect) { if (pRect == &maBtn1Rect) @@ -569,7 +569,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD if ((nDrawFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty()) { ControlState nState = IsEnabled() ? ControlState::ENABLED : ControlState::NONE; - Rectangle aCtrlRegion(maThumbRect); + tools::Rectangle aCtrlRegion(maThumbRect); if (mnStateFlags & SCRBAR_STATE_THUMB_DOWN) nState |= ControlState::PRESSED; @@ -579,7 +579,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD if (IsMouseOver()) { - Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel()); + tools::Rectangle* pRect = ImplFindPartRect(GetPointerPosPixel()); if (pRect) { if (pRect == &maThumbRect) @@ -597,7 +597,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext) { DecorationView aDecoView(&rRenderContext); - Rectangle aTempRect; + tools::Rectangle aTempRect; DrawButtonFlags nStyle; const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); SymbolType eSymbolType; @@ -741,7 +741,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) bool bIsInside = false; Point aPoint( 0, 0 ); - Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); + tools::Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); switch ( meScrollType ) { @@ -869,7 +869,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) bool bDragToMouse = false; Point aPoint( 0, 0 ); - Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); + tools::Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); if ( HitTestNativeScrollbar( bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, aControlRegion, rMousePos, bIsInside )? @@ -1102,7 +1102,7 @@ void ScrollBar::ApplySettings(vcl::RenderContext& rRenderContext) rRenderContext.SetBackground(); } -void ScrollBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) +void ScrollBar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { ImplDraw(rRenderContext); } @@ -1125,7 +1125,7 @@ IMPL_LINK_NOARG(ScrollBar, ImplAutoTimerHdl, Timer *, void) void ScrollBar::ImplInvert() { - Rectangle aRect( maThumbRect ); + tools::Rectangle aRect( maThumbRect ); if( aRect.getWidth() > 4 ) { aRect.Left() += 2; @@ -1217,13 +1217,13 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt ) } } -Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt ) +tools::Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt ) { bool bHorizontal = ( GetStyle() & WB_HORZ ) != 0; bool bIsInside = false; Point aPoint( 0, 0 ); - Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); + tools::Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); if( HitTestNativeScrollbar( bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, aControlRegion, rPt, bIsInside )? @@ -1268,8 +1268,8 @@ bool ScrollBar::PreNotify( NotifyEvent& rNEvt ) // Trigger a redraw if mouse over state has changed if( IsNativeControlSupported(ControlType::Scrollbar, ControlPart::Entire) ) { - Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); - Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); + tools::Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); + tools::Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); if( pRect != pLastRect || pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow() ) { vcl::Region aRgn( GetActiveClipRegion() ); @@ -1421,7 +1421,7 @@ Size ScrollBar::GetOptimalSize() const Size ScrollBar::getCurrentCalcSize() const { - Rectangle aCtrlRegion; + tools::Rectangle aCtrlRegion; aCtrlRegion.Union(maBtn1Rect); aCtrlRegion.Union(maBtn2Rect); aCtrlRegion.Union(maPage1Rect); diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 5c16e5a96dba..51e894b280c7 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -110,7 +110,7 @@ void Slider::ImplInitSettings() void Slider::ImplUpdateRects( bool bUpdate ) { - Rectangle aOldThumbRect = maThumbRect; + tools::Rectangle aOldThumbRect = maThumbRect; bool bInvalidateAll = false; if ( mnThumbPixRange ) @@ -138,8 +138,8 @@ void Slider::ImplUpdateRects( bool bUpdate ) else maChannel2Rect.SetEmpty(); - const Rectangle aControlRegion( Rectangle( Point(0,0), Size( SLIDER_THUMB_SIZE, 10 ) ) ); - Rectangle aThumbBounds, aThumbContent; + const tools::Rectangle aControlRegion( tools::Rectangle( Point(0,0), Size( SLIDER_THUMB_SIZE, 10 ) ) ); + tools::Rectangle aThumbBounds, aThumbContent; if ( GetNativeControlRegion( ControlType::Slider, ControlPart::ThumbHorz, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aThumbBounds, aThumbContent ) ) @@ -172,8 +172,8 @@ void Slider::ImplUpdateRects( bool bUpdate ) else maChannel2Rect.SetEmpty(); - const Rectangle aControlRegion( Rectangle( Point(0,0), Size( 10, SLIDER_THUMB_SIZE ) ) ); - Rectangle aThumbBounds, aThumbContent; + const tools::Rectangle aControlRegion( tools::Rectangle( Point(0,0), Size( 10, SLIDER_THUMB_SIZE ) ) ); + tools::Rectangle aThumbBounds, aThumbContent; if ( GetNativeControlRegion( ControlType::Slider, ControlPart::ThumbVert, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aThumbBounds, aThumbContent ) ) @@ -341,7 +341,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) sldValue.mnThumbState |= ControlState::ROLLOVER; } - const Rectangle aCtrlRegion(Point(0,0), GetOutputSizePixel()); + const tools::Rectangle aCtrlRegion(Point(0,0), GetOutputSizePixel()); bool bNativeOK = rRenderContext.DrawNativeControl(ControlType::Slider, nPart, aCtrlRegion, nState, sldValue, OUString()); if (bNativeOK) return; @@ -349,7 +349,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) if (!maChannel1Rect.IsEmpty()) { long nRectSize; - Rectangle aRect = maChannel1Rect; + tools::Rectangle aRect = maChannel1Rect; rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); if (GetStyle() & WB_HORZ) { @@ -393,7 +393,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) if (!maChannel2Rect.IsEmpty()) { long nRectSize; - Rectangle aRect = maChannel2Rect; + tools::Rectangle aRect = maChannel2Rect; rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); if (GetStyle() & WB_HORZ) { @@ -452,7 +452,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) bool Slider::ImplIsPageUp( const Point& rPos ) { Size aSize = GetOutputSizePixel(); - Rectangle aRect = maChannel1Rect; + tools::Rectangle aRect = maChannel1Rect; if ( GetStyle() & WB_HORZ ) { aRect.Top() = 0; @@ -469,7 +469,7 @@ bool Slider::ImplIsPageUp( const Point& rPos ) bool Slider::ImplIsPageDown( const Point& rPos ) { Size aSize = GetOutputSizePixel(); - Rectangle aRect = maChannel2Rect; + tools::Rectangle aRect = maChannel2Rect; if ( GetStyle() & WB_HORZ ) { aRect.Top() = 0; @@ -809,7 +809,7 @@ void Slider::KeyInput( const KeyEvent& rKEvt ) Control::KeyInput( rKEvt ); } -void Slider::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/) +void Slider::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) { ImplDraw(rRenderContext); } diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 6294549bc917..1899000f7d90 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -104,16 +104,16 @@ void SpinButton::Resize() Size aSize(GetOutputSizePixel()); Point aTmpPoint; - Rectangle aRect(aTmpPoint, aSize); + tools::Rectangle aRect(aTmpPoint, aSize); if (mbHorz) { - maLowerRect = Rectangle(0, 0, aSize.Width() / 2, aSize.Height() - 1); - maUpperRect = Rectangle(maLowerRect.TopRight(), aRect.BottomRight()); + maLowerRect = tools::Rectangle(0, 0, aSize.Width() / 2, aSize.Height() - 1); + maUpperRect = tools::Rectangle(maLowerRect.TopRight(), aRect.BottomRight()); } else { - maUpperRect = Rectangle(0, 0, aSize.Width() - 1, aSize.Height() / 2); - maLowerRect = Rectangle(maUpperRect.BottomLeft(), aRect.BottomRight()); + maUpperRect = tools::Rectangle(0, 0, aSize.Width() - 1, aSize.Height() / 2); + maLowerRect = tools::Rectangle(maUpperRect.BottomLeft(), aRect.BottomRight()); } ImplCalcFocusRect(ImplIsUpperEnabled() || !ImplIsLowerEnabled()); @@ -142,17 +142,17 @@ void SpinButton::Draw(OutputDevice* pDev, const Point& rPos, const Size& rSize, pDev->SetSettings( aSettings ); } - Rectangle aRect( Point( 0, 0 ), aSize ); - Rectangle aLowerRect, aUpperRect; + tools::Rectangle aRect( Point( 0, 0 ), aSize ); + tools::Rectangle aLowerRect, aUpperRect; if ( mbHorz ) { - aLowerRect = Rectangle( 0, 0, aSize.Width()/2, aSize.Height()-1 ); - aUpperRect = Rectangle( aLowerRect.TopRight(), aRect.BottomRight() ); + aLowerRect = tools::Rectangle( 0, 0, aSize.Width()/2, aSize.Height()-1 ); + aUpperRect = tools::Rectangle( aLowerRect.TopRight(), aRect.BottomRight() ); } else { - aUpperRect = Rectangle( 0, 0, aSize.Width()-1, aSize.Height()/2 ); - aLowerRect = Rectangle( aUpperRect.BottomLeft(), aRect.BottomRight() ); + aUpperRect = tools::Rectangle( 0, 0, aSize.Width()-1, aSize.Height()/2 ); + aLowerRect = tools::Rectangle( aUpperRect.BottomLeft(), aRect.BottomRight() ); } aUpperRect += aPos; @@ -164,7 +164,7 @@ void SpinButton::Draw(OutputDevice* pDev, const Point& rPos, const Size& rSize, pDev->Pop(); } -void SpinButton::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/) +void SpinButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) { HideFocus(); @@ -427,7 +427,7 @@ void SpinButton::ImplCalcFocusRect( bool _bUpper ) mbUpperIsFocused = _bUpper; } -Rectangle* SpinButton::ImplFindPartRect( const Point& rPt ) +tools::Rectangle* SpinButton::ImplFindPartRect( const Point& rPt ) { if( maUpperRect.IsInside( rPt ) ) return &maUpperRect; @@ -449,8 +449,8 @@ bool SpinButton::PreNotify( NotifyEvent& rNEvt ) if (IsNativeControlSupported(ControlType::Spinbox, ControlPart::Entire) || IsNativeControlSupported(ControlType::Spinbox, ControlPart::AllButtons) ) { - Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); - Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); + tools::Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); + tools::Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); if (pRect != pLastRect || (pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow())) { vcl::Region aRgn(GetActiveClipRegion()); diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index c006140571a3..84fb780d50f6 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -32,7 +32,7 @@ namespace { void ImplGetSpinbuttonValue(vcl::Window* pWin, - const Rectangle& rUpperRect, const Rectangle& rLowerRect, + const tools::Rectangle& rUpperRect, const tools::Rectangle& rLowerRect, bool bUpperIn, bool bLowerIn, bool bUpperEnabled, bool bLowerEnabled, bool bHorz, SpinbuttonValue& rValue ) { @@ -82,7 +82,7 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW rRenderContext.IsNativeControlSupported(ControlType::Spinbox, rSpinbuttonValue.mnLowerPart)) { // only paint the embedded spin buttons, all buttons are painted at once - Rectangle aUpperAndLowerButtons( rSpinbuttonValue.maUpperRect.GetUnion( rSpinbuttonValue.maLowerRect ) ); + tools::Rectangle aUpperAndLowerButtons( rSpinbuttonValue.maUpperRect.GetUnion( rSpinbuttonValue.maLowerRect ) ); bNativeOK = rRenderContext.DrawNativeControl(ControlType::Spinbox, ControlPart::AllButtons, aUpperAndLowerButtons, ControlState::ENABLED, rSpinbuttonValue, OUString()); } @@ -92,14 +92,14 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW vcl::Window* pBorder = pWin->GetWindow(GetWindowType::Border); // to not overwrite everything, set the button region as clipregion to the border window - Rectangle aClipRect(rSpinbuttonValue.maLowerRect); + tools::Rectangle aClipRect(rSpinbuttonValue.maLowerRect); aClipRect.Union(rSpinbuttonValue.maUpperRect); vcl::RenderContext* pContext = &rRenderContext; vcl::Region oldRgn; Point aPt; Size aSize(pBorder->GetOutputSizePixel()); // the size of the border window, i.e., the whole control - Rectangle aNatRgn(aPt, aSize); + tools::Rectangle aNatRgn(aPt, aSize); if (!pWin->SupportsDoubleBuffering()) { @@ -112,7 +112,7 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW pContext = pBorder; } - Rectangle aBound, aContent; + tools::Rectangle aBound, aContent; if (!ImplGetSVData()->maNWFData.mbCanDrawWidgetAnySize && pContext->GetNativeControlRegion(ControlType::Spinbox, ControlPart::Entire, aNatRgn, ControlState::NONE, rSpinbuttonValue, @@ -121,7 +121,7 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW aSize = aContent.GetSize(); } - Rectangle aRgn(aPt, aSize); + tools::Rectangle aRgn(aPt, aSize); if (pWin->SupportsDoubleBuffering()) { // convert from borderwin space, to the pWin's space @@ -144,7 +144,7 @@ bool ImplDrawNativeSpinbuttons(vcl::RenderContext& rRenderContext, const Spinbut if (rRenderContext.IsNativeControlSupported(ControlType::SpinButtons, ControlPart::Entire)) { - Rectangle aArea = rSpinbuttonValue.maUpperRect.GetUnion(rSpinbuttonValue.maLowerRect); + tools::Rectangle aArea = rSpinbuttonValue.maUpperRect.GetUnion(rSpinbuttonValue.maLowerRect); // only paint the standalone spin buttons, all buttons are painted at once bNativeOK = rRenderContext.DrawNativeControl(ControlType::SpinButtons, ControlPart::AllButtons, aArea, ControlState::ENABLED, rSpinbuttonValue, OUString()); @@ -155,7 +155,7 @@ bool ImplDrawNativeSpinbuttons(vcl::RenderContext& rRenderContext, const Spinbut } void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow, - const Rectangle& rUpperRect, const Rectangle& rLowerRect, + const tools::Rectangle& rUpperRect, const tools::Rectangle& rLowerRect, bool bUpperIn, bool bLowerIn, bool bUpperEnabled, bool bLowerEnabled, bool bHorz, bool bMirrorHorz) { @@ -205,7 +205,7 @@ void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow } void ImplDrawUpDownButtons(vcl::RenderContext& rRenderContext, - const Rectangle& rUpperRect, const Rectangle& rLowerRect, + const tools::Rectangle& rUpperRect, const tools::Rectangle& rLowerRect, bool bUpperIn, bool bLowerIn, bool bUpperEnabled, bool bLowerEnabled, bool bHorz, bool bMirrorHorz) { @@ -229,14 +229,14 @@ void ImplDrawUpDownButtons(vcl::RenderContext& rRenderContext, if (bUpperIn) nStyle |= DrawButtonFlags::Pressed; - Rectangle aUpRect = aDecoView.DrawButton(rUpperRect, nStyle); + tools::Rectangle aUpRect = aDecoView.DrawButton(rUpperRect, nStyle); nStyle = DrawButtonFlags::NoLeftLightBorder; // draw lower/right Button if (bLowerIn) nStyle |= DrawButtonFlags::Pressed; - Rectangle aLowRect = aDecoView.DrawButton(rLowerRect, nStyle); + tools::Rectangle aLowRect = aDecoView.DrawButton(rLowerRect, nStyle); // make use of additional default edge aUpRect.Left()--; @@ -403,7 +403,7 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt ) { // put DropDownButton to the right mbInDropDown = ShowDropDown( !mbInDropDown ); - Invalidate(Rectangle(Point(), GetOutputSizePixel())); + Invalidate(tools::Rectangle(Point(), GetOutputSizePixel())); } if (mbUpperIn || mbLowerIn) @@ -519,7 +519,7 @@ bool SpinField::EventNotify(NotifyEvent& rNEvt) else if ((nMod == KEY_MOD2) && !mbInDropDown && (GetStyle() & WB_DROPDOWN)) { mbInDropDown = ShowDropDown(true); - Invalidate(Rectangle(Point(), GetOutputSizePixel())); + Invalidate(tools::Rectangle(Point(), GetOutputSizePixel())); bDone = true; } } @@ -584,7 +584,7 @@ void SpinField::FillLayoutData() const Edit::FillLayoutData(); } -void SpinField::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) +void SpinField::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { if (mbSpin) { @@ -600,7 +600,7 @@ void SpinField::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect DrawButtonFlags nStyle = DrawButtonFlags::NoLightBorder; if (mbInDropDown) nStyle |= DrawButtonFlags::Pressed; - Rectangle aInnerRect = aView.DrawButton(maDropDownRect, nStyle); + tools::Rectangle aInnerRect = aView.DrawButton(maDropDownRect, nStyle); SymbolType eSymbol = SymbolType::SPIN_DOWN; DrawSymbolFlags nSymbolStyle = IsEnabled() ? DrawSymbolFlags::NONE : DrawSymbolFlags::Disable; @@ -610,8 +610,8 @@ void SpinField::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect Edit::Paint(rRenderContext, rRect); } -void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rectangle& rDDArea, - Rectangle& rSpinUpArea, Rectangle& rSpinDownArea) +void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, tools::Rectangle& rDDArea, + tools::Rectangle& rSpinUpArea, tools::Rectangle& rSpinDownArea) { const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings(); @@ -624,7 +624,7 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect nW = GetDrawPixel( pDev, nW ); aDropDownSize = Size( CalcZoom( nW ), aSize.Height() ); aSize.Width() -= aDropDownSize.Width(); - rDDArea = Rectangle( Point( aSize.Width(), 0 ), aDropDownSize ); + rDDArea = tools::Rectangle( Point( aSize.Width(), 0 ), aDropDownSize ); rDDArea.Top()--; } else @@ -640,7 +640,7 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect nBottom1--; bool bNativeRegionOK = false; - Rectangle aContentUp, aContentDown; + tools::Rectangle aContentUp, aContentDown; if ((pDev->GetOutDevType() == OUTDEV_WINDOW) && // there is just no useful native support for spinfields with dropdown @@ -652,11 +652,11 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect // get the system's spin button size ImplControlValue aControlValue; - Rectangle aBound; + tools::Rectangle aBound; Point aPoint; // use the full extent of the control - Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); + tools::Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); bNativeRegionOK = pWin->GetNativeControlRegion(ControlType::Spinbox, ControlPart::ButtonUp, @@ -682,8 +682,8 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect { aSize.Width() -= CalcZoom( GetDrawPixel( pDev, rStyleSettings.GetSpinSize() ) ); - rSpinUpArea = Rectangle( aSize.Width(), 0, rOutSz.Width()-aDropDownSize.Width()-1, nBottom1 ); - rSpinDownArea = Rectangle( rSpinUpArea.Left(), nTop2, rSpinUpArea.Right(), nBottom2 ); + rSpinUpArea = tools::Rectangle( aSize.Width(), 0, rOutSz.Width()-aDropDownSize.Width()-1, nBottom1 ); + rSpinDownArea = tools::Rectangle( rSpinUpArea.Left(), nTop2, rSpinUpArea.Right(), nBottom2 ); } } else @@ -707,11 +707,11 @@ void SpinField::Resize() ImplControlValue aControlValue; Point aPoint; - Rectangle aContent, aBound; + tools::Rectangle aContent, aBound; // use the full extent of the control vcl::Window *pBorder = GetWindow( GetWindowType::Border ); - Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); + tools::Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); // adjust position and size of the edit field if (GetNativeControlRegion(ControlType::Spinbox, ControlPart::SubEdit, aArea, ControlState::NONE, @@ -748,7 +748,7 @@ void SpinField::Resize() mpEdit->SetSizePixel(aSize); if (GetStyle() & WB_SPIN) - Invalidate(Rectangle(maUpperRect.TopLeft(), maLowerRect.BottomRight())); + Invalidate(tools::Rectangle(maUpperRect.TopLeft(), maLowerRect.BottomRight())); if (GetStyle() & WB_DROPDOWN) Invalidate(maDropDownRect); } @@ -825,7 +825,7 @@ void SpinField::DataChanged( const DataChangedEvent& rDCEvt ) } } -Rectangle* SpinField::ImplFindPartRect(const Point& rPt) +tools::Rectangle* SpinField::ImplFindPartRect(const Point& rPt) { if (maUpperRect.IsInside(rPt)) return &maUpperRect; @@ -847,8 +847,8 @@ bool SpinField::PreNotify(NotifyEvent& rNEvt) if( IsNativeControlSupported(ControlType::Spinbox, ControlPart::Entire) || IsNativeControlSupported(ControlType::Spinbox, ControlPart::AllButtons) ) { - Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); - Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); + tools::Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); + tools::Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); if( pRect != pLastRect || (pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow()) ) { // FIXME: this is currently only on OS X @@ -886,7 +886,7 @@ bool SpinField::PreNotify(NotifyEvent& rNEvt) void SpinField::EndDropDown() { mbInDropDown = false; - Invalidate(Rectangle(Point(), GetOutputSizePixel())); + Invalidate(tools::Rectangle(Point(), GetOutputSizePixel())); } bool SpinField::ShowDropDown( bool ) @@ -903,8 +903,8 @@ Size SpinField::CalcMinimumSizeForText(const OUString &rString) const if ( GetStyle() & WB_SPIN ) { ImplControlValue aControlValue; - Rectangle aArea( Point(), Size(100, aSz.Height())); - Rectangle aEntireBound, aEntireContent, aEditBound, aEditContent; + tools::Rectangle aArea( Point(), Size(100, aSz.Height())); + tools::Rectangle aEntireBound, aEntireContent, aEditBound, aEditContent; if ( GetNativeControlRegion(ControlType::Spinbox, ControlPart::Entire, aArea, ControlState::NONE, aControlValue, OUString(), aEntireBound, aEntireContent) && @@ -986,7 +986,7 @@ void SpinField::Draw(OutputDevice* pDev, const Point& rPos, const Size& rSize, D pDev->SetSettings(aSettings); } - Rectangle aDD, aUp, aDown; + tools::Rectangle aDD, aUp, aDown; ImplCalcButtonAreas(pDev, aSize, aDD, aUp, aDown); aDD.Move(aPos.X(), aPos.Y()); aUp.Move(aPos.X(), aPos.Y()); @@ -1003,7 +1003,7 @@ void SpinField::Draw(OutputDevice* pDev, const Point& rPos, const Size& rSize, D { DecorationView aView( pDev ); DrawButtonFlags nStyle = DrawButtonFlags::NoLightBorder; - Rectangle aInnerRect = aView.DrawButton( aDD, nStyle ); + tools::Rectangle aInnerRect = aView.DrawButton( aDD, nStyle ); SymbolType eSymbol = SymbolType::SPIN_DOWN; DrawSymbolFlags nSymbolStyle = (IsEnabled() || (nFlags & DrawFlags::NoDisable)) ? DrawSymbolFlags::NONE : DrawSymbolFlags::Disable; aView.DrawSymbol(aInnerRect, eSymbol, aButtonTextColor, nSymbolStyle); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 52afe6b4924f..2df0fbfd5028 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -51,7 +51,7 @@ struct ImplTabItem OUString maHelpText; OString maHelpId; OString maTabName; - Rectangle maRect; + tools::Rectangle maRect; sal_uInt16 mnLine; bool mbFullVisible; bool mbEnabled; @@ -232,9 +232,9 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) aSize.Width() += TAB_TABOFFSET_X*2; aSize.Height() += TAB_TABOFFSET_Y*2; - Rectangle aCtrlRegion( Point( 0, 0 ), aSize ); - Rectangle aBoundingRgn, aContentRgn; - const TabitemValue aControlValue(Rectangle(TAB_TABOFFSET_X, TAB_TABOFFSET_Y, + tools::Rectangle aCtrlRegion( Point( 0, 0 ), aSize ); + tools::Rectangle aBoundingRgn, aContentRgn; + const TabitemValue aControlValue(tools::Rectangle(TAB_TABOFFSET_X, TAB_TABOFFSET_Y, aSize.Width() - TAB_TABOFFSET_X * 2, aSize.Height() - TAB_TABOFFSET_Y * 2)); if(GetNativeControlRegion( ControlType::TabItem, ControlPart::Entire, aCtrlRegion, @@ -425,7 +425,7 @@ bool TabControl::ImplPlaceTabs( long nWidth ) nLinePosAry[nLines] = nPos; } - Rectangle aNewRect( Point( nX, nY ), aSize ); + tools::Rectangle aNewRect( Point( nX, nY ), aSize ); if ( mbSmallInvalidate && (it->maRect != aNewRect) ) mbSmallInvalidate = false; it->maRect = aNewRect; @@ -523,7 +523,7 @@ bool TabControl::ImplPlaceTabs( long nWidth ) return true; } -Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHeight ) +tools::Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHeight ) { Size aWinSize = Control::GetOutputSizePixel(); if ( nWidth < 0 ) @@ -536,8 +536,8 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe long nW = nWidth-TAB_OFFSET*2; long nH = nHeight-TAB_OFFSET*2; return (nW > 0 && nH > 0) - ? Rectangle( Point( TAB_OFFSET, TAB_OFFSET ), Size( nW, nH ) ) - : Rectangle(); + ? tools::Rectangle( Point( TAB_OFFSET, TAB_OFFSET ), Size( nW, nH ) ) + : tools::Rectangle(); } if ( nItemPos == TAB_PAGERECT ) @@ -548,19 +548,19 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe else nLastPos = 0; - Rectangle aRect = ImplGetTabRect( nLastPos, nWidth, nHeight ); + tools::Rectangle aRect = ImplGetTabRect( nLastPos, nWidth, nHeight ); long nW = nWidth-TAB_OFFSET*2; long nH = nHeight-aRect.Bottom()-TAB_OFFSET*2; aRect = (nW > 0 && nH > 0) - ? Rectangle( Point( TAB_OFFSET, aRect.Bottom()+TAB_OFFSET ), Size( nW, nH ) ) - : Rectangle(); + ? tools::Rectangle( Point( TAB_OFFSET, aRect.Bottom()+TAB_OFFSET ), Size( nW, nH ) ) + : tools::Rectangle(); return aRect; } nWidth -= 1; if ( (nWidth <= 0) || (nHeight <= 0) ) - return Rectangle(); + return tools::Rectangle(); if ( mbFormat || (mnLastWidth != nWidth) || (mnLastHeight != nHeight) ) { @@ -570,14 +570,14 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe bool bRet = ImplPlaceTabs( nWidth ); if ( !bRet ) - return Rectangle(); + return tools::Rectangle(); mnLastWidth = nWidth; mnLastHeight = nHeight; mbFormat = false; } - return size_t(nItemPos) < mpTabCtrlData->maItemList.size() ? mpTabCtrlData->maItemList[nItemPos].maRect : Rectangle(); + return size_t(nItemPos) < mpTabCtrlData->maItemList.size() ? mpTabCtrlData->maItemList[nItemPos].maRect : tools::Rectangle(); } void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) @@ -593,7 +593,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) if ( IsReallyVisible() && IsUpdateMode() ) { sal_uInt16 nPos = GetPagePos( nId ); - Rectangle aRect = ImplGetTabRect( nPos ); + tools::Rectangle aRect = ImplGetTabRect( nPos ); if ( !pOldItem || !pItem || (pOldItem->mnLine != pItem->mnLine) ) { @@ -619,7 +619,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) if ( pOldPage == pPage ) return; - Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); + tools::Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); if ( pOldPage ) { @@ -632,7 +632,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) { if ( ( GetStyle() & WB_NOBORDER ) ) { - Rectangle aRectNoTab(Point(0, 0), GetSizePixel()); + tools::Rectangle aRectNoTab(Point(0, 0), GetSizePixel()); pPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() ); } else @@ -685,11 +685,11 @@ bool TabControl::ImplPosCurTabPage() { if ( ( GetStyle() & WB_NOBORDER ) ) { - Rectangle aRectNoTab(Point(0, 0), GetSizePixel()); + tools::Rectangle aRectNoTab(Point(0, 0), GetSizePixel()); pItem->mpTabPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() ); return true; } - Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); + tools::Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); pItem->mpTabPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() ); return true; } @@ -720,7 +720,7 @@ void TabControl::ImplShowFocus() return; sal_uInt16 nCurPos = GetPagePos( mnCurPageId ); - Rectangle aRect = ImplGetTabRect( nCurPos ); + tools::Rectangle aRect = ImplGetTabRect( nCurPos ); const ImplTabItem& rItem = mpTabCtrlData->maItemList[ nCurPos ]; Size aTabSize = aRect.GetSize(); Size aImageSize( 0, 0 ); @@ -764,14 +764,14 @@ void TabControl::ImplShowFocus() ShowFocus( aRect ); } -void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* pItem, const Rectangle& rCurRect, +void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* pItem, const tools::Rectangle& rCurRect, bool bFirstInGroup, bool bLastInGroup, bool /* bIsCurrentItem */ ) { if (pItem->maRect.IsEmpty()) return; const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - Rectangle aRect = pItem->maRect; + tools::Rectangle aRect = pItem->maRect; long nLeftBottom = aRect.Bottom(); long nRightBottom = aRect.Bottom(); bool bLeftBorder = true; @@ -844,7 +844,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::TabItem, ControlPart::Entire); if ( bNativeOK ) { - TabitemValue tiValue(Rectangle(pItem->maRect.Left() + TAB_TABOFFSET_X, + TabitemValue tiValue(tools::Rectangle(pItem->maRect.Left() + TAB_TABOFFSET_X, pItem->maRect.Top() + TAB_TABOFFSET_Y, pItem->maRect.Right() - TAB_TABOFFSET_X, pItem->maRect.Bottom() - TAB_TABOFFSET_Y)); @@ -857,7 +857,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p if (bLastInGroup) tiValue.mnAlignment |= TabitemFlags::LastInGroup; - Rectangle aCtrlRegion( pItem->maRect ); + tools::Rectangle aCtrlRegion( pItem->maRect ); bNativeOK = rRenderContext.DrawNativeControl(ControlType::TabItem, ControlPart::Entire, aCtrlRegion, nState, tiValue, OUString() ); } @@ -940,7 +940,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p Color aOldColor(rRenderContext.GetTextColor()); rRenderContext.SetTextColor(aColor); - const Rectangle aOutRect(nXPos + aImageSize.Width(), nYPos, + const tools::Rectangle aOutRect(nXPos + aImageSize.Width(), nYPos, nXPos + aImageSize.Width() + nTextWidth, nYPos + nTextHeight); DrawControlText(rRenderContext, aOutRect, pItem->maFormatText, nStyle, nullptr, nullptr); @@ -1041,18 +1041,18 @@ void TabControl::KeyInput( const KeyEvent& rKEvt ) Control::KeyInput( rKEvt ); } -void TabControl::Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect) +void TabControl::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { if (!(GetStyle() & WB_NOBORDER)) ImplPaint(rRenderContext, rRect); } -void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) +void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { HideFocus(); // reformat if needed - Rectangle aRect = ImplGetTabRect(TAB_PAGERECT); + tools::Rectangle aRect = ImplGetTabRect(TAB_PAGERECT); // find current item ImplTabItem* pCurItem = nullptr; @@ -1068,7 +1068,7 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& // Draw the TabPage border const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - Rectangle aCurRect; + tools::Rectangle aCurRect; aRect.Left() -= TAB_OFFSET; aRect.Top() -= TAB_OFFSET; aRect.Right() += TAB_OFFSET; @@ -1110,7 +1110,7 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& if (rRenderContext.IsNativeControlSupported(ControlType::TabHeader, ControlPart::Entire)) { - Rectangle aHeaderRect(aRect.Left(), 0, aRect.Right(), aRect.Top()); + tools::Rectangle aHeaderRect(aRect.Left(), 0, aRect.Right(), aRect.Top()); aClipRgn = rRenderContext.GetActiveClipRegion(); aClipRgn.Intersect(aHeaderRect); @@ -1280,7 +1280,7 @@ void TabControl::setAllocation(const Size &rAllocation) if ( mbSmallInvalidate ) { - Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); + tools::Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); aRect.Left() -= TAB_OFFSET+TAB_BORDER_LEFT; aRect.Top() -= TAB_OFFSET+TAB_BORDER_TOP; aRect.Right() += TAB_OFFSET+TAB_BORDER_RIGHT; @@ -1363,7 +1363,7 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) OUString aStr = GetHelpText( nItemId ); if ( !aStr.isEmpty() ) { - Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); + tools::Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); aItemRect.Left() = aPt.X(); aItemRect.Top() = aPt.Y(); @@ -1394,7 +1394,7 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) const OUString& rStr = pItem->maText; if ( rStr != pItem->maFormatText ) { - Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); + tools::Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); aItemRect.Left() = aPt.X(); aItemRect.Top() = aPt.Y(); @@ -1419,7 +1419,7 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) // show tooltip if not text but image is set and helptext is available if ( !rHelpText.isEmpty() && pItem->maText.isEmpty() && !!pItem->maTabImage ) { - Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); + tools::Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); aItemRect.Left() = aPt.X(); aItemRect.Top() = aPt.Y(); @@ -1521,7 +1521,7 @@ void TabControl::DataChanged( const DataChangedEvent& rDCEvt ) } } -Rectangle* TabControl::ImplFindPartRect( const Point& rPt ) +tools::Rectangle* TabControl::ImplFindPartRect( const Point& rPt ) { ImplTabItem* pFoundItem = nullptr; int nFound = 0; @@ -1550,8 +1550,8 @@ bool TabControl::PreNotify( NotifyEvent& rNEvt ) // trigger redraw if mouse over state has changed if( IsNativeControlSupported(ControlType::TabItem, ControlPart::Entire) ) { - Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); - Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); + tools::Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); + tools::Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); if( pRect != pLastRect || (pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow()) ) { vcl::Region aClipRgn; @@ -1560,7 +1560,7 @@ bool TabControl::PreNotify( NotifyEvent& rNEvt ) // allow for slightly bigger tabitems // as used by gtk // TODO: query for the correct sizes - Rectangle aRect(*pLastRect); + tools::Rectangle aRect(*pLastRect); aRect.Left()-=2; aRect.Right()+=2; aRect.Top()-=3; @@ -1571,7 +1571,7 @@ bool TabControl::PreNotify( NotifyEvent& rNEvt ) // allow for slightly bigger tabitems // as used by gtk // TODO: query for the correct sizes - Rectangle aRect(*pRect); + tools::Rectangle aRect(*pRect); aRect.Left()-=2; aRect.Right()+=2; aRect.Top()-=3; @@ -1613,7 +1613,7 @@ void TabControl::SetTabPageSizePixel( const Size& rSize ) Size aNewSize( rSize ); aNewSize.Width() += TAB_OFFSET*2; - Rectangle aRect = ImplGetTabRect( TAB_PAGERECT, + tools::Rectangle aRect = ImplGetTabRect( TAB_PAGERECT, aNewSize.Width(), aNewSize.Height() ); aNewSize.Height() += aRect.Top()+TAB_OFFSET; Window::SetOutputSizePixel( aNewSize ); @@ -1621,7 +1621,7 @@ void TabControl::SetTabPageSizePixel( const Size& rSize ) Size TabControl::GetTabPageSizePixel() const { - Rectangle aRect = const_cast<TabControl*>(this)->ImplGetTabRect( TAB_PAGERECT ); + tools::Rectangle aRect = const_cast<TabControl*>(this)->ImplGetTabRect( TAB_PAGERECT ); return aRect.GetSize(); } @@ -2026,9 +2026,9 @@ void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage ) } } -Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const +tools::Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const { - Rectangle aRet; + tools::Rectangle aRet; if( !HasLayoutData() || ! mpTabCtrlData->maLayoutPageIdToLine.size() ) FillLayoutData(); @@ -2085,9 +2085,9 @@ void TabControl::FillLayoutData() const const_cast<TabControl*>(this)->Invalidate(); } -Rectangle TabControl::GetTabBounds( sal_uInt16 nPageId ) const +tools::Rectangle TabControl::GetTabBounds( sal_uInt16 nPageId ) const { - Rectangle aRet; + tools::Rectangle aRet; ImplTabItem* pItem = ImplGetItem( nPageId ); if(pItem) @@ -2157,7 +2157,7 @@ Size TabControl::calculateRequisition() const TabControl* pThis = const_cast<TabControl*>(this); sal_uInt16 nPos = it - mpTabCtrlData->maItemList.begin(); - Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX); if (aTabRect.Bottom() > nTabLabelsBottom) nTabLabelsBottom = aTabRect.Bottom(); if (aTabRect.Right() > nTabLabelsRight) @@ -2419,7 +2419,7 @@ bool NotebookbarTabControlBase::ImplPlaceTabs( long nWidth ) if( !it->maText.isEmpty() && aSize.getWidth() < 100) aSize.Width() = 100; - Rectangle aNewRect( Point( nX, nY ), aSize ); + tools::Rectangle aNewRect( Point( nX, nY ), aSize ); if ( mbSmallInvalidate && (it->maRect != aNewRect) ) mbSmallInvalidate = false; @@ -2539,12 +2539,12 @@ bool NotebookbarTabControlBase::ImplPlaceTabs( long nWidth ) return true; } -void NotebookbarTabControlBase::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) +void NotebookbarTabControlBase::ImplPaint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { HideFocus(); // reformat if needed - Rectangle aRect = ImplGetTabRect(TAB_PAGERECT); + tools::Rectangle aRect = ImplGetTabRect(TAB_PAGERECT); // find current item ImplTabItem* pCurItem = nullptr; @@ -2560,7 +2560,7 @@ void NotebookbarTabControlBase::ImplPaint(vcl::RenderContext& rRenderContext, co // Draw the TabPage border const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - Rectangle aCurRect; + tools::Rectangle aCurRect; aRect.Left() -= TAB_OFFSET; aRect.Top() -= TAB_OFFSET; aRect.Right() += TAB_OFFSET; @@ -2602,7 +2602,7 @@ void NotebookbarTabControlBase::ImplPaint(vcl::RenderContext& rRenderContext, co if (rRenderContext.IsNativeControlSupported(ControlType::TabHeader, ControlPart::Entire)) { - Rectangle aHeaderRect(aRect.Left(), 0, aRect.Right(), aRect.Top()); + tools::Rectangle aHeaderRect(aRect.Left(), 0, aRect.Right(), aRect.Top()); aClipRgn = rRenderContext.GetActiveClipRegion(); aClipRgn.Intersect(aHeaderRect); @@ -2781,7 +2781,7 @@ Size NotebookbarTabControlBase::calculateRequisition() const NotebookbarTabControlBase* pThis = const_cast<NotebookbarTabControlBase*>(this); sal_uInt16 nPos = it - mpTabCtrlData->maItemList.begin(); - Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX); if (aTabRect.Bottom() > nTabLabelsBottom) { nTabLabelsBottom = aTabRect.Bottom(); |