summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/source/classes/fwktabwindow.cxx15
-rw-r--r--framework/source/uielement/togglebuttontoolbarcontroller.cxx2
-rw-r--r--sfx2/source/appl/sfxhelp.cxx9
-rw-r--r--sfx2/source/dialog/dockwin.cxx1
-rw-r--r--svx/inc/AccessibleStaticTextBase.hxx4
-rw-r--r--svx/inc/accessibility.hrc2
-rw-r--r--svx/inc/svx/editeng.hxx2
-rw-r--r--svx/inc/svx/unoedsrc.hxx32
-rw-r--r--svx/inc/svx/unofored.hxx2
-rw-r--r--svx/inc/svx/unoforou.hxx2
-rw-r--r--svx/inc/svx/unoshtxt.hxx13
-rw-r--r--svx/inc/svx/unotext.hxx2
-rw-r--r--svx/source/accessibility/AccessibleEditableTextPara.cxx150
-rw-r--r--svx/source/accessibility/AccessibleEditableTextPara.hxx19
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx2
-rw-r--r--svx/source/accessibility/AccessibleImageBullet.cxx20
-rw-r--r--svx/source/accessibility/AccessibleStaticTextBase.cxx47
-rw-r--r--svx/source/accessibility/accessibility.src12
-rw-r--r--svx/source/cui/treeopt.cxx15
-rw-r--r--svx/source/editeng/editeng.cxx20
-rw-r--r--svx/source/editeng/impedit.cxx2
-rw-r--r--svx/source/editeng/impedit.hxx2
-rw-r--r--svx/source/editeng/impedit2.cxx46
-rw-r--r--svx/source/inc/unoedprx.hxx6
-rw-r--r--svx/source/table/accessiblecell.cxx11
-rw-r--r--svx/source/table/accessiblecell.hxx1
-rw-r--r--svx/source/table/accessibletableshape.cxx11
-rw-r--r--svx/source/table/cell.cxx66
-rw-r--r--svx/source/table/cell.hxx2
-rw-r--r--svx/source/table/celleditsource.hxx2
-rw-r--r--svx/source/unoedit/unoedprx.cxx10
-rw-r--r--svx/source/unoedit/unofored.cxx11
-rw-r--r--svx/source/unoedit/unoforou.cxx10
-rw-r--r--svx/source/unoedit/unotext.cxx10
-rw-r--r--svx/source/unoedit/unoviwou.cxx1
35 files changed, 452 insertions, 110 deletions
diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx
index a7c6882751ee..71c26ecb681c 100644
--- a/framework/source/classes/fwktabwindow.cxx
+++ b/framework/source/classes/fwktabwindow.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/awt/XContainerWindowProvider.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -90,7 +91,7 @@ FwkTabPage::FwkTabPage(
const css::uno::Reference< css::awt::XContainerWindowEventHandler >& rEventHdl,
const css::uno::Reference< css::awt::XContainerWindowProvider >& rProvider ) :
- TabPage( pParent, WB_DIALOGCONTROL ),
+ TabPage( pParent, WB_DIALOGCONTROL | WB_TABSTOP | WB_CHILDDLGCTRL ),
m_sPageURL ( rPageURL ),
m_xEventHdl ( rEventHdl ),
@@ -122,6 +123,18 @@ void FwkTabPage::CreateDialog()
m_xWinProvider->createContainerWindow(
m_sPageURL, rtl::OUString(), xParent, xHandler ), uno::UNO_QUERY );
+ uno::Reference< awt::XControl > xPageControl( m_xPage, uno::UNO_QUERY );
+ if ( xPageControl.is() )
+ {
+ uno::Reference< awt::XWindowPeer > xWinPeer( xPageControl->getPeer() );
+ if ( xWinPeer.is() )
+ {
+ Window* pWindow = VCLUnoHelper::GetWindow( xWinPeer );
+ if ( pWindow )
+ pWindow->SetStyle( pWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
+ }
+ }
+
CallMethod( INITIALIZE_METHOD );
}
catch ( lang::IllegalArgumentException& )
diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
index 301c9a022182..9bf4ad91c6f2 100644
--- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
@@ -246,7 +246,6 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta
< m_aDropdownMenuList.size() ) )
{
m_aCurrentSelection = m_aDropdownMenuList[nPos];
- m_pToolbar->SetItemText( m_nID, m_aCurrentSelection );
// send notification
uno::Sequence< beans::NamedValue > aInfo( 1 );
@@ -353,7 +352,6 @@ IMPL_LINK( ToggleButtonToolbarController, MenuSelectHdl, Menu *, pMenu )
if ( nItemId > 0 && nItemId <= m_aDropdownMenuList.size() )
{
m_aCurrentSelection = m_aDropdownMenuList[nItemId-1];
- m_pToolbar->SetItemText( m_nID, m_aCurrentSelection );
execute( 0 );
}
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index f419bc3e3d55..8a6622636c14 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -193,7 +193,10 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
sal_Bool bRet = sal_False;
::rtl::OUString sAnchor;
- ULONG nSolarCount = Application::ReleaseSolarMutex();
+ // --> OD 2009-07-01 #159496#
+ // do not release solar mutex due to crash regarding accessibility
+// ULONG nSolarCount = Application::ReleaseSolarMutex();
+ // <--
try
{
::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ),
@@ -215,7 +218,9 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
catch( ::com::sun::star::uno::Exception& )
{
}
- Application::AcquireSolarMutex( nSolarCount );
+ // --> OD 2009-07-01 #159496#
+// Application::AcquireSolarMutex( nSolarCount );
+ // <--
return bRet;
}
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index afcf2aeef353..f31ed1724907 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -236,6 +236,7 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
}
Window* pContentWindow = VCLUnoHelper::GetWindow(xWindow);
+ pContentWindow->SetStyle( pContentWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
pTitleDockWindow->SetWrappedWindow(pContentWindow);
}
diff --git a/svx/inc/AccessibleStaticTextBase.hxx b/svx/inc/AccessibleStaticTextBase.hxx
index 5ee498be5695..60a31117185f 100644
--- a/svx/inc/AccessibleStaticTextBase.hxx
+++ b/svx/inc/AccessibleStaticTextBase.hxx
@@ -44,6 +44,7 @@
class SvxEditSource;
+class SvxEditViewForwarder;
namespace accessibility
{
@@ -266,6 +267,9 @@ namespace accessibility
protected:
Rectangle GetParagraphBoundingBox() const;
+ sal_Int32 GetParagraphCount() const;
+ sal_Int32 GetParagraphIndex() const;
+ sal_Int32 GetLineCount( sal_Int32 nParagraph ) const;
private:
diff --git a/svx/inc/accessibility.hrc b/svx/inc/accessibility.hrc
index c202c4611ffe..5688f7a8033e 100644
--- a/svx/inc/accessibility.hrc
+++ b/svx/inc/accessibility.hrc
@@ -80,8 +80,6 @@
// text paragraphs and bullets
#define RID_SVXSTR_A11Y_TEXTHELPER_START (RID_SVXSTR_ACCESSIBILITY_START + 70)
-#define RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 0)
-#define RID_SVXSTR_A11Y_PARAGRAPH_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 1)
#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 2)
#define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 3)
diff --git a/svx/inc/svx/editeng.hxx b/svx/inc/svx/editeng.hxx
index d5176034a301..65168297274e 100644
--- a/svx/inc/svx/editeng.hxx
+++ b/svx/inc/svx/editeng.hxx
@@ -219,6 +219,8 @@ public:
USHORT GetLineCount( USHORT nParagraph ) const;
xub_StrLen GetLineLen( USHORT nParagraph, USHORT nLine ) const;
+ void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
sal_uInt32 GetLineHeight( USHORT nParagraph, USHORT nLine = 0 );
USHORT GetFirstLineOffset( USHORT nParagraph );
ParagraphInfos GetParagraphInfos( USHORT nPara );
diff --git a/svx/inc/svx/unoedsrc.hxx b/svx/inc/svx/unoedsrc.hxx
index 3eafa5795893..a4777b6469b4 100644
--- a/svx/inc/svx/unoedsrc.hxx
+++ b/svx/inc/svx/unoedsrc.hxx
@@ -31,6 +31,8 @@
#ifndef _SVX_UNOEDSRC_HXX
#define _SVX_UNOEDSRC_HXX
+#include <com/sun/star/accessibility/TextSegment.hpp>
+
#include <tools/solar.h>
#include <i18npool/lang.h>
#include <tools/link.hxx>
@@ -358,6 +360,36 @@ public:
*/
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const = 0;
+ /** Query bounds of line in paragraph
+
+ @param rStart [output param; 0 .. text_len]
+ The index in the paragraph text that belongs to the chara at the start of the line
+
+ @param rEnd [output param; 0 .. text_len]
+ The index in the paragraph text that follows the last chara in the line
+
+ @param nParagraph[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nLine[0 .. m-1]
+ Index of line in paragraph to query line length of
+
+ */
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const = 0;
+
+ /** Query the line number for a index in the paragraphs text
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nIndex[0 .. m-1]
+ Index of of the chara in the paragraph text
+
+ @returns [0 .. k-1]
+ The line number of the chara in the paragraph
+ */
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const = 0;
+
/** Delete given text range and reformat text
@param rSelection
diff --git a/svx/inc/svx/unofored.hxx b/svx/inc/svx/unofored.hxx
index e912e5e4e593..a9c72f766a35 100644
--- a/svx/inc/svx/unofored.hxx
+++ b/svx/inc/svx/unofored.hxx
@@ -81,6 +81,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
diff --git a/svx/inc/svx/unoforou.hxx b/svx/inc/svx/unoforou.hxx
index 91ef33cae3b7..75adcc620a47 100644
--- a/svx/inc/svx/unoforou.hxx
+++ b/svx/inc/svx/unoforou.hxx
@@ -102,6 +102,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
diff --git a/svx/inc/svx/unoshtxt.hxx b/svx/inc/svx/unoshtxt.hxx
index e8d8e2b76f6c..6027191d222e 100644
--- a/svx/inc/svx/unoshtxt.hxx
+++ b/svx/inc/svx/unoshtxt.hxx
@@ -35,9 +35,14 @@
#include <svx/unoedsrc.hxx>
#include "svx/svxdllapi.h"
-namespace com { namespace sun { namespace star { namespace uno {
- class XInterface;
-} } } }
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XInterface;
+ }
+ namespace accessibility {
+ struct TextSegment;
+ }
+} } }
class SvxTextForwarder;
class SdrObject;
@@ -80,7 +85,7 @@ public:
// static sal_Bool hasLevels( const SdrObject* pObject );
- // the viewforwarder interface
+ // the SvxViewForwarder interface
virtual BOOL IsValid() const;
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point&, const MapMode& ) const;
diff --git a/svx/inc/svx/unotext.hxx b/svx/inc/svx/unotext.hxx
index ec3170cde8ba..63ce0a28b739 100644
--- a/svx/inc/svx/unotext.hxx
+++ b/svx/inc/svx/unotext.hxx
@@ -231,6 +231,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
diff --git a/svx/source/accessibility/AccessibleEditableTextPara.cxx b/svx/source/accessibility/AccessibleEditableTextPara.cxx
index 27963bfdffc4..1c0ce04bb1d6 100644
--- a/svx/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/svx/source/accessibility/AccessibleEditableTextPara.cxx
@@ -806,7 +806,7 @@ namespace accessibility
// must provide XAccesibleText by hand, since it comes publicly inherited by XAccessibleEditableText
if ( rType == ::getCppuType((uno::Reference< XAccessibleText > *)0) )
{
- uno::Reference< XAccessibleText > aAccText = this;
+ uno::Reference< XAccessibleText > aAccText = static_cast< XAccessibleEditableText * >(this);
aRet <<= aAccText;
}
else if ( rType == ::getCppuType((uno::Reference< XAccessibleEditableText > *)0) )
@@ -912,65 +912,18 @@ namespace accessibility
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- // append first 40 characters from text, or first line, if shorter
- // (writer takes first sentence here, but that's not supported
- // from EditEngine)
- // throws if defunc
- ::rtl::OUString aLine;
-
- if( getCharacterCount() )
- aLine = getTextAtIndex(0, AccessibleTextType::LINE).SegmentText;
-
- // Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION ) );
- String sParaIndex = ::rtl::OUString::valueOf( GetParagraphIndex() );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- if( aLine.getLength() > MaxDescriptionLen )
- {
- ::rtl::OUString aCurrWord;
- sal_Int32 i;
-
- // search backward from MaxDescriptionLen for previous word start
- for( aCurrWord=getTextAtIndex(MaxDescriptionLen, AccessibleTextType::WORD).SegmentText,
- i=MaxDescriptionLen,
- aLine=::rtl::OUString();
- i>=0;
- --i )
- {
- if( getTextAtIndex(i, AccessibleTextType::WORD).SegmentText != aCurrWord )
- {
- if( i == 0 )
- // prevent completely empty string
- aLine = getTextAtIndex(0, AccessibleTextType::WORD).SegmentText;
- else
- aLine = getTextRange(0, i);
- }
- }
- }
+// ::vos::OGuard aGuard( Application::GetSolarMutex() );
- return ::rtl::OUString( sStr ) + aLine;
+ return ::rtl::OUString();
}
::rtl::OUString SAL_CALL AccessibleEditableTextPara::getAccessibleName() throw (uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
- // Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_PARAGRAPH_NAME) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
+// ::vos::OGuard aGuard( Application::GetSolarMutex() );
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString();
}
uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleEditableTextPara::getAccessibleRelationSet() throw (uno::RuntimeException)
@@ -2113,6 +2066,99 @@ namespace accessibility
return aOutSequence;
}
+ // XAccessibleMultiLineText
+ sal_Int32 SAL_CALL AccessibleEditableTextPara::getLineNumberAtIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ 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" );
+ if (bValidPara)
+ {
+ // 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) );
+ else
+ throw lang::IndexOutOfBoundsException();
+ }
+ return nRes;
+ }
+
+ // XAccessibleMultiLineText
+ ::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();
+ const bool bValidPara = 0 <= nPara && nPara < rCacheTF.GetParagraphCount();
+ DBG_ASSERT( bValidPara, "getTextAtLineNumber: current paragraph index out of range" );
+ if (bValidPara)
+ {
+ if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( static_cast< USHORT >(nPara) ))
+ {
+ USHORT nStart = 0, nEnd = 0;
+ rCacheTF.GetLineBoundaries( nStart, nEnd, static_cast< USHORT >(nPara), static_cast< USHORT >(nLineNo) );
+ if (nStart != 0xFFFF && nEnd != 0xFFFF)
+ {
+ try
+ {
+ aResult.SegmentText = getTextRange( nStart, nEnd );
+ aResult.SegmentStart = nStart;
+ aResult.SegmentEnd = nEnd;
+ }
+ catch (lang::IndexOutOfBoundsException)
+ {
+ // this is not the exception that should be raised in this function ...
+ DBG_ASSERT( 0, "unexpected exception" );
+ }
+ }
+ }
+ else
+ throw lang::IndexOutOfBoundsException();
+ }
+ return aResult;
+ }
+
+ // XAccessibleMultiLineText
+ ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineWithCaret( ) throw (uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ ::com::sun::star::accessibility::TextSegment aResult;
+ try
+ {
+ aResult = getTextAtLineNumber( getNumberOfLineWithCaret() );
+ }
+ catch (lang::IndexOutOfBoundsException &)
+ {
+ // this one needs to be catched since this interface does not allow for it.
+ }
+ return aResult;
+ }
+
+ // XAccessibleMultiLineText
+ sal_Int32 SAL_CALL AccessibleEditableTextPara::getNumberOfLineWithCaret( ) throw (uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ sal_Int32 nRes = -1;
+ try
+ {
+ nRes = getLineNumberAtIndex( getCaretPosition() );
+ }
+ catch (lang::IndexOutOfBoundsException &)
+ {
+ // this one needs to be catched since this interface does not allow for it.
+ }
+ return nRes;
+ }
+
// XServiceInfo
::rtl::OUString SAL_CALL AccessibleEditableTextPara::getImplementationName (void) throw (uno::RuntimeException)
diff --git a/svx/source/accessibility/AccessibleEditableTextPara.hxx b/svx/source/accessibility/AccessibleEditableTextPara.hxx
index 5cf8c5361d20..4e297f44c3b5 100644
--- a/svx/source/accessibility/AccessibleEditableTextPara.hxx
+++ b/svx/source/accessibility/AccessibleEditableTextPara.hxx
@@ -34,12 +34,10 @@
#include <tools/gen.hxx>
#include <tools/string.hxx>
#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/compbase7.hxx>
+#include <cppuhelper/compbase8.hxx>
#include <cppuhelper/typeprovider.hxx>
-
-#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
#include <cppuhelper/interfacecontainer.hxx>
-#endif
+
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
@@ -47,6 +45,8 @@
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
+#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
+
#include <comphelper/accessibletexthelper.hxx>
#include <comphelper/broadcasthelper.hxx>
#include "AccessibleParaManager.hxx"
@@ -55,12 +55,13 @@
namespace accessibility
{
- typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::accessibility::XAccessible,
+ typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::accessibility::XAccessible,
::com::sun::star::accessibility::XAccessibleContext,
::com::sun::star::accessibility::XAccessibleComponent,
::com::sun::star::accessibility::XAccessibleEditableText,
::com::sun::star::accessibility::XAccessibleEventBroadcaster,
::com::sun::star::accessibility::XAccessibleTextAttributes,
+ ::com::sun::star::accessibility::XAccessibleMultiLineText,
::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase;
/** This class implements the actual text paragraphs for the EditEngine/Outliner UAA
@@ -128,7 +129,7 @@ namespace accessibility
virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
- // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText)
+ // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText AND by XAccessibleMultiLineText)
virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
@@ -163,6 +164,12 @@ namespace accessibility
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ // XAccessibleMultiLineText
+ virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getNumberOfLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException);
+
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName (void) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService (const ::rtl::OUString& sServiceName) throw (::com::sun::star::uno::RuntimeException);
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 072d6347f3f4..6420a14c98ae 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -161,6 +161,8 @@ namespace accessibility
sal_Bool GetAttributeRun( USHORT&, USHORT&, USHORT, USHORT ) const { return sal_False; }
USHORT GetLineCount( USHORT nPara ) const { return nPara == 0 ? 1 : 0; }
USHORT GetLineLen( USHORT, USHORT ) const { return 0; }
+ void GetLineBoundaries( /*out*/USHORT & rStart, /*out*/USHORT & rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const { rStart = rEnd = 0; }
+ USHORT GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const { return 0; }
// the following two methods would, strictly speaking, require
// a switch to a real EditSource, too. Fortunately, the
diff --git a/svx/source/accessibility/AccessibleImageBullet.cxx b/svx/source/accessibility/AccessibleImageBullet.cxx
index 2ea02d03bf28..694043d69f4e 100644
--- a/svx/source/accessibility/AccessibleImageBullet.cxx
+++ b/svx/source/accessibility/AccessibleImageBullet.cxx
@@ -172,16 +172,8 @@ namespace accessibility
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
// Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) );
}
::rtl::OUString SAL_CALL AccessibleImageBullet::getAccessibleName() throw (uno::RuntimeException)
@@ -190,16 +182,8 @@ namespace accessibility
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
// Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) );
}
uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleImageBullet::getAccessibleRelationSet() throw (uno::RuntimeException)
diff --git a/svx/source/accessibility/AccessibleStaticTextBase.cxx b/svx/source/accessibility/AccessibleStaticTextBase.cxx
index b611b62b47e6..333c555bb746 100644
--- a/svx/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/svx/source/accessibility/AccessibleStaticTextBase.cxx
@@ -173,12 +173,16 @@ namespace accessibility
AccessibleEditableTextPara& GetParagraph( sal_Int32 nPara ) const;
sal_Int32 GetParagraphCount() const;
+ sal_Int32 GetParagraphIndex() const;
+ sal_Int32 GetLineCount( sal_Int32 nParagraph ) const;
+
EPosition Index2Internal( sal_Int32 nFlatIndex ) const
{
DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
return ImpCalcInternal( nFlatIndex, false );
}
+
EPosition Range2Internal( sal_Int32 nFlatIndex ) const
{
DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
@@ -327,6 +331,26 @@ namespace accessibility
return mpTextParagraph->GetTextForwarder().GetParagraphCount();
}
+ sal_Int32 AccessibleStaticTextBase_Impl::GetParagraphIndex() const
+ {
+ DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
+
+ sal_Int32 nIndex = -1;
+ if( mpTextParagraph )
+ nIndex = mpTextParagraph->GetParagraphIndex();
+ return nIndex;
+ }
+
+ sal_Int32 AccessibleStaticTextBase_Impl::GetLineCount( sal_Int32 nParagraph ) const
+ {
+ DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
+
+ sal_Int32 nIndex = 0;
+ if( mpTextParagraph )
+ nIndex = mpTextParagraph->GetTextForwarder().GetLineCount( static_cast< USHORT >(nParagraph) );
+ return nIndex;
+ }
+
sal_Int32 AccessibleStaticTextBase_Impl::Internal2Index( EPosition nEEIndex ) const
{
sal_Int32 aRes(0);
@@ -1001,10 +1025,25 @@ namespace accessibility
return ::comphelper::concatSequences( aRunAttrSeq, aDiffVec.getAsConstList() );
}
- Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const
- {
- return mpImpl->GetParagraphBoundingBox();
- }
+ Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const
+ {
+ return mpImpl->GetParagraphBoundingBox();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetParagraphIndex() const
+ {
+ return mpImpl->GetParagraphIndex();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetParagraphCount() const
+ {
+ return mpImpl->GetParagraphCount();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetLineCount( sal_Int32 nParagraph ) const
+ {
+ return mpImpl->GetLineCount( nParagraph );
+ }
} // end of namespace accessibility
diff --git a/svx/source/accessibility/accessibility.src b/svx/source/accessibility/accessibility.src
index 323ff7982876..418236a0107d 100644
--- a/svx/source/accessibility/accessibility.src
+++ b/svx/source/accessibility/accessibility.src
@@ -196,19 +196,9 @@ String RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION
Text [ en-US ] = "This is where you can edit the contour." ;
};
-String RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION
-{
- Text [ en-US ] = "Paragraph: $(ARG) " ;
-};
-
-String RID_SVXSTR_A11Y_PARAGRAPH_NAME
-{
- Text [ en-US ] = "Paragraph $(ARG)" ;
-};
-
String RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION
{
- Text [ en-US ] = "Image bullet in paragraph: $(ARG)" ;
+ Text [ en-US ] = "Image bullet in paragraph" ;
};
String RID_SVXSTR_A11Y_IMAGEBULLET_NAME
diff --git a/svx/source/cui/treeopt.cxx b/svx/source/cui/treeopt.cxx
index 7491b2bb1cc5..744f9d5c1dbe 100644
--- a/svx/source/cui/treeopt.cxx
+++ b/svx/source/cui/treeopt.cxx
@@ -64,6 +64,8 @@
#include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XTabController.hpp>
#include <vcl/help.hxx>
#ifndef _LINGUISTIC_MISC_HHX_
#include <linguistic/misc.hxx>
@@ -2745,10 +2747,23 @@ void ExtensionsTabPage::CreateDialogWithHandler()
if ( !bWithHandler || m_xEventHdl.is() )
{
+ SetStyle( GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
Reference< awt::XWindowPeer > xParent( VCLUnoHelper::GetInterface( this ), UNO_QUERY );
m_xPage = Reference < awt::XWindow >(
m_xWinProvider->createContainerWindow(
m_sPageURL, rtl::OUString(), xParent, m_xEventHdl ), UNO_QUERY );
+
+ Reference< awt::XControl > xPageControl( m_xPage, UNO_QUERY );
+ if ( xPageControl.is() )
+ {
+ Reference< awt::XWindowPeer > xWinPeer( xPageControl->getPeer() );
+ if ( xWinPeer.is() )
+ {
+ Window* pWindow = VCLUnoHelper::GetWindow( xWinPeer );
+ if ( pWindow )
+ pWindow->SetStyle( pWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
+ }
+ }
}
}
catch ( ::com::sun::star::lang::IllegalArgumentException& )
diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx
index 16b6f6510f40..059dae19c8f8 100644
--- a/svx/source/editeng/editeng.cxx
+++ b/svx/source/editeng/editeng.cxx
@@ -697,15 +697,35 @@ sal_uInt16 EditEngine::GetParagraphCount() const
sal_uInt16 EditEngine::GetLineCount( sal_uInt16 nParagraph ) const
{
DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
return pImpEditEngine->GetLineCount( nParagraph );
}
sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const
{
DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
return pImpEditEngine->GetLineLen( nParagraph, nLine );
}
+void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
+ return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
+}
+
+USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
+ return pImpEditEngine->GetLineNumberAtIndex( nPara, nIndex );
+}
+
sal_uInt32 EditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine )
{
DBG_CHKTHIS( EditEngine, 0 );
diff --git a/svx/source/editeng/impedit.cxx b/svx/source/editeng/impedit.cxx
index 2e27bd744637..16f0c1f5277d 100644
--- a/svx/source/editeng/impedit.cxx
+++ b/svx/source/editeng/impedit.cxx
@@ -670,6 +670,8 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US
USHORT nTextPortionStart = 0;
USHORT nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() );
+ if (nPara == USHRT_MAX) // #i94322
+ return;
ParaPortion* pParaPortion = pEditEngine->pImpEditEngine->GetParaPortions().GetObject( nPara );
nShowCursorFlags |= nExtraCursorFlags;
diff --git a/svx/source/editeng/impedit.hxx b/svx/source/editeng/impedit.hxx
index 5df4b0f5ed29..25b7cec4f449 100644
--- a/svx/source/editeng/impedit.hxx
+++ b/svx/source/editeng/impedit.hxx
@@ -813,6 +813,8 @@ public:
sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace );
sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const;
sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine );
sal_uInt32 GetParaHeight( sal_uInt16 nParagraph );
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx
index 47a3aa24b3e9..f8cd7e67a4c9 100644
--- a/svx/source/editeng/impedit2.cxx
+++ b/svx/source/editeng/impedit2.cxx
@@ -3300,9 +3300,9 @@ USHORT ImpEditEngine::GetLineCount( USHORT nParagraph ) const
xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const
{
- DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineLen: Out of range" );
ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph );
- DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineHeight" );
+ DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineLen" );
if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
{
EditLine* pLine = pPPortion->GetLines().GetObject( nLine );
@@ -3313,6 +3313,48 @@ xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const
return 0xFFFF;
}
+void ImpEditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph );
+ DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineBoundaries" );
+ rStart = rEnd = 0xFFFF; // default values in case of error
+ if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
+ {
+ EditLine* pLine = pPPortion->GetLines().GetObject( nLine );
+ DBG_ASSERT( pLine, "Zeile nicht gefunden: GetLineBoundaries" );
+ rStart = pLine->GetStart();
+ rEnd = pLine->GetEnd();
+ }
+}
+
+USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ USHORT nLineNo = 0xFFFF;
+ ContentNode* pNode = GetEditDoc().SaveGetObject( nPara );
+ DBG_ASSERT( pNode, "GetLineNumberAtIndex: invalid paragraph index" );
+ if (pNode)
+ {
+ // we explicitly allow for the index to point at the character right behind the text
+ const bool bValidIndex = /*0 <= nIndex &&*/ nIndex <= pNode->Len();
+ DBG_ASSERT( bValidIndex, "GetLineNumberAtIndex: invalid index" );
+ const USHORT nLineCount = GetLineCount( nPara );
+ if (nIndex == pNode->Len())
+ nLineNo = nLineCount > 0 ? nLineCount - 1 : 0;
+ else if (bValidIndex) // nIndex < pNode->Len()
+ {
+ USHORT nStart = USHRT_MAX, nEnd = USHRT_MAX;
+ for (USHORT i = 0; i < nLineCount && nLineNo == 0xFFFF; ++i)
+ {
+ GetLineBoundaries( nStart, nEnd, nPara, i );
+ if (nStart <= nIndex && nIndex < nEnd)
+ nLineNo = i;
+ }
+ }
+ }
+ return nLineNo;
+}
+
USHORT ImpEditEngine::GetLineHeight( USHORT nParagraph, USHORT nLine )
{
DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
diff --git a/svx/source/inc/unoedprx.hxx b/svx/source/inc/unoedprx.hxx
index 070367f26dd9..4758b17dd621 100644
--- a/svx/source/inc/unoedprx.hxx
+++ b/svx/source/inc/unoedprx.hxx
@@ -79,6 +79,9 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
+
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
@@ -118,12 +121,13 @@ public:
SvxAccessibleTextEditViewAdapter();
virtual ~SvxAccessibleTextEditViewAdapter();
+ // SvxViewForwarder interface
virtual BOOL IsValid() const;
-
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+ // SvxEditViewForwarder interface
virtual sal_Bool GetSelection( ESelection& rSelection ) const;
virtual sal_Bool SetSelection( const ESelection& rSelection );
virtual sal_Bool Copy();
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx
index 6f4bea3cbd40..d76d5e1b3079 100644
--- a/svx/source/table/accessiblecell.cxx
+++ b/svx/source/table/accessiblecell.cxx
@@ -573,4 +573,15 @@ sal_Int32 SAL_CALL AccessibleCell::getAccessibleIndexInParent (void) throw (Runt
return mnIndexInParent;
}
+::rtl::OUString SAL_CALL AccessibleCell::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException)
+{
+ ThrowIfDisposed ();
+ ::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
+
+ if( mxCell.is() )
+ return mxCell->getName();
+
+ return AccessibleCellBase::getAccessibleName();
+}
+
} // end of namespace accessibility
diff --git a/svx/source/table/accessiblecell.hxx b/svx/source/table/accessiblecell.hxx
index 166495ecc83d..95c8d684fe3b 100644
--- a/svx/source/table/accessiblecell.hxx
+++ b/svx/source/table/accessiblecell.hxx
@@ -85,6 +85,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet(void) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(void) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException);
// XAccessibleComponent
virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint) throw (::com::sun::star::uno::RuntimeException);
diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx
index 89e18137eeb0..455d39eee467 100644
--- a/svx/source/table/accessibletableshape.cxx
+++ b/svx/source/table/accessibletableshape.cxx
@@ -160,6 +160,8 @@ Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild( sal_Int32
maChildMap[xCell] = xAccessibleCell;
+ xAccessibleCell->Init();
+
Reference< XAccessible > xChild( xAccessibleCell.get() );
return xChild;
}
@@ -501,10 +503,11 @@ Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleCellAt( sal
::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
checkCellPosition( nColumn, nRow );
- (void)nRow;
- (void)nColumn;
- Reference< XAccessible > xRet;
- return xRet;
+ sal_Int32 nChildIndex = 0;
+ if( mxImpl->mxTable.is() )
+ nChildIndex = mxImpl->mxTable->getColumnCount() * nRow + nColumn;
+
+ return getAccessibleChild( nChildIndex );
}
//--------------------------------------------------------------------
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 4ac7b4754f8d..46268a68ca02 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1757,5 +1757,71 @@ void SAL_CALL Cell::disposing( const EventObject& /*Source*/ ) throw (RuntimeExc
dispose();
}
+static OUString getCellName( sal_Int32 nCol, sal_Int32 nRow )
+{
+ rtl::OUStringBuffer aBuf;
+
+ if (nCol < 26*26)
+ {
+ if (nCol < 26)
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nCol)));
+ else
+ {
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ (static_cast<sal_uInt16>(nCol) / 26) - 1));
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ (static_cast<sal_uInt16>(nCol) % 26)));
+ }
+ }
+ else
+ {
+ String aStr;
+ while (nCol >= 26)
+ {
+ sal_Int32 nC = nCol % 26;
+ aStr += static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nC));
+ nCol = nCol - nC;
+ nCol = nCol / 26 - 1;
+ }
+ aStr += static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nCol));
+ aStr.Reverse();
+ aBuf.append( aStr);
+ }
+ aBuf.append( OUString::valueOf(nRow+1) );
+ return aBuf.makeStringAndClear();
+}
+
+OUString Cell::getName()
+{
+ // todo: optimize!
+ OUString sName;
+ if( mxTable.is() ) try
+ {
+ Reference< XCell > xThis( static_cast< XCell* >( this ) );
+
+ sal_Int32 nRowCount = mxTable->getRowCount();
+ sal_Int32 nColCount = mxTable->getColumnCount();
+ for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ )
+ {
+ for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ )
+ {
+ Reference< XCell > xCell( mxTable->getCellByPosition( nCol, nRow ) );
+ if( xCell == xThis )
+ {
+ return getCellName( nCol, nRow );
+ }
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+
+ return sName;
+}
+
} }
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index 7f6225fa6f42..901fe4735e51 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -209,6 +209,8 @@ public:
SVX_DLLPRIVATE void notifyModified();
+ ::rtl::OUString getName();
+
protected:
SVX_DLLPRIVATE virtual const SfxItemSet& GetObjectItemSet();
SVX_DLLPRIVATE virtual void SetObjectItem(const SfxPoolItem& rItem);
diff --git a/svx/source/table/celleditsource.hxx b/svx/source/table/celleditsource.hxx
index 72d0f18c582f..1d097dc6ede5 100644
--- a/svx/source/table/celleditsource.hxx
+++ b/svx/source/table/celleditsource.hxx
@@ -73,7 +73,7 @@ public:
void lock();
void unlock();
- // the viewforwarder interface
+ // the SvxViewForwarder interface
virtual BOOL IsValid() const;
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point&, const MapMode& ) const;
diff --git a/svx/source/unoedit/unoedprx.cxx b/svx/source/unoedit/unoedprx.cxx
index 7c31f8b14ffc..e7bbcea519b8 100644
--- a/svx/source/unoedit/unoedprx.cxx
+++ b/svx/source/unoedit/unoedprx.cxx
@@ -1044,6 +1044,16 @@ USHORT SvxAccessibleTextAdapter::GetLineLen( USHORT nPara, USHORT nLine ) const
return static_cast< USHORT >(aEndIndex.GetIndex());
}
+void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ mrTextForwarder->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
+}
+
+USHORT SvxAccessibleTextAdapter::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return mrTextForwarder->GetLineNumberAtIndex( nPara, nIndex );
+}
+
sal_Bool SvxAccessibleTextAdapter::Delete( const ESelection& rSel )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx
index 685e5973b39f..c06c37ae2070 100644
--- a/svx/source/unoedit/unofored.cxx
+++ b/svx/source/unoedit/unofored.cxx
@@ -471,6 +471,17 @@ USHORT SvxEditEngineForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const
return rEditEngine.GetLineLen(nPara, nLine);
}
+void SvxEditEngineForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const
+{
+ rEditEngine.GetLineBoundaries(rStart, rEnd, nPara, nLine);
+}
+
+USHORT SvxEditEngineForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return rEditEngine.GetLineNumberAtIndex(nPara, nIndex);
+}
+
+
sal_Bool SvxEditEngineForwarder::QuickFormatDoc( BOOL )
{
rEditEngine.QuickFormatDoc();
diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx
index c46551d52d4f..9c6cb07440d7 100644
--- a/svx/source/unoedit/unoforou.cxx
+++ b/svx/source/unoedit/unoforou.cxx
@@ -430,6 +430,16 @@ USHORT SvxOutlinerForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const
return rOutliner.GetLineLen(nPara, nLine);
}
+void SvxOutlinerForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const
+{
+ return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine );
+}
+
+USHORT SvxOutlinerForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex );
+}
+
sal_Bool SvxOutlinerForwarder::QuickFormatDoc( BOOL )
{
rOutliner.QuickFormatDoc();
diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx
index 4a550fb8537d..a46533657f1c 100644
--- a/svx/source/unoedit/unotext.cxx
+++ b/svx/source/unoedit/unotext.cxx
@@ -2647,6 +2647,16 @@ USHORT SvxDummyTextSource::GetLineLen( USHORT, USHORT ) const
return 0;
}
+void SvxDummyTextSource::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const
+{
+ rStart = rEnd = 0;
+}
+
+USHORT SvxDummyTextSource::GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const
+{
+ return 0;
+}
+
sal_Bool SvxDummyTextSource::QuickFormatDoc( BOOL )
{
return sal_False;
diff --git a/svx/source/unoedit/unoviwou.cxx b/svx/source/unoedit/unoviwou.cxx
index aff102a09900..3826a4d6a330 100644
--- a/svx/source/unoedit/unoviwou.cxx
+++ b/svx/source/unoedit/unoviwou.cxx
@@ -35,6 +35,7 @@
#include <svx/unoviwou.hxx>
#include <svx/outliner.hxx>
+#include <svx/editeng.hxx>
#include <svx/svdotext.hxx>