diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-10 15:05:22 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-11 06:44:48 +0200 |
commit | 2fdee9fd60bc4bb61f773fa1f766e84f4ee0dae3 (patch) | |
tree | 4a541f076f822fc11d26001a16174976b2853da3 /toolkit | |
parent | f111fbf5d508c8215615f037d7e1c1f563812a13 (diff) |
Unify/Port to use VCLUnoHelper for AWT <-> VCL conversions
Following
Change-Id: Id48f81deb05aee2026509037f7d14575735e5be0
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Jul 10 14:49:03 2024 +0200
VCLUnoHelper: Align AWT <-> VCL helpers with convert.hxx impl
, port all uses of the helper functions defined in
`include/toolkit/helper/convert.hxx` to use the
`VCLUnoHelper` equivalents instead, to unify usage
and avoid duplication.
Drop `include/toolkit/helper/convert.hxx` now that
it's unused.
Change-Id: I22695a93e40e47bb2b14d191a2e0a4eb7c856895
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170317
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxaccessiblecomponent.cxx | 10 | ||||
-rw-r--r-- | toolkit/source/awt/vclxmenu.cxx | 6 | ||||
-rw-r--r-- | toolkit/source/awt/vclxregion.cxx | 16 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 3 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 26 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 62 | ||||
-rw-r--r-- | toolkit/source/controls/tree/treecontrolpeer.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/hatchwindow/hatchwindow.cxx | 8 | ||||
-rw-r--r-- | toolkit/source/helper/vclunohelper.cxx | 3 |
9 files changed, 68 insertions, 70 deletions
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 453bf38056c8..da5e165ab831 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -27,8 +27,8 @@ #include <i18nlangtag/languagetag.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> #include <toolkit/awt/vclxwindow.hxx> -#include <toolkit/helper/convert.hxx> #include <toolkit/awt/vclxfont.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/toolkit/dialog.hxx> #include <vcl/vclevent.hxx> #include <vcl/window.hxx> @@ -697,8 +697,8 @@ uno::Reference< accessibility::XAccessible > VCLXAccessibleComponent::getAccessi uno::Reference< accessibility::XAccessibleComponent > xComp( xAcc->getAccessibleContext(), uno::UNO_QUERY ); if ( xComp.is() ) { - tools::Rectangle aRect = VCLRectangle( xComp->getBounds() ); - Point aPos = VCLPoint( rPoint ); + tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()); + Point aPos = VCLUnoHelper::ConvertToVCLPoint(rPoint); if ( aRect.Contains( aPos ) ) { xChild = xAcc; @@ -720,12 +720,12 @@ awt::Rectangle VCLXAccessibleComponent::implGetBounds() if ( pWindow ) { AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute(); - aBounds = AWTRectangle( aRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aRect); vcl::Window* pParent = pWindow->GetAccessibleParentWindow(); if ( pParent ) { AbsoluteScreenPixelRectangle aParentRect = pParent->GetWindowExtentsAbsolute(); - awt::Point aParentScreenLoc = AWTPoint( aParentRect.TopLeft() ); + awt::Point aParentScreenLoc = VCLUnoHelper::ConvertToAWTPoint(aParentRect.TopLeft()); aBounds.X -= aParentScreenLoc.X; aBounds.Y -= aParentScreenLoc.Y; } diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index d7b8a7ba44e7..192c3ab9d346 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -18,7 +18,6 @@ */ #include <toolkit/awt/vclxmenu.hxx> -#include <toolkit/helper/convert.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/uno/XComponentContext.hpp> @@ -507,9 +506,8 @@ sal_Int16 VCLXMenu::execute( pPopupMenu->SetMenuFlags(nMenuFlags); // cannot call this with mutex locked because it will call back into us return pPopupMenu->Execute( - VCLUnoHelper::GetWindow( rxWindowPeer ), - VCLRectangle( rPos ), - static_cast<PopupMenuFlags>(nFlags) | PopupMenuFlags::NoMouseUpClose ); + VCLUnoHelper::GetWindow(rxWindowPeer), VCLUnoHelper::ConvertToVCLRect(rPos), + static_cast<PopupMenuFlags>(nFlags) | PopupMenuFlags::NoMouseUpClose); } diff --git a/toolkit/source/awt/vclxregion.cxx b/toolkit/source/awt/vclxregion.cxx index fff7e7969d9a..1d9eec4785dc 100644 --- a/toolkit/source/awt/vclxregion.cxx +++ b/toolkit/source/awt/vclxregion.cxx @@ -19,8 +19,6 @@ #include <awt/vclxregion.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <toolkit/helper/convert.hxx> - VCLXRegion::VCLXRegion() @@ -35,7 +33,7 @@ css::awt::Rectangle VCLXRegion::getBounds() { std::scoped_lock aGuard( maMutex ); - return AWTRectangle( maRegion.GetBoundRect() ); + return VCLUnoHelper::ConvertToAWTRect(maRegion.GetBoundRect()); } void VCLXRegion::clear() @@ -56,28 +54,28 @@ void VCLXRegion::unionRectangle( const css::awt::Rectangle& rRect ) { std::scoped_lock aGuard( maMutex ); - maRegion.Union( VCLRectangle( rRect ) ); + maRegion.Union(VCLUnoHelper::ConvertToVCLRect(rRect)); } void VCLXRegion::intersectRectangle( const css::awt::Rectangle& rRect ) { std::scoped_lock aGuard( maMutex ); - maRegion.Intersect( VCLRectangle( rRect ) ); + maRegion.Intersect(VCLUnoHelper::ConvertToVCLRect(rRect)); } void VCLXRegion::excludeRectangle( const css::awt::Rectangle& rRect ) { std::scoped_lock aGuard( maMutex ); - maRegion.Exclude( VCLRectangle( rRect ) ); + maRegion.Exclude(VCLUnoHelper::ConvertToVCLRect(rRect)); } void VCLXRegion::xOrRectangle( const css::awt::Rectangle& rRect ) { std::scoped_lock aGuard( maMutex ); - maRegion.XOr( VCLRectangle( rRect ) ); + maRegion.XOr(VCLUnoHelper::ConvertToVCLRect(rRect)); } void VCLXRegion::unionRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion ) @@ -125,14 +123,14 @@ css::uno::Sequence< css::awt::Rectangle > VCLXRegion::getRectangles() for(const auto& rRect : aRectangles) { - aRects.getArray()[a++] = AWTRectangle(rRect); + aRects.getArray()[a++] = VCLUnoHelper::ConvertToAWTRect(rRect); } //Rectangle aRect; //sal_uInt32 nR = 0; //RegionHandle h = maRegion.BeginEnumRects(); //while ( maRegion.GetEnumRects( h, aRect ) ) - // aRects.getArray()[nR++] = AWTRectangle( aRect ); + // aRects.getArray()[nR++] = VCLUnoHelper::ConvertToAWTRect( aRect ); //maRegion.EndEnumRects( h ); return aRects; diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 9e9c547e4ba6..c13d6c3fc8bb 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -87,7 +87,6 @@ #include <toolkit/helper/vclunohelper.hxx> #include <helper/property.hxx> -#include <toolkit/helper/convert.hxx> #include <controls/filectrl.hxx> #include <controls/svmedit.hxx> #include <controls/table/tablecontrol.hxx> @@ -1875,7 +1874,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow( } else if ( !VCLUnoHelper::IsZero( rDescriptor.Bounds ) ) { - tools::Rectangle aRect = VCLRectangle( rDescriptor.Bounds ); + tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(rDescriptor.Bounds); pNewWindow->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() ); } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index c5cfc9ec7553..20ddba055804 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -36,7 +36,6 @@ #include <awt/vclxpointer.hxx> #include <toolkit/awt/vclxwindows.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <toolkit/helper/convert.hxx> #include <helper/property.hxx> #include <rtl/math.hxx> #include <sal/log.hxx> @@ -449,7 +448,8 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { css::awt::PaintEvent aEvent; aEvent.Source = getXWeak(); - aEvent.UpdateRect = AWTRectangle( *static_cast<tools::Rectangle*>(rVclWindowEvent.GetData()) ); + aEvent.UpdateRect = VCLUnoHelper::ConvertToAWTRect( + *static_cast<tools::Rectangle*>(rVclWindowEvent.GetData())); aEvent.Count = 0; mpImpl->getPaintListeners().windowPaint( aEvent ); } @@ -757,7 +757,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { css::awt::DockingEvent aEvent; aEvent.Source = getXWeak(); - aEvent.TrackingRectangle = AWTRectangle( pData->maTrackRect ); + aEvent.TrackingRectangle = VCLUnoHelper::ConvertToAWTRect(pData->maTrackRect); aEvent.MousePos.X = pData->maMousePos.X(); aEvent.MousePos.Y = pData->maMousePos.Y(); aEvent.bLiveMode = false; @@ -778,7 +778,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { css::awt::DockingEvent aEvent; aEvent.Source = getXWeak(); - aEvent.TrackingRectangle = AWTRectangle( pData->maTrackRect ); + aEvent.TrackingRectangle = VCLUnoHelper::ConvertToAWTRect(pData->maTrackRect); aEvent.MousePos.X = pData->maMousePos.X(); aEvent.MousePos.Y = pData->maMousePos.Y(); aEvent.bLiveMode = false; @@ -793,7 +793,8 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) css::awt::DockingData aDockingData = xFirstListener->docking( aEvent ); - pData->maTrackRect = VCLRectangle( aDockingData.TrackingRectangle ); + pData->maTrackRect + = VCLUnoHelper::ConvertToVCLRect(aDockingData.TrackingRectangle); pData->mbFloating = aDockingData.bFloating; } } @@ -809,7 +810,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { css::awt::EndDockingEvent aEvent; aEvent.Source = getXWeak(); - aEvent.WindowRectangle = AWTRectangle( pData->maWindowRect ); + aEvent.WindowRectangle = VCLUnoHelper::ConvertToAWTRect(pData->maWindowRect); aEvent.bFloating = pData->mbFloating; aEvent.bCancelled = pData->mbCancelled; mpImpl->getDockableWindowListeners().notifyEach( &XDockableWindowListener::endDocking, aEvent ); @@ -982,9 +983,11 @@ css::awt::Rectangle VCLXWindow::getPosSize( ) if ( GetWindow() ) { if( vcl::Window::GetDockingManager()->IsDockable( GetWindow() ) ) - aBounds = AWTRectangle( vcl::Window::GetDockingManager()->GetPosSizePixel( GetWindow() ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect( + vcl::Window::GetDockingManager()->GetPosSizePixel(GetWindow())); else - aBounds = AWTRectangle( tools::Rectangle( GetWindow()->GetPosPixel(), GetWindow()->GetSizePixel() ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect( + tools::Rectangle(GetWindow()->GetPosPixel(), GetWindow()->GetSizePixel())); } return aBounds; @@ -1183,7 +1186,8 @@ void VCLXWindow::invalidateRect( const css::awt::Rectangle& rRect, sal_Int16 nIn SolarMutexGuard aGuard; if ( GetWindow() ) - GetWindow()->Invalidate( VCLRectangle(rRect), static_cast<InvalidateFlags>(nInvalidateFlags) ); + GetWindow()->Invalidate(VCLUnoHelper::ConvertToVCLRect(rRect), + static_cast<InvalidateFlags>(nInvalidateFlags)); } @@ -2517,14 +2521,14 @@ void SAL_CALL VCLXWindow::setOutputSize( const css::awt::Size& aSize ) { SolarMutexGuard aGuard; if( VclPtr<vcl::Window> pWindow = GetWindow() ) - pWindow->SetOutputSizePixel( VCLSize( aSize ) ); + pWindow->SetOutputSizePixel(VCLUnoHelper::ConvertToVCLSize(aSize)); } css::awt::Size SAL_CALL VCLXWindow::getOutputSize( ) { SolarMutexGuard aGuard; if( VclPtr<vcl::Window> pWindow = GetWindow() ) - return AWTSize( pWindow->GetOutputSizePixel() ); + return VCLUnoHelper::ConvertToAWTSize(pWindow->GetOutputSizePixel()); else return css::awt::Size(); } diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 76f4a6af1e2b..72aecc5152b9 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -25,7 +25,6 @@ #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <toolkit/helper/vclunohelper.hxx> #include <helper/property.hxx> -#include <toolkit/helper/convert.hxx> #include <com/sun/star/awt/VisualEffect.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/resource/XStringResourceResolver.hpp> @@ -443,7 +442,7 @@ css::awt::Size VCLXButton::getMinimumSize( ) VclPtr< PushButton > pButton = GetAs< PushButton >(); if ( pButton ) aSz = pButton->CalcMinimumSize(); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXButton::getPreferredSize( ) @@ -458,7 +457,7 @@ css::awt::Size VCLXButton::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz = VCLSize(rNewSize); + Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); VclPtr< PushButton > pButton = GetAs< PushButton >(); if ( pButton ) { @@ -479,7 +478,7 @@ css::awt::Size VCLXButton::calcAdjustedSize( const css::awt::Size& rNewSize ) aSz = aMinSz; } } - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } void VCLXButton::setProperty( const OUString& PropertyName, const css::uno::Any& Value) @@ -662,7 +661,7 @@ css::awt::Size VCLXImageControl::getMinimumSize( ) Size aSz = GetImage().GetSizePixel(); aSz = ImplCalcWindowSize( aSz ); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXImageControl::getPreferredSize( ) @@ -899,7 +898,7 @@ css::awt::Size VCLXCheckBox::getMinimumSize() VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >(); if ( pCheckBox ) aSz = pCheckBox->CalcMinimumSize(); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXCheckBox::getPreferredSize() @@ -911,7 +910,7 @@ css::awt::Size VCLXCheckBox::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz = VCLSize(rNewSize); + Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >(); if ( pCheckBox ) { @@ -921,7 +920,7 @@ css::awt::Size VCLXCheckBox::calcAdjustedSize( const css::awt::Size& rNewSize ) else aSz = aMinSz; } - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } void VCLXCheckBox::setProperty( const OUString& PropertyName, const css::uno::Any& Value) @@ -1224,7 +1223,7 @@ css::awt::Size VCLXRadioButton::getMinimumSize( ) VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >(); if ( pRadioButton ) aSz = pRadioButton->CalcMinimumSize(); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXRadioButton::getPreferredSize( ) @@ -1236,7 +1235,7 @@ css::awt::Size VCLXRadioButton::calcAdjustedSize( const css::awt::Size& rNewSize { SolarMutexGuard aGuard; - Size aSz = VCLSize(rNewSize); + Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >(); if ( pRadioButton ) { @@ -1246,7 +1245,7 @@ css::awt::Size VCLXRadioButton::calcAdjustedSize( const css::awt::Size& rNewSize else aSz = aMinSz; } - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } void VCLXRadioButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) @@ -1958,7 +1957,7 @@ css::awt::Size VCLXListBox::getMinimumSize( ) VclPtr< ListBox > pListBox = GetAs< ListBox >(); if ( pListBox ) aSz = pListBox->CalcMinimumSize(); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXListBox::getPreferredSize( ) @@ -1972,17 +1971,17 @@ css::awt::Size VCLXListBox::getPreferredSize( ) if ( pListBox->GetStyle() & WB_DROPDOWN ) aSz.AdjustHeight(4 ); } - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXListBox::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz = VCLSize(rNewSize); + Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); VclPtr< ListBox > pListBox = GetAs< ListBox >(); if ( pListBox ) aSz = pListBox->CalcAdjustedSize( aSz ); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXListBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) @@ -1992,7 +1991,7 @@ css::awt::Size VCLXListBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) VclPtr< ListBox > pListBox = GetAs< ListBox >(); if ( pListBox ) aSz = pListBox->CalcBlockSize( nCols, nLines ); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } void VCLXListBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) @@ -2875,7 +2874,7 @@ css::awt::Size VCLXFixedHyperlink::getMinimumSize( ) VclPtr< FixedText > pFixedText = GetAs< FixedText >(); if ( pFixedText ) aSz = pFixedText->CalcMinimumSize(); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXFixedHyperlink::getPreferredSize( ) @@ -3097,7 +3096,7 @@ css::awt::Size VCLXFixedText::getMinimumSize( ) VclPtr< FixedText > pFixedText = GetAs< FixedText >(); if ( pFixedText ) aSz = pFixedText->CalcMinimumSize(); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXFixedText::getPreferredSize( ) @@ -3855,7 +3854,7 @@ css::awt::Size VCLXEdit::getMinimumSize( ) VclPtr< Edit > pEdit = GetAs< Edit >(); if ( pEdit ) aSz = pEdit->CalcMinimumSize(); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXEdit::getPreferredSize( ) @@ -3869,7 +3868,7 @@ css::awt::Size VCLXEdit::getPreferredSize( ) aSz = pEdit->CalcMinimumSize(); aSz.AdjustHeight(4 ); } - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXEdit::calcAdjustedSize( const css::awt::Size& rNewSize ) @@ -3897,7 +3896,7 @@ css::awt::Size VCLXEdit::getMinimumSize( sal_Int16 nCols, sal_Int16 ) else aSz = pEdit->CalcMinimumSize(); } - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } void VCLXEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) @@ -4312,7 +4311,7 @@ css::awt::Size VCLXComboBox::getMinimumSize( ) VclPtr< ComboBox > pComboBox = GetAs< ComboBox >(); if ( pComboBox ) aSz = pComboBox->CalcMinimumSize(); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXComboBox::getPreferredSize( ) @@ -4327,18 +4326,18 @@ css::awt::Size VCLXComboBox::getPreferredSize( ) if ( pComboBox->GetStyle() & WB_DROPDOWN ) aSz.AdjustHeight(4 ); } - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXComboBox::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz = VCLSize(rNewSize); + Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); VclPtr< ComboBox > pComboBox = GetAs< ComboBox >(); if ( pComboBox ) aSz = pComboBox->CalcAdjustedSize( aSz ); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXComboBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) @@ -4349,7 +4348,7 @@ css::awt::Size VCLXComboBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) VclPtr< ComboBox > pComboBox = GetAs< ComboBox >(); if ( pComboBox ) aSz = pComboBox->CalcBlockSize( nCols, nLines ); - return AWTSize(aSz); + return VCLUnoHelper::ConvertToAWTSize(aSz); } void VCLXComboBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) @@ -6450,7 +6449,7 @@ css::awt::Size VCLXFileControl::getMinimumSize() { Size aTmpSize = pControl->GetEdit().CalcMinimumSize(); aTmpSize.AdjustWidth(pControl->GetButton().CalcMinimumSize().Width() ); - aSz = AWTSize(pControl->CalcWindowSize( aTmpSize )); + aSz = VCLUnoHelper::ConvertToAWTSize(pControl->CalcWindowSize(aTmpSize)); } return aSz; } @@ -6485,7 +6484,7 @@ css::awt::Size VCLXFileControl::getMinimumSize( sal_Int16 nCols, sal_Int16 ) VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) { - aSz = AWTSize(pControl->GetEdit().CalcSize( nCols )); + aSz = VCLUnoHelper::ConvertToAWTSize(pControl->GetEdit().CalcSize(nCols)); aSz.Width += pControl->GetButton().CalcMinimumSize().Width(); } return aSz; @@ -7677,7 +7676,7 @@ css::awt::Size VCLXMultiLineEdit::getMinimumSize() css::awt::Size aSz; VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) - aSz = AWTSize(pEdit->CalcMinimumSize()); + aSz = VCLUnoHelper::ConvertToAWTSize(pEdit->CalcMinimumSize()); return aSz; } @@ -7693,7 +7692,8 @@ css::awt::Size VCLXMultiLineEdit::calcAdjustedSize( const css::awt::Size& rNewSi css::awt::Size aSz = rNewSize; VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) - aSz = AWTSize(pEdit->CalcAdjustedSize( VCLSize(rNewSize ))); + aSz = VCLUnoHelper::ConvertToAWTSize( + pEdit->CalcAdjustedSize(VCLUnoHelper::ConvertToVCLSize(rNewSize))); return aSz; } @@ -7704,7 +7704,7 @@ css::awt::Size VCLXMultiLineEdit::getMinimumSize( sal_Int16 nCols, sal_Int16 nLi css::awt::Size aSz; VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) - aSz = AWTSize(pEdit->CalcBlockSize( nCols, nLines )); + aSz = VCLUnoHelper::ConvertToAWTSize(pEdit->CalcBlockSize(nCols, nLines)); return aSz; } diff --git a/toolkit/source/controls/tree/treecontrolpeer.cxx b/toolkit/source/controls/tree/treecontrolpeer.cxx index 78b93b9bb9fc..94390ceed15a 100644 --- a/toolkit/source/controls/tree/treecontrolpeer.cxx +++ b/toolkit/source/controls/tree/treecontrolpeer.cxx @@ -1188,7 +1188,7 @@ css::awt::Size TreeControlPeer::getMinimumSize() /* todo MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow(); if ( pEdit ) - aSz = AWTSize(pEdit->CalcMinimumSize()); + aSz = VCLUnoHelper::ConvertToAWTSize(pEdit->CalcMinimumSize()); */ return aSz; } @@ -1206,7 +1206,7 @@ css::awt::Size TreeControlPeer::calcAdjustedSize( const css::awt::Size& rNewSize /* todo MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow(); if ( pEdit ) - aSz = AWTSize(pEdit->CalcAdjustedSize( VCLSize(rNewSize ))); + aSz = VCLUnoHelper::ConvertToAWTSize(pEdit->CalcAdjustedSize(VCLUnoHelper::ConvertToVCLSize(rNewSize))); */ return aSz; } diff --git a/toolkit/source/hatchwindow/hatchwindow.cxx b/toolkit/source/hatchwindow/hatchwindow.cxx index 4685126b203d..ba7add58485f 100644 --- a/toolkit/source/hatchwindow/hatchwindow.cxx +++ b/toolkit/source/hatchwindow/hatchwindow.cxx @@ -23,7 +23,7 @@ #include "hatchwindow.hxx" #include "ipwin.hxx" -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/typeprovider.hxx> #include <osl/diagnose.h> @@ -72,11 +72,11 @@ void VCLXHatchWindow::QueryObjAreaPixel( tools::Rectangle & aRect ) if ( !m_xController.is() ) return; - awt::Rectangle aUnoRequestRect = AWTRectangle( aRect ); + awt::Rectangle aUnoRequestRect = VCLUnoHelper::ConvertToAWTRect(aRect); try { awt::Rectangle aUnoResultRect = m_xController->calcAdjustedRectangle( aUnoRequestRect ); - aRect = VCLRectangle( aUnoResultRect ); + aRect = VCLUnoHelper::ConvertToVCLRect(aUnoResultRect); } catch( uno::Exception& ) { @@ -88,7 +88,7 @@ void VCLXHatchWindow::RequestObjAreaPixel( const tools::Rectangle & aRect ) { if ( m_xController.is() ) { - awt::Rectangle aUnoRequestRect = AWTRectangle( aRect ); + awt::Rectangle aUnoRequestRect = VCLUnoHelper::ConvertToAWTRect(aRect); try { m_xController->requestPositioning( aUnoRequestRect ); diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index 354675e5c96b..dfedb5043b1b 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -37,7 +37,6 @@ #include <com/sun/star/embed/EmbedMapUnits.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <toolkit/helper/vclunohelper.hxx> -#include <toolkit/helper/convert.hxx> #include <awt/vclxbitmap.hxx> #include <awt/vclxregion.hxx> #include <toolkit/awt/vclxwindow.hxx> @@ -129,7 +128,7 @@ vcl::Region VCLUnoHelper::GetRegion( const css::uno::Reference< css::awt::XRegio { const css::uno::Sequence< css::awt::Rectangle > aRects = rxRegion->getRectangles(); for ( const auto& rRect : aRects ) - aRegion.Union( VCLRectangle( rRect ) ); + aRegion.Union(VCLUnoHelper::ConvertToVCLRect(rRect)); } return aRegion; } |