diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-10 15:05:22 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-11 06:44:48 +0200 |
commit | 2fdee9fd60bc4bb61f773fa1f766e84f4ee0dae3 (patch) | |
tree | 4a541f076f822fc11d26001a16174976b2853da3 /accessibility | |
parent | f111fbf5d508c8215615f037d7e1c1f563812a13 (diff) |
Unify/Port to use VCLUnoHelper for AWT <-> VCL conversions
Following
Change-Id: Id48f81deb05aee2026509037f7d14575735e5be0
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Jul 10 14:49:03 2024 +0200
VCLUnoHelper: Align AWT <-> VCL helpers with convert.hxx impl
, port all uses of the helper functions defined in
`include/toolkit/helper/convert.hxx` to use the
`VCLUnoHelper` equivalents instead, to unify usage
and avoid duplication.
Drop `include/toolkit/helper/convert.hxx` now that
it's unused.
Change-Id: I22695a93e40e47bb2b14d191a2e0a4eb7c856895
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170317
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'accessibility')
33 files changed, 148 insertions, 129 deletions
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 ) |