sc/source/ui/Accessibility/AccessibleCell.cxx | 4 sc/source/ui/Accessibility/AccessibleDocument.cxx | 6 - sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 4 sc/source/ui/Accessibility/AccessibleEditObject.cxx | 10 - sc/source/ui/Accessibility/AccessiblePageHeader.cxx | 4 sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx | 4 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx | 6 - sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx | 6 - sc/source/ui/Accessibility/AccessiblePreviewTable.cxx | 4 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx | 4 sc/source/ui/inc/AccessibleCell.hxx | 4 sc/source/ui/inc/AccessibleContextBase.hxx | 4 sc/source/ui/inc/AccessibleDocument.hxx | 6 - sc/source/ui/inc/AccessibleDocumentPagePreview.hxx | 4 sc/source/ui/inc/AccessibleEditObject.hxx | 8 - sc/source/ui/inc/AccessiblePageHeader.hxx | 4 sc/source/ui/inc/AccessiblePageHeaderArea.hxx | 4 sc/source/ui/inc/AccessiblePreviewCell.hxx | 4 sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx | 4 sc/source/ui/inc/AccessiblePreviewTable.hxx | 4 sc/source/ui/inc/AccessibleSpreadsheet.hxx | 4 sfx2/source/control/thumbnailviewacc.cxx | 36 ------ sfx2/source/control/thumbnailviewacc.hxx | 1 svx/source/dialog/weldeditview.cxx | 62 ++--------- 24 files changed, 63 insertions(+), 138 deletions(-)
New commits: commit 3a51a200e552f240d4242ccf32d0421a424306ab Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Apr 30 12:29:59 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu May 1 09:52:23 2025 +0200 svx a11y: Use OAccessibleComponentHelper for WeldEditAccessible This allows to reuse some of the XAccessibleComponent logic already implemented in the new base class. WeldEditAccessible::getBounds implements what is needed to implement OAccessibleComponentHelper::implGetBounds, so rename it - and drop the SolarMutexGuard at the beginning of the method, as the base class takes care of that when calling the method. For now, keep the custom implementations for XAccessibleEventBroadcaster methods XAccessibleEventBroadcaster::addAccessibleEventListener and XAccessibleEventBroadcaster::removeAccessibleEventListener which forward the task to the AccessibleTextHelper in use. (This will be further change in upcoming commits.) Rename WeldEditAccessible::ClearWin to WeldEditAccessible::dispose, let it override the base class implementation and call the base class implementation at the end. Add a check and return early if the object has already been disposed. Without this, CppunitTest_starmath_qa_cppunit was seen triggering a segfault, because the object now first got disposed in the SalInstanceDrawingArea dtor: 1 WeldEditAccessible::dispose weldeditview.cxx 549 0x7f2472cb63c3 2 SalInstanceDrawingArea::~SalInstanceDrawingArea salvtables.cxx 6466 0x7f247d9eb528 3 SalInstanceDrawingArea::~SalInstanceDrawingArea salvtables.cxx 6442 0x7f247d9eb600 4 SalInstanceDrawingArea::~SalInstanceDrawingArea salvtables.cxx 6442 0x7f247d9eb689 5 std::default_delete<weld::DrawingArea>::operator() unique_ptr.h 93 0x7f247765c69b 6 std::unique_ptr<weld::DrawingArea, std::default_delete<weld::DrawingArea>>::~unique_ptr unique_ptr.h 399 0x7f247765c60f 7 weld::CustomWeld::~CustomWeld customweld.hxx 150 0x7f247765c5c9 8 std::default_delete<weld::CustomWeld>::operator() unique_ptr.h 93 0x7f247765c507 9 std::__uniq_ptr_impl<weld::CustomWeld, std::default_delete<weld::CustomWeld>>::reset unique_ptr.h 205 0x7f2477674318 10 std::unique_ptr<weld::CustomWeld, std::default_delete<weld::CustomWeld>>::reset unique_ptr.h 504 0x7f2477672f8d 11 SmEditWindow::DeleteEditView edit.cxx 857 0x7f247767013a 12 SmEditWindow::~SmEditWindow edit.cxx 148 0x7f2477670059 13 o3tl::default_delete<SmEditWindow>::operator() deleter.hxx 46 0x7f2477728e57 14 std::__uniq_ptr_impl<SmEditWindow, o3tl::default_delete<SmEditWindow>>::reset unique_ptr.h 205 0x7f2477729008 15 std::unique_ptr<SmEditWindow, o3tl::default_delete<SmEditWindow>>::reset unique_ptr.h 504 0x7f24777224cd 16 SmCmdBoxWindow::dispose view.cxx 1016 0x7f247771d23b 17 VclReferenceBase::disposeOnce vclreferencebase.cxx 38 0x7f247d4f3163 18 VclPtr<SmCmdBoxWindow>::disposeAndClear vclptr.hxx 207 0x7f24775d6472 19 (anonymous namespace)::Test::tearDown test_starmath.cxx 138 0x7f24775cb4c0 20 CppUnit::TestCaller<(anonymous namespace)::Test>::tearDown TestCaller.h 185 0x7f24775d543a [...] And later on, WeldEditAccessible::dispose would be called again from the WeldEditView dtor (which was previously calling WeldEditAccessible::ClearWin). No change in behavior intended or observed in a quick test with the qt6 VCL plugin and Base's "Tools" -> "SQL" dialog, where a WeldEditView is used for the "Command to execute" edit view. (Accerciser still highlights the correct area when selecting the object or its paragraph children.) Change-Id: I9864a35d53bdbd2332869780c097896102b9523b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184833 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 1303fb5be2bf..86d64454e0b4 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -23,11 +23,9 @@ #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> -#include <com/sun/star/accessibility/XAccessibleComponent.hpp> -#include <com/sun/star/accessibility/XAccessibleContext2.hpp> -#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <comphelper/accessiblecomponenthelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/processor2d/processor2dtools.hxx> @@ -510,13 +508,9 @@ public: }; } -typedef cppu::WeakImplHelper<css::lang::XServiceInfo, css::accessibility::XAccessible, - css::accessibility::XAccessibleComponent, - css::accessibility::XAccessibleContext2, - css::accessibility::XAccessibleEventBroadcaster> - WeldEditAccessibleBaseClass; - -class WeldEditAccessible : public WeldEditAccessibleBaseClass +class WeldEditAccessible + : public cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper, + css::accessibility::XAccessible, css::lang::XServiceInfo> { weld::CustomWidgetController* m_pController; EditEngine* m_pEditEngine; @@ -545,8 +539,11 @@ public: EditEngine* GetEditEngine() { return m_pEditEngine; } EditView* GetEditView() { return m_pEditView; } - void ClearWin() + void SAL_CALL dispose() override { + if (!isAlive()) + return; + // remove handler before current object gets destroyed // (avoid handler being called for already dead object) m_pEditEngine->SetNotifyHdl(Link<EENotify&, void>()); @@ -562,6 +559,8 @@ public: //! (e.g. the one set by the 'SetEventSource' call) m_xTextHelper->Dispose(); m_xTextHelper.reset(); + + OAccessibleComponentHelper::dispose(); } // XAccessible @@ -572,17 +571,6 @@ public: } // XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point& rPoint) override - { - //! the arguments coordinates are relative to the current window ! - //! Thus the top left-point is (0, 0) - SolarMutexGuard aGuard; - if (!m_pController) - throw css::uno::RuntimeException(); - - Size aSz(m_pController->GetOutputSizePixel()); - return rPoint.X >= 0 && rPoint.Y >= 0 && rPoint.X < aSz.Width() && rPoint.Y < aSz.Height(); - } virtual css::uno::Reference<css::accessibility::XAccessible> SAL_CALL getAccessibleAtPoint(const css::awt::Point& rPoint) override @@ -594,9 +582,8 @@ public: return m_xTextHelper->GetAt(rPoint); } - virtual css::awt::Rectangle SAL_CALL getBounds() override + virtual css::awt::Rectangle implGetBounds() override { - SolarMutexGuard aGuard; if (!m_pController) throw css::uno::RuntimeException(); @@ -612,21 +599,6 @@ public: return aRet; } - virtual css::awt::Point SAL_CALL getLocation() override - { - SolarMutexGuard aGuard; - if (!m_pController) - throw css::uno::RuntimeException(); - - const css::awt::Rectangle aRect(getBounds()); - css::awt::Point aRet; - - aRet.X = aRect.X; - aRet.Y = aRect.Y; - - return aRet; - } - virtual css::awt::Point SAL_CALL getLocationOnScreen() override { SolarMutexGuard aGuard; @@ -645,16 +617,6 @@ public: return aScreenLoc; } - virtual css::awt::Size SAL_CALL getSize() override - { - SolarMutexGuard aGuard; - if (!m_pController) - throw css::uno::RuntimeException(); - - Size aSz(m_pController->GetOutputSizePixel()); - return css::awt::Size(aSz.Width(), aSz.Height()); - } - virtual void SAL_CALL grabFocus() override { m_pController->GrabFocus(); } virtual sal_Int32 SAL_CALL getForeground() override @@ -879,7 +841,7 @@ WeldEditView::~WeldEditView() #if !ENABLE_WASM_STRIP_ACCESSIBILITY if (m_xAccessible.is()) { - m_xAccessible->ClearWin(); // make Accessible nonfunctional + m_xAccessible->dispose(); m_xAccessible.clear(); } #endif commit 2c25cabba1d69b0238cf06e03637d23e33dc0c56 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Apr 30 11:38:46 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu May 1 09:52:16 2025 +0200 sfx2 a11y: Drop ThumbnailViewAcc::getAccessibleIndexInParent The base class implementation in OAccessibleComponentHelper::getAccessibleIndexInParent basically implements the same logic already. Change-Id: Ib2106fd6ace58c016cb0d7c3eb8b98a724af34fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184832 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx index cd29f0e94836..268538b18f23 100644 --- a/sfx2/source/control/thumbnailviewacc.cxx +++ b/sfx2/source/control/thumbnailviewacc.cxx @@ -83,42 +83,6 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getAcces return mpThumbnailView->GetDrawingArea()->get_accessible_parent(); } -sal_Int64 SAL_CALL ThumbnailViewAcc::getAccessibleIndexInParent() -{ - ThrowIfDisposed(); - const SolarMutexGuard aSolarGuard; - - // -1 for child not found/no parent (according to specification) - sal_Int64 nRet = -1; - - uno::Reference<accessibility::XAccessible> xParent(getAccessibleParent()); - if (!xParent) - return nRet; - - try - { - uno::Reference<accessibility::XAccessibleContext> xParentContext(xParent->getAccessibleContext()); - - // iterate over parent's children and search for this object - if ( xParentContext.is() ) - { - sal_Int64 nChildCount = xParentContext->getAccessibleChildCount(); - for ( sal_Int64 nChild = 0; ( nChild < nChildCount ) && ( -1 == nRet ); ++nChild ) - { - uno::Reference<XAccessible> xChild(xParentContext->getAccessibleChild(nChild)); - if ( xChild.get() == this ) - nRet = nChild; - } - } - } - catch (const uno::Exception&) - { - TOOLS_WARN_EXCEPTION( "sfx", "ThumbnailViewAcc::getAccessibleIndexInParent" ); - } - - return nRet; -} - sal_Int16 SAL_CALL ThumbnailViewAcc::getAccessibleRole() { ThrowIfDisposed(); diff --git a/sfx2/source/control/thumbnailviewacc.hxx b/sfx2/source/control/thumbnailviewacc.hxx index 5b85249d6489..318a6f671d51 100644 --- a/sfx2/source/control/thumbnailviewacc.hxx +++ b/sfx2/source/control/thumbnailviewacc.hxx @@ -63,7 +63,6 @@ public: virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; - virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; commit f5d607b4ffb031879bd493c59a453fb4740a07e1 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Apr 30 11:05:47 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu May 1 09:52:09 2025 +0200 sc a11y: Make GetBoundingBoxOnScreen::GetBoundingBox{,OnScreen} non-const These methods are almost exclusively used to implement the non-const OAccessibleCompomentHelper::implGetBounds and OAccessibleComponentHelper::getLocationOnScreen overrides. Making them non-const allows dropping some const_casts in some of the subclass implementations. Change-Id: Ia26858c1211629c4a336919c8e9d4d0c70e73097 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184831 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 35288daa99fc..8ac122e33509 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -147,7 +147,7 @@ void SAL_CALL ScAccessibleCell::grabFocus( ) } } -AbsoluteScreenPixelRectangle ScAccessibleCell::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessibleCell::GetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aCellRect(GetBoundingBox()); if (mpViewShell) @@ -162,7 +162,7 @@ AbsoluteScreenPixelRectangle ScAccessibleCell::GetBoundingBoxOnScreen() const return aCellRect; } -tools::Rectangle ScAccessibleCell::GetBoundingBox() const +tools::Rectangle ScAccessibleCell::GetBoundingBox() { tools::Rectangle aCellRect; if (mpViewShell) diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index d1bd67a7686e..ea3ddbf2da1f 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -1930,7 +1930,7 @@ uno::Sequence<sal_Int8> SAL_CALL ///===== IAccessibleViewForwarder ======================================== -tools::Rectangle ScAccessibleDocument::GetVisibleArea_Impl() const +tools::Rectangle ScAccessibleDocument::GetVisibleArea_Impl() { tools::Rectangle aVisRect(GetBoundingBox()); @@ -2008,7 +2008,7 @@ OUString return sName; } -AbsoluteScreenPixelRectangle ScAccessibleDocument::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessibleDocument::GetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aRect; if (mpViewShell) @@ -2020,7 +2020,7 @@ AbsoluteScreenPixelRectangle ScAccessibleDocument::GetBoundingBoxOnScreen() cons return aRect; } -tools::Rectangle ScAccessibleDocument::GetBoundingBox() const +tools::Rectangle ScAccessibleDocument::GetBoundingBox() { tools::Rectangle aRect; if (mpViewShell) diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 5b3248ba079b..32f74e8bd240 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -1456,7 +1456,7 @@ OUString ScAccessibleDocumentPagePreview::createAccessibleName() return sName; } -AbsoluteScreenPixelRectangle ScAccessibleDocumentPagePreview::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessibleDocumentPagePreview::GetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aRect; if (mpViewShell) @@ -1468,7 +1468,7 @@ AbsoluteScreenPixelRectangle ScAccessibleDocumentPagePreview::GetBoundingBoxOnSc return aRect; } -tools::Rectangle ScAccessibleDocumentPagePreview::GetBoundingBox() const +tools::Rectangle ScAccessibleDocumentPagePreview::GetBoundingBox() { tools::Rectangle aRect; if (mpViewShell) diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index cccae7991bf8..116aa043c329 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -183,7 +183,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleEditObject::getAccessibleAtPo return xRet; } -AbsoluteScreenPixelRectangle ScAccessibleEditObject::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessibleEditObject::GetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aScreenBounds; @@ -211,7 +211,7 @@ AbsoluteScreenPixelRectangle ScAccessibleEditObject::GetBoundingBoxOnScreen() co return aScreenBounds; } -tools::Rectangle ScAccessibleEditObject::GetBoundingBox() const +tools::Rectangle ScAccessibleEditObject::GetBoundingBox() { tools::Rectangle aBounds( GetBoundingBoxOnScreen() ); @@ -531,7 +531,7 @@ uno::Reference< XAccessibleRelationSet > ScAccessibleEditObject::getAccessibleRe return uno::Reference< XAccessibleRelationSet >(); } -AbsoluteScreenPixelRectangle ScAccessibleEditControlObject::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessibleEditControlObject::GetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aScreenBounds; @@ -544,11 +544,11 @@ AbsoluteScreenPixelRectangle ScAccessibleEditControlObject::GetBoundingBoxOnScre return aScreenBounds; } -tools::Rectangle ScAccessibleEditControlObject::GetBoundingBox() const +tools::Rectangle ScAccessibleEditControlObject::GetBoundingBox() { tools::Rectangle aBounds( GetBoundingBoxOnScreen() ); - uno::Reference< XAccessibleContext > xContext(const_cast<ScAccessibleEditControlObject*>(this)->getAccessibleContext()); + uno::Reference<XAccessibleContext> xContext = getAccessibleContext(); if ( xContext.is() ) { uno::Reference< XAccessible > xParent( xContext->getAccessibleParent() ); diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index beb373429475..70947036669d 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -290,7 +290,7 @@ OUString ScAccessiblePageHeader::createAccessibleName() return sName.replaceFirst("%1", ScResId(SCSTR_UNKNOWN)); } -AbsoluteScreenPixelRectangle ScAccessiblePageHeader::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessiblePageHeader::GetBoundingBoxOnScreen() { tools::Rectangle aCellRect(GetBoundingBox()); if (mpViewShell) @@ -305,7 +305,7 @@ AbsoluteScreenPixelRectangle ScAccessiblePageHeader::GetBoundingBoxOnScreen() co return AbsoluteScreenPixelRectangle(aCellRect); } -tools::Rectangle ScAccessiblePageHeader::GetBoundingBox() const +tools::Rectangle ScAccessiblePageHeader::GetBoundingBox() { tools::Rectangle aRect; if (mpViewShell) diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index c807a01661dd..cde9d59a6550 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -219,7 +219,7 @@ OUString ScAccessiblePageHeaderArea::createAccessibleName() return sName; } -AbsoluteScreenPixelRectangle ScAccessiblePageHeaderArea::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessiblePageHeaderArea::GetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aRect; if (mxParent.is()) @@ -239,7 +239,7 @@ AbsoluteScreenPixelRectangle ScAccessiblePageHeaderArea::GetBoundingBoxOnScreen( return aRect; } -tools::Rectangle ScAccessiblePageHeaderArea::GetBoundingBox() const +tools::Rectangle ScAccessiblePageHeaderArea::GetBoundingBox() { tools::Rectangle aRect; if (mxParent.is()) diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index 469ecab7ca85..12b553ea56b0 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -191,7 +191,7 @@ uno::Sequence<sal_Int8> SAL_CALL //==== internal ========================================================= -AbsoluteScreenPixelRectangle ScAccessiblePreviewCell::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessiblePreviewCell::GetBoundingBoxOnScreen() { tools::Rectangle aCellRect; if (mpViewShell) @@ -207,13 +207,13 @@ AbsoluteScreenPixelRectangle ScAccessiblePreviewCell::GetBoundingBoxOnScreen() c return AbsoluteScreenPixelRectangle(aCellRect); } -tools::Rectangle ScAccessiblePreviewCell::GetBoundingBox() const +tools::Rectangle ScAccessiblePreviewCell::GetBoundingBox() { tools::Rectangle aCellRect; if (mpViewShell) { mpViewShell->GetLocationData().GetCellPosition( maCellAddress, aCellRect ); - uno::Reference<XAccessible> xAccParent = const_cast<ScAccessiblePreviewCell*>(this)->getAccessibleParent(); + uno::Reference<XAccessible> xAccParent = getAccessibleParent(); if (xAccParent.is()) { uno::Reference<XAccessibleContext> xAccParentContext = xAccParent->getAccessibleContext(); diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index 843e61f611e1..41128a36d0ed 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -283,7 +283,7 @@ uno::Sequence<sal_Int8> SAL_CALL //==== internal ========================================================= -AbsoluteScreenPixelRectangle ScAccessiblePreviewHeaderCell::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessiblePreviewHeaderCell::GetBoundingBoxOnScreen() { tools::Rectangle aCellRect; @@ -309,7 +309,7 @@ AbsoluteScreenPixelRectangle ScAccessiblePreviewHeaderCell::GetBoundingBoxOnScre return AbsoluteScreenPixelRectangle(aCellRect); } -tools::Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBox() const +tools::Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBox() { FillTableInfo(); @@ -319,7 +319,7 @@ tools::Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBox() const const ScPreviewColRowInfo& rRowInfo = mpTableInfo->GetRowInfo()[maCellPos.Row()]; tools::Rectangle aCellRect( rColInfo.nPixelStart, rRowInfo.nPixelStart, rColInfo.nPixelEnd, rRowInfo.nPixelEnd ); - uno::Reference<XAccessible> xAccParent = const_cast<ScAccessiblePreviewHeaderCell*>(this)->getAccessibleParent(); + uno::Reference<XAccessible> xAccParent = getAccessibleParent(); if (xAccParent.is()) { uno::Reference<XAccessibleContext> xAccParentContext = xAccParent->getAccessibleContext(); diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index f1c788646736..30acfbbd086e 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -574,7 +574,7 @@ OUString ScAccessiblePreviewTable::createAccessibleName() return sName; } -AbsoluteScreenPixelRectangle ScAccessiblePreviewTable::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessiblePreviewTable::GetBoundingBoxOnScreen() { tools::Rectangle aCellRect(GetBoundingBox()); if (mpViewShell) @@ -589,7 +589,7 @@ AbsoluteScreenPixelRectangle ScAccessiblePreviewTable::GetBoundingBoxOnScreen() return AbsoluteScreenPixelRectangle(aCellRect); } -tools::Rectangle ScAccessiblePreviewTable::GetBoundingBox() const +tools::Rectangle ScAccessiblePreviewTable::GetBoundingBox() { FillTableInfo(); diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index b3198242eaf1..3e00f653cd5a 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -1318,7 +1318,7 @@ uno::Sequence<sal_Int8> SAL_CALL //==== internal ========================================================= -AbsoluteScreenPixelRectangle ScAccessibleSpreadsheet::GetBoundingBoxOnScreen() const +AbsoluteScreenPixelRectangle ScAccessibleSpreadsheet::GetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aRect; if (mpViewShell) @@ -1330,7 +1330,7 @@ AbsoluteScreenPixelRectangle ScAccessibleSpreadsheet::GetBoundingBoxOnScreen() c return aRect; } -tools::Rectangle ScAccessibleSpreadsheet::GetBoundingBox() const +tools::Rectangle ScAccessibleSpreadsheet::GetBoundingBox() { tools::Rectangle aRect; if (mpViewShell) diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx index 69764db893b5..0df06614d38f 100644 --- a/sc/source/ui/inc/AccessibleCell.hxx +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -91,10 +91,10 @@ public: protected: /// Return the object's current bounding box relative to the desktop. - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; /// Return the object's current bounding box relative to the parent object. - virtual tools::Rectangle GetBoundingBox() const override; + virtual tools::Rectangle GetBoundingBox() override; public: ///===== XAccessibleContext ============================================== diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx b/sc/source/ui/inc/AccessibleContextBase.hxx index 526727e4a242..db795a0bc122 100644 --- a/sc/source/ui/inc/AccessibleContextBase.hxx +++ b/sc/source/ui/inc/AccessibleContextBase.hxx @@ -147,12 +147,12 @@ protected: /// Return the object's current bounding box relative to the desktop. /// /// @throws css::uno::RuntimeException - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const = 0; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() = 0; /// Return the object's current bounding box relative to the parent object. /// /// @throws css::uno::RuntimeException - virtual tools::Rectangle GetBoundingBox() const = 0; + virtual tools::Rectangle GetBoundingBox() = 0; public: /// Calls all listeners to notify them about the change. diff --git a/sc/source/ui/inc/AccessibleDocument.hxx b/sc/source/ui/inc/AccessibleDocument.hxx index 7ef7882efa79..707724d31cb6 100644 --- a/sc/source/ui/inc/AccessibleDocument.hxx +++ b/sc/source/ui/inc/AccessibleDocument.hxx @@ -217,10 +217,10 @@ protected: createAccessibleName() override; /// Return the object's current bounding box relative to the desktop. - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; /// Return the object's current bounding box relative to the parent object. - virtual tools::Rectangle GetBoundingBox() const override; + virtual tools::Rectangle GetBoundingBox() override; private: ScTabViewShell* mpViewShell; @@ -248,7 +248,7 @@ private: OUString GetCurrentCellName() const; static const OUString & GetCurrentCellDescription(); - tools::Rectangle GetVisibleArea_Impl() const; + tools::Rectangle GetVisibleArea_Impl(); public: ScDocument *GetDocument() const ; ScAddress GetCurCellAddress() const; diff --git a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx index 956825a2dc20..8b5284e52bd7 100644 --- a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx +++ b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx @@ -106,11 +106,11 @@ protected: public: // needed in ScShapeChildren /// Return the object's current bounding box relative to the desktop. - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; protected: /// Return the object's current bounding box relative to the parent object. - virtual tools::Rectangle GetBoundingBox() const override; + virtual tools::Rectangle GetBoundingBox() override; private: ScPreviewShell* mpViewShell; diff --git a/sc/source/ui/inc/AccessibleEditObject.hxx b/sc/source/ui/inc/AccessibleEditObject.hxx index 159fa2eeb77e..451d28ee71ab 100644 --- a/sc/source/ui/inc/AccessibleEditObject.hxx +++ b/sc/source/ui/inc/AccessibleEditObject.hxx @@ -94,10 +94,10 @@ public: protected: /// Return the object's current bounding box relative to the desktop. - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; /// Return the object's current bounding box relative to the parent object. - virtual tools::Rectangle GetBoundingBox() const override; + virtual tools::Rectangle GetBoundingBox() override; public: ///===== XAccessibleContext ============================================== @@ -198,10 +198,10 @@ private: protected: /// Return the object's current bounding box relative to the desktop. - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; /// Return the object's current bounding box relative to the parent object. - virtual tools::Rectangle GetBoundingBox() const override; + virtual tools::Rectangle GetBoundingBox() override; public: ScAccessibleEditControlObject(weld::CustomWidgetController* pController, EditObjectType eObjectType) diff --git a/sc/source/ui/inc/AccessiblePageHeader.hxx b/sc/source/ui/inc/AccessiblePageHeader.hxx index d08db8dacdb7..ddba68248cb5 100644 --- a/sc/source/ui/inc/AccessiblePageHeader.hxx +++ b/sc/source/ui/inc/AccessiblePageHeader.hxx @@ -69,8 +69,8 @@ protected: virtual OUString createAccessibleDescription() override; virtual OUString createAccessibleName() override; - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; - virtual tools::Rectangle GetBoundingBox() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; + virtual tools::Rectangle GetBoundingBox() override; private: ScPreviewShell* mpViewShell; diff --git a/sc/source/ui/inc/AccessiblePageHeaderArea.hxx b/sc/source/ui/inc/AccessiblePageHeaderArea.hxx index a1e813ec67e0..75d1b12b46c6 100644 --- a/sc/source/ui/inc/AccessiblePageHeaderArea.hxx +++ b/sc/source/ui/inc/AccessiblePageHeaderArea.hxx @@ -97,8 +97,8 @@ protected: virtual OUString createAccessibleDescription() override; virtual OUString createAccessibleName() override; - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; - virtual tools::Rectangle GetBoundingBox() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; + virtual tools::Rectangle GetBoundingBox() override; private: std::unique_ptr<EditTextObject> mpEditObj; diff --git a/sc/source/ui/inc/AccessiblePreviewCell.hxx b/sc/source/ui/inc/AccessiblePreviewCell.hxx index b40b65242df3..9c128c844f4b 100644 --- a/sc/source/ui/inc/AccessiblePreviewCell.hxx +++ b/sc/source/ui/inc/AccessiblePreviewCell.hxx @@ -77,8 +77,8 @@ public: getImplementationId() override; protected: - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; - virtual tools::Rectangle GetBoundingBox() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; + virtual tools::Rectangle GetBoundingBox() override; private: ScPreviewShell* mpViewShell; diff --git a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx index f3317b41331b..01b1171120cd 100644 --- a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx +++ b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx @@ -107,8 +107,8 @@ protected: virtual OUString createAccessibleDescription() override; virtual OUString createAccessibleName() override; - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; - virtual tools::Rectangle GetBoundingBox() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; + virtual tools::Rectangle GetBoundingBox() override; private: ScPreviewShell* mpViewShell; diff --git a/sc/source/ui/inc/AccessiblePreviewTable.hxx b/sc/source/ui/inc/AccessiblePreviewTable.hxx index 34fa7a8d3643..49f9b5183c0a 100644 --- a/sc/source/ui/inc/AccessiblePreviewTable.hxx +++ b/sc/source/ui/inc/AccessiblePreviewTable.hxx @@ -116,8 +116,8 @@ protected: virtual OUString createAccessibleDescription() override; virtual OUString createAccessibleName() override; - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; - virtual tools::Rectangle GetBoundingBox() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; + virtual tools::Rectangle GetBoundingBox() override; private: ScPreviewShell* mpViewShell; diff --git a/sc/source/ui/inc/AccessibleSpreadsheet.hxx b/sc/source/ui/inc/AccessibleSpreadsheet.hxx index d1d906dda622..7a966905331d 100644 --- a/sc/source/ui/inc/AccessibleSpreadsheet.hxx +++ b/sc/source/ui/inc/AccessibleSpreadsheet.hxx @@ -206,10 +206,10 @@ private: virtual sal_Bool SAL_CALL unselectColumn( sal_Int32 column ) override; /// Return the object's current bounding box relative to the desktop. - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const override; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; /// Return the object's current bounding box relative to the parent object. - virtual tools::Rectangle GetBoundingBox() const override; + virtual tools::Rectangle GetBoundingBox() override; bool IsDefunc(sal_Int64 nParentStates); bool IsEditable();