accessibility/inc/pch/precompiled_acc.hxx | 2 accessibility/source/extended/AccessibleBrowseBox.cxx | 9 - accessibility/source/extended/AccessibleBrowseBoxBase.cxx | 15 +- accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx | 10 - accessibility/source/extended/AccessibleBrowseBoxTable.cxx | 5 accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx | 9 - accessibility/source/extended/AccessibleGridControl.cxx | 10 - accessibility/source/extended/AccessibleGridControlBase.cxx | 15 +- accessibility/source/extended/AccessibleGridControlHeader.cxx | 5 accessibility/source/extended/AccessibleGridControlTable.cxx | 5 accessibility/source/extended/AccessibleGridControlTableCell.cxx | 8 - accessibility/source/extended/AccessibleIconView.cxx | 5 accessibility/source/extended/accessibleiconchoicectrlentry.cxx | 20 +-- accessibility/source/extended/accessiblelistboxentry.cxx | 25 ++-- accessibility/source/extended/accessibletabbar.cxx | 10 - accessibility/source/extended/accessibletabbarpage.cxx | 4 accessibility/source/extended/accessibletabbarpagelist.cxx | 8 - accessibility/source/extended/textwindowaccessibility.cxx | 6 accessibility/source/standard/accessiblemenubasecomponent.cxx | 6 accessibility/source/standard/accessiblemenucomponent.cxx | 6 accessibility/source/standard/accessiblemenuitemcomponent.cxx | 8 - accessibility/source/standard/vclxaccessibleedit.cxx | 4 accessibility/source/standard/vclxaccessibleheaderbaritem.cxx | 5 accessibility/source/standard/vclxaccessiblelist.cxx | 7 - accessibility/source/standard/vclxaccessiblelistitem.cxx | 17 +- accessibility/source/standard/vclxaccessiblemenuitem.cxx | 6 accessibility/source/standard/vclxaccessiblestatusbar.cxx | 4 accessibility/source/standard/vclxaccessiblestatusbaritem.cxx | 8 - accessibility/source/standard/vclxaccessibletabpage.cxx | 12 - accessibility/source/standard/vclxaccessibletabpagewindow.cxx | 4 accessibility/source/standard/vclxaccessibletextcomponent.cxx | 6 accessibility/source/standard/vclxaccessibletoolbox.cxx | 5 accessibility/source/standard/vclxaccessibletoolboxitem.cxx | 8 - basctl/source/accessibility/accessibledialogcontrolshape.cxx | 3 basctl/source/accessibility/accessibledialogwindow.cxx | 9 - framework/source/layoutmanager/toolbarlayoutmanager.cxx | 27 ++-- include/toolkit/helper/convert.hxx | 61 --------- reportdesign/inc/pch/precompiled_rptui.hxx | 1 reportdesign/source/ui/inspection/GeometryHandler.cxx | 9 - reportdesign/source/ui/misc/UITools.cxx | 4 reportdesign/source/ui/report/ReportController.cxx | 4 reportdesign/source/ui/report/ReportSection.cxx | 11 + reportdesign/source/ui/report/ViewsWindow.cxx | 9 - sc/source/ui/Accessibility/AccessibleContextBase.cxx | 18 +- sc/source/ui/Accessibility/AccessibleDocument.cxx | 13 +- sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 22 ++- sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx | 11 + sc/source/ui/Accessibility/AccessiblePreviewCell.cxx | 5 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx | 5 sc/source/ui/unoobj/shapeuno.cxx | 10 + sc/source/ui/unoobj/viewuno.cxx | 6 sfx2/inc/pch/precompiled_sfx.hxx | 1 sfx2/source/statbar/stbitem.cxx | 3 sfx2/source/view/ipclient.cxx | 9 - sfx2/source/view/sfxbasecontroller.cxx | 6 solenv/clang-format/excludelist | 1 svtools/source/control/accessibleruler.cxx | 15 +- svx/source/accessibility/svxpixelctlaccessiblecontext.cxx | 4 svx/source/accessibility/svxrectctaccessiblecontext.cxx | 4 svx/source/svdraw/svdoole2.cxx | 7 - toolkit/source/awt/vclxaccessiblecomponent.cxx | 10 - toolkit/source/awt/vclxmenu.cxx | 6 toolkit/source/awt/vclxregion.cxx | 16 +- toolkit/source/awt/vclxtoolkit.cxx | 3 toolkit/source/awt/vclxwindow.cxx | 26 ++-- toolkit/source/awt/vclxwindows.cxx | 62 +++++----- toolkit/source/controls/tree/treecontrolpeer.cxx | 4 toolkit/source/hatchwindow/hatchwindow.cxx | 8 - toolkit/source/helper/vclunohelper.cxx | 3 69 files changed, 336 insertions(+), 357 deletions(-)
New commits: commit 2fdee9fd60bc4bb61f773fa1f766e84f4ee0dae3 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Jul 10 15:05:22 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Jul 11 06:44:48 2024 +0200 Unify/Port to use VCLUnoHelper for AWT <-> VCL conversions Following Change-Id: Id48f81deb05aee2026509037f7d14575735e5be0 Author: Michael Weghorn <m.wegh...@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.wegh...@posteo.de> diff --git a/accessibility/inc/pch/precompiled_acc.hxx b/accessibility/inc/pch/precompiled_acc.hxx index c9589365ab4b..885d43ce436f 100644 --- a/accessibility/inc/pch/precompiled_acc.hxx +++ b/accessibility/inc/pch/precompiled_acc.hxx @@ -316,7 +316,7 @@ #include <toolkit/awt/vclxdevice.hxx> #include <toolkit/awt/vclxwindows.hxx> #include <toolkit/dllapi.h> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <tools/color.hxx> #include <tools/contnr.hxx> #include <tools/degree.hxx> diff --git a/accessibility/source/extended/AccessibleBrowseBox.cxx b/accessibility/source/extended/AccessibleBrowseBox.cxx index 705df2536cfe..debdf15e2443 100644 --- a/accessibility/source/extended/AccessibleBrowseBox.cxx +++ b/accessibility/source/extended/AccessibleBrowseBox.cxx @@ -23,7 +23,6 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <utility> #include <vcl/accessibletableprovider.hxx> -#include <toolkit/helper/convert.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <sal/types.h> @@ -137,21 +136,21 @@ AccessibleBrowseBox::getAccessibleAtPoint( const awt::Point& rPoint ) css::uno::Reference< css::accessibility::XAccessible > xChild; sal_Int32 nIndex = 0; - if( mpBrowseBox->ConvertPointToControlIndex( nIndex, VCLPoint( rPoint ) ) ) + if (mpBrowseBox->ConvertPointToControlIndex(nIndex, VCLUnoHelper::ConvertToVCLPoint(rPoint))) xChild = mpBrowseBox->CreateAccessibleControl( nIndex ); else { // try whether point is in one of the fixed children // (table, header bars, corner control) - Point aPoint( VCLPoint( rPoint ) ); + Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)); for( nIndex = 0; (nIndex < vcl::BBINDEX_FIRSTCONTROL) && !xChild.is(); ++nIndex ) { css::uno::Reference< css::accessibility::XAccessible > xCurrChild( implGetFixedChild( nIndex ) ); css::uno::Reference< css::accessibility::XAccessibleComponent > xCurrChildComp( xCurrChild, uno::UNO_QUERY ); - if( xCurrChildComp.is() && - VCLRectangle( xCurrChildComp->getBounds() ).Contains( aPoint ) ) + if (xCurrChildComp.is() + && VCLUnoHelper::ConvertToVCLRect(xCurrChildComp->getBounds()).Contains(aPoint)) xChild = xCurrChild; } } diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx index 8d9a0577e638..9d10c78650e1 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx @@ -18,7 +18,6 @@ */ #include <extended/AccessibleBrowseBoxBase.hxx> -#include <toolkit/helper/convert.hxx> #include <utility> #include <vcl/accessibletableprovider.hxx> #include <cppuhelper/supportsservice.hxx> @@ -27,6 +26,7 @@ #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp> +#include <toolkit/helper/vclunohelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <vcl/window.hxx> #include <vcl/svapp.hxx> @@ -210,27 +210,28 @@ lang::Locale SAL_CALL AccessibleBrowseBoxBase::getLocale() sal_Bool SAL_CALL AccessibleBrowseBoxBase::containsPoint( const css::awt::Point& rPoint ) { - return tools::Rectangle( Point(), getBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); + return tools::Rectangle(Point(), getBoundingBox().GetSize()) + .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); } awt::Rectangle SAL_CALL AccessibleBrowseBoxBase::getBounds() { - return AWTRectangle( getBoundingBox() ); + return VCLUnoHelper::ConvertToAWTRect(getBoundingBox()); } awt::Point SAL_CALL AccessibleBrowseBoxBase::getLocation() { - return AWTPoint( getBoundingBox().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(getBoundingBox().TopLeft()); } awt::Point SAL_CALL AccessibleBrowseBoxBase::getLocationOnScreen() { - return AWTPoint( getBoundingBoxOnScreen().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(getBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL AccessibleBrowseBoxBase::getSize() { - return AWTSize( getBoundingBox().GetSize() ); + return VCLUnoHelper::ConvertToAWTSize(getBoundingBox().GetSize()); } void SAL_CALL AccessibleBrowseBoxBase::focusGained( const css::awt::FocusEvent& ) @@ -350,7 +351,7 @@ bool AccessibleBrowseBoxBase::implIsShowing() xParentComp( mxParent->getAccessibleContext(), uno::UNO_QUERY ); if( xParentComp.is() ) bShowing = implGetBoundingBox().Overlaps( - VCLRectangle( xParentComp->getBounds() ) ); + VCLUnoHelper::ConvertToVCLRect(xParentComp->getBounds())); } return bShowing; } diff --git a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx index 69370f9e4a4c..26704ccb3387 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx @@ -18,7 +18,7 @@ */ #include <extended/AccessibleBrowseBoxHeaderBar.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/accessibletableprovider.hxx> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> @@ -76,9 +76,11 @@ AccessibleBrowseBoxHeaderBar::getAccessibleAtPoint( const awt::Point& rPoint ) sal_Int32 nRow = 0; sal_uInt16 nColumnPos = 0; - bool bConverted = isRowBar() ? - mpBrowseBox->ConvertPointToRowHeader( nRow, VCLPoint( rPoint ) ) : - mpBrowseBox->ConvertPointToColumnHeader( nColumnPos, VCLPoint( rPoint ) ); + bool bConverted + = isRowBar() + ? mpBrowseBox->ConvertPointToRowHeader(nRow, VCLUnoHelper::ConvertToVCLPoint(rPoint)) + : mpBrowseBox->ConvertPointToColumnHeader(nColumnPos, + VCLUnoHelper::ConvertToVCLPoint(rPoint)); return bConverted ? implGetChild( nRow, nColumnPos ) : Reference< XAccessible >(); } diff --git a/accessibility/source/extended/AccessibleBrowseBoxTable.cxx b/accessibility/source/extended/AccessibleBrowseBoxTable.cxx index 7046ed792507..83ab211b18f2 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTable.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTable.cxx @@ -18,7 +18,7 @@ */ #include <extended/AccessibleBrowseBoxTable.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/accessibletableprovider.hxx> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> @@ -77,7 +77,8 @@ AccessibleBrowseBoxTable::getAccessibleAtPoint( const awt::Point& rPoint ) Reference< XAccessible > xChild; sal_Int32 nRow = 0; sal_uInt16 nColumnPos = 0; - if( mpBrowseBox->ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) ) + if (mpBrowseBox->ConvertPointToCellAddress(nRow, nColumnPos, + VCLUnoHelper::ConvertToVCLPoint(rPoint))) xChild = mpBrowseBox->CreateAccessibleCell( nRow, nColumnPos ); return xChild; diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx index 7c77128aa237..bd092a0114b4 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx @@ -19,7 +19,8 @@ #include <extended/AccessibleBrowseBoxTableCell.hxx> -#include <toolkit/helper/convert.hxx> + +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/accessibletableprovider.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> @@ -117,7 +118,8 @@ namespace accessibility if ( !implIsValidIndex( nIndex, implGetText().getLength() ) ) throw IndexOutOfBoundsException(); - aRect = AWTRectangle( mpBrowseBox->GetFieldCharacterBounds( getRowPos(), getColumnPos(), nIndex ) ); + aRect = VCLUnoHelper::ConvertToAWTRect( + mpBrowseBox->GetFieldCharacterBounds(getRowPos(), getColumnPos(), nIndex)); } return aRect; @@ -130,7 +132,8 @@ namespace accessibility SolarMethodGuard aGuard(getMutex()); ensureIsAlive(); - return mpBrowseBox->GetFieldIndexAtPoint( getRowPos(), getColumnPos(), VCLPoint( _aPoint ) ); + return mpBrowseBox->GetFieldIndexAtPoint(getRowPos(), getColumnPos(), + VCLUnoHelper::ConvertToVCLPoint(_aPoint)); } /** @return diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index 88af9f423d8e..46d04780285b 100644 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -23,7 +23,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <utility> #include <vcl/accessibletable.hxx> #include <vcl/svapp.hxx> @@ -148,21 +148,21 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint ) css::uno::Reference< css::accessibility::XAccessible > xChild; sal_Int32 nIndex = 0; - if( m_aTable.ConvertPointToControlIndex( nIndex, VCLPoint( rPoint ) ) ) + if (m_aTable.ConvertPointToControlIndex(nIndex, VCLUnoHelper::ConvertToVCLPoint(rPoint))) xChild = m_aTable.CreateAccessibleControl( nIndex ); else { // try whether point is in one of the fixed children // (table, header bars, corner control) - Point aPoint( VCLPoint( rPoint ) ); + Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)); for( nIndex = 0; (nIndex < 3) && !xChild.is(); ++nIndex ) { css::uno::Reference< css::accessibility::XAccessible > xCurrChild( implGetFixedChild( nIndex ) ); css::uno::Reference< css::accessibility::XAccessibleComponent > xCurrChildComp( xCurrChild, uno::UNO_QUERY ); - if( xCurrChildComp.is() && - VCLRectangle( xCurrChildComp->getBounds() ).Contains( aPoint ) ) + if (xCurrChildComp.is() + && VCLUnoHelper::ConvertToVCLRect(xCurrChildComp->getBounds()).Contains(aPoint)) xChild = xCurrChild; } } diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index a57946989e1b..950e927fca86 100644 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -18,7 +18,7 @@ */ #include <extended/AccessibleGridControlBase.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <utility> #include <vcl/accessibletable.hxx> #include <vcl/svapp.hxx> @@ -183,27 +183,28 @@ lang::Locale SAL_CALL AccessibleGridControlBase::getLocale() sal_Bool SAL_CALL AccessibleGridControlBase::containsPoint( const awt::Point& rPoint ) { - return tools::Rectangle( Point(), getBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); + return tools::Rectangle(Point(), getBoundingBox().GetSize()) + .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); } awt::Rectangle SAL_CALL AccessibleGridControlBase::getBounds() { - return AWTRectangle( getBoundingBox() ); + return VCLUnoHelper::ConvertToAWTRect(getBoundingBox()); } awt::Point SAL_CALL AccessibleGridControlBase::getLocation() { - return AWTPoint( getBoundingBox().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(getBoundingBox().TopLeft()); } awt::Point SAL_CALL AccessibleGridControlBase::getLocationOnScreen() { - return AWTPoint( getBoundingBoxOnScreen().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(getBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL AccessibleGridControlBase::getSize() { - return AWTSize( getBoundingBox().GetSize() ); + return VCLUnoHelper::ConvertToAWTSize(getBoundingBox().GetSize()); } // css::accessibility::XAccessibleEventBroadcaster @@ -273,7 +274,7 @@ bool AccessibleGridControlBase::implIsShowing() xParentComp( m_xParent->getAccessibleContext(), uno::UNO_QUERY ); if( xParentComp.is() ) bShowing = implGetBoundingBox().Overlaps( - VCLRectangle( xParentComp->getBounds() ) ); + VCLUnoHelper::ConvertToVCLRect(xParentComp->getBounds())); } return bShowing; } diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index c6b278386b9b..b028f6837141 100644 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -20,7 +20,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <extended/AccessibleGridControlHeader.hxx> #include <extended/AccessibleGridControlHeaderCell.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/accessibletable.hxx> #include <vcl/svapp.hxx> @@ -96,7 +96,8 @@ AccessibleGridControlHeader::getAccessibleAtPoint( const awt::Point& rPoint ) sal_Int32 nRow = 0; sal_Int32 nColumnPos = 0; - bool bConverted = m_aTable.ConvertPointToCellAddress(nRow, nColumnPos, VCLPoint(rPoint)); + bool bConverted = m_aTable.ConvertPointToCellAddress(nRow, nColumnPos, + VCLUnoHelper::ConvertToVCLPoint(rPoint)); return bConverted ? implGetChild( nRow, nColumnPos ) : Reference< XAccessible >(); } diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index 9ee3d4af4f56..171c4889b895 100644 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -23,7 +23,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <extended/AccessibleGridControlTable.hxx> #include <extended/AccessibleGridControlTableCell.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/accessibletable.hxx> #include <vcl/svapp.hxx> #include <tools/debug.hxx> @@ -95,7 +95,8 @@ AccessibleGridControlTable::getAccessibleAtPoint( const awt::Point& rPoint ) Reference< XAccessible > xChild; sal_Int32 nRow = 0; sal_Int32 nColumnPos = 0; - if( m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) ) + if (m_aTable.ConvertPointToCellAddress(nRow, nColumnPos, + VCLUnoHelper::ConvertToVCLPoint(rPoint))) xChild = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumnPos); return xChild; } diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index 86d3da7ddb32..a24e62d068e3 100644 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -18,9 +18,9 @@ */ #include <extended/AccessibleGridControlTableCell.hxx> -#include <toolkit/helper/convert.hxx> #include <vcl/accessibletable.hxx> #include <vcl/svapp.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <tools/gen.hxx> #include <tools/debug.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> @@ -138,7 +138,8 @@ namespace accessibility if ( !implIsValidIndex( nIndex, implGetText().getLength() ) ) throw IndexOutOfBoundsException(); - return AWTRectangle( m_aTable.GetFieldCharacterBounds( getRowPos(), getColumnPos(), nIndex ) ); + return VCLUnoHelper::ConvertToAWTRect( + m_aTable.GetFieldCharacterBounds(getRowPos(), getColumnPos(), nIndex)); } sal_Int32 SAL_CALL AccessibleGridControlTableCell::getIndexAtPoint( const css::awt::Point& _aPoint ) @@ -147,7 +148,8 @@ namespace accessibility ensureIsAlive(); - return m_aTable.GetFieldIndexAtPoint( getRowPos(), getColumnPos(), VCLPoint( _aPoint ) ); + return m_aTable.GetFieldIndexAtPoint(getRowPos(), getColumnPos(), + VCLUnoHelper::ConvertToVCLPoint(_aPoint)); } /** @return diff --git a/accessibility/source/extended/AccessibleIconView.cxx b/accessibility/source/extended/AccessibleIconView.cxx index 6bc5c99e9243..a1321c7dded6 100644 --- a/accessibility/source/extended/AccessibleIconView.cxx +++ b/accessibility/source/extended/AccessibleIconView.cxx @@ -11,7 +11,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/event.hxx> #include <extended/AccessibleIconView.hxx> @@ -35,7 +35,8 @@ void AccessibleIconView::ProcessWindowEvent(const VclWindowEvent& rVclWindowEven case VclEventId::WindowMouseMove: if (MouseEvent* pMouseEvt = static_cast<MouseEvent*>(rVclWindowEvent.GetData())) { - if (auto xChild = getAccessibleAtPoint(AWTPoint(pMouseEvt->GetPosPixel()))) + if (auto xChild = getAccessibleAtPoint( + VCLUnoHelper::ConvertToAWTPoint(pMouseEvt->GetPosPixel()))) { // Allow announcing the element on mouse hover css::uno::Any aNew(xChild); diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx index 95e9c4375004..869af7c3ffe1 100644 --- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx @@ -25,7 +25,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <svtools/stringtransfer.hxx> @@ -133,7 +133,8 @@ namespace accessibility { Reference< XAccessibleComponent > xParentComp( xParentContext, uno::UNO_QUERY ); if( xParentComp.is() ) - bShowing = GetBoundingBox_Impl().Overlaps( VCLRectangle( xParentComp->getBounds() ) ); + bShowing = GetBoundingBox_Impl().Overlaps( + VCLUnoHelper::ConvertToVCLRect(xParentComp->getBounds())); } return bShowing; @@ -333,7 +334,8 @@ namespace accessibility sal_Bool SAL_CALL AccessibleIconChoiceCtrlEntry::containsPoint( const awt::Point& rPoint ) { - return tools::Rectangle( Point(), GetBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); + return tools::Rectangle(Point(), GetBoundingBox().GetSize()) + .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); } Reference< XAccessible > SAL_CALL AccessibleIconChoiceCtrlEntry::getAccessibleAtPoint( const awt::Point& ) @@ -343,22 +345,22 @@ namespace accessibility awt::Rectangle SAL_CALL AccessibleIconChoiceCtrlEntry::getBounds( ) { - return AWTRectangle( GetBoundingBox() ); + return VCLUnoHelper::ConvertToAWTRect(GetBoundingBox()); } awt::Point SAL_CALL AccessibleIconChoiceCtrlEntry::getLocation( ) { - return AWTPoint( GetBoundingBox().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); } awt::Point SAL_CALL AccessibleIconChoiceCtrlEntry::getLocationOnScreen( ) { - return AWTPoint( GetBoundingBoxOnScreen().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint( GetBoundingBoxOnScreen().TopLeft() ); } awt::Size SAL_CALL AccessibleIconChoiceCtrlEntry::getSize( ) { - return AWTSize( GetBoundingBox().GetSize() ); + return VCLUnoHelper::ConvertToAWTSize(GetBoundingBox().GetSize()); } void SAL_CALL AccessibleIconChoiceCtrlEntry::grabFocus( ) @@ -417,7 +419,7 @@ namespace accessibility tools::Rectangle aItemRect = GetBoundingBox_Impl(); tools::Rectangle aCharRect = m_pIconCtrl->GetEntryCharacterBounds( m_nIndex, _nIndex ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = AWTRectangle( aCharRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -434,7 +436,7 @@ namespace accessibility vcl::ControlLayoutData aLayoutData; tools::Rectangle aItemRect = GetBoundingBox_Impl(); m_pIconCtrl->RecordLayoutData( &aLayoutData, aItemRect ); - Point aPnt( VCLPoint( aPoint ) ); + Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); nIndex = aLayoutData.GetIndexForPoint( aPnt ); diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx index 74c7c9c58171..5d8ff5ce4a98 100644 --- a/accessibility/source/extended/accessiblelistboxentry.cxx +++ b/accessibility/source/extended/accessiblelistboxentry.cxx @@ -31,7 +31,7 @@ #include <i18nlangtag/languagetag.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/accessibleeventnotifier.hxx> @@ -176,7 +176,8 @@ namespace accessibility { Reference< XAccessibleComponent > xParentComp( xParentContext, uno::UNO_QUERY ); if( xParentComp.is() ) - bShowing = GetBoundingBox_Impl().Overlaps( VCLRectangle( xParentComp->getBounds() ) ); + bShowing = GetBoundingBox_Impl().Overlaps( + VCLUnoHelper::ConvertToVCLRect(xParentComp->getBounds())); } return bShowing; @@ -520,7 +521,8 @@ namespace accessibility sal_Bool SAL_CALL AccessibleListBoxEntry::containsPoint( const awt::Point& rPoint ) { - return tools::Rectangle( Point(), GetBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); + return tools::Rectangle(Point(), GetBoundingBox().GetSize()) + .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); } Reference< XAccessible > SAL_CALL AccessibleListBoxEntry::getAccessibleAtPoint( const awt::Point& _aPoint ) @@ -529,7 +531,8 @@ namespace accessibility ::osl::MutexGuard aGuard( m_aMutex ); EnsureIsAlive(); - SvTreeListEntry* pEntry = m_pTreeListBox->GetEntry( VCLPoint( _aPoint ) ); + SvTreeListEntry* pEntry + = m_pTreeListBox->GetEntry(VCLUnoHelper::ConvertToVCLPoint(_aPoint)); if ( !pEntry ) throw RuntimeException(u"AccessibleListBoxEntry::getAccessibleAtPoint - pEntry cannot be empty!"_ustr); @@ -538,29 +541,29 @@ namespace accessibility assert(xListBox.is()); auto pAccEntry = xListBox->implGetAccessible(*pEntry); tools::Rectangle aRect = pAccEntry->GetBoundingBox_Impl(); - if ( aRect.Contains( VCLPoint( _aPoint ) ) ) + if (aRect.Contains(VCLUnoHelper::ConvertToVCLPoint(_aPoint))) xAcc = pAccEntry.get(); return xAcc; } awt::Rectangle SAL_CALL AccessibleListBoxEntry::getBounds( ) { - return AWTRectangle( GetBoundingBox() ); + return VCLUnoHelper::ConvertToAWTRect(GetBoundingBox()); } awt::Point SAL_CALL AccessibleListBoxEntry::getLocation( ) { - return AWTPoint( GetBoundingBox().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); } awt::Point SAL_CALL AccessibleListBoxEntry::getLocationOnScreen( ) { - return AWTPoint( GetBoundingBoxOnScreen().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL AccessibleListBoxEntry::getSize( ) { - return AWTSize( GetBoundingBox().GetSize() ); + return VCLUnoHelper::ConvertToAWTSize(GetBoundingBox().GetSize()); } void SAL_CALL AccessibleListBoxEntry::grabFocus( ) @@ -624,7 +627,7 @@ namespace accessibility m_pTreeListBox->RecordLayoutData( &aLayoutData, aItemRect ); tools::Rectangle aCharRect = aLayoutData.GetCharacterBounds( nIndex ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = AWTRectangle( aCharRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -644,7 +647,7 @@ namespace accessibility vcl::ControlLayoutData aLayoutData; tools::Rectangle aItemRect = GetBoundingBox(); m_pTreeListBox->RecordLayoutData( &aLayoutData, aItemRect ); - Point aPnt( VCLPoint( aPoint ) ); + Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); nIndex = aLayoutData.GetIndexForPoint( aPnt ); } diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx index beae5dd61331..9942ab4f21fa 100644 --- a/accessibility/source/extended/accessibletabbar.cxx +++ b/accessibility/source/extended/accessibletabbar.cxx @@ -34,8 +34,7 @@ #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <toolkit/awt/vclxfont.hxx> -#include <toolkit/helper/convert.hxx> - +#include <toolkit/helper/vclunohelper.hxx> namespace accessibility { @@ -146,7 +145,8 @@ namespace accessibility { awt::Rectangle aBounds; if ( m_pTabBar ) - aBounds = AWTRectangle( tools::Rectangle( m_pTabBar->GetPosPixel(), m_pTabBar->GetSizePixel() ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect( + tools::Rectangle(m_pTabBar->GetPosPixel(), m_pTabBar->GetSizePixel())); return aBounds; } @@ -366,8 +366,8 @@ namespace accessibility Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), 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; diff --git a/accessibility/source/extended/accessibletabbarpage.cxx b/accessibility/source/extended/accessibletabbarpage.cxx index 5120b007d066..97af7f39d8b1 100644 --- a/accessibility/source/extended/accessibletabbarpage.cxx +++ b/accessibility/source/extended/accessibletabbarpage.cxx @@ -28,7 +28,7 @@ #include <unotools/accessiblerelationsethelper.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <i18nlangtag/languagetag.hxx> @@ -164,7 +164,7 @@ namespace accessibility if ( m_pTabBar ) { // get bounding rectangle relative to the AccessibleTabBar - aBounds = AWTRectangle( m_pTabBar->GetPageRect( m_nPageId ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect(m_pTabBar->GetPageRect(m_nPageId)); // get position of the AccessibleTabBarPageList relative to the AccessibleTabBar Reference< XAccessible > xParent = getAccessibleParent(); diff --git a/accessibility/source/extended/accessibletabbarpagelist.cxx b/accessibility/source/extended/accessibletabbarpagelist.cxx index 8ba5571155aa..db553e40e0ce 100644 --- a/accessibility/source/extended/accessibletabbarpagelist.cxx +++ b/accessibility/source/extended/accessibletabbarpagelist.cxx @@ -29,7 +29,7 @@ #include <unotools/accessiblerelationsethelper.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <i18nlangtag/languagetag.hxx> @@ -306,7 +306,7 @@ namespace accessibility { awt::Rectangle aBounds; if ( m_pTabBar ) - aBounds = AWTRectangle( m_pTabBar->GetPageArea() ); + aBounds = VCLUnoHelper::ConvertToAWTRect(m_pTabBar->GetPageArea()); return aBounds; } @@ -491,8 +491,8 @@ namespace accessibility Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), 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; diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 0badad467a6f..bf3a02f5c92e 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -38,7 +38,7 @@ #include <vcl/txtattr.hxx> #include <vcl/window.hxx> #include <comphelper/diagnose_ex.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <comphelper/sequence.hxx> #include <algorithm> @@ -867,8 +867,8 @@ Document::retrieveCharacterBounds(Paragraph const * pParagraph, css::awt::Rectangle aBounds( 0, 0, 0, 0 ); if ( nIndex == nLength ) { - aBounds = AWTRectangle( - m_rEngine.PaMtoEditCursor(::TextPaM(nNumber, nIndex))); + aBounds + = VCLUnoHelper::ConvertToAWTRect(m_rEngine.PaMtoEditCursor(::TextPaM(nNumber, nIndex))); } else { diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx index 4ef911dccc12..6489e14f7e6f 100644 --- a/accessibility/source/standard/accessiblemenubasecomponent.cxx +++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx @@ -21,7 +21,7 @@ #include <standard/vclxaccessiblemenu.hxx> #include <standard/vclxaccessiblemenuitem.hxx> #include <standard/vclxaccessiblemenuseparator.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> @@ -347,8 +347,8 @@ Reference< XAccessible > OAccessibleMenuBaseComponent::GetChildAt( const awt::Po Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), 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; diff --git a/accessibility/source/standard/accessiblemenucomponent.cxx b/accessibility/source/standard/accessiblemenucomponent.cxx index 9d86f0246a42..051828d21a1f 100644 --- a/accessibility/source/standard/accessiblemenucomponent.cxx +++ b/accessibility/source/standard/accessiblemenucomponent.cxx @@ -20,7 +20,7 @@ #include <standard/accessiblemenucomponent.hxx> #include <toolkit/awt/vclxfont.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> @@ -98,7 +98,7 @@ awt::Rectangle OAccessibleMenuComponent::implGetBounds() { // get bounding rectangle of the window in screen coordinates AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute(); - aBounds = AWTRectangle( aRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aRect); // get position of the accessible parent in screen coordinates Reference< XAccessible > xParent = getAccessibleParent(); @@ -235,7 +235,7 @@ awt::Point OAccessibleMenuComponent::getLocationOnScreen( ) if ( pWindow ) { AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute(); - aPos = AWTPoint( aRect.TopLeft() ); + aPos = VCLUnoHelper::ConvertToAWTPoint(aRect.TopLeft()); } } diff --git a/accessibility/source/standard/accessiblemenuitemcomponent.cxx b/accessibility/source/standard/accessiblemenuitemcomponent.cxx index d6b8b209a7d0..011e05f9dadf 100644 --- a/accessibility/source/standard/accessiblemenuitemcomponent.cxx +++ b/accessibility/source/standard/accessiblemenuitemcomponent.cxx @@ -19,9 +19,6 @@ #include <standard/accessiblemenuitemcomponent.hxx> - -#include <toolkit/helper/convert.hxx> - #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> @@ -29,6 +26,7 @@ #include <unotools/accessiblerelationsethelper.hxx> #include <comphelper/accessiblecontexthelper.hxx> #include <comphelper/accessibletexthelper.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <vcl/menu.hxx> @@ -241,14 +239,14 @@ awt::Rectangle OAccessibleMenuItemComponent::implGetBounds() if ( m_pParent ) { // get bounding rectangle of the item relative to the containing window - aBounds = AWTRectangle( m_pParent->GetBoundingRectangle( m_nItemPos ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect(m_pParent->GetBoundingRectangle(m_nItemPos)); // get position of containing window in screen coordinates vcl::Window* pWindow = m_pParent->GetWindow(); if ( pWindow ) { AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute(); - awt::Point aWindowScreenLoc = AWTPoint( aRect.TopLeft() ); + awt::Point aWindowScreenLoc = VCLUnoHelper::ConvertToAWTPoint(aRect.TopLeft()); // get position of accessible parent in screen coordinates Reference< XAccessible > xParent = getAccessibleParent(); diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx index 0ab1580f3cca..f7ce36f3187e 100644 --- a/accessibility/source/standard/vclxaccessibleedit.cxx +++ b/accessibility/source/standard/vclxaccessibleedit.cxx @@ -20,7 +20,7 @@ #include <standard/vclxaccessibleedit.hxx> #include <toolkit/awt/vclxwindows.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> @@ -388,7 +388,7 @@ awt::Rectangle VCLXAccessibleEdit::getCharacterBounds( sal_Int32 nIndex ) } else { - aBounds = AWTRectangle( pControl->GetCharacterBounds( nIndex ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect(pControl->GetCharacterBounds(nIndex)); } } diff --git a/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx b/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx index 0b1445461b1b..df740cd7cf62 100644 --- a/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx +++ b/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx @@ -29,7 +29,7 @@ #include <unotools/accessiblerelationsethelper.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <i18nlangtag/languagetag.hxx> using namespace ::com::sun::star; @@ -75,7 +75,8 @@ awt::Rectangle VCLXAccessibleHeaderBarItem::implGetBounds() OExternalLockGuard aGuard( this ); if ( m_pHeadBar ) - aBounds = AWTRectangle( m_pHeadBar->GetItemRect( sal_uInt16( m_nIndexInParent ) ) ); + aBounds + = VCLUnoHelper::ConvertToAWTRect(m_pHeadBar->GetItemRect(sal_uInt16(m_nIndexInParent))); return aBounds; } diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index 04bb77d0d02e..ab3c1597caef 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -30,10 +30,10 @@ #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> #include <o3tl/safeint.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <vcl/toolkit/combobox.hxx> #include <vcl/toolkit/lstbox.hxx> -#include <toolkit/helper/convert.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -877,7 +877,7 @@ awt::Rectangle VCLXAccessibleList::implGetBounds() && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN ) { if ( m_pListBoxHelper->IsInDropDown() ) - aBounds = AWTRectangle(m_pListBoxHelper->GetDropDownPosSizePixel()); + aBounds = VCLUnoHelper::ConvertToAWTRect(m_pListBoxHelper->GetDropDownPosSizePixel()); } else { @@ -910,7 +910,8 @@ awt::Point VCLXAccessibleList::getLocationOnScreen( ) && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN ) { if ( m_pListBoxHelper->IsInDropDown() ) - aPos = AWTPoint(m_pListBoxHelper->GetDropDownPosSizePixel().TopLeft()); + aPos = VCLUnoHelper::ConvertToAWTPoint( + m_pListBoxHelper->GetDropDownPosSizePixel().TopLeft()); } else { diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx index 62cd311abbe0..af616805a50e 100644 --- a/accessibility/source/standard/vclxaccessiblelistitem.cxx +++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx @@ -18,7 +18,7 @@ */ #include <standard/vclxaccessiblelistitem.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <helper/IComboListBoxHelper.hxx> #include <com/sun/star/awt/Rectangle.hpp> @@ -290,7 +290,7 @@ sal_Bool SAL_CALL VCLXAccessibleListItem::containsPoint( const awt::Point& _aPoi { tools::Rectangle aRect(pListBoxHelper->GetBoundingRectangle(static_cast<sal_uInt16>(m_nIndexInParent))); aRect.Move(-aRect.Left(), -aRect.Top()); - bInside = aRect.Contains( VCLPoint( _aPoint ) ); + bInside = aRect.Contains(VCLUnoHelper::ConvertToVCLPoint(_aPoint)); } return bInside; } @@ -308,7 +308,8 @@ awt::Rectangle SAL_CALL VCLXAccessibleListItem::getBounds( ) awt::Rectangle aRect; ::accessibility::IComboListBoxHelper* pListBoxHelper = m_xParent.is() ? m_xParent->getListBoxHelper() : nullptr; if (pListBoxHelper) - aRect = AWTRectangle(pListBoxHelper->GetBoundingRectangle(static_cast<sal_uInt16>(m_nIndexInParent))); + aRect = VCLUnoHelper::ConvertToAWTRect( + pListBoxHelper->GetBoundingRectangle(static_cast<sal_uInt16>(m_nIndexInParent))); return aRect; } @@ -325,7 +326,7 @@ awt::Point SAL_CALL VCLXAccessibleListItem::getLocation( ) tools::Rectangle aRect = pListBoxHelper->GetBoundingRectangle( static_cast<sal_uInt16>(m_nIndexInParent) ); aPoint = aRect.TopLeft(); } - return AWTPoint( aPoint ); + return VCLUnoHelper::ConvertToAWTPoint(aPoint); } awt::Point SAL_CALL VCLXAccessibleListItem::getLocationOnScreen( ) @@ -341,7 +342,7 @@ awt::Point SAL_CALL VCLXAccessibleListItem::getLocationOnScreen( ) aPoint = aRect.TopLeft(); aPoint += Point(pListBoxHelper->GetWindowExtentsAbsolute().TopLeft()); } - return AWTPoint( aPoint ); + return VCLUnoHelper::ConvertToAWTPoint(aPoint); } awt::Size SAL_CALL VCLXAccessibleListItem::getSize( ) @@ -354,7 +355,7 @@ awt::Size SAL_CALL VCLXAccessibleListItem::getSize( ) if (pListBoxHelper) aSize = pListBoxHelper->GetBoundingRectangle( static_cast<sal_uInt16>(m_nIndexInParent) ).GetSize(); - return AWTSize( aSize ); + return VCLUnoHelper::ConvertToAWTSize(aSize); } void SAL_CALL VCLXAccessibleListItem::grabFocus( ) @@ -414,7 +415,7 @@ awt::Rectangle SAL_CALL VCLXAccessibleListItem::getCharacterBounds( sal_Int32 nI tools::Rectangle aCharRect = pListBoxHelper->GetEntryCharacterBounds( m_nIndexInParent, nIndex ); tools::Rectangle aItemRect = pListBoxHelper->GetBoundingRectangle( static_cast<sal_uInt16>(m_nIndexInParent) ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = AWTRectangle( aCharRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -438,7 +439,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getIndexAtPoint( const awt::Point& aP { sal_Int32 nPos = LISTBOX_ENTRY_NOTFOUND; tools::Rectangle aItemRect = pListBoxHelper->GetBoundingRectangle( static_cast<sal_uInt16>(m_nIndexInParent) ); - Point aPnt( VCLPoint( aPoint ) ); + Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); sal_Int32 nI = pListBoxHelper->GetIndexForPoint( aPnt, nPos ); if ( nI != -1 && m_nIndexInParent == nPos ) diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx index 1766b316559b..b505920aed93 100644 --- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx +++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx @@ -18,7 +18,6 @@ */ #include <standard/vclxaccessiblemenuitem.hxx> -#include <toolkit/helper/convert.hxx> #include <helper/characterattributeshelper.hxx> #include <comphelper/accessiblecontexthelper.hxx> #include <comphelper/accessiblekeybindinghelper.hxx> @@ -31,6 +30,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <comphelper/sequence.hxx> #include <i18nlangtag/languagetag.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/event.hxx> #include <vcl/svapp.hxx> #include <vcl/window.hxx> @@ -239,7 +239,7 @@ awt::Rectangle VCLXAccessibleMenuItem::getCharacterBounds( sal_Int32 nIndex ) tools::Rectangle aItemRect = m_pParent->GetBoundingRectangle( m_nItemPos ); tools::Rectangle aCharRect = m_pParent->GetCharacterBounds( nItemId, nIndex ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = AWTRectangle( aCharRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -263,7 +263,7 @@ sal_Int32 VCLXAccessibleMenuItem::getIndexAtPoint( const awt::Point& aPoint ) { sal_uInt16 nItemId = 0; tools::Rectangle aItemRect = m_pParent->GetBoundingRectangle( m_nItemPos ); - Point aPnt( VCLPoint( aPoint ) ); + Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); sal_Int32 nI = m_pParent->GetIndexForPoint( aPnt, nItemId ); if ( nI != -1 && m_pParent->GetItemId( m_nItemPos ) == nItemId ) diff --git a/accessibility/source/standard/vclxaccessiblestatusbar.cxx b/accessibility/source/standard/vclxaccessiblestatusbar.cxx index bbf19b4416a5..416c5781b156 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbar.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbar.cxx @@ -19,7 +19,7 @@ #include <standard/vclxaccessiblestatusbar.hxx> #include <standard/vclxaccessiblestatusbaritem.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <comphelper/accessiblecontexthelper.hxx> @@ -307,7 +307,7 @@ Reference< XAccessible > VCLXAccessibleStatusBar::getAccessibleAtPoint( const aw Reference< XAccessible > xChild; if ( m_pStatusBar ) { - sal_uInt16 nItemId = m_pStatusBar->GetItemId( VCLPoint( rPoint ) ); + sal_uInt16 nItemId = m_pStatusBar->GetItemId(VCLUnoHelper::ConvertToVCLPoint(rPoint)); sal_Int32 nItemPos = m_pStatusBar->GetItemPos( nItemId ); if ( nItemPos >= 0 && o3tl::make_unsigned(nItemPos) < m_aAccessibleChildren.size() ) xChild = getAccessibleChild( nItemPos ); diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx index db5e6cf140fe..b49f3cbecd4b 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx @@ -18,7 +18,7 @@ */ #include <standard/vclxaccessiblestatusbaritem.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <helper/characterattributeshelper.hxx> #include <com/sun/star/accessibility/AccessibleEventId.hpp> @@ -148,7 +148,7 @@ awt::Rectangle VCLXAccessibleStatusBarItem::implGetBounds() awt::Rectangle aBounds( 0, 0, 0, 0 ); if ( m_pStatusBar ) - aBounds = AWTRectangle( m_pStatusBar->GetItemRect( m_nItemId ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect(m_pStatusBar->GetItemRect(m_nItemId)); return aBounds; } @@ -500,7 +500,7 @@ awt::Rectangle VCLXAccessibleStatusBarItem::getCharacterBounds( sal_Int32 nIndex m_pStatusBar->RecordLayoutData( &aLayoutData, aItemRect ); tools::Rectangle aCharRect = aLayoutData.GetCharacterBounds( nIndex ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = AWTRectangle( aCharRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -517,7 +517,7 @@ sal_Int32 VCLXAccessibleStatusBarItem::getIndexAtPoint( const awt::Point& aPoint vcl::ControlLayoutData aLayoutData; tools::Rectangle aItemRect = m_pStatusBar->GetItemRect( m_nItemId ); m_pStatusBar->RecordLayoutData( &aLayoutData, aItemRect ); - Point aPnt( VCLPoint( aPoint ) ); + Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); nIndex = aLayoutData.GetIndexForPoint( aPnt ); } diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx index dad454ab0021..d2e32f1dfa46 100644 --- a/accessibility/source/standard/vclxaccessibletabpage.cxx +++ b/accessibility/source/standard/vclxaccessibletabpage.cxx @@ -18,7 +18,7 @@ */ #include <standard/vclxaccessibletabpage.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <helper/characterattributeshelper.hxx> #include <com/sun/star/accessibility/AccessibleEventId.hpp> @@ -191,7 +191,7 @@ awt::Rectangle VCLXAccessibleTabPage::implGetBounds() awt::Rectangle aBounds( 0, 0, 0, 0 ); if ( m_pTabControl ) - aBounds = AWTRectangle( m_pTabControl->GetTabBounds( m_nPageId ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect(m_pTabControl->GetTabBounds(m_nPageId)); return aBounds; } @@ -408,8 +408,8 @@ Reference< XAccessible > VCLXAccessibleTabPage::getAccessibleAtPoint( const awt: Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), 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; @@ -588,7 +588,7 @@ awt::Rectangle VCLXAccessibleTabPage::getCharacterBounds( sal_Int32 nIndex ) tools::Rectangle aPageRect = m_pTabControl->GetTabBounds( m_nPageId ); tools::Rectangle aCharRect; // m_pTabControl->GetCharacterBounds( m_nPageId, nIndex ); aCharRect.Move( -aPageRect.Left(), -aPageRect.Top() ); - aBounds = AWTRectangle( aCharRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -604,7 +604,7 @@ sal_Int32 VCLXAccessibleTabPage::getIndexAtPoint( const awt::Point& /*aPoint*/ ) // { // sal_uInt16 nPageId = 0; // tools::Rectangle aPageRect = m_pTabControl->GetTabBounds( m_nPageId ); -// Point aPnt( VCLPoint( aPoint ) ); +// Point aPnt( VCLUnoHelper::ConvertToVCLPoint( aPoint ) ); // aPnt += aPageRect.TopLeft(); // sal_Int32 nI = m_pTabControl->GetIndexForPoint( aPnt, nPageId ); // if ( nI != -1 && m_nPageId == nPageId ) diff --git a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx index dea12aed6fb0..32424e807cec 100644 --- a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx +++ b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx @@ -19,7 +19,7 @@ #include <standard/vclxaccessibletabpagewindow.hxx> #include <comphelper/accessiblecontexthelper.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/tabctrl.hxx> #include <vcl/tabpage.hxx> #include <sal/log.hxx> @@ -72,7 +72,7 @@ awt::Rectangle VCLXAccessibleTabPageWindow::implGetBounds() { tools::Rectangle aRect( m_pTabPage->GetPosPixel(), m_pTabPage->GetSizePixel() ); aRect.Move( -aPageRect.Left(), -aPageRect.Top() ); - aBounds = AWTRectangle( aRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aRect); } } diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx index 0bf781f09758..8085759cc948 100644 --- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx +++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx @@ -18,7 +18,7 @@ */ #include <standard/vclxaccessibletextcomponent.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <helper/characterattributeshelper.hxx> #include <com/sun/star/accessibility/AccessibleEventId.hpp> @@ -250,7 +250,7 @@ awt::Rectangle VCLXAccessibleTextComponent::getCharacterBounds( sal_Int32 nIndex awt::Rectangle aRect; VclPtr< Control > pControl = GetAs< Control >(); if ( pControl ) - aRect = AWTRectangle( pControl->GetCharacterBounds( nIndex ) ); + aRect = VCLUnoHelper::ConvertToAWTRect(pControl->GetCharacterBounds(nIndex)); return aRect; } @@ -271,7 +271,7 @@ sal_Int32 VCLXAccessibleTextComponent::getIndexAtPoint( const awt::Point& aPoint sal_Int32 nIndex = -1; VclPtr< Control > pControl = GetAs< Control >(); if ( pControl ) - nIndex = pControl->GetIndexForPoint( VCLPoint( aPoint ) ); + nIndex = pControl->GetIndexForPoint(VCLUnoHelper::ConvertToVCLPoint(aPoint)); return nIndex; } diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 9094ce357b6b..9d4cb3aaf203 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -20,7 +20,7 @@ #include <standard/vclxaccessibletoolbox.hxx> #include <standard/vclxaccessibletoolboxitem.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> @@ -663,7 +663,8 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleAtPoint( c VclPtr< ToolBox > pToolBox = GetAs< ToolBox >(); if ( pToolBox ) { - ToolBox::ImplToolItems::size_type nItemPos = pToolBox->GetItemPos( VCLPoint( _rPoint ) ); + ToolBox::ImplToolItems::size_type nItemPos + = pToolBox->GetItemPos(VCLUnoHelper::ConvertToVCLPoint(_rPoint)); if ( nItemPos != ToolBox::ITEM_NOTFOUND ) xAccessible = getAccessibleChild( nItemPos ); } diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx index b8e489c9f610..8c95e25bace6 100644 --- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx +++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx @@ -18,7 +18,7 @@ */ #include <standard/vclxaccessibletoolboxitem.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <helper/accresmgr.hxx> #include <strings.hrc> #include <com/sun/star/awt/Rectangle.hpp> @@ -208,7 +208,7 @@ awt::Rectangle VCLXAccessibleToolBoxItem::implGetBounds( ) { awt::Rectangle aRect; if ( m_pToolBox ) - aRect = AWTRectangle( m_pToolBox->GetItemPosRect( m_nIndexInParent ) ); + aRect = VCLUnoHelper::ConvertToAWTRect(m_pToolBox->GetItemPosRect(m_nIndexInParent)); return aRect; } @@ -477,7 +477,7 @@ awt::Rectangle SAL_CALL VCLXAccessibleToolBoxItem::getCharacterBounds( sal_Int32 tools::Rectangle aCharRect = m_pToolBox->GetCharacterBounds( m_nItemId, nIndex ); tools::Rectangle aItemRect = m_pToolBox->GetItemRect( m_nItemId ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = AWTRectangle( aCharRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -492,7 +492,7 @@ sal_Int32 SAL_CALL VCLXAccessibleToolBoxItem::getIndexAtPoint( const awt::Point& { ToolBoxItemId nItemId; tools::Rectangle aItemRect = m_pToolBox->GetItemRect( m_nItemId ); - Point aPnt( VCLPoint( aPoint ) ); + Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); sal_Int32 nIdx = m_pToolBox->GetIndexForPoint( aPnt, nItemId ); if ( nIdx != -1 && nItemId == m_nItemId ) diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx index 4abd4076d26a..22e9403bfed2 100644 --- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx +++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx @@ -30,7 +30,6 @@ #include <cppuhelper/supportsservice.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <toolkit/awt/vclxfont.hxx> -#include <toolkit/helper/convert.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/accessiblecontexthelper.hxx> #include <comphelper/diagnose_ex.hxx> @@ -147,7 +146,7 @@ awt::Rectangle AccessibleDialogControlShape::GetBounds() const // clip the shape's bounding box with the bounding box of its parent tools::Rectangle aParentRect( Point( 0, 0 ), m_pDialogWindow->GetSizePixel() ); aRect = aRect.GetIntersection( aParentRect ); - aBounds = AWTRectangle( aRect ); + aBounds = VCLUnoHelper::ConvertToAWTRect(aRect); } } diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx index e9b4513294fb..def3a8fdede0 100644 --- a/basctl/source/accessibility/accessibledialogwindow.cxx +++ b/basctl/source/accessibility/accessibledialogwindow.cxx @@ -36,7 +36,7 @@ #include <tools/debug.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <toolkit/awt/vclxfont.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <i18nlangtag/languagetag.hxx> @@ -409,7 +409,8 @@ awt::Rectangle AccessibleDialogWindow::implGetBounds() { awt::Rectangle aBounds; if ( m_pDialogWindow ) - aBounds = AWTRectangle( tools::Rectangle( m_pDialogWindow->GetPosPixel(), m_pDialogWindow->GetSizePixel() ) ); + aBounds = VCLUnoHelper::ConvertToAWTRect( + tools::Rectangle(m_pDialogWindow->GetPosPixel(), m_pDialogWindow->GetSizePixel())); return aBounds; } @@ -685,8 +686,8 @@ Reference< XAccessible > AccessibleDialogWindow::getAccessibleAtPoint( const awt Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), 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; diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 3b61f2a543f6..500d4a6d59ca 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -38,7 +38,6 @@ #include <o3tl/string_view.hxx> #include <unotools/cmdoptions.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <toolkit/helper/convert.hxx> #include <utility> #include <vcl/i18nhelp.hxx> #include <vcl/dockingarea.hxx> @@ -1498,7 +1497,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno xWindow->setPosSize( aPixelPos.X(), aPixelPos.Y(), 0, 0, awt::PosSize::POS ); if( bSetSize ) - xWindow->setOutputSize( AWTSize( aSize) ); + xWindow->setOutputSize(VCLUnoHelper::ConvertToAWTSize(aSize)); if ( pWindow ) { @@ -1726,7 +1725,8 @@ awt::Point ToolbarLayoutManager::implts_findNextCascadeFloatingPos() SolarMutexGuard aGuard; VclPtr<vcl::Window> pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); if ( pContainerWindow ) - aStartPos = AWTPoint(pContainerWindow->OutputToScreenPixel(VCLPoint(aStartPos))); + aStartPos = VCLUnoHelper::ConvertToAWTPoint( + pContainerWindow->OutputToScreenPixel(VCLUnoHelper::ConvertToVCLPoint(aStartPos))); } // Determine size of top and left docking area @@ -3393,13 +3393,15 @@ awt::DockingData SAL_CALL ToolbarLayoutManager::docking( const awt::DockingEvent awt::Size aFloatSize = aUIDockingElement.m_aFloatingData.m_aSize; if ( aFloatSize.Width > 0 && aFloatSize.Height > 0 ) { - aUIDockingElement.m_aFloatingData.m_aPos = AWTPoint(pContainerWindow->ScreenToOutputPixel(VCLPoint(e.MousePos))); + aUIDockingElement.m_aFloatingData.m_aPos + = VCLUnoHelper::ConvertToAWTPoint(pContainerWindow->ScreenToOutputPixel( + VCLUnoHelper::ConvertToVCLPoint(e.MousePos))); aDockingData.TrackingRectangle.Height = aFloatSize.Height; aDockingData.TrackingRectangle.Width = aFloatSize.Width; } else { - aFloatSize = AWTSize(pToolBox->CalcWindowSizePixel()); + aFloatSize = VCLUnoHelper::ConvertToAWTSize(pToolBox->CalcWindowSizePixel()); if ( !bIsHorizontal ) { // Floating toolbars are always horizontal aligned! We have to swap @@ -3414,7 +3416,9 @@ awt::DockingData SAL_CALL ToolbarLayoutManager::docking( const awt::DockingEvent // For the first time we don't have any data about the floating size of a toolbar. // We calculate it and store it for later use. - aUIDockingElement.m_aFloatingData.m_aPos = AWTPoint(pContainerWindow->ScreenToOutputPixel(VCLPoint(e.MousePos))); + aUIDockingElement.m_aFloatingData.m_aPos + = VCLUnoHelper::ConvertToAWTPoint(pContainerWindow->ScreenToOutputPixel( + VCLUnoHelper::ConvertToVCLPoint(e.MousePos))); aUIDockingElement.m_aFloatingData.m_aSize = aFloatSize; aUIDockingElement.m_aFloatingData.m_nLines = pToolBox->GetFloatingLines(); aUIDockingElement.m_aFloatingData.m_bIsHorizontal = isToolboxHorizontalAligned( pToolBox ); @@ -3569,8 +3573,9 @@ sal_Bool SAL_CALL ToolbarLayoutManager::prepareToggleFloatingMode( const lang::E if ( pWindow && pWindow->GetType() == WindowType::TOOLBOX ) { ToolBox* pToolBox = static_cast< ToolBox *>( pWindow.get() ); - aUIDockingElement.m_aFloatingData.m_aPos = AWTPoint(pToolBox->GetPosPixel()); - aUIDockingElement.m_aFloatingData.m_aSize = AWTSize(pToolBox->GetOutputSizePixel()); + aUIDockingElement.m_aFloatingData.m_aPos + = VCLUnoHelper::ConvertToAWTPoint(pToolBox->GetPosPixel()); + aUIDockingElement.m_aFloatingData.m_aSize = VCLUnoHelper::ConvertToAWTSize(pToolBox->GetOutputSizePixel()); aUIDockingElement.m_aFloatingData.m_nLines = pToolBox->GetFloatingLines(); aUIDockingElement.m_aFloatingData.m_bIsHorizontal = isToolboxHorizontalAligned( pToolBox ); } @@ -3638,9 +3643,9 @@ void SAL_CALL ToolbarLayoutManager::toggleFloatingMode( const lang::EventObject& if ( !bSetSize ) { if ( pToolBox ) - aUIDockingElement.m_aFloatingData.m_aSize = AWTSize(pToolBox->CalcFloatingWindowSizePixel()); + aUIDockingElement.m_aFloatingData.m_aSize = VCLUnoHelper::ConvertToAWTSize(pToolBox->CalcFloatingWindowSizePixel()); else if ( pWindow ) - aUIDockingElement.m_aFloatingData.m_aSize = AWTSize(pWindow->GetOutputSizePixel()); + aUIDockingElement.m_aFloatingData.m_aSize = VCLUnoHelper::ConvertToAWTSize(pWindow->GetOutputSizePixel()); } xWindow->setPosSize( aUIDockingElement.m_aFloatingData.m_aPos.X, @@ -3677,7 +3682,7 @@ void SAL_CALL ToolbarLayoutManager::toggleFloatingMode( const lang::EventObject& ::Size aSize = pToolBox->CalcWindowSizePixel( 1 ); awt::Rectangle aRect = xWindow->getPosSize(); xWindow->setPosSize( aRect.X, aRect.Y, 0, 0, awt::PosSize::POS ); - xWindow->setOutputSize( AWTSize( aSize ) ); + xWindow->setOutputSize(VCLUnoHelper::ConvertToAWTSize(aSize)); } } diff --git a/include/toolkit/helper/convert.hxx b/include/toolkit/helper/convert.hxx deleted file mode 100644 index 255d5b26b4c6..000000000000 --- a/include/toolkit/helper/convert.hxx +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_TOOLKIT_HELPER_CONVERT_HXX -#define INCLUDED_TOOLKIT_HELPER_CONVERT_HXX - -#include <com/sun/star/awt/Rectangle.hpp> -#include <com/sun/star/awt/Size.hpp> -#include <com/sun/star/awt/Point.hpp> - -#include <tools/gen.hxx> - -inline css::awt::Size AWTSize( const Size& rVCLSize ) -{ - return css::awt::Size( rVCLSize.Width(), rVCLSize.Height() ); -} - -inline ::Size VCLSize( const css::awt::Size& rAWTSize ) -{ - return ::Size( rAWTSize.Width, rAWTSize.Height ); -} - -inline css::awt::Point AWTPoint( const PointTemplateBase& rVCLPoint ) -{ - return css::awt::Point( rVCLPoint.X(), rVCLPoint.Y() ); -} - -inline ::Point VCLPoint( const css::awt::Point& rAWTPoint ) -{ - return ::Point( rAWTPoint.X, rAWTPoint.Y ); -} - -inline css::awt::Rectangle AWTRectangle( const RectangleTemplateBase& rVCLRect ) -{ - return css::awt::Rectangle( rVCLRect.Left(), rVCLRect.Top(), rVCLRect.GetWidth(), rVCLRect.GetHeight() ); -} - -inline ::tools::Rectangle VCLRectangle( const css::awt::Rectangle& rAWTRect ) -{ - return ::tools::Rectangle( ::Point( rAWTRect.X, rAWTRect.Y ), ::Size( rAWTRect.Width, rAWTRect.Height ) ); -} - -#endif // INCLUDED_TOOLKIT_HELPER_CONVERT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/reportdesign/inc/pch/precompiled_rptui.hxx b/reportdesign/inc/pch/precompiled_rptui.hxx index 9dc3e3fd6fe2..908dfa9cf4f9 100644 --- a/reportdesign/inc/pch/precompiled_rptui.hxx +++ b/reportdesign/inc/pch/precompiled_rptui.hxx @@ -444,7 +444,6 @@ #include <svx/xit.hxx> #include <svx/xpoly.hxx> #include <svx/xtable.hxx> -#include <toolkit/helper/convert.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/color.hxx> #include <tools/date.hxx> diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 9b7d1db223bd..8ec61ceaca5e 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -82,7 +82,6 @@ #include <sfx2/docfilt.hxx> #include <helpids.h> -#include <toolkit/helper/convert.hxx> #include <o3tl/functional.hxx> #include <o3tl/safeint.hxx> @@ -1605,11 +1604,11 @@ void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos, if ( !xSection.is() || uno::Reference< report::XShape>(xSourceReportComponent,uno::UNO_QUERY).is() ) // shapes can overlap. return; - ::Point aPos(VCLPoint(_aNewPos)); + ::Point aPos(VCLUnoHelper::ConvertToVCLPoint(_aNewPos)); if ( aPos.X() < 0 || aPos.Y() < 0 ) // TODO: have to check size with pos aka || (aPos.X() + aAwtSize.Width) > m_xSection->getReportDefinition()-> throw beans::PropertyVetoException(RptResId(RID_STR_ILLEGAL_POSITION),xSourceReportComponent); - ::tools::Rectangle aSourceRect(aPos,VCLSize(_aSize)); + ::tools::Rectangle aSourceRect(aPos, VCLUnoHelper::ConvertToVCLSize(_aSize)); const sal_Int32 nCount = xSection->getCount(); for (sal_Int32 i = 0; i < nCount ; ++i) @@ -1617,7 +1616,9 @@ void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos, const uno::Reference< report::XReportComponent> xReportComponent(xSection->getByIndex(i),uno::UNO_QUERY); if ( xReportComponent.is() && xReportComponent != xSourceReportComponent ) { - const ::tools::Rectangle aBoundRect(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize())); + const ::tools::Rectangle aBoundRect( + VCLUnoHelper::ConvertToVCLPoint(xReportComponent->getPosition()), + VCLUnoHelper::ConvertToVCLSize(xReportComponent->getSize())); const ::tools::Rectangle aRect = aSourceRect.GetIntersection(aBoundRect); if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) ) throw beans::PropertyVetoException(RptResId( RID_STR_OVERLAP_OTHER_CONTROL),xSourceReportComponent); diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 2d3851486816..549307b941e4 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -19,7 +19,6 @@ #include <memory> -#include <toolkit/helper/convert.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <SectionView.hxx> #include <UITools.hxx> @@ -935,7 +934,8 @@ tools::Rectangle getRectangleFromControl(SdrObject* _pControl) uno::Reference< report::XReportComponent > xComponent( _pControl->getUnoShape(), uno::UNO_QUERY); if (xComponent.is()) { - tools::Rectangle aRect(VCLPoint(xComponent->getPosition()),VCLSize(xComponent->getSize())); + tools::Rectangle aRect(VCLUnoHelper::ConvertToVCLPoint(xComponent->getPosition()), + VCLUnoHelper::ConvertToVCLSize(xComponent->getSize())); aRect.setHeight(aRect.getOpenHeight() + 1); aRect.setWidth(aRect.getOpenWidth() + 1); return aRect; diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 49cb91063efe..e616cd859eab 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -127,7 +127,6 @@ #include <PropertyForward.hxx> #include <SectionWindow.hxx> -#include <toolkit/helper/convert.hxx> #include <GroupsSorting.hxx> #include <PageNumber.hxx> #include <UndoEnv.hxx> @@ -2415,7 +2414,8 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ aDescriptor.Put(SvxBrushItem(::Color(ColorTransparency, _xSection->getBackColor()),RPTUI_ID_BRUSH)); else { - aDescriptor.Put(SvxSizeItem(RPTUI_ID_SIZE,VCLSize(getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE)))); + aDescriptor.Put(SvxSizeItem(RPTUI_ID_SIZE, + VCLUnoHelper::ConvertToVCLSize(getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE)))); aDescriptor.Put(SvxLRSpaceItem(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN) ,getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN),0,RPTUI_ID_LRSPACE)); aDescriptor.Put(SvxULSpaceItem(static_cast<sal_uInt16>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_TOPMARGIN)) diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index ec70ae7192e8..61e38fff8e8c 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -43,7 +43,7 @@ #include <com/sun/star/frame/XPopupMenuController.hpp> #include <comphelper/propertyvalue.hxx> #include <toolkit/awt/vclxmenu.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <comphelper/diagnose_ex.hxx> #include <RptDef.hxx> #include <SectionWindow.hxx> @@ -255,7 +255,8 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC // Clone to target SdrModel rtl::Reference<SdrObject> pNewObj(pObject->CloneSdrObject(*m_pModel)); m_pPage->InsertObject(pNewObj.get(), SAL_MAX_SIZE); - tools::Rectangle aRet(VCLPoint(rCopy->getPosition()),VCLSize(rCopy->getSize())); + tools::Rectangle aRet(VCLUnoHelper::ConvertToVCLPoint(rCopy->getPosition()), + VCLUnoHelper::ConvertToVCLSize(rCopy->getSize())); aRet.setHeight(aRet.getOpenHeight() + 1); aRet.setWidth(aRet.getOpenWidth() + 1); bool bOverlapping = true; @@ -536,7 +537,9 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I { xReportComponent->setPosition(aPos); correctOverlapping(pObject,*this,false); - tools::Rectangle aRet(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize())); + tools::Rectangle aRet( + VCLUnoHelper::ConvertToVCLPoint(xReportComponent->getPosition()), + VCLUnoHelper::ConvertToVCLSize(xReportComponent->getSize())); aRet.setHeight(aRet.getOpenHeight() + 1); aRet.setWidth(aRet.getOpenWidth() + 1); if ( m_xSection.is() && (o3tl::make_unsigned(aRet.getOpenHeight() + aRet.Top()) > m_xSection->getHeight()) ) @@ -768,7 +771,7 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) aCurrent.realloc(nLength + 3); auto pCurrent = aCurrent.getArray(); pCurrent[nLength].Name = PROPERTY_POSITION; - pCurrent[nLength++].Value <<= AWTPoint(aDropPos); + pCurrent[nLength++].Value <<= VCLUnoHelper::ConvertToAWTPoint(aDropPos); // give also the DND Action (Shift|Ctrl) Key to really say what we want pCurrent[nLength].Name = "DNDAction"; pCurrent[nLength++].Value <<= _rEvt.mnAction; diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 111cb612227c..3dfb95ead12f 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -39,7 +39,7 @@ #include <vcl/settings.hxx> #include <core_resource.hxx> #include <svx/svdundo.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <algorithm> #include <cstdlib> #include <numeric> @@ -1238,7 +1238,7 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe for (; pColIter != pColEnd; ++pColIter) { uno::Reference< report::XReportComponent> xRC(*pColIter); - aPrevious = VCLPoint(xRC->getPosition()); + aPrevious = VCLUnoHelper::ConvertToVCLPoint(xRC->getPosition()); awt::Size aSize = xRC->getSize(); if ( aNewPos.X() < nLeftMargin ) @@ -1259,12 +1259,13 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe aNewPos.setX( 0 ); xRC->setSize(aSize); } - xRC->setPosition(AWTPoint(aNewPos)); + xRC->setPosition(VCLUnoHelper::ConvertToAWTPoint(aNewPos)); if ( (pColIter+1) != pColEnd ) { // bring aNewPos to the position of the next object uno::Reference< report::XReportComponent> xRCNext = *(pColIter + 1); - Point aNextPosition = VCLPoint(xRCNext->getPosition()); + Point aNextPosition + = VCLUnoHelper::ConvertToVCLPoint(xRCNext->getPosition()); aNewPos += aNextPosition - aPrevious; } } diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 34826eb80e9d..4300cf98cbab 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -23,7 +23,7 @@ #include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp> #include <tools/gen.hxx> #include <tools/color.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <svl/hint.hxx> #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> @@ -158,7 +158,8 @@ sal_Bool SAL_CALL ScAccessibleContextBase::containsPoint(const awt::Point& rPoin { SolarMutexGuard aGuard; IsObjectValid(); - return tools::Rectangle (Point(), GetBoundingBox().GetSize()).Contains(VCLPoint(rPoint)); + return tools::Rectangle(Point(), GetBoundingBox().GetSize()) + .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); } uno::Reference< XAccessible > SAL_CALL ScAccessibleContextBase::getAccessibleAtPoint( @@ -172,28 +173,28 @@ awt::Rectangle SAL_CALL ScAccessibleContextBase::getBounds( ) { SolarMutexGuard aGuard; IsObjectValid(); - return AWTRectangle(GetBoundingBox()); + return VCLUnoHelper::ConvertToAWTRect(GetBoundingBox()); } awt::Point SAL_CALL ScAccessibleContextBase::getLocation( ) { SolarMutexGuard aGuard; IsObjectValid(); - return AWTPoint(GetBoundingBox().TopLeft()); + return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); } awt::Point SAL_CALL ScAccessibleContextBase::getLocationOnScreen( ) { SolarMutexGuard aGuard; IsObjectValid(); - return AWTPoint(GetBoundingBoxOnScreen().TopLeft()); + return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL ScAccessibleContextBase::getSize( ) { SolarMutexGuard aGuard; IsObjectValid(); - return AWTSize(GetBoundingBox().GetSize()); + return VCLUnoHelper::ConvertToAWTSize(GetBoundingBox().GetSize()); } bool ScAccessibleContextBase::isShowing( ) @@ -206,8 +207,9 @@ bool ScAccessibleContextBase::isShowing( ) uno::Reference<XAccessibleComponent> xParentComponent (mxParent->getAccessibleContext(), uno::UNO_QUERY); if (xParentComponent.is()) { - tools::Rectangle aParentBounds(VCLRectangle(xParentComponent->getBounds())); - tools::Rectangle aBounds(VCLRectangle(getBounds())); + tools::Rectangle aParentBounds( + VCLUnoHelper::ConvertToVCLRect(xParentComponent->getBounds())); + tools::Rectangle aBounds(VCLUnoHelper::ConvertToVCLRect(getBounds())); bShowing = aBounds.Overlaps(aParentBounds); } } diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 94909b4fa21f..3380d9c7fa41 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -54,8 +54,8 @@ #include <comphelper/sequence.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/docfile.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> -#include <toolkit/helper/convert.hxx> #include <utility> #include <vcl/svapp.hxx> @@ -572,9 +572,10 @@ uno::Reference< XAccessible > ScChildrenShapes::GetAt(const awt::Point& rPoint) if (pShape->pAccShape.is()) { - Point aPoint(VCLPoint(rPoint)); - aPoint -= VCLRectangle(pShape->pAccShape->getBounds()).TopLeft(); - if (pShape->pAccShape->containsPoint(AWTPoint(aPoint))) + Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + aPoint + -= VCLUnoHelper::ConvertToVCLRect(pShape->pAccShape->getBounds()).TopLeft(); + if (pShape->pAccShape->containsPoint(VCLUnoHelper::ConvertToAWTPoint(aPoint))) { xAccessible = pShape->pAccShape.get(); bFound = true; @@ -1638,8 +1639,8 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocument::getAccessibleAtPoin uno::Reference< XAccessibleComponent > xComp(xCont, uno::UNO_QUERY); if (xComp.is()) { - tools::Rectangle aBound(VCLRectangle(xComp->getBounds())); - if (aBound.Contains(VCLPoint(rPoint))) + tools::Rectangle aBound(VCLUnoHelper::ConvertToVCLRect(xComp->getBounds())); + if (aBound.Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint))) xAccessible = mxTempAcc; } } diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index f2010156ef1a..2715dbf0ae35 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -48,7 +48,7 @@ #include <svx/IAccessibleParent.hxx> #include <svx/IAccessibleViewForwarder.hxx> #include <svx/ShapeTypeHandler.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <sfx2/docfile.hxx> @@ -919,11 +919,14 @@ namespace { struct ScShapePointFound { Point maPoint; - explicit ScShapePointFound(const awt::Point& rPoint) : maPoint(VCLPoint(rPoint)) {} + explicit ScShapePointFound(const awt::Point& rPoint) + : maPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)) + { + } bool operator() (const ScShapeChild& rShape) { bool bResult(false); - if (VCLRectangle(rShape.mpAccShape->getBounds()).Contains(maPoint)) + if (VCLUnoHelper::ConvertToVCLRect(rShape.mpAccShape->getBounds()).Contains(maPoint)) bResult = true; return bResult; } @@ -1023,7 +1026,8 @@ void ScShapeChildren::FillShapes(const tools::Rectangle& aPixelPaintRect, const if (xShape.is()) { tools::Rectangle aRect(pWin->LogicToPixel( - tools::Rectangle(VCLPoint(xShape->getPosition()), VCLSize(xShape->getSize())), aMapMode)); + tools::Rectangle(VCLUnoHelper::ConvertToVCLPoint(xShape->getPosition()), + VCLUnoHelper::ConvertToVCLSize(xShape->getSize())), aMapMode)); if(!aClippedPixelPaintRect.GetIntersection(aRect).IsEmpty()) { ScShapeChild aShape; @@ -1291,7 +1295,9 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces mpTable = new ScAccessiblePreviewTable( this, mpViewShell, nIndex ); mpTable->Init(); } - if (mpTable.is() && VCLRectangle(mpTable->getBounds()).Contains(VCLPoint(rPoint))) + if (mpTable.is() + && VCLUnoHelper::ConvertToVCLRect(mpTable->getBounds()) + .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint))) xAccessible = mpTable.get(); } if (!xAccessible.is()) @@ -1313,11 +1319,11 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces } } - Point aPoint(VCLPoint(rPoint)); + Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)); - if (VCLRectangle(mpHeader->getBounds()).Contains(aPoint)) + if (VCLUnoHelper::ConvertToVCLRect(mpHeader->getBounds()).Contains(aPoint)) xAccessible = mpHeader.get(); - else if (VCLRectangle(mpFooter->getBounds()).Contains(aPoint)) + else if (VCLUnoHelper::ConvertToVCLRect(mpFooter->getBounds()).Contains(aPoint)) xAccessible = mpFooter.get(); } if (!xAccessible.is()) diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index 75f67e2ed302..89ed4343ff35 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -34,7 +34,7 @@ #include <comphelper/sequence.hxx> #include <editeng/editobj.hxx> #include <svx/AccessibleTextHelper.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> using namespace ::com::sun::star; @@ -233,8 +233,10 @@ AbsoluteScreenPixelRectangle ScAccessiblePageHeaderArea::GetBoundingBoxOnScreen( { // has the same size and position on screen like the parent aRect = AbsoluteScreenPixelRectangle( - AbsoluteScreenPixelPoint(VCLPoint(xComp->getLocationOnScreen())), - AbsoluteScreenPixelSize(VCLRectangle(xComp->getBounds()).GetSize())); + AbsoluteScreenPixelPoint( + VCLUnoHelper::ConvertToVCLPoint(xComp->getLocationOnScreen())), + AbsoluteScreenPixelSize( + VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()).GetSize())); } } return aRect; @@ -250,7 +252,8 @@ tools::Rectangle ScAccessiblePageHeaderArea::GetBoundingBox() const if (xComp.is()) { // has the same size and position on screen like the parent and so the pos is (0, 0) - tools::Rectangle aNewRect(Point(0, 0), VCLRectangle(xComp->getBounds()).GetSize()); + tools::Rectangle aNewRect(Point(0, 0), + VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()).GetSize()); aRect = aNewRect; } } diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index 93df6a503837..9bcbb14e3b92 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -31,7 +31,7 @@ #include <editeng/brushitem.hxx> #include <vcl/window.hxx> #include <vcl/svapp.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <comphelper/sequence.hxx> @@ -220,7 +220,8 @@ tools::Rectangle ScAccessiblePreviewCell::GetBoundingBox() const uno::Reference<XAccessibleComponent> xAccParentComp (xAccParentContext, uno::UNO_QUERY); if (xAccParentComp.is()) { - tools::Rectangle aParentRect (VCLRectangle(xAccParentComp->getBounds())); + tools::Rectangle aParentRect( + VCLUnoHelper::ConvertToVCLRect(xAccParentComp->getBounds())); aCellRect.Move(-aParentRect.Left(), -aParentRect.Top()); } } diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index 6112d13c7377..c16ae0f72c37 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -35,7 +35,7 @@ #include <vcl/window.hxx> #include <vcl/svapp.hxx> #include <svl/hint.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #ifdef indices #undef indices @@ -325,7 +325,8 @@ tools::Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBox() const uno::Reference<XAccessibleComponent> xAccParentComp (xAccParentContext, uno::UNO_QUERY); if (xAccParentComp.is()) { - tools::Rectangle aParentRect (VCLRectangle(xAccParentComp->getBounds())); + tools::Rectangle aParentRect( + VCLUnoHelper::ConvertToVCLRect(xAccParentComp->getBounds())); aCellRect.Move(-aParentRect.Left(), -aParentRect.Top()); } } diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index 08aee1cc9c63..950daf37813c 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -28,7 +28,7 @@ #include <vcl/svapp.hxx> #include <sfx2/event.hxx> #include <editeng/unofield.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/diagnose_ex.hxx> @@ -279,7 +279,9 @@ static ScRange lcl_GetAnchorCell( const uno::Reference< drawing::XShape >& xShap if (rCaptionPoint.Y < 0) rUnoPoint.Y += rCaptionPoint.Y; } - aReturn = pDoc->GetRange( nTab, tools::Rectangle( VCLPoint(rUnoPoint), VCLPoint(rUnoPoint) )); + aReturn + = pDoc->GetRange(nTab, tools::Rectangle(VCLUnoHelper::ConvertToVCLPoint(rUnoPoint), + VCLUnoHelper::ConvertToVCLPoint(rUnoPoint))); } else { @@ -290,7 +292,9 @@ static ScRange lcl_GetAnchorCell( const uno::Reference< drawing::XShape >& xShap if (rCaptionPoint.Y < 0) rUnoPoint.Y += rCaptionPoint.Y; } - aReturn = pDoc->GetRange( nTab, tools::Rectangle( VCLPoint(rUnoPoint), VCLPoint(rUnoPoint) )); + aReturn + = pDoc->GetRange(nTab, tools::Rectangle(VCLUnoHelper::ConvertToVCLPoint(rUnoPoint), + VCLUnoHelper::ConvertToVCLPoint(rUnoPoint))); } return aReturn; diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index d0fdb360e4bb..dc1169bfe871 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -41,7 +41,7 @@ #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/queryinterface.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <tools/multisel.hxx> @@ -406,7 +406,7 @@ awt::Rectangle ScViewPaneBase::GetVisArea() const aVisPos.AdjustX( -(aVisSize.Width()) ); } tools::Rectangle aVisRect( aVisPos, aVisSize ); - aVisArea = AWTRectangle(aVisRect); + aVisArea = VCLUnoHelper::ConvertToAWTRect(aVisRect); } } return aVisArea; @@ -1937,7 +1937,7 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName if ( pActiveWin ) { AbsoluteScreenPixelRectangle aRect = pActiveWin->GetWindowExtentsAbsolute(); - aRet <<= AWTRectangle( aRect ); + aRet <<= VCLUnoHelper::ConvertToAWTRect(aRect); } } } diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx index 97de88104b0b..cdcf5a4107f9 100644 --- a/sfx2/inc/pch/precompiled_sfx.hxx +++ b/sfx2/inc/pch/precompiled_sfx.hxx @@ -348,7 +348,6 @@ #include <svtools/sfxecode.hxx> #include <svtools/soerr.hxx> #include <svtools/svtdllapi.h> -#include <toolkit/helper/convert.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/color.hxx> #include <tools/datetime.hxx> diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 6ac8a1a62f9c..c195af87bb41 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -47,7 +47,6 @@ #include <svl/eitem.hxx> #include <svl/intitem.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <toolkit/helper/convert.hxx> using namespace ::com::sun::star; @@ -331,7 +330,7 @@ void SAL_CALL SfxStatusBarControl::paint( OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( xGraphics ); if ( pOutDev ) { - ::tools::Rectangle aRect = VCLRectangle( rOutputRectangle ); + ::tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(rOutputRectangle); UserDrawEvent aUserDrawEvent(pOutDev, aRect, pBar->GetCurItemId()); Paint( aUserDrawEvent ); } diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index d9de88c8a8d2..141332b99d0a 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -55,7 +55,6 @@ #include <vcl/timer.hxx> #include <vcl/window.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <toolkit/helper/convert.hxx> #include <tools/debug.hxx> #include <comphelper/diagnose_ex.hxx> #include <tools/fract.hxx> @@ -458,7 +457,7 @@ awt::Rectangle SAL_CALL SfxInPlaceClient_Impl::getPlacement() aRealObjArea = pEditWin->LogicToPixel(aRealObjArea); } - return AWTRectangle( aRealObjArea ); + return VCLUnoHelper::ConvertToAWTRect(aRealObjArea); } @@ -488,7 +487,7 @@ awt::Rectangle SAL_CALL SfxInPlaceClient_Impl::getClipRectangle() aRealObjArea = pEditWin->LogicToPixel(aRealObjArea); } - return AWTRectangle( aRealObjArea ); + return VCLUnoHelper::ConvertToAWTRect(aRealObjArea); } @@ -516,8 +515,8 @@ void SAL_CALL SfxInPlaceClient_Impl::changedPlacement( const awt::Rectangle& aPo // check if the change is at least one pixel in size awt::Rectangle aOldRect = getPlacement(); - tools::Rectangle aNewPixelRect = VCLRectangle( aPosRect ); - tools::Rectangle aOldPixelRect = VCLRectangle( aOldRect ); + tools::Rectangle aNewPixelRect = VCLUnoHelper::ConvertToVCLRect(aPosRect); + tools::Rectangle aOldPixelRect = VCLUnoHelper::ConvertToVCLRect(aOldRect); if ( aOldPixelRect == aNewPixelRect ) // nothing has changed return; diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 7ad3a2d6c9ef..dbf3554e2681 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -62,7 +62,7 @@ #include <comphelper/diagnose_ex.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/sequence.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <framework/titlehelper.hxx> #include <comphelper/processfactory.hxx> #include <vcl/svapp.hxx> @@ -830,9 +830,9 @@ awt::Rectangle SAL_CALL SfxBaseController::queryBorderedArea( const awt::Rectang SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) { - tools::Rectangle aTmpRect = VCLRectangle( aPreliminaryRectangle ); + tools::Rectangle aTmpRect = VCLUnoHelper::ConvertToVCLRect(aPreliminaryRectangle); m_pData->m_pViewShell->QueryObjAreaPixel( aTmpRect ); - return AWTRectangle( aTmpRect ); + return VCLUnoHelper::ConvertToAWTRect(aTmpRect); } return aPreliminaryRectangle; diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 1764d176f505..93c0b5f789d1 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -6083,7 +6083,6 @@ include/toolkit/controls/unocontrolbase.hxx include/toolkit/controls/unocontrolmodel.hxx include/toolkit/controls/unocontrols.hxx include/toolkit/helper/accessiblefactory.hxx -include/toolkit/helper/convert.hxx include/toolkit/helper/listenermultiplexer.hxx include/toolkit/helper/macros.hxx include/toolkit/helper/vclunohelper.hxx diff --git a/svtools/source/control/accessibleruler.cxx b/svtools/source/control/accessibleruler.cxx index 35cd3a92e53f..2752cf7f7d4b 100644 --- a/svtools/source/control/accessibleruler.cxx +++ b/svtools/source/control/accessibleruler.cxx @@ -21,7 +21,7 @@ #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <comphelper/accessibleeventnotifier.hxx> #include <cppuhelper/supportsservice.hxx> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <utility> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> @@ -70,8 +70,9 @@ uno::Reference< XAccessibleContext > SAL_CALL SvtRulerAccessible::getAccessibleC sal_Bool SAL_CALL SvtRulerAccessible::containsPoint( const awt::Point& rPoint ) { // no guard -> done in getBounds() -// return GetBoundingBox().IsInside( VCLPoint( rPoint ) ); - return tools::Rectangle( Point( 0, 0 ), GetBoundingBox().GetSize() ).Contains( VCLPoint( rPoint ) ); +// return GetBoundingBox().IsInside( VCLUnoHelper::ConvertToVCLPoint( rPoint ) ); + return tools::Rectangle(Point(0, 0), GetBoundingBox().GetSize()) + .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); } uno::Reference< XAccessible > SAL_CALL SvtRulerAccessible::getAccessibleAtPoint( const awt::Point& ) @@ -85,25 +86,25 @@ uno::Reference< XAccessible > SAL_CALL SvtRulerAccessible::getAccessibleAtPoint( awt::Rectangle SAL_CALL SvtRulerAccessible::getBounds() { // no guard -> done in GetBoundingBox() - return AWTRectangle( GetBoundingBox() ); + return VCLUnoHelper::ConvertToAWTRect(GetBoundingBox()); } awt::Point SAL_CALL SvtRulerAccessible::getLocation() { // no guard -> done in GetBoundingBox() - return AWTPoint( GetBoundingBox().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); } awt::Point SAL_CALL SvtRulerAccessible::getLocationOnScreen() { // no guard -> done in GetBoundingBoxOnScreen() - return AWTPoint( GetBoundingBoxOnScreen().TopLeft() ); + return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL SvtRulerAccessible::getSize() { // no guard -> done in GetBoundingBox() - return AWTSize( GetBoundingBox().GetSize() ); + return VCLUnoHelper::ConvertToAWTSize(GetBoundingBox().GetSize()); } //===== XAccessibleContext ================================================== diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index 81a4ac0344c5..c339c0a6c4f9 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -21,7 +21,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <utility> -e ... etc. - the rest is truncated