summaryrefslogtreecommitdiff
path: root/editeng/source/accessibility/AccessibleEditableTextPara.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'editeng/source/accessibility/AccessibleEditableTextPara.cxx')
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx68
1 files changed, 44 insertions, 24 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 89917d77a8..1ead09ce47 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -1129,6 +1129,26 @@ namespace accessibility
return aPoint;
}
+ // --> OD 2009-12-16 #i88070#
+ // fallback to parent's <XAccessibleContext> instance
+ else
+ {
+ uno::Reference< XAccessibleContext > xParentContext = xParent->getAccessibleContext();
+ if ( xParentContext.is() )
+ {
+ uno::Reference< XAccessibleComponent > xParentContextComponent( xParentContext, uno::UNO_QUERY );
+ if( xParentContextComponent.is() )
+ {
+ awt::Point aRefPoint = xParentContextComponent->getLocationOnScreen();
+ awt::Point aPoint = getLocation();
+ aPoint.X += aRefPoint.X;
+ aPoint.Y += aRefPoint.Y;
+
+ return aPoint;
+ }
+ }
+ }
+ // <--
}
throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Cannot access parent")),
@@ -1223,7 +1243,7 @@ namespace accessibility
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
CheckIndex(nIndex); // may throw IndexOutOfBoundsException
// get default attribues...
@@ -1254,7 +1274,7 @@ namespace accessibility
aAny >>= f1;
}
int i = 3;
- }
+ }
#endif
// get resulting sequence
@@ -1890,8 +1910,8 @@ namespace accessibility
}
// XAccessibleTextAttributes
- uno::Sequence< beans::PropertyValue > SAL_CALL AccessibleEditableTextPara::getDefaultAttributes(
- const uno::Sequence< ::rtl::OUString >& rRequestedAttributes )
+ uno::Sequence< beans::PropertyValue > SAL_CALL AccessibleEditableTextPara::getDefaultAttributes(
+ const uno::Sequence< ::rtl::OUString >& rRequestedAttributes )
throw (uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
@@ -1909,8 +1929,8 @@ namespace accessibility
DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
"AccessibleEditableTextPara::getCharacterAttributes: index value overflow");
- // get XPropertySetInfo for paragraph attributes and
- // character attributes that span all the paragraphs text.
+ // get XPropertySetInfo for paragraph attributes and
+ // character attributes that span all the paragraphs text.
SvxAccessibleTextPropertySet aPropSet( &GetEditSource(),
ImplGetSvxCharAndParaPropertiesSet() );
aPropSet.SetSelection( MakeSelection( 0, GetTextLen() ) );
@@ -1957,8 +1977,8 @@ namespace accessibility
sal_Int32 nOutLen = 0;
for (sal_Int32 i = 0; i < nLength; ++i)
{
- // calling implementation functions:
- // _getPropertyState and _getPropertyValue (see below) to provide
+ // calling implementation functions:
+ // _getPropertyState and _getPropertyValue (see below) to provide
// the proper paragraph number when retrieving paragraph attributes
PropertyState eState = aPropSet._getPropertyState( pProperties->Name, mnParagraphIndex );
if ( eState == PropertyState_AMBIGUOUS_VALUE )
@@ -1967,7 +1987,7 @@ namespace accessibility
}
//if (eState == PropertyState_DIRECT_VALUE)
- // per definition all paragraph properties and all character
+ // per definition all paragraph properties and all character
// properties spanning the whole paragraph should be returned
// and declared as default value
{
@@ -1987,9 +2007,9 @@ namespace accessibility
}
- uno::Sequence< beans::PropertyValue > SAL_CALL AccessibleEditableTextPara::getRunAttributes(
- sal_Int32 nIndex,
- const uno::Sequence< ::rtl::OUString >& rRequestedAttributes )
+ uno::Sequence< beans::PropertyValue > SAL_CALL AccessibleEditableTextPara::getRunAttributes(
+ sal_Int32 nIndex,
+ const uno::Sequence< ::rtl::OUString >& rRequestedAttributes )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
@@ -2046,7 +2066,7 @@ namespace accessibility
}
else
aProperties = xPropSetInfo->getProperties();
-
+
sal_Int32 nLength = aProperties.getLength();
const beans::Property *pProperties = aProperties.getConstArray();
@@ -2056,7 +2076,7 @@ namespace accessibility
sal_Int32 nOutLen = 0;
for (sal_Int32 i = 0; i < nLength; ++i)
{
- // calling 'regular' functions that will operate on the selection
+ // calling 'regular' functions that will operate on the selection
PropertyState eState = aPropSet.getPropertyState( pProperties->Name );
if (eState == PropertyState_DIRECT_VALUE)
{
@@ -2160,7 +2180,7 @@ namespace accessibility
sal_Int32 nRes = -1;
sal_Int32 nPara = GetParagraphIndex();
-
+
SvxTextForwarder &rCacheTF = GetTextForwarder();
const bool bValidPara = 0 <= nPara && nPara < rCacheTF.GetParagraphCount();
DBG_ASSERT( bValidPara, "getLineNumberAtIndex: current paragraph index out of range" );
@@ -2168,7 +2188,7 @@ namespace accessibility
{
// we explicitly allow for the index to point at the character right behind the text
if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( static_cast< USHORT >(nPara) ))
- nRes = rCacheTF.GetLineNumberAtIndex( static_cast< USHORT >(nPara), static_cast< USHORT >(nIndex) );
+ nRes = rCacheTF.GetLineNumberAtIndex( static_cast< USHORT >(nPara), static_cast< USHORT >(nIndex) );
else
throw lang::IndexOutOfBoundsException();
}
@@ -2179,7 +2199,7 @@ namespace accessibility
::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineNumber( sal_Int32 nLineNo ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
-
+
::com::sun::star::accessibility::TextSegment aResult;
sal_Int32 nPara = GetParagraphIndex();
SvxTextForwarder &rCacheTF = GetTextForwarder();
@@ -2203,8 +2223,8 @@ namespace accessibility
{
// this is not the exception that should be raised in this function ...
DBG_ASSERT( 0, "unexpected exception" );
- }
- }
+ }
+ }
}
else
throw lang::IndexOutOfBoundsException();
@@ -2216,7 +2236,7 @@ namespace accessibility
::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineWithCaret( ) throw (uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
-
+
::com::sun::star::accessibility::TextSegment aResult;
try
{
@@ -2225,7 +2245,7 @@ namespace accessibility
catch (lang::IndexOutOfBoundsException &)
{
// this one needs to be catched since this interface does not allow for it.
- }
+ }
return aResult;
}
@@ -2233,7 +2253,7 @@ namespace accessibility
sal_Int32 SAL_CALL AccessibleEditableTextPara::getNumberOfLineWithCaret( ) throw (uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
-
+
sal_Int32 nRes = -1;
try
{
@@ -2242,7 +2262,7 @@ namespace accessibility
catch (lang::IndexOutOfBoundsException &)
{
// this one needs to be catched since this interface does not allow for it.
- }
+ }
return nRes;
}