diff options
author | Malte Timmermann <Malte.Timmermann@sun.com> | 2010-02-25 16:58:44 +0100 |
---|---|---|
committer | Malte Timmermann <Malte.Timmermann@sun.com> | 2010-02-25 16:58:44 +0100 |
commit | fdde6b9aa1922baa6b0248ea35a4d8bb969b1fb8 (patch) | |
tree | e25219df465a9a4f97ded189b296e961e2a4b01a /svx/source | |
parent | c51e93fc737bdb7f806ee9ce534706b318042a48 (diff) |
mtaccfixes: #i14114# XAccessibleHypertext for EditEngine
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/accessibility/AccessibleEditableTextPara.cxx | 87 | ||||
-rw-r--r-- | svx/source/accessibility/AccessibleEditableTextPara.hxx | 11 | ||||
-rw-r--r-- | svx/source/accessibility/AccessibleEmptyEditSource.cxx | 2 | ||||
-rw-r--r-- | svx/source/accessibility/AccessibleHyperlink.cxx | 146 | ||||
-rw-r--r-- | svx/source/accessibility/AccessibleHyperlink.hxx | 82 | ||||
-rw-r--r-- | svx/source/accessibility/AccessibleTextHelper.cxx | 4 | ||||
-rwxr-xr-x | svx/source/accessibility/makefile.mk | 1 | ||||
-rw-r--r-- | svx/source/inc/unoedprx.hxx | 7 | ||||
-rw-r--r-- | svx/source/unoedit/unoedprx.cxx | 27 | ||||
-rw-r--r-- | svx/source/unoedit/unofored.cxx | 5 | ||||
-rw-r--r-- | svx/source/unoedit/unoforou.cxx | 5 | ||||
-rw-r--r-- | svx/source/unoedit/unotext.cxx | 4 |
12 files changed, 374 insertions, 7 deletions
diff --git a/svx/source/accessibility/AccessibleEditableTextPara.cxx b/svx/source/accessibility/AccessibleEditableTextPara.cxx index 1c0ce04bb1d6..a5be07fc33b2 100644 --- a/svx/source/accessibility/AccessibleEditableTextPara.cxx +++ b/svx/source/accessibility/AccessibleEditableTextPara.cxx @@ -43,6 +43,7 @@ #include <vos/mutex.hxx> #include <vcl/window.hxx> #include <vcl/svapp.hxx> +#include <svx/flditem.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/awt/Point.hpp> @@ -73,6 +74,7 @@ #include "unolingu.hxx" #include "unopracc.hxx" #include "AccessibleEditableTextPara.hxx" +#include "AccessibleHyperlink.hxx" #include <svx/dialmgr.hxx> #include "accessibility.hrc" @@ -528,7 +530,9 @@ namespace accessibility { uno::Reference< XAccessible > xPara = xParentContext->getAccessibleChild( nIndex ); if( xPara.is() ) + { return uno::Reference< XAccessibleText > ( xPara, uno::UNO_QUERY ); + } } } @@ -814,6 +818,11 @@ namespace accessibility uno::Reference< XAccessibleEditableText > aAccEditText = this; aRet <<= aAccEditText; } + else if ( rType == ::getCppuType((uno::Reference< XAccessibleHypertext > *)0) ) + { + uno::Reference< XAccessibleHypertext > aAccHyperText = this; + aRet <<= aAccHyperText; + } else { aRet = AccessibleTextParaInterfaceBase::queryInterface(rType); @@ -2066,6 +2075,84 @@ namespace accessibility return aOutSequence; } + // XAccessibleHypertext + ::sal_Int32 SAL_CALL AccessibleEditableTextPara::getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException) + { + SvxAccessibleTextAdapter& rT = GetTextForwarder(); + const sal_Int32 nPara = GetParagraphIndex(); + + USHORT nHyperLinks = 0; + USHORT nFields = rT.GetFieldCount( nPara ); + for ( USHORT n = 0; n < nFields; n++ ) + { + EFieldInfo aField = rT.GetFieldInfo( nPara, n ); + if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) + nHyperLinks++; + } + return nHyperLinks; + } + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL AccessibleEditableTextPara::getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > xRef; + + SvxAccessibleTextAdapter& rT = GetTextForwarder(); + const sal_Int32 nPara = GetParagraphIndex(); + + USHORT nHyperLink = 0; + USHORT nFields = rT.GetFieldCount( nPara ); + for ( USHORT n = 0; n < nFields; n++ ) + { + EFieldInfo aField = rT.GetFieldInfo( nPara, n ); + if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) + { + if ( nHyperLink == nLinkIndex ) + { + USHORT nEEStart = aField.aPosition.nIndex; + + // Translate EE Index to accessible index + USHORT nStart = rT.CalcEditEngineIndex( nPara, nEEStart ); + USHORT nEnd = nStart + aField.aCurrentText.Len(); + xRef = new AccessibleHyperlink( rT, new SvxFieldItem( *aField.pFieldItem ), nPara, nEEStart, nStart, nEnd, aField.aCurrentText ); + break; + } + nHyperLink++; + } + } + + return xRef; + } + + ::sal_Int32 SAL_CALL AccessibleEditableTextPara::getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + const sal_Int32 nPara = GetParagraphIndex(); + SvxAccessibleTextAdapter& rT = GetTextForwarder(); + +// SvxAccessibleTextIndex aIndex; +// aIndex.SetIndex(nPara, nCharIndex, rT); +// const USHORT nEEIndex = aIndex.GetEEIndex(); + + const USHORT nEEIndex = rT.CalcEditEngineIndex( nPara, nCharIndex ); + sal_Int32 nHLIndex = 0; + USHORT nHyperLink = 0; + USHORT nFields = rT.GetFieldCount( nPara ); + for ( USHORT n = 0; n < nFields; n++ ) + { + EFieldInfo aField = rT.GetFieldInfo( nPara, n ); + if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) + { + if ( aField.aPosition.nIndex == nEEIndex ) + { + nHLIndex = nHyperLink; + break; + } + nHyperLink++; + } + } + + return nHLIndex; + } + // XAccessibleMultiLineText sal_Int32 SAL_CALL AccessibleEditableTextPara::getLineNumberAtIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { diff --git a/svx/source/accessibility/AccessibleEditableTextPara.hxx b/svx/source/accessibility/AccessibleEditableTextPara.hxx index 4e297f44c3b5..daf4e6e7867c 100644 --- a/svx/source/accessibility/AccessibleEditableTextPara.hxx +++ b/svx/source/accessibility/AccessibleEditableTextPara.hxx @@ -34,7 +34,7 @@ #include <tools/gen.hxx> #include <tools/string.hxx> #include <cppuhelper/weakref.hxx> -#include <cppuhelper/compbase8.hxx> +#include <cppuhelper/compbase9.hxx> #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/interfacecontainer.hxx> @@ -45,6 +45,7 @@ #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/XAccessibleHypertext.hpp> #include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp> #include <comphelper/accessibletexthelper.hxx> @@ -55,12 +56,13 @@ namespace accessibility { - typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::accessibility::XAccessible, + typedef ::cppu::WeakComponentImplHelper9< ::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::XAccessibleHypertext, ::com::sun::star::accessibility::XAccessibleMultiLineText, ::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase; @@ -164,6 +166,11 @@ 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); + // XAccessibleHypertext + virtual ::sal_Int32 SAL_CALL getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHyperLinkIndex( ::sal_Int32 nCharIndex ) 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); diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx index 8bfc618dfbd9..3ddae99f33a3 100644 --- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx +++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx @@ -145,6 +145,8 @@ namespace accessibility { return XubString(); } + void FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen ) {;} + BOOL IsValid() const { return sal_True; } void SetNotifyHdl( const Link& ) {} diff --git a/svx/source/accessibility/AccessibleHyperlink.cxx b/svx/source/accessibility/AccessibleHyperlink.cxx new file mode 100644 index 000000000000..5d0e98f0b0d2 --- /dev/null +++ b/svx/source/accessibility/AccessibleHyperlink.cxx @@ -0,0 +1,146 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleEditableTextPara.cxx,v $ + * $Revision: 1.53 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svx.hxx" + +#include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/uno/Reference.hxx> +#include <comphelper/accessiblekeybindinghelper.hxx> + +#include "AccessibleHyperlink.hxx" +#include "unoedprx.hxx" +#include <svx/flditem.hxx> +#include <vcl/keycodes.hxx> + +using namespace ::com::sun::star; + + +//------------------------------------------------------------------------ +// +// AccessibleHyperlink implementation +// +//------------------------------------------------------------------------ + +namespace accessibility +{ + + AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD ) + : rTA( r ) + { + pFld = p; + nPara = nP; + nRealIdx = nR; + nStartIdx = nStt; + nEndIdx = nEnd; + aDescription = rD; + } + + AccessibleHyperlink::~AccessibleHyperlink() + { + delete pFld; + } + + // XAccessibleAction + sal_Int32 SAL_CALL AccessibleHyperlink::getAccessibleActionCount() throw (uno::RuntimeException) + { + return isValid() ? 1 : 0; + } + + sal_Bool SAL_CALL AccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + sal_Bool bRet = sal_False; + if ( isValid() && ( nIndex == 0 ) ) + { + rTA.FieldClicked( *pFld, nPara, nRealIdx ); + bRet = sal_True; + } + return bRet; + } + + ::rtl::OUString SAL_CALL AccessibleHyperlink::getAccessibleActionDescription( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + ::rtl::OUString aDesc; + + if ( isValid() && ( nIndex == 0 ) ) + aDesc = aDescription; + + return aDesc; + } + + uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL AccessibleHyperlink::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > xKeyBinding; + + if( isValid() && ( nIndex == 0 ) ) + { + ::comphelper::OAccessibleKeyBindingHelper* pKeyBindingHelper = new ::comphelper::OAccessibleKeyBindingHelper(); + xKeyBinding = pKeyBindingHelper; + + awt::KeyStroke aKeyStroke; + aKeyStroke.Modifiers = 0; + aKeyStroke.KeyCode = KEY_RETURN; + aKeyStroke.KeyChar = 0; + aKeyStroke.KeyFunc = 0; + pKeyBindingHelper->AddKeyBinding( aKeyStroke ); + } + + return xKeyBinding; + } + + // XAccessibleHyperlink + uno::Any SAL_CALL AccessibleHyperlink::getAccessibleActionAnchor( sal_Int32 /*nIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + return uno::Any(); + } + + uno::Any SAL_CALL AccessibleHyperlink::getAccessibleActionObject( sal_Int32 /*nIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) + { + return uno::Any(); + } + + sal_Int32 SAL_CALL AccessibleHyperlink::getStartIndex() throw (uno::RuntimeException) + { + return nStartIdx; + } + + sal_Int32 SAL_CALL AccessibleHyperlink::getEndIndex() throw (uno::RuntimeException) + { + return nEndIdx; + } + + sal_Bool SAL_CALL AccessibleHyperlink::isValid( ) throw (uno::RuntimeException) + { + return rTA.IsValid(); + } + +} // end of namespace accessibility + +//------------------------------------------------------------------------ diff --git a/svx/source/accessibility/AccessibleHyperlink.hxx b/svx/source/accessibility/AccessibleHyperlink.hxx new file mode 100644 index 000000000000..5192f4b5be0b --- /dev/null +++ b/svx/source/accessibility/AccessibleHyperlink.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleEditableTextPara.hxx,v $ + * $Revision: 1.22 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVX_ACCESSIBLE_HYPERLINK_HXX +#define _SVX_ACCESSIBLE_HYPERLINK_HXX + +#include <cppuhelper/weakref.hxx> +#include <cppuhelper/compbase1.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/interfacecontainer.hxx> + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp> + +#include <tools/solar.h> + +class SvxFieldItem; +class SvxAccessibleTextAdapter; + +namespace accessibility +{ + + class AccessibleHyperlink : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleHyperlink > + { + private: + + SvxAccessibleTextAdapter& rTA; + SvxFieldItem* pFld; + USHORT nPara, nRealIdx; // EE values + sal_Int32 nStartIdx, nEndIdx; // translated values + ::rtl::OUString aDescription; + + public: + AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD ); + ~AccessibleHyperlink(); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleHyperlink + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getStartIndex() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getEndIndex() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isValid() throw (::com::sun::star::uno::RuntimeException); + }; + +} // end of namespace accessibility + +#endif + diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index 5b632115c93c..d186de9d060d 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -52,10 +52,6 @@ #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> #include <com/sun/star/accessibility/XAccessibleComponent.hpp> -#include <com/sun/star/accessibility/AccessibleRole.hpp> -#include <com/sun/star/accessibility/AccessibleTextType.hpp> -#include <com/sun/star/accessibility/XAccessibleText.hpp> -#include <com/sun/star/accessibility/XAccessibleEditableText.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <comphelper/accessibleeventnotifier.hxx> #include <unotools/accessiblestatesethelper.hxx> diff --git a/svx/source/accessibility/makefile.mk b/svx/source/accessibility/makefile.mk index 8b1802bf1a25..dfc25b00a3bb 100755 --- a/svx/source/accessibility/makefile.mk +++ b/svx/source/accessibility/makefile.mk @@ -68,6 +68,7 @@ LIB2OBJFILES= \ $(SLO)$/AccessibleTextEventQueue.obj \ $(SLO)$/AccessibleStaticTextBase.obj \ $(SLO)$/AccessibleParaManager.obj \ + $(SLO)$/AccessibleHyperlink.obj \ $(SLO)$/AccessibleEditableTextPara.obj \ $(SLO)$/AccessibleImageBullet.obj \ $(SLO)$/ShapeTypeHandler.obj \ diff --git a/svx/source/inc/unoedprx.hxx b/svx/source/inc/unoedprx.hxx index a260063d7525..47c75777acf8 100644 --- a/svx/source/inc/unoedprx.hxx +++ b/svx/source/inc/unoedprx.hxx @@ -53,7 +53,10 @@ public: virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); virtual void GetPortions( USHORT nPara, SvUShorts& rList ) const; - virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const; + virtual sal_Int32 CalcLogicalIndex( USHORT nPara, USHORT nEEIndex ); + virtual USHORT CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex ); + + virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const; virtual USHORT GetItemState( USHORT nPara, USHORT nWhich ) const; virtual void QuickInsertText( const String& rText, const ESelection& rSel ); @@ -64,6 +67,8 @@ public: virtual SfxItemPool* GetPool() const; virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ); + virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ); + virtual BOOL IsValid() const; virtual LanguageType GetLanguage( USHORT, USHORT ) const; diff --git a/svx/source/unoedit/unoedprx.cxx b/svx/source/unoedit/unoedprx.cxx index e7bbcea519b8..72ce7da212da 100644 --- a/svx/source/unoedit/unoedprx.cxx +++ b/svx/source/unoedit/unoedprx.cxx @@ -692,6 +692,33 @@ XubString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, return mrTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } +void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +{ + DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + + mrTextForwarder->FieldClicked( rField, nPara, nPos ); +} + +sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( USHORT nPara, USHORT nEEIndex ) +{ + DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + + SvxAccessibleTextIndex aIndex; + aIndex.SetEEIndex(nPara, nEEIndex, *mrTextForwarder); + return aIndex.GetIndex(); +} + +USHORT SvxAccessibleTextAdapter::CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex ) +{ + DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + + SvxAccessibleTextIndex aIndex; + aIndex.SetIndex(nPara, nLogicalIndex, *mrTextForwarder); + return aIndex.GetEEIndex(); +} + + + BOOL SvxAccessibleTextAdapter::IsValid() const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx index 14c8fb20a768..3c853580644e 100644 --- a/svx/source/unoedit/unofored.cxx +++ b/svx/source/unoedit/unofored.cxx @@ -174,6 +174,11 @@ XubString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, US return rEditEngine.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } +void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +{ + rEditEngine.FieldClicked( rField, nPara, nPos ); +} + USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, USHORT nWhich ) { EECharAttribArray aAttribs; diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx index a98b6830b698..3a3a93e92a06 100644 --- a/svx/source/unoedit/unoforou.cxx +++ b/svx/source/unoedit/unoforou.cxx @@ -245,6 +245,11 @@ XubString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, USHO return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } +void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +{ + rOutliner.FieldClicked( rField, nPara, nPos ); +} + BOOL SvxOutlinerForwarder::IsValid() const { // cannot reliably query outliner state diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx index a4d8c36462e6..92218031fdc2 100644 --- a/svx/source/unoedit/unotext.cxx +++ b/svx/source/unoedit/unotext.cxx @@ -2573,6 +2573,10 @@ XubString SvxDummyTextSource::CalcFieldValue( const SvxFieldItem&, sal_uInt16, s return XubString(); } +void SvxDummyTextSource::FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen ) +{ +} + sal_Bool SvxDummyTextSource::IsValid() const { return sal_False; |