summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-10-05 14:14:49 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-10-05 18:51:37 -0500
commit0338874f3cc719a6265a497c357ef41bf9f1cf41 (patch)
treea505a912eb3b91aa1b485fc12b3e060bbc4c81c4
parent07e6f0abaaf4b4c2566868b6cf5c9c13dc488686 (diff)
accfixes2: scrollsbar's accessible name are horizontal/vertical scroll bar
-rw-r--r--accessibility/inc/accessibility/helper/accessiblestrings.hrc2
-rw-r--r--accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx4
-rw-r--r--accessibility/source/helper/accessiblestrings.src11
-rw-r--r--accessibility/source/standard/vclxaccessiblescrollbar.cxx21
4 files changed, 37 insertions, 1 deletions
diff --git a/accessibility/inc/accessibility/helper/accessiblestrings.hrc b/accessibility/inc/accessibility/helper/accessiblestrings.hrc
index bdc3c02d0660..9369b067c9d5 100644
--- a/accessibility/inc/accessibility/helper/accessiblestrings.hrc
+++ b/accessibility/inc/accessibility/helper/accessiblestrings.hrc
@@ -45,6 +45,8 @@
#define RID_STR_ACC_ACTION_DECBLOCK ( RID_TK_ACC_START + 6 )
#define RID_STR_ACC_ACTION_CHECK ( RID_TK_ACC_START + 7 )
#define RID_STR_ACC_ACTION_UNCHECK ( RID_TK_ACC_START + 8 )
+#define RID_STR_ACC_SCROLLBAR_NAME_VERTICAL ( RID_TK_ACC_START + 9 )
+#define RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL ( RID_TK_ACC_START + 10 )
#define RID_STR_ACC_NAME_BROWSEBUTTON ( RID_TK_ACC_START + 100 )
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx
index b1d26c84f7cb..287544b3f44a 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx
@@ -78,6 +78,10 @@ public:
virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleContext
+ ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException);
+
};
#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX
diff --git a/accessibility/source/helper/accessiblestrings.src b/accessibility/source/helper/accessiblestrings.src
index e24d43a17861..06f0c318dc5b 100644
--- a/accessibility/source/helper/accessiblestrings.src
+++ b/accessibility/source/helper/accessiblestrings.src
@@ -69,11 +69,22 @@ String RID_STR_ACC_ACTION_CHECK
{
Text [ en-US ] = "Check";
};
+
String RID_STR_ACC_ACTION_UNCHECK
{
Text [ en-US ] = "Uncheck";
};
+String RID_STR_ACC_SCROLLBAR_NAME_VERTICAL
+{
+ Text [ en-US ] = "Vertical scroll bar";
+};
+
+String RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL
+{
+ Text [ en-US ] = "Horizontal scroll bar";
+};
+
String RID_STR_ACC_NAME_BROWSEBUTTON
{
Text [ en-US ] = "Browse";
diff --git a/accessibility/source/standard/vclxaccessiblescrollbar.cxx b/accessibility/source/standard/vclxaccessiblescrollbar.cxx
index feb11f4e6d9c..59023354820d 100644
--- a/accessibility/source/standard/vclxaccessiblescrollbar.cxx
+++ b/accessibility/source/standard/vclxaccessiblescrollbar.cxx
@@ -276,6 +276,25 @@ Any VCLXAccessibleScrollBar::getMinimumValue( ) throw (RuntimeException)
return aValue;
}
-// -----------------------------------------------------------------------------
+::rtl::OUString VCLXAccessibleScrollBar::getAccessibleName( ) throw (uno::RuntimeException)
+{
+ OExternalLockGuard aGuard( this );
+
+ ::rtl::OUString aName;
+ VCLXScrollBar* pVCLXScrollBar = static_cast< VCLXScrollBar* >( GetVCLXWindow() );
+ if ( pVCLXScrollBar )
+ {
+ if ( pVCLXScrollBar->getOrientation() == ScrollBarOrientation::HORIZONTAL )
+ {
+ aName = TK_RES_STRING( RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL );
+ }
+ else if ( pVCLXScrollBar->getOrientation() == ScrollBarOrientation::VERTICAL )
+ {
+ aName = TK_RES_STRING( RID_STR_ACC_SCROLLBAR_NAME_VERTICAL );
+ }
+ }
+ return aName;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */