diff options
author | Sascha Ballach <sab@openoffice.org> | 2002-05-24 14:09:52 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2002-05-24 14:09:52 +0000 |
commit | dbf9380bf3c07eb7301f8873584bfa6eb61cbeab (patch) | |
tree | f13187ddda63c38760b372231df4fb7094bec005 | |
parent | 44913d97cb258a18baff522add40ed730ac4aef2 (diff) |
#95584#; make GetBoundingBox a const method
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCell.cxx | 23 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx | 35 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessibleCell.hxx | 13 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessibleSpreadsheet.hxx | 19 |
4 files changed, 62 insertions, 28 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 0ef723aab604..4139be01b5d7 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleCell.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: thb $ $Date: 2002-05-17 19:04:44 $ + * last change: $Author: sab $ $Date: 2002-05-24 15:07:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,6 +71,9 @@ #ifndef _SC_ACCESSIBLETEXT_HXX #include "AccessibleText.hxx" #endif +#ifndef _SC_ACCESSIBLEDOCUMENT_HXX +#include "AccessibleDocument.hxx" +#endif #ifndef SC_TABVWSH_HXX #include "tabvwsh.hxx" #endif @@ -137,12 +140,14 @@ ScAccessibleCell::ScAccessibleCell( ScTabViewShell* pViewShell, ScAddress& rCellAddress, sal_Int32 nIndex, - ScSplitPos eSplitPos) + ScSplitPos eSplitPos, + ScAccessibleDocument* pAccDoc) : ScAccessibleCellBase(rxParent, GetDocument(pViewShell), rCellAddress, nIndex), mpViewShell(pViewShell), meSplitPos(eSplitPos), - mpTextHelper(NULL) + mpTextHelper(NULL), + mpAccDoc(pAccDoc) { } @@ -193,7 +198,7 @@ void SAL_CALL ScAccessibleCell::grabFocus( ) } } -Rectangle ScAccessibleCell::GetBoundingBoxOnScreen(void) +Rectangle ScAccessibleCell::GetBoundingBoxOnScreen(void) const throw (uno::RuntimeException) { Rectangle aCellRect(GetBoundingBox()); @@ -210,7 +215,7 @@ Rectangle ScAccessibleCell::GetBoundingBoxOnScreen(void) return aCellRect; } -Rectangle ScAccessibleCell::GetBoundingBox(void) +Rectangle ScAccessibleCell::GetBoundingBox(void) const throw (uno::RuntimeException) { Rectangle aCellRect; @@ -297,7 +302,11 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL throw (uno::RuntimeException) { ScUnoGuard aGuard; - utl::AccessibleRelationSetHelper* pRelationSet = new utl::AccessibleRelationSetHelper(); + utl::AccessibleRelationSetHelper* pRelationSet = NULL; + if (mpAccDoc) + pRelationSet = mpAccDoc->GetRelationSet(&maCellAddress); + if (!pRelationSet) + pRelationSet = new utl::AccessibleRelationSetHelper(); FillDependends(pRelationSet); FillPrecedents(pRelationSet); return pRelationSet; diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index c67b072e6ff2..35588e1162de 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleSpreadsheet.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: sab $ $Date: 2002-04-19 18:14:00 $ + * last change: $Author: sab $ $Date: 2002-05-24 15:09:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,6 +67,9 @@ #ifndef _SC_ACCESSIBLECELL_HXX #include "AccessibleCell.hxx" #endif +#ifndef _SC_ACCESSIBLEDOCUMENT_HXX +#include "AccessibleDocument.hxx" +#endif #ifndef SC_TABVWSH_HXX #include "tabvwsh.hxx" #endif @@ -114,19 +117,20 @@ using namespace ::drafts::com::sun::star::accessibility; //===== internal ============================================================ ScAccessibleSpreadsheet::ScAccessibleSpreadsheet( - const uno::Reference<XAccessible>& rxParent, + ScAccessibleDocument* pAccDoc, ScTabViewShell* pViewShell, sal_uInt16 nTab, ScSplitPos eSplitPos) : - ScAccessibleTableBase (rxParent, GetDocument(pViewShell), + ScAccessibleTableBase (pAccDoc, GetDocument(pViewShell), ScRange(ScAddress(0, 0, nTab),ScAddress(MAXCOL, MAXROW, nTab))), mpViewShell(pViewShell), mpMarkedRanges(NULL), mpSortedMarkedCells(NULL), maVisCells(GetVisCells(GetVisArea(pViewShell, eSplitPos))), meSplitPos(eSplitPos), - mbHasSelection(sal_False) + mbHasSelection(sal_False), + mpAccDoc(pAccDoc) { if (pViewShell) { @@ -235,7 +239,9 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint else mbDelIns = sal_False; } - else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + // commented out, because to use a ModelChangeEvent is not the right way + // at the moment there is no way, but the Java/Gnome Api should be extended sometime +/* else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) { if (mpViewShell) { @@ -252,7 +258,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint CommitTableModelChange(aNewPos.Top(), aNewPos.Left(), aNewPos.Bottom(), aNewPos.Right(), AccessibleTableModelChangeType::UPDATE); } - } + }*/ } else if (rHint.ISA( ScUpdateRefHint )) { @@ -369,7 +375,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleCel ScUnoGuard aGuard; ScAddress aCellAddress(static_cast<sal_uInt16>(maRange.aStart.Col() + nColumn), static_cast<sal_uInt16>(maRange.aStart.Row() + nRow), maRange.aStart.Tab()); - ScAccessibleCell* pAccessibleCell = new ScAccessibleCell(this, mpViewShell, aCellAddress, getAccessibleIndex(nRow, nColumn), meSplitPos); + ScAccessibleCell* pAccessibleCell = new ScAccessibleCell(this, mpViewShell, aCellAddress, getAccessibleIndex(nRow, nColumn), meSplitPos, mpAccDoc); uno::Reference < XAccessible > xAccessible = pAccessibleCell; pAccessibleCell->Init(); return xAccessible; @@ -418,6 +424,15 @@ void SAL_CALL ScAccessibleSpreadsheet::grabFocus( ) //===== XAccessibleContext ============================================== +uno::Reference<XAccessibleRelationSet> SAL_CALL ScAccessibleSpreadsheet::getAccessibleRelationSet(void) + throw (::com::sun::star::uno::RuntimeException) +{ + utl::AccessibleRelationSetHelper* pRelationSet = NULL; + if(mpAccDoc) + pRelationSet = mpAccDoc->GetRelationSet(NULL); + return pRelationSet; +} + uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleSpreadsheet::getAccessibleStateSet(void) throw (uno::RuntimeException) @@ -645,7 +660,7 @@ uno::Sequence<sal_Int8> SAL_CALL //==== internal ========================================================= -Rectangle ScAccessibleSpreadsheet::GetBoundingBoxOnScreen() +Rectangle ScAccessibleSpreadsheet::GetBoundingBoxOnScreen() const throw (uno::RuntimeException) { Rectangle aRect; @@ -658,7 +673,7 @@ Rectangle ScAccessibleSpreadsheet::GetBoundingBoxOnScreen() return aRect; } -Rectangle ScAccessibleSpreadsheet::GetBoundingBox() +Rectangle ScAccessibleSpreadsheet::GetBoundingBox() const throw (uno::RuntimeException) { Rectangle aRect; diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx index af688c9041e0..70581d2b07fc 100644 --- a/sc/source/ui/inc/AccessibleCell.hxx +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleCell.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: thb $ $Date: 2002-05-17 19:05:25 $ + * last change: $Author: sab $ $Date: 2002-05-24 15:06:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,6 +81,7 @@ #endif class ScTabViewShell; +class ScAccessibleDocument; namespace accessibility { @@ -102,7 +103,8 @@ public: ScTabViewShell* pViewShell, ScAddress& rCellAddress, sal_Int32 nIndex, - ScSplitPos eSplitPos); + ScSplitPos eSplitPos, + ScAccessibleDocument* pAccDoc); protected: virtual ~ScAccessibleCell(); @@ -121,11 +123,11 @@ public: protected: /// Return the object's current bounding box relative to the desktop. - virtual Rectangle GetBoundingBoxOnScreen(void) + virtual Rectangle GetBoundingBoxOnScreen(void) const throw (::com::sun::star::uno::RuntimeException); /// Return the object's current bounding box relative to the parent object. - virtual Rectangle GetBoundingBox(void) + virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException); public: @@ -179,6 +181,7 @@ public: private: ScTabViewShell* mpViewShell; + ScAccessibleDocument* mpAccDoc; accessibility::AccessibleTextHelper* mpTextHelper; diff --git a/sc/source/ui/inc/AccessibleSpreadsheet.hxx b/sc/source/ui/inc/AccessibleSpreadsheet.hxx index 4033c7e663dc..866144104a9b 100644 --- a/sc/source/ui/inc/AccessibleSpreadsheet.hxx +++ b/sc/source/ui/inc/AccessibleSpreadsheet.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleSpreadsheet.hxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: sab $ $Date: 2002-04-19 18:12:37 $ + * last change: $Author: sab $ $Date: 2002-05-24 15:08:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,6 +87,7 @@ public: }; class ScTabViewShell; +class ScAccessibleDocument; /** @descr This base class provides an implementation of the @@ -98,8 +99,7 @@ class ScAccessibleSpreadsheet public: //===== internal ======================================================== ScAccessibleSpreadsheet( - const ::com::sun::star::uno::Reference< - ::drafts::com::sun::star::accessibility::XAccessible>& rxParent, + ScAccessibleDocument* pAccDoc, ScTabViewShell* pViewShell, sal_uInt16 nTab, ScSplitPos eSplitPos); @@ -159,6 +159,12 @@ public: ///===== XAccessibleContext ============================================== + /// Return NULL to indicate that an empty relation set. + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL + getAccessibleRelationSet(void) + throw (::com::sun::star::uno::RuntimeException); + /// Return the set of current states. virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL @@ -219,16 +225,17 @@ public: protected: /// Return the object's current bounding box relative to the desktop. - virtual Rectangle GetBoundingBoxOnScreen(void) + virtual Rectangle GetBoundingBoxOnScreen(void) const throw (::com::sun::star::uno::RuntimeException); /// Return the object's current bounding box relative to the parent object. - virtual Rectangle GetBoundingBox(void) + virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException); private: ScTabViewShell* mpViewShell; ScRangeList* mpMarkedRanges; std::vector<ScMyAddress>* mpSortedMarkedCells; + ScAccessibleDocument* mpAccDoc; Rectangle maVisCells; ScSplitPos meSplitPos; ScAddress maActiveCell; |