summaryrefslogtreecommitdiff
path: root/sw/source/core/access/acccell.cxx
diff options
context:
space:
mode:
authorDaniel Vogelheim <dvo@openoffice.org>2002-05-24 12:40:29 +0000
committerDaniel Vogelheim <dvo@openoffice.org>2002-05-24 12:40:29 +0000
commit19de31ed4e173052b4dc0b093666ef8fe1740e77 (patch)
tree99bc61c7fc40b2a0a14cfeb06efbbb49914fc26b /sw/source/core/access/acccell.cxx
parent222cdf953fa44d609fde68225da84e1e066a2395 (diff)
#95586# added XAccessibleValue interface to table cell
Diffstat (limited to 'sw/source/core/access/acccell.cxx')
-rw-r--r--sw/source/core/access/acccell.cxx87
1 files changed, 85 insertions, 2 deletions
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index 05e276632561..d58e9d97050b 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acccell.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dvo $ $Date: 2002-05-22 11:38:21 $
+ * last change: $Author: dvo $ $Date: 2002-05-24 13:40:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -106,6 +106,12 @@
#ifndef _ACCFRMOBJSLIST_HXX
#include <accfrmobjslist.hxx>
#endif
+#ifndef _FRMFMT_HXX
+#include "frmfmt.hxx"
+#endif
+#ifndef _CELLATR_HXX
+#include "cellatr.hxx"
+#endif
#ifndef _ACCMAP_HXX
#include "accmap.hxx"
@@ -114,6 +120,8 @@
#include <acccell.hxx>
#endif
+#include <limits.h>
+
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using namespace ::drafts::com::sun::star::accessibility;
@@ -325,3 +333,78 @@ void SwAccessibleCell::InvalidatePosOrSize( const SwRect& rOldBox )
xAccImpl->InvalidateChildPosOrSize( GetFrm(), rOldBox );
SwAccessibleContext::InvalidatePosOrSize( rOldBox );
}
+
+
+// ===== XAccessibleInterface ===========================================
+
+Any SwAccessibleCell::queryInterface( const Type& rType )
+ throw( RuntimeException )
+{
+ if ( rType == ::getCppuType((Reference<XAccessibleValue> *)0) )
+ {
+ Reference<XAccessibleValue> xValue = this;
+ Any aRet;
+ aRet <<= xValue;
+ return aRet;
+ }
+ else
+ {
+ return SwAccessibleContext::queryInterface( rType );
+ }
+}
+
+
+// ===== XAccessibleValue ===============================================
+
+SwFrmFmt* SwAccessibleCell::GetTblBoxFormat() const
+{
+ DBG_ASSERT( GetFrm() != NULL, "no frame?" );
+ DBG_ASSERT( GetFrm()->IsCellFrm(), "no cell frame?" );
+
+ const SwCellFrm* pCellFrm = static_cast<const SwCellFrm*>( GetFrm() );
+ return pCellFrm->GetTabBox()->GetFrmFmt();
+}
+
+
+Any SwAccessibleCell::getCurrentValue( )
+ throw( RuntimeException )
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ CHECK_FOR_DEFUNC( XAccessibleValue );
+
+ Any aAny;
+ aAny <<= GetTblBoxFormat()->GetTblBoxValue().GetValue();
+ return aAny;
+}
+
+sal_Bool SwAccessibleCell::setCurrentValue( const Any& aNumber )
+ throw( RuntimeException )
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ CHECK_FOR_DEFUNC( XAccessibleValue );
+
+ double fValue;
+ sal_Bool bValid = (aNumber >>= fValue);
+ if( bValid )
+ {
+ SwTblBoxValue aValue( fValue );
+ GetTblBoxFormat()->SetAttr( aValue );
+ }
+ return bValid;
+}
+
+Any SwAccessibleCell::getMaximumValue( )
+ throw( RuntimeException )
+{
+ Any aAny;
+ aAny <<= DBL_MAX;
+ return aAny;
+}
+
+Any SwAccessibleCell::getMinimumValue( )
+ throw( RuntimeException )
+{
+ Any aAny;
+ aAny <<= DBL_MIN;
+ return aAny;
+}