Bump version to 4.3-4
[LibreOffice.git] / editeng / source / uno / unoedprx.cxx
blob8a3eb5677d18e8e64428604e4a7db41e5b72784c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 // Global header
27 #include <limits.h>
28 #include <vector>
29 #include <algorithm>
30 #include <osl/mutex.hxx>
31 #include <vcl/window.hxx>
32 #include <vcl/svapp.hxx>
33 #include <com/sun/star/uno/Any.hxx>
34 #include <com/sun/star/uno/Reference.hxx>
38 // Project-local header
41 #include "editeng/unoedprx.hxx"
42 #include <editeng/unotext.hxx>
43 #include <editeng/unoedhlp.hxx>
44 #include <editeng/editdata.hxx>
45 #include <editeng/editeng.hxx>
46 #include <editeng/editview.hxx>
47 #include <editeng/AccessibleStringWrap.hxx>
48 #include <editeng/outliner.hxx>
50 using namespace ::com::sun::star;
53 class SvxAccessibleTextIndex
55 public:
56 SvxAccessibleTextIndex() :
57 mnPara(0),
58 mnIndex(0),
59 mnEEIndex(0),
60 mnFieldOffset(0),
61 mnFieldLen(0),
62 mbInField(false),
63 mnBulletOffset(0),
64 mnBulletLen(0),
65 mbInBullet(false) {};
66 ~SvxAccessibleTextIndex() {};
68 // Get/Set current paragraph
69 void SetParagraph( sal_Int32 nPara )
71 mnPara = nPara;
73 sal_Int32 GetParagraph() const { return mnPara; }
75 /** Set the index in the UAA semantic
77 @param nIndex
78 The index from the UA API (fields and bullets are expanded)
80 @param rTF
81 The text forwarder to use in the calculations
83 void SetIndex( sal_Int32 nIndex, const SvxTextForwarder& rTF );
84 void SetIndex( sal_Int32 nPara, sal_Int32 nIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetIndex(nIndex, rTF); }
85 sal_Int32 GetIndex() const { return mnIndex; }
87 /** Set the index in the edit engine semantic
89 Update the object state to reflect the given index position in
90 EditEngine/Outliner index values
92 @param nEEIndex
93 The index from the edit engine (fields span exactly one index increment)
95 @param rTF
96 The text forwarder to use in the calculations
98 void SetEEIndex( sal_uInt16 nEEIndex, const SvxTextForwarder& rTF );
99 void SetEEIndex( sal_Int32 nPara, sal_uInt16 nEEIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetEEIndex(nEEIndex, rTF); }
100 sal_uInt16 GetEEIndex() const;
102 void SetFieldOffset( sal_Int32 nOffset, sal_Int32 nLen ) { mnFieldOffset = nOffset; mnFieldLen = nLen; }
103 sal_Int32 GetFieldOffset() const { return mnFieldOffset; }
104 sal_Int32 GetFieldLen() const { return mnFieldLen; }
105 void AreInField( bool bInField = true ) { mbInField = bInField; }
106 bool InField() const { return mbInField; }
108 void SetBulletOffset( sal_Int32 nOffset, sal_Int32 nLen ) { mnBulletOffset = nOffset; mnBulletLen = nLen; }
109 sal_Int32 GetBulletOffset() const { return mnBulletOffset; }
110 sal_Int32 GetBulletLen() const { return mnBulletLen; }
111 void AreInBullet( bool bInBullet = true ) { mbInBullet = bInBullet; }
112 bool InBullet() const { return mbInBullet; }
114 /// returns false if the given range is non-editable (e.g. contains bullets or _parts_ of fields)
115 bool IsEditableRange( const SvxAccessibleTextIndex& rEnd ) const;
117 private:
118 sal_Int32 mnPara;
119 sal_Int32 mnIndex;
120 sal_Int32 mnEEIndex;
121 sal_Int32 mnFieldOffset;
122 sal_Int32 mnFieldLen;
123 bool mbInField;
124 sal_Int32 mnBulletOffset;
125 sal_Int32 mnBulletLen;
126 bool mbInBullet;
129 ESelection MakeEESelection( const SvxAccessibleTextIndex& rStart, const SvxAccessibleTextIndex& rEnd )
131 // deal with field special case: to really get a field contained
132 // within a selection, the start index must be before or on the
133 // field, the end index after it.
135 // The SvxAccessibleTextIndex.GetEEIndex method gives the index on
136 // the field, as long the input index is on the field. Thus,
137 // correction necessary for the end index
139 // Therefore, for _ranges_, if part of the field is touched, all
140 // of the field must be selected
141 if( rStart.GetParagraph() <= rEnd.GetParagraph() ||
142 (rStart.GetParagraph() == rEnd.GetParagraph() &&
143 rStart.GetEEIndex() <= rEnd.GetEEIndex()) )
145 if( rEnd.InField() && rEnd.GetFieldOffset() )
146 return ESelection( rStart.GetParagraph(), rStart.GetEEIndex(),
147 rEnd.GetParagraph(), rEnd.GetEEIndex()+1 );
149 else if( rStart.GetParagraph() > rEnd.GetParagraph() ||
150 (rStart.GetParagraph() == rEnd.GetParagraph() &&
151 rStart.GetEEIndex() > rEnd.GetEEIndex()) )
153 if( rStart.InField() && rStart.GetFieldOffset() )
154 return ESelection( rStart.GetParagraph(), rStart.GetEEIndex()+1,
155 rEnd.GetParagraph(), rEnd.GetEEIndex() );
158 return ESelection( rStart.GetParagraph(), rStart.GetEEIndex(),
159 rEnd.GetParagraph(), rEnd.GetEEIndex() );
162 ESelection MakeEESelection( const SvxAccessibleTextIndex& rIndex )
164 return ESelection( rIndex.GetParagraph(), rIndex.GetEEIndex(),
165 rIndex.GetParagraph(), rIndex.GetEEIndex() + 1 );
168 sal_uInt16 SvxAccessibleTextIndex::GetEEIndex() const
170 DBG_ASSERT(mnEEIndex >= 0 && mnEEIndex <= USHRT_MAX,
171 "SvxAccessibleTextIndex::GetEEIndex: index value overflow");
173 return static_cast< sal_uInt16 > (mnEEIndex);
176 void SvxAccessibleTextIndex::SetEEIndex( sal_uInt16 nEEIndex, const SvxTextForwarder& rTF )
178 // reset
179 mnFieldOffset = 0;
180 mbInField = false;
181 mnFieldLen = 0;
182 mnBulletOffset = 0;
183 mbInBullet = false;
184 mnBulletLen = 0;
186 // set known values
187 mnEEIndex = nEEIndex;
189 // calculate unknowns
190 sal_Int32 nCurrField, nFieldCount = rTF.GetFieldCount( GetParagraph() );
192 mnIndex = nEEIndex;
194 EBulletInfo aBulletInfo = rTF.GetBulletInfo( GetParagraph() );
196 // any text bullets?
197 if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND &&
198 aBulletInfo.bVisible &&
199 aBulletInfo.nType != SVX_NUM_BITMAP )
201 mnIndex += aBulletInfo.aText.getLength();
204 for( nCurrField=0; nCurrField < nFieldCount; ++nCurrField )
206 EFieldInfo aFieldInfo( rTF.GetFieldInfo( GetParagraph(), nCurrField ) );
208 if( aFieldInfo.aPosition.nIndex > nEEIndex )
209 break;
211 if( aFieldInfo.aPosition.nIndex == nEEIndex )
213 AreInField();
214 break;
217 // #106010#
218 mnIndex += ::std::max(aFieldInfo.aCurrentText.getLength()-1, (sal_Int32)0);
222 void SvxAccessibleTextIndex::SetIndex( sal_Int32 nIndex, const SvxTextForwarder& rTF )
224 // reset
225 mnFieldOffset = 0;
226 mbInField = false;
227 mnFieldLen = 0;
228 mnBulletOffset = 0;
229 mbInBullet = false;
230 mnBulletLen = 0;
232 // set known values
233 mnIndex = nIndex;
235 // calculate unknowns
236 sal_Int32 nCurrField, nFieldCount = rTF.GetFieldCount( GetParagraph() );
238 DBG_ASSERT(nIndex >= 0 && nIndex <= USHRT_MAX,
239 "SvxAccessibleTextIndex::SetIndex: index value overflow");
241 mnEEIndex = nIndex;
243 EBulletInfo aBulletInfo = rTF.GetBulletInfo( GetParagraph() );
245 // any text bullets?
246 if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND &&
247 aBulletInfo.bVisible &&
248 aBulletInfo.nType != SVX_NUM_BITMAP )
250 sal_Int32 nBulletLen = aBulletInfo.aText.getLength();
252 if( nIndex < nBulletLen )
254 AreInBullet();
255 SetBulletOffset( nIndex, nBulletLen );
256 mnEEIndex = 0;
257 return;
260 mnEEIndex = mnEEIndex - nBulletLen;
263 for( nCurrField=0; nCurrField < nFieldCount; ++nCurrField )
265 EFieldInfo aFieldInfo( rTF.GetFieldInfo( GetParagraph(), nCurrField ) );
267 // we're before a field
268 if( aFieldInfo.aPosition.nIndex > mnEEIndex )
269 break;
271 // #106010#
272 mnEEIndex -= ::std::max(aFieldInfo.aCurrentText.getLength()-1, (sal_Int32)0);
274 // we're within a field
275 if( aFieldInfo.aPosition.nIndex >= mnEEIndex )
277 AreInField();
278 SetFieldOffset( ::std::max(aFieldInfo.aCurrentText.getLength()-1, (sal_Int32)0) - (aFieldInfo.aPosition.nIndex - mnEEIndex),
279 aFieldInfo.aCurrentText.getLength() );
280 mnEEIndex = aFieldInfo.aPosition.nIndex ;
281 break;
286 bool SvxAccessibleTextIndex::IsEditableRange( const SvxAccessibleTextIndex& rEnd ) const
288 if( GetIndex() > rEnd.GetIndex() )
289 return rEnd.IsEditableRange( *this );
291 if( InBullet() || rEnd.InBullet() )
292 return false;
294 if( InField() && GetFieldOffset() )
295 return false; // within field
297 if( rEnd.InField() && rEnd.GetFieldOffset() >= rEnd.GetFieldLen() - 1 )
298 return false; // within field
300 return true;
305 SvxEditSourceAdapter::SvxEditSourceAdapter() : mbEditSourceValid( false )
309 SvxEditSourceAdapter::~SvxEditSourceAdapter()
313 SvxEditSource* SvxEditSourceAdapter::Clone() const
315 if( mbEditSourceValid && mpAdaptee.get() )
317 SAL_WNODEPRECATED_DECLARATIONS_PUSH
318 ::std::auto_ptr< SvxEditSource > pClonedAdaptee( mpAdaptee->Clone() );
319 SAL_WNODEPRECATED_DECLARATIONS_POP
321 if( pClonedAdaptee.get() )
323 SvxEditSourceAdapter* pClone = new SvxEditSourceAdapter();
325 if( pClone )
327 pClone->SetEditSource( pClonedAdaptee );
328 return pClone;
333 return NULL;
336 SvxAccessibleTextAdapter* SvxEditSourceAdapter::GetTextForwarderAdapter()
338 if( mbEditSourceValid && mpAdaptee.get() )
340 SvxTextForwarder* pTextForwarder = mpAdaptee->GetTextForwarder();
342 if( pTextForwarder )
344 maTextAdapter.SetForwarder(*pTextForwarder);
346 return &maTextAdapter;
350 return NULL;
353 SvxTextForwarder* SvxEditSourceAdapter::GetTextForwarder()
355 return GetTextForwarderAdapter();
358 SvxViewForwarder* SvxEditSourceAdapter::GetViewForwarder()
360 if( mbEditSourceValid && mpAdaptee.get() )
361 return mpAdaptee->GetViewForwarder();
363 return NULL;
366 SvxAccessibleTextEditViewAdapter* SvxEditSourceAdapter::GetEditViewForwarderAdapter( bool bCreate )
368 if( mbEditSourceValid && mpAdaptee.get() )
370 SvxEditViewForwarder* pEditViewForwarder = mpAdaptee->GetEditViewForwarder(bCreate);
372 if( pEditViewForwarder )
374 SvxAccessibleTextAdapter* pTextAdapter = GetTextForwarderAdapter();
376 if( pTextAdapter )
378 maEditViewAdapter.SetForwarder(*pEditViewForwarder, *pTextAdapter);
380 return &maEditViewAdapter;
385 return NULL;
388 SvxEditViewForwarder* SvxEditSourceAdapter::GetEditViewForwarder( bool bCreate )
390 return GetEditViewForwarderAdapter( bCreate );
393 void SvxEditSourceAdapter::UpdateData()
395 if( mbEditSourceValid && mpAdaptee.get() )
396 mpAdaptee->UpdateData();
399 SfxBroadcaster& SvxEditSourceAdapter::GetBroadcaster() const
401 if( mbEditSourceValid && mpAdaptee.get() )
402 return mpAdaptee->GetBroadcaster();
404 return maDummyBroadcaster;
407 SAL_WNODEPRECATED_DECLARATIONS_PUSH
408 void SvxEditSourceAdapter::SetEditSource( ::std::auto_ptr< SvxEditSource > pAdaptee )
410 if( pAdaptee.get() )
412 mpAdaptee = pAdaptee;
413 mbEditSourceValid = true;
415 else
417 // do a lazy delete (prevents us from deleting the broadcaster
418 // from within a broadcast in
419 // AccessibleTextHelper_Impl::Notify)
420 mbEditSourceValid = false;
423 SAL_WNODEPRECATED_DECLARATIONS_POP
425 bool SvxEditSourceAdapter::IsValid() const
427 return mbEditSourceValid;
433 SvxAccessibleTextAdapter::SvxAccessibleTextAdapter() : mpTextForwarder( NULL )
437 SvxAccessibleTextAdapter::~SvxAccessibleTextAdapter()
441 sal_Int32 SvxAccessibleTextAdapter::GetParagraphCount() const
443 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
445 return mpTextForwarder->GetParagraphCount();
448 sal_Int32 SvxAccessibleTextAdapter::GetTextLen( sal_Int32 nParagraph ) const
450 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
452 SvxAccessibleTextIndex aIndex;
453 aIndex.SetEEIndex( nParagraph, mpTextForwarder->GetTextLen( nParagraph ), *this );
455 return aIndex.GetIndex();
458 OUString SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const
460 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
462 SvxAccessibleTextIndex aStartIndex;
463 SvxAccessibleTextIndex aEndIndex;
465 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
466 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
468 // normalize selection
469 if( rSel.nStartPara > rSel.nEndPara ||
470 (rSel.nStartPara == rSel.nEndPara && rSel.nStartPos > rSel.nEndPos) )
472 ::std::swap( aStartIndex, aEndIndex );
475 OUString sStr = mpTextForwarder->GetText( MakeEESelection(aStartIndex, aEndIndex) );
477 // trim field text, if necessary
478 if( aStartIndex.InField() )
480 DBG_ASSERT(aStartIndex.GetFieldOffset() >= 0 &&
481 aStartIndex.GetFieldOffset() <= USHRT_MAX,
482 "SvxAccessibleTextIndex::GetText: index value overflow");
484 sStr = sStr.copy( aStartIndex.GetFieldOffset() );
486 if( aEndIndex.InField() && aEndIndex.GetFieldOffset() )
488 DBG_ASSERT(sStr.getLength() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) >= 0 &&
489 sStr.getLength() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) <= USHRT_MAX,
490 "SvxAccessibleTextIndex::GetText: index value overflow");
492 sStr = sStr.copy(0, sStr.getLength() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) );
495 EBulletInfo aBulletInfo1 = GetBulletInfo( aStartIndex.GetParagraph() );
496 EBulletInfo aBulletInfo2 = GetBulletInfo( aEndIndex.GetParagraph() );
498 if( aEndIndex.InBullet() )
500 // append trailing bullet
501 sStr += aBulletInfo2.aText;
503 DBG_ASSERT(sStr.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) >= 0 &&
504 sStr.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) <= USHRT_MAX,
505 "SvxAccessibleTextIndex::GetText: index value overflow");
507 sStr = sStr.copy(0, sStr.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) );
509 else if( aStartIndex.GetParagraph() != aEndIndex.GetParagraph() &&
510 HaveTextBullet( aEndIndex.GetParagraph() ) )
512 OUString sBullet = aBulletInfo2.aText;
514 DBG_ASSERT(sBullet.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) >= 0 &&
515 sBullet.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) <= USHRT_MAX,
516 "SvxAccessibleTextIndex::GetText: index value overflow");
518 sBullet = sBullet.copy(0, sBullet.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) );
520 // insert bullet
521 sStr = sStr.replaceAt( GetTextLen(aStartIndex.GetParagraph()) - aStartIndex.GetIndex(), 0, sBullet );
524 return sStr;
527 SfxItemSet SvxAccessibleTextAdapter::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) const
529 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
531 SvxAccessibleTextIndex aStartIndex;
532 SvxAccessibleTextIndex aEndIndex;
534 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
535 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
537 return mpTextForwarder->GetAttribs( MakeEESelection(aStartIndex, aEndIndex), nOnlyHardAttrib );
540 SfxItemSet SvxAccessibleTextAdapter::GetParaAttribs( sal_Int32 nPara ) const
542 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
544 return mpTextForwarder->GetParaAttribs( nPara );
547 void SvxAccessibleTextAdapter::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
549 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
551 mpTextForwarder->SetParaAttribs( nPara, rSet );
554 void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& , bool , sal_uInt16 )
556 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
559 void SvxAccessibleTextAdapter::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const
561 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
563 mpTextForwarder->GetPortions( nPara, rList );
566 sal_uInt16 SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
568 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
570 SvxAccessibleTextIndex aStartIndex;
571 SvxAccessibleTextIndex aEndIndex;
573 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
574 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
576 return mpTextForwarder->GetItemState( MakeEESelection(aStartIndex, aEndIndex),
577 nWhich );
580 sal_uInt16 SvxAccessibleTextAdapter::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
582 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
584 return mpTextForwarder->GetItemState( nPara, nWhich );
587 void SvxAccessibleTextAdapter::QuickInsertText( const OUString& rText, const ESelection& rSel )
589 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
591 SvxAccessibleTextIndex aStartIndex;
592 SvxAccessibleTextIndex aEndIndex;
594 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
595 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
597 mpTextForwarder->QuickInsertText( rText,
598 MakeEESelection(aStartIndex, aEndIndex) );
601 void SvxAccessibleTextAdapter::QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel )
603 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
605 SvxAccessibleTextIndex aStartIndex;
606 SvxAccessibleTextIndex aEndIndex;
608 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
609 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
611 mpTextForwarder->QuickInsertField( rFld,
612 MakeEESelection(aStartIndex, aEndIndex) );
615 void SvxAccessibleTextAdapter::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel )
617 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
619 SvxAccessibleTextIndex aStartIndex;
620 SvxAccessibleTextIndex aEndIndex;
622 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
623 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
625 mpTextForwarder->QuickSetAttribs( rSet,
626 MakeEESelection(aStartIndex, aEndIndex) );
629 void SvxAccessibleTextAdapter::QuickInsertLineBreak( const ESelection& rSel )
631 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
633 SvxAccessibleTextIndex aStartIndex;
634 SvxAccessibleTextIndex aEndIndex;
636 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
637 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
639 mpTextForwarder->QuickInsertLineBreak( MakeEESelection(aStartIndex, aEndIndex) );
642 SfxItemPool* SvxAccessibleTextAdapter::GetPool() const
644 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
646 return mpTextForwarder->GetPool();
649 OUString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor )
651 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
653 return mpTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
656 void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos )
658 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
660 mpTextForwarder->FieldClicked( rField, nPara, nPos );
663 sal_uInt16 SvxAccessibleTextAdapter::CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 nLogicalIndex )
665 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
667 SvxAccessibleTextIndex aIndex;
668 aIndex.SetIndex(nPara, nLogicalIndex, *mpTextForwarder);
669 return aIndex.GetEEIndex();
674 bool SvxAccessibleTextAdapter::IsValid() const
676 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
678 if( mpTextForwarder )
679 return mpTextForwarder->IsValid();
680 else
681 return false;
684 LanguageType SvxAccessibleTextAdapter::GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const
686 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
688 SvxAccessibleTextIndex aIndex;
690 aIndex.SetIndex( nPara, nPos, *this );
692 return mpTextForwarder->GetLanguage( nPara, aIndex.GetEEIndex() );
695 sal_Int32 SvxAccessibleTextAdapter::GetFieldCount( sal_Int32 nPara ) const
697 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
699 return mpTextForwarder->GetFieldCount( nPara );
702 EFieldInfo SvxAccessibleTextAdapter::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
704 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
706 return mpTextForwarder->GetFieldInfo( nPara, nField );
709 EBulletInfo SvxAccessibleTextAdapter::GetBulletInfo( sal_Int32 nPara ) const
711 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
713 return mpTextForwarder->GetBulletInfo( nPara );
716 void SvxAccessibleTextAdapter::SetUpdateModeForAcc(bool bUp)
718 return mpTextForwarder->SetUpdateModeForAcc(bUp);
721 bool SvxAccessibleTextAdapter::GetUpdateModeForAcc( ) const
723 return mpTextForwarder->GetUpdateModeForAcc();
726 Rectangle SvxAccessibleTextAdapter::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const
728 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
730 SvxAccessibleTextIndex aIndex;
731 aIndex.SetIndex( nPara, nIndex, *this );
733 // preset if anything goes wrong below
734 // n-th char in GetParagraphIndex's paragraph
735 Rectangle aRect = mpTextForwarder->GetCharBounds( nPara, aIndex.GetEEIndex() );
737 if( aIndex.InBullet() )
739 EBulletInfo aBulletInfo = GetBulletInfo( nPara );
741 OutputDevice* pOutDev = GetRefDevice();
743 DBG_ASSERT(pOutDev!=NULL, "SvxAccessibleTextAdapter::GetCharBounds: No ref device");
745 // preset if anything goes wrong below
746 aRect = aBulletInfo.aBounds; // better than nothing
747 if( pOutDev )
749 AccessibleStringWrap aStringWrap( *pOutDev, aBulletInfo.aFont, aBulletInfo.aText );
751 aStringWrap.GetCharacterBounds( aIndex.GetBulletOffset(), aRect );
752 aRect.Move( aBulletInfo.aBounds.Left(), aBulletInfo.aBounds.Top() );
755 else
757 // handle field content manually
758 if( aIndex.InField() )
760 OutputDevice* pOutDev = GetRefDevice();
762 DBG_ASSERT(pOutDev!=NULL, "SvxAccessibleTextAdapter::GetCharBounds: No ref device");
764 if( pOutDev )
766 ESelection aSel = MakeEESelection( aIndex );
768 SvxFont aFont = EditEngine::CreateSvxFontFromItemSet( mpTextForwarder->GetAttribs( aSel ) );
769 AccessibleStringWrap aStringWrap( *pOutDev,
770 aFont,
771 mpTextForwarder->GetText( aSel ) );
773 Rectangle aStartRect = mpTextForwarder->GetCharBounds( nPara, aIndex.GetEEIndex() );
775 aStringWrap.GetCharacterBounds( aIndex.GetFieldOffset(), aRect );
776 aRect.Move( aStartRect.Left(), aStartRect.Top() );
781 return aRect;
784 Rectangle SvxAccessibleTextAdapter::GetParaBounds( sal_Int32 nPara ) const
786 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
788 EBulletInfo aBulletInfo = GetBulletInfo( nPara );
790 if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND &&
791 aBulletInfo.bVisible &&
792 aBulletInfo.nType != SVX_NUM_BITMAP )
794 // include bullet in para bounding box
795 Rectangle aRect( mpTextForwarder->GetParaBounds( nPara ) );
797 aRect.Union( aBulletInfo.aBounds );
799 return aRect;
802 return mpTextForwarder->GetParaBounds( nPara );
805 MapMode SvxAccessibleTextAdapter::GetMapMode() const
807 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
809 return mpTextForwarder->GetMapMode();
812 OutputDevice* SvxAccessibleTextAdapter::GetRefDevice() const
814 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
816 return mpTextForwarder->GetRefDevice();
819 bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_Int32& nPara, sal_Int32& nIndex ) const
821 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
823 if( !mpTextForwarder->GetIndexAtPoint( rPoint, nPara, nIndex ) )
824 return false;
826 SvxAccessibleTextIndex aIndex;
827 aIndex.SetEEIndex(nPara, nIndex, *this);
829 DBG_ASSERT(aIndex.GetIndex() >= 0 && aIndex.GetIndex() <= USHRT_MAX,
830 "SvxAccessibleTextIndex::SetIndex: index value overflow");
832 nIndex = aIndex.GetIndex();
834 EBulletInfo aBulletInfo = GetBulletInfo( nPara );
836 // any text bullets?
837 if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND &&
838 aBulletInfo.bVisible &&
839 aBulletInfo.nType != SVX_NUM_BITMAP )
841 if( aBulletInfo.aBounds.IsInside( rPoint) )
843 OutputDevice* pOutDev = GetRefDevice();
845 DBG_ASSERT(pOutDev!=NULL, "SvxAccessibleTextAdapter::GetIndexAtPoint: No ref device");
847 if( !pOutDev )
848 return false;
850 AccessibleStringWrap aStringWrap( *pOutDev, aBulletInfo.aFont, aBulletInfo.aText );
852 Point aPoint = rPoint;
853 aPoint.Move( -aBulletInfo.aBounds.Left(), -aBulletInfo.aBounds.Top() );
855 DBG_ASSERT(aStringWrap.GetIndexAtPoint( aPoint ) >= 0 &&
856 aStringWrap.GetIndexAtPoint( aPoint ) <= USHRT_MAX,
857 "SvxAccessibleTextIndex::SetIndex: index value overflow");
859 nIndex = aStringWrap.GetIndexAtPoint( aPoint );
860 return true;
864 if( aIndex.InField() )
866 OutputDevice* pOutDev = GetRefDevice();
868 DBG_ASSERT(pOutDev!=NULL, "SvxAccessibleTextAdapter::GetIndexAtPoint: No ref device");
870 if( !pOutDev )
871 return false;
873 ESelection aSelection = MakeEESelection( aIndex );
874 SvxFont aFont = EditEngine::CreateSvxFontFromItemSet( mpTextForwarder->GetAttribs( aSelection ) );
875 AccessibleStringWrap aStringWrap( *pOutDev,
876 aFont,
877 mpTextForwarder->GetText( aSelection ) );
879 Rectangle aRect = mpTextForwarder->GetCharBounds( nPara, aIndex.GetEEIndex() );
880 Point aPoint = rPoint;
881 aPoint.Move( -aRect.Left(), -aRect.Top() );
883 DBG_ASSERT(aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( rPoint ) >= 0 &&
884 aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( rPoint ) <= USHRT_MAX,
885 "SvxAccessibleTextIndex::SetIndex: index value overflow");
887 nIndex = (aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( aPoint ));
888 return true;
891 return true;
894 bool SvxAccessibleTextAdapter::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const
896 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
898 SvxAccessibleTextIndex aIndex;
899 aIndex.SetIndex(nPara, nIndex, *this);
900 nIndex = aIndex.GetEEIndex();
902 if( aIndex.InBullet() )
904 DBG_ASSERT(aIndex.GetBulletLen() >= 0 &&
905 aIndex.GetBulletLen() <= USHRT_MAX,
906 "SvxAccessibleTextIndex::SetIndex: index value overflow");
908 // always treat bullet as separate word
909 nStart = 0;
910 nEnd = aIndex.GetBulletLen();
912 return true;
915 if( aIndex.InField() )
917 DBG_ASSERT(aIndex.GetIndex() - aIndex.GetFieldOffset() >= 0 &&
918 aIndex.GetIndex() - aIndex.GetFieldOffset() <= USHRT_MAX &&
919 nStart + aIndex.GetFieldLen() >= 0 &&
920 nStart + aIndex.GetFieldLen() <= USHRT_MAX,
921 "SvxAccessibleTextIndex::SetIndex: index value overflow");
923 // always treat field as separate word
924 // TODO: to circumvent this, _we_ would have to do the break iterator stuff!
925 nStart = aIndex.GetIndex() - aIndex.GetFieldOffset();
926 nEnd = nStart + aIndex.GetFieldLen();
928 return true;
931 if( !mpTextForwarder->GetWordIndices( nPara, nIndex, nStart, nEnd ) )
932 return false;
934 aIndex.SetEEIndex( nPara, nStart, *this );
935 DBG_ASSERT(aIndex.GetIndex() >= 0 &&
936 aIndex.GetIndex() <= USHRT_MAX,
937 "SvxAccessibleTextIndex::SetIndex: index value overflow");
938 nStart = aIndex.GetIndex();
940 aIndex.SetEEIndex( nPara, nEnd, *this );
941 DBG_ASSERT(aIndex.GetIndex() >= 0 &&
942 aIndex.GetIndex() <= USHRT_MAX,
943 "SvxAccessibleTextIndex::SetIndex: index value overflow");
944 nEnd = aIndex.GetIndex();
946 return true;
949 bool SvxAccessibleTextAdapter::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool /* bInCell */ ) const
951 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
953 SvxAccessibleTextIndex aIndex;
954 aIndex.SetIndex(nPara, nIndex, *this);
955 nIndex = aIndex.GetEEIndex();
957 if( aIndex.InBullet() )
959 DBG_ASSERT(aIndex.GetBulletLen() >= 0 &&
960 aIndex.GetBulletLen() <= USHRT_MAX,
961 "SvxAccessibleTextIndex::SetIndex: index value overflow");
963 // always treat bullet as distinct attribute
964 nStartIndex = 0;
965 nEndIndex = aIndex.GetBulletLen();
967 return true;
970 if( aIndex.InField() )
972 DBG_ASSERT(aIndex.GetIndex() - aIndex.GetFieldOffset() >= 0 &&
973 aIndex.GetIndex() - aIndex.GetFieldOffset() <= USHRT_MAX,
974 "SvxAccessibleTextIndex::SetIndex: index value overflow");
976 // always treat field as distinct attribute
977 nStartIndex = aIndex.GetIndex() - aIndex.GetFieldOffset();
978 nEndIndex = nStartIndex + aIndex.GetFieldLen();
980 return true;
983 if( !mpTextForwarder->GetAttributeRun( nStartIndex, nEndIndex, nPara, nIndex ) )
984 return false;
986 aIndex.SetEEIndex( nPara, nStartIndex, *this );
987 DBG_ASSERT(aIndex.GetIndex() >= 0 &&
988 aIndex.GetIndex() <= USHRT_MAX,
989 "SvxAccessibleTextIndex::SetIndex: index value overflow");
990 nStartIndex = aIndex.GetIndex();
992 aIndex.SetEEIndex( nPara, nEndIndex, *this );
993 DBG_ASSERT(aIndex.GetIndex() >= 0 &&
994 aIndex.GetIndex() <= USHRT_MAX,
995 "SvxAccessibleTextIndex::SetIndex: index value overflow");
996 nEndIndex = aIndex.GetIndex();
998 return true;
1001 sal_Int32 SvxAccessibleTextAdapter::GetLineCount( sal_Int32 nPara ) const
1003 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1005 return mpTextForwarder->GetLineCount( nPara );
1008 sal_Int32 SvxAccessibleTextAdapter::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const
1010 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1012 SvxAccessibleTextIndex aStartIndex;
1013 SvxAccessibleTextIndex aEndIndex;
1014 sal_Int32 nCurrLine;
1015 sal_Int32 nCurrIndex, nLastIndex;
1016 for( nCurrLine=0, nCurrIndex=0, nLastIndex=0; nCurrLine<=nLine; ++nCurrLine )
1018 nLastIndex = nCurrIndex;
1019 nCurrIndex =
1020 nCurrIndex + mpTextForwarder->GetLineLen( nPara, nCurrLine );
1023 aEndIndex.SetEEIndex( nPara, nCurrIndex, *this );
1024 if( nLine > 0 )
1026 aStartIndex.SetEEIndex( nPara, nLastIndex, *this );
1028 return aEndIndex.GetIndex() - aStartIndex.GetIndex();
1030 else
1031 return aEndIndex.GetIndex();
1034 void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const
1036 mpTextForwarder->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
1039 sal_Int32 SvxAccessibleTextAdapter::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const
1041 return mpTextForwarder->GetLineNumberAtIndex( nPara, nIndex );
1044 bool SvxAccessibleTextAdapter::Delete( const ESelection& rSel )
1046 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1048 SvxAccessibleTextIndex aStartIndex;
1049 SvxAccessibleTextIndex aEndIndex;
1051 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
1052 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
1054 return mpTextForwarder->Delete( MakeEESelection(aStartIndex, aEndIndex ) );
1057 bool SvxAccessibleTextAdapter::InsertText( const OUString& rStr, const ESelection& rSel )
1059 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1061 SvxAccessibleTextIndex aStartIndex;
1062 SvxAccessibleTextIndex aEndIndex;
1064 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
1065 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
1067 return mpTextForwarder->InsertText( rStr, MakeEESelection(aStartIndex, aEndIndex) );
1070 bool SvxAccessibleTextAdapter::QuickFormatDoc( bool bFull )
1072 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1074 return mpTextForwarder->QuickFormatDoc( bFull );
1077 sal_Int16 SvxAccessibleTextAdapter::GetDepth( sal_Int32 nPara ) const
1079 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1081 return mpTextForwarder->GetDepth( nPara );
1084 bool SvxAccessibleTextAdapter::SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth )
1086 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1088 return mpTextForwarder->SetDepth( nPara, nNewDepth );
1091 void SvxAccessibleTextAdapter::SetForwarder( SvxTextForwarder& rForwarder )
1093 mpTextForwarder = &rForwarder;
1096 bool SvxAccessibleTextAdapter::HaveImageBullet( sal_Int32 nPara ) const
1098 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1100 EBulletInfo aBulletInfo = GetBulletInfo( nPara );
1102 return ( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND &&
1103 aBulletInfo.bVisible &&
1104 aBulletInfo.nType == SVX_NUM_BITMAP );
1107 bool SvxAccessibleTextAdapter::HaveTextBullet( sal_Int32 nPara ) const
1109 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1111 EBulletInfo aBulletInfo = GetBulletInfo( nPara );
1113 return ( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND &&
1114 aBulletInfo.bVisible &&
1115 aBulletInfo.nType != SVX_NUM_BITMAP );
1118 bool SvxAccessibleTextAdapter::IsEditable( const ESelection& rSel )
1120 DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
1122 SvxAccessibleTextIndex aStartIndex;
1123 SvxAccessibleTextIndex aEndIndex;
1125 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *this );
1126 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *this );
1128 // normalize selection
1129 if( rSel.nStartPara > rSel.nEndPara ||
1130 (rSel.nStartPara == rSel.nEndPara && rSel.nStartPos > rSel.nEndPos) )
1132 ::std::swap( aStartIndex, aEndIndex );
1135 return aStartIndex.IsEditableRange( aEndIndex );
1138 const SfxItemSet * SvxAccessibleTextAdapter::GetEmptyItemSetPtr()
1140 OSL_FAIL( "not implemented" );
1141 return 0;
1144 void SvxAccessibleTextAdapter::AppendParagraph()
1146 OSL_FAIL( "not implemented" );
1149 sal_Int32 SvxAccessibleTextAdapter::AppendTextPortion( sal_Int32, const OUString &, const SfxItemSet & )
1151 OSL_FAIL( "not implemented" );
1152 return 0;
1154 void SvxAccessibleTextAdapter::CopyText(const SvxTextForwarder&)
1156 OSL_FAIL( "not implemented" );
1163 SvxAccessibleTextEditViewAdapter::SvxAccessibleTextEditViewAdapter()
1164 : mpViewForwarder(NULL)
1165 , mpTextForwarder(NULL)
1169 SvxAccessibleTextEditViewAdapter::~SvxAccessibleTextEditViewAdapter()
1173 bool SvxAccessibleTextEditViewAdapter::IsValid() const
1175 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1177 if( mpViewForwarder )
1178 return mpViewForwarder->IsValid();
1179 else
1180 return false;
1183 Rectangle SvxAccessibleTextEditViewAdapter::GetVisArea() const
1185 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1187 return mpViewForwarder->GetVisArea();
1190 Point SvxAccessibleTextEditViewAdapter::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
1192 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1194 return mpViewForwarder->LogicToPixel(rPoint, rMapMode);
1197 Point SvxAccessibleTextEditViewAdapter::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
1199 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1201 return mpViewForwarder->PixelToLogic(rPoint, rMapMode);
1204 bool SvxAccessibleTextEditViewAdapter::GetSelection( ESelection& rSel ) const
1206 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1208 ESelection aSelection;
1210 if( !mpViewForwarder->GetSelection( aSelection ) )
1211 return false;
1213 SvxAccessibleTextIndex aStartIndex;
1214 SvxAccessibleTextIndex aEndIndex;
1216 aStartIndex.SetEEIndex( aSelection.nStartPara, aSelection.nStartPos, *mpTextForwarder );
1217 aEndIndex.SetEEIndex( aSelection.nEndPara, aSelection.nEndPos, *mpTextForwarder );
1219 DBG_ASSERT(aStartIndex.GetIndex() >= 0 && aStartIndex.GetIndex() <= USHRT_MAX &&
1220 aEndIndex.GetIndex() >= 0 && aEndIndex.GetIndex() <= USHRT_MAX,
1221 "SvxAccessibleTextEditViewAdapter::GetSelection: index value overflow");
1223 rSel = ESelection( aStartIndex.GetParagraph(), aStartIndex.GetIndex(),
1224 aEndIndex.GetParagraph(), aEndIndex.GetIndex() );
1226 return true;
1229 bool SvxAccessibleTextEditViewAdapter::SetSelection( const ESelection& rSel )
1231 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1233 SvxAccessibleTextIndex aStartIndex;
1234 SvxAccessibleTextIndex aEndIndex;
1236 aStartIndex.SetIndex( rSel.nStartPara, rSel.nStartPos, *mpTextForwarder );
1237 aEndIndex.SetIndex( rSel.nEndPara, rSel.nEndPos, *mpTextForwarder );
1239 return mpViewForwarder->SetSelection( MakeEESelection(aStartIndex, aEndIndex) );
1242 bool SvxAccessibleTextEditViewAdapter::Copy()
1244 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1246 return mpViewForwarder->Copy();
1249 bool SvxAccessibleTextEditViewAdapter::Cut()
1251 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1253 return mpViewForwarder->Cut();
1256 bool SvxAccessibleTextEditViewAdapter::Paste()
1258 DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
1260 return mpViewForwarder->Paste();
1263 void SvxAccessibleTextEditViewAdapter::SetForwarder( SvxEditViewForwarder& rForwarder,
1264 SvxAccessibleTextAdapter& rTextForwarder )
1266 mpViewForwarder = &rForwarder;
1267 mpTextForwarder = &rTextForwarder;
1270 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */