1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #include <vcl/svapp.hxx>
21 #include <osl/mutex.hxx>
22 #include <rtl/instance.hxx>
24 #include <editeng/eeitem.hxx>
25 #include <editeng/flditem.hxx>
26 #include <editeng/unofield.hxx>
27 #include <editeng/unotext.hxx>
28 #include <comphelper/servicehelper.hxx>
29 #include <comphelper/serviceinfohelper.hxx>
30 #include <cppuhelper/supportsservice.hxx>
32 using namespace ::cppu
;
33 using namespace ::com::sun::star
;
35 #define QUERYINT( xint ) \
36 if( rType == cppu::UnoType<xint>::get() ) \
37 return uno::makeAny(uno::Reference< xint >(this))
40 // SvxUnoTextContentEnumeration
43 SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase
& _rText
) throw()
46 mxParentText
= const_cast<SvxUnoTextBase
*>(&_rText
);
47 if( mrText
.GetEditSource() )
48 mpEditSource
= mrText
.GetEditSource()->Clone();
54 SvxUnoTextContentEnumeration::~SvxUnoTextContentEnumeration() throw()
59 // container::XEnumeration
60 sal_Bool SAL_CALL
SvxUnoTextContentEnumeration::hasMoreElements()
61 throw( uno::RuntimeException
, std::exception
)
63 SolarMutexGuard aGuard
;
64 if( mpEditSource
&& mpEditSource
->GetTextForwarder() )
65 return mnNextParagraph
< mpEditSource
->GetTextForwarder()->GetParagraphCount();
70 uno::Any
SvxUnoTextContentEnumeration::nextElement() throw( container::NoSuchElementException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
72 SolarMutexGuard aGuard
;
74 if(!hasMoreElements())
75 throw container::NoSuchElementException();
77 SvxUnoTextContent
* pContent
= 0;
79 const SvxUnoTextRangeBaseList
& rRanges( mpEditSource
->getRanges() );
80 SvxUnoTextRangeBaseList::const_iterator aIter
;
81 for( aIter
= rRanges
.begin(); (aIter
!= rRanges
.end()) && (pContent
== 0); ++aIter
)
83 SvxUnoTextContent
* pIterContent
= dynamic_cast< SvxUnoTextContent
* >( (*aIter
) );
84 if( pIterContent
&& (pIterContent
->mnParagraph
== mnNextParagraph
) )
85 pContent
= pIterContent
;
89 pContent
= new SvxUnoTextContent( mrText
, mnNextParagraph
);
93 uno::Reference
< text::XTextContent
> xRef( pContent
);
94 return uno::makeAny( xRef
);
98 // class SvxUnoTextContent
101 SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextBase
& rText
, sal_Int32 nPara
) throw()
102 : SvxUnoTextRangeBase(rText
)
104 , mrParentText(rText
)
105 , maDisposeListeners(maDisposeContainerMutex
)
106 , mbDisposing( false )
108 mxParentText
= const_cast<SvxUnoTextBase
*>(&rText
);
109 if( GetEditSource() && GetEditSource()->GetTextForwarder() )
110 SetSelection( ESelection( mnParagraph
,0, mnParagraph
, GetEditSource()->GetTextForwarder()->GetTextLen( mnParagraph
) ) );
113 SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextContent
& rContent
) throw()
114 : SvxUnoTextRangeBase(rContent
)
115 , text::XTextContent()
116 , container::XEnumerationAccess()
117 , lang::XTypeProvider()
118 , cppu::OWeakAggObject()
119 , mrParentText(rContent
.mrParentText
)
120 , maDisposeListeners(maDisposeContainerMutex
)
121 , mbDisposing( false )
123 mxParentText
= rContent
.mxParentText
;
124 mnParagraph
= rContent
.mnParagraph
;
125 SetSelection( rContent
.GetSelection() );
128 SvxUnoTextContent::~SvxUnoTextContent() throw()
133 uno::Any SAL_CALL
SvxUnoTextContent::queryAggregation( const uno::Type
& rType
) throw( uno::RuntimeException
, std::exception
)
135 QUERYINT( text::XTextRange
);
136 else QUERYINT( beans::XMultiPropertyStates
);
137 else QUERYINT( beans::XPropertySet
);
138 else QUERYINT( beans::XMultiPropertySet
);
139 else QUERYINT( beans::XPropertyState
);
140 else QUERYINT( text::XTextContent
);
141 else QUERYINT( text::XTextRangeCompare
);
142 else QUERYINT( lang::XComponent
);
143 else QUERYINT( container::XEnumerationAccess
);
144 else QUERYINT( container::XElementAccess
);
145 else QUERYINT( lang::XServiceInfo
);
146 else QUERYINT( lang::XTypeProvider
);
147 else QUERYINT( lang::XUnoTunnel
);
149 return OWeakAggObject::queryAggregation( rType
);
152 uno::Any SAL_CALL
SvxUnoTextContent::queryInterface( const uno::Type
& rType
) throw( uno::RuntimeException
, std::exception
)
154 return OWeakAggObject::queryInterface(rType
);
157 void SAL_CALL
SvxUnoTextContent::acquire() throw( )
159 OWeakAggObject::acquire();
162 void SAL_CALL
SvxUnoTextContent::release() throw( )
164 OWeakAggObject::release();
171 struct theSvxUnoTextContentTypes
:
172 public rtl::StaticWithInit
<uno::Sequence
<uno::Type
>, theSvxUnoTextContentTypes
>
174 uno::Sequence
<uno::Type
> operator () ()
176 uno::Sequence
< uno::Type
> aTypeSequence
;
178 aTypeSequence
.realloc( 11 ); // !DANGER! keep this updated
179 uno::Type
* pTypes
= aTypeSequence
.getArray();
181 *pTypes
++ = cppu::UnoType
<text::XTextRange
>::get();
182 *pTypes
++ = cppu::UnoType
<beans::XPropertySet
>::get();
183 *pTypes
++ = cppu::UnoType
<beans::XMultiPropertySet
>::get();
184 *pTypes
++ = cppu::UnoType
<beans::XMultiPropertyStates
>::get();
185 *pTypes
++ = cppu::UnoType
<beans::XPropertyState
>::get();
186 *pTypes
++ = cppu::UnoType
<text::XTextRangeCompare
>::get();
187 *pTypes
++ = cppu::UnoType
<text::XTextContent
>::get();
188 *pTypes
++ = cppu::UnoType
<container::XEnumerationAccess
>::get();
189 *pTypes
++ = cppu::UnoType
<lang::XServiceInfo
>::get();
190 *pTypes
++ = cppu::UnoType
<lang::XTypeProvider
>::get();
191 *pTypes
++ = cppu::UnoType
<lang::XUnoTunnel
>::get();
193 return aTypeSequence
;
198 uno::Sequence
< uno::Type
> SAL_CALL
SvxUnoTextContent::getTypes()
199 throw (uno::RuntimeException
, std::exception
)
201 return theSvxUnoTextContentTypes::get();
204 uno::Sequence
< sal_Int8
> SAL_CALL
SvxUnoTextContent::getImplementationId()
205 throw (uno::RuntimeException
, std::exception
)
207 return css::uno::Sequence
<sal_Int8
>();
212 uno::Reference
< text::XText
> SAL_CALL
SvxUnoTextContent::getText()
213 throw(uno::RuntimeException
, std::exception
)
218 // text::XTextContent
219 void SAL_CALL
SvxUnoTextContent::attach( const uno::Reference
< text::XTextRange
>& )
220 throw(lang::IllegalArgumentException
, uno::RuntimeException
, std::exception
)
224 uno::Reference
< text::XTextRange
> SAL_CALL
SvxUnoTextContent::getAnchor() throw( uno::RuntimeException
, std::exception
)
226 return uno::Reference
< text::XTextRange
>::query( mxParentText
);
231 void SAL_CALL
SvxUnoTextContent::dispose()
232 throw(uno::RuntimeException
, std::exception
)
234 SolarMutexGuard aGuard
;
237 return; // catched a recursion
241 lang::EventObject aEvt
;
242 aEvt
.Source
= *(OWeakAggObject
*) this;
243 maDisposeListeners
.disposeAndClear(aEvt
);
245 if( mxParentText
.is() )
246 mxParentText
->removeTextContent( this );
249 void SAL_CALL
SvxUnoTextContent::addEventListener( const uno::Reference
< lang::XEventListener
>& xListener
)
250 throw(uno::RuntimeException
, std::exception
)
252 maDisposeListeners
.addInterface(xListener
);
255 void SAL_CALL
SvxUnoTextContent::removeEventListener( const uno::Reference
< lang::XEventListener
>& aListener
)
256 throw(uno::RuntimeException
, std::exception
)
258 maDisposeListeners
.removeInterface(aListener
);
261 // XEnumerationAccess
263 uno::Reference
< container::XEnumeration
> SAL_CALL
SvxUnoTextContent::createEnumeration( )
264 throw(uno::RuntimeException
, std::exception
)
266 SolarMutexGuard aGuard
;
268 return new SvxUnoTextRangeEnumeration( mrParentText
, mnParagraph
);
271 // XElementAccess ( container::XEnumerationAccess )
273 uno::Type SAL_CALL
SvxUnoTextContent::getElementType()
274 throw(uno::RuntimeException
, std::exception
)
276 return cppu::UnoType
<text::XTextRange
>::get();
279 sal_Bool SAL_CALL
SvxUnoTextContent::hasElements()
280 throw(uno::RuntimeException
, std::exception
)
282 SolarMutexGuard aGuard
;
284 SvxTextForwarder
* pForwarder
= GetEditSource() ? GetEditSource()->GetTextForwarder() : NULL
;
287 std::vector
<sal_Int32
> aPortions
;
288 pForwarder
->GetPortions( mnParagraph
, aPortions
);
289 return !aPortions
.empty();
299 void SAL_CALL
SvxUnoTextContent::setPropertyValue( const OUString
& aPropertyName
, const uno::Any
& aValue
)
300 throw(beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
302 _setPropertyValue( aPropertyName
, aValue
, mnParagraph
);
305 uno::Any SAL_CALL
SvxUnoTextContent::getPropertyValue( const OUString
& PropertyName
)
306 throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
308 return _getPropertyValue( PropertyName
, mnParagraph
);
312 void SAL_CALL
SvxUnoTextContent::setPropertyValues( const uno::Sequence
< OUString
>& aPropertyNames
, const uno::Sequence
< uno::Any
>& aValues
) throw (beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
314 _setPropertyValues( aPropertyNames
, aValues
, mnParagraph
);
317 uno::Sequence
< uno::Any
> SAL_CALL
SvxUnoTextContent::getPropertyValues( const uno::Sequence
< OUString
>& aPropertyNames
) throw (uno::RuntimeException
, std::exception
)
319 return _getPropertyValues( aPropertyNames
, mnParagraph
);
322 /*// XTolerantMultiPropertySet
323 uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SvxUnoTextContent::setPropertyValuesTolerant( const uno::Sequence< OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues ) throw (lang::IllegalArgumentException, uno::RuntimeException)
325 return _setPropertyValuesTolerant(aPropertyNames, aValues, mnParagraph);
328 uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL SvxUnoTextContent::getPropertyValuesTolerant( const uno::Sequence< OUString >& aPropertyNames ) throw (uno::RuntimeException)
330 return _getPropertyValuesTolerant(aPropertyNames, mnParagraph);
333 uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SvxUnoTextContent::getDirectPropertyValuesTolerant( const uno::Sequence< OUString >& aPropertyNames )
334 throw (uno::RuntimeException)
336 return _getDirectPropertyValuesTolerant(aPropertyNames, mnParagraph);
339 // beans::XPropertyState
340 beans::PropertyState SAL_CALL
SvxUnoTextContent::getPropertyState( const OUString
& PropertyName
)
341 throw(beans::UnknownPropertyException
, uno::RuntimeException
, std::exception
)
343 return _getPropertyState( PropertyName
, mnParagraph
);
346 uno::Sequence
< beans::PropertyState
> SAL_CALL
SvxUnoTextContent::getPropertyStates( const uno::Sequence
< OUString
>& aPropertyName
)
347 throw(beans::UnknownPropertyException
, uno::RuntimeException
, std::exception
)
349 return _getPropertyStates( aPropertyName
, mnParagraph
);
352 void SAL_CALL
SvxUnoTextContent::setPropertyToDefault( const OUString
& PropertyName
)
353 throw(beans::UnknownPropertyException
, uno::RuntimeException
, std::exception
)
355 _setPropertyToDefault( PropertyName
, mnParagraph
);
358 // lang::XServiceInfo
360 OUString SAL_CALL
SvxUnoTextContent::getImplementationName()
361 throw(uno::RuntimeException
, std::exception
)
363 return OUString("SvxUnoTextContent");
366 uno::Sequence
< OUString
> SAL_CALL
SvxUnoTextContent::getSupportedServiceNames()
367 throw(uno::RuntimeException
, std::exception
)
369 uno::Sequence
< OUString
> aSeq( SvxUnoTextRangeBase::getSupportedServiceNames() );
370 comphelper::ServiceInfoHelper::addToSequence( aSeq
, 5, "com.sun.star.style.ParagraphProperties",
371 "com.sun.star.style.ParagraphPropertiesComplex",
372 "com.sun.star.style.ParagraphPropertiesAsian",
373 "com.sun.star.text.TextContent",
374 "com.sun.star.text.Paragraph");
379 // class SvxUnoTextRangeEnumeration
382 SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration( const SvxUnoTextBase
& rText
, sal_Int32 nPara
) throw()
383 : mxParentText( const_cast<SvxUnoTextBase
*>(&rText
) ),
384 mrParentText( rText
),
385 mnParagraph( nPara
),
388 mpEditSource
= rText
.GetEditSource() ? rText
.GetEditSource()->Clone() : NULL
;
390 if( mpEditSource
&& mpEditSource
->GetTextForwarder() )
392 mpPortions
= new std::vector
<sal_Int32
>;
393 mpEditSource
->GetTextForwarder()->GetPortions( nPara
, *mpPortions
);
401 SvxUnoTextRangeEnumeration::~SvxUnoTextRangeEnumeration() throw()
407 // container::XEnumeration
409 sal_Bool SAL_CALL
SvxUnoTextRangeEnumeration::hasMoreElements()
410 throw(uno::RuntimeException
, std::exception
)
412 SolarMutexGuard aGuard
;
414 return mpPortions
&& mnNextPortion
< mpPortions
->size();
417 uno::Any SAL_CALL
SvxUnoTextRangeEnumeration::nextElement()
418 throw(container::NoSuchElementException
, lang::WrappedTargetException
, uno::RuntimeException
, std::exception
)
420 SolarMutexGuard aGuard
;
422 if( mpPortions
== NULL
|| mnNextPortion
>= mpPortions
->size() )
423 throw container::NoSuchElementException();
425 sal_uInt16 nStartPos
= 0;
426 if (mnNextPortion
> 0)
427 nStartPos
= mpPortions
->at(mnNextPortion
-1);
428 sal_uInt16 nEndPos
= mpPortions
->at(mnNextPortion
);
429 ESelection
aSel( mnParagraph
, nStartPos
, mnParagraph
, nEndPos
);
431 uno::Reference
< text::XTextRange
> xRange
;
433 const SvxUnoTextRangeBaseList
& rRanges( mpEditSource
->getRanges() );
435 SvxUnoTextRange
* pRange
= 0;
437 SvxUnoTextRangeBaseList::const_iterator aIter
;
438 for( aIter
= rRanges
.begin(); (aIter
!= rRanges
.end()) && (pRange
== 0); ++aIter
)
440 SvxUnoTextRange
* pIterRange
= dynamic_cast< SvxUnoTextRange
* >( (*aIter
) );
441 if( pIterRange
&& pIterRange
->mbPortion
&& (aSel
.IsEqual( pIterRange
->maSelection
) ) )
447 pRange
= new SvxUnoTextRange( mrParentText
, true );
448 pRange
->SetSelection(aSel
);
455 return uno::makeAny( xRange
);
458 SvxUnoTextCursor::SvxUnoTextCursor( const SvxUnoTextBase
& rText
) throw()
459 : SvxUnoTextRangeBase(rText
),
460 mxParentText( const_cast<SvxUnoTextBase
*>(&rText
) )
464 SvxUnoTextCursor::SvxUnoTextCursor( const SvxUnoTextCursor
& rCursor
) throw()
465 : SvxUnoTextRangeBase(rCursor
)
466 , text::XTextCursor()
467 , lang::XTypeProvider()
468 , cppu::OWeakAggObject()
469 , mxParentText(rCursor
.mxParentText
)
473 SvxUnoTextCursor::~SvxUnoTextCursor() throw()
477 // Comment out automatically - [getIdlClass(es) or queryInterface]
478 // Please use the XTypeProvider!
479 //sal_Bool SvxUnoTextCursor::queryInterface( uno::Uik aUIK, Reference< uno::XInterface > & xRef)
480 uno::Any SAL_CALL
SvxUnoTextCursor::queryAggregation( const uno::Type
& rType
)
481 throw(uno::RuntimeException
, std::exception
)
483 if( rType
== cppu::UnoType
<text::XTextRange
>::get())
484 return uno::makeAny(uno::Reference
< text::XTextRange
>(static_cast<SvxUnoTextRangeBase
*>(this)));
485 else QUERYINT( text::XTextCursor
);
486 else QUERYINT( beans::XMultiPropertyStates
);
487 else QUERYINT( beans::XPropertySet
);
488 else QUERYINT( beans::XMultiPropertySet
);
489 else QUERYINT( beans::XPropertyState
);
490 else QUERYINT( text::XTextRangeCompare
);
491 else QUERYINT( lang::XServiceInfo
);
492 else QUERYINT( lang::XTypeProvider
);
493 else QUERYINT( lang::XUnoTunnel
);
495 return OWeakAggObject::queryAggregation( rType
);
498 uno::Any SAL_CALL
SvxUnoTextCursor::queryInterface( const uno::Type
& rType
)
499 throw(uno::RuntimeException
, std::exception
)
501 return OWeakAggObject::queryInterface(rType
);
504 void SAL_CALL
SvxUnoTextCursor::acquire() throw ( )
506 OWeakAggObject::acquire();
509 void SAL_CALL
SvxUnoTextCursor::release() throw ( )
511 OWeakAggObject::release();
516 struct theSvxUnoTextCursorTypes
:
517 public rtl::StaticWithInit
<uno::Sequence
<uno::Type
>, theSvxUnoTextCursorTypes
>
519 uno::Sequence
<uno::Type
> operator () ()
521 uno::Sequence
< uno::Type
> aTypeSequence
;
523 aTypeSequence
.realloc( 10 ); // !DANGER! keep this updated
524 uno::Type
* pTypes
= aTypeSequence
.getArray();
526 *pTypes
++ = cppu::UnoType
<text::XTextRange
>::get();
527 *pTypes
++ = cppu::UnoType
<text::XTextCursor
>::get();
528 *pTypes
++ = cppu::UnoType
<beans::XPropertySet
>::get();
529 *pTypes
++ = cppu::UnoType
<beans::XMultiPropertySet
>::get();
530 *pTypes
++ = cppu::UnoType
<beans::XMultiPropertyStates
>::get();
531 *pTypes
++ = cppu::UnoType
<beans::XPropertyState
>::get();
532 *pTypes
++ = cppu::UnoType
<text::XTextRangeCompare
>::get();
533 *pTypes
++ = cppu::UnoType
<lang::XServiceInfo
>::get();
534 *pTypes
++ = cppu::UnoType
<lang::XTypeProvider
>::get();
535 *pTypes
++ = cppu::UnoType
<lang::XUnoTunnel
>::get();
537 return aTypeSequence
;
543 uno::Sequence
< uno::Type
> SAL_CALL
SvxUnoTextCursor::getTypes()
544 throw(uno::RuntimeException
, std::exception
)
546 return theSvxUnoTextCursorTypes::get();
549 uno::Sequence
< sal_Int8
> SAL_CALL
SvxUnoTextCursor::getImplementationId()
550 throw (uno::RuntimeException
, std::exception
)
552 return css::uno::Sequence
<sal_Int8
>();
556 void SAL_CALL
SvxUnoTextCursor::collapseToStart()
557 throw(uno::RuntimeException
, std::exception
)
559 SolarMutexGuard aGuard
;
563 void SAL_CALL
SvxUnoTextCursor::collapseToEnd()
564 throw(uno::RuntimeException
, std::exception
)
566 SolarMutexGuard aGuard
;
570 sal_Bool SAL_CALL
SvxUnoTextCursor::isCollapsed()
571 throw(uno::RuntimeException
, std::exception
)
573 SolarMutexGuard aGuard
;
574 return IsCollapsed();
577 sal_Bool SAL_CALL
SvxUnoTextCursor::goLeft( sal_Int16 nCount
, sal_Bool bExpand
)
578 throw(uno::RuntimeException
, std::exception
)
580 SolarMutexGuard aGuard
;
581 return GoLeft( nCount
, bExpand
);
584 sal_Bool SAL_CALL
SvxUnoTextCursor::goRight( sal_Int16 nCount
, sal_Bool bExpand
)
585 throw(uno::RuntimeException
, std::exception
)
587 SolarMutexGuard aGuard
;
588 return GoRight( nCount
, bExpand
);
591 void SAL_CALL
SvxUnoTextCursor::gotoStart( sal_Bool bExpand
)
592 throw(uno::RuntimeException
, std::exception
)
594 SolarMutexGuard aGuard
;
595 GotoStart( bExpand
);
598 void SAL_CALL
SvxUnoTextCursor::gotoEnd( sal_Bool bExpand
)
599 throw(uno::RuntimeException
, std::exception
)
601 SolarMutexGuard aGuard
;
605 void SAL_CALL
SvxUnoTextCursor::gotoRange( const uno::Reference
< text::XTextRange
>& xRange
, sal_Bool bExpand
)
606 throw(uno::RuntimeException
, std::exception
)
611 SvxUnoTextRangeBase
* pRange
= SvxUnoTextRangeBase::getImplementation( xRange
);
615 ESelection aNewSel
= pRange
->GetSelection();
619 const ESelection
& rOldSel
= GetSelection();
620 aNewSel
.nStartPara
= rOldSel
.nStartPara
;
621 aNewSel
.nStartPos
= rOldSel
.nStartPos
;
624 SetSelection( aNewSel
);
628 // text::XTextRange (rest in SvxTextRange)
629 uno::Reference
< text::XText
> SAL_CALL
SvxUnoTextCursor::getText() throw( uno::RuntimeException
, std::exception
)
634 uno::Reference
< text::XTextRange
> SAL_CALL
SvxUnoTextCursor::getStart()
635 throw(uno::RuntimeException
, std::exception
)
637 return SvxUnoTextRangeBase::getStart();
640 uno::Reference
< text::XTextRange
> SAL_CALL
SvxUnoTextCursor::getEnd()
641 throw(uno::RuntimeException
, std::exception
)
643 return SvxUnoTextRangeBase::getEnd();
646 OUString SAL_CALL
SvxUnoTextCursor::getString() throw( uno::RuntimeException
, std::exception
)
648 return SvxUnoTextRangeBase::getString();
651 void SAL_CALL
SvxUnoTextCursor::setString( const OUString
& aString
) throw(uno::RuntimeException
, std::exception
)
653 SvxUnoTextRangeBase::setString(aString
);
655 // lang::XServiceInfo
656 OUString SAL_CALL
SvxUnoTextCursor::getImplementationName() throw(uno::RuntimeException
, std::exception
)
658 return OUString("SvxUnoTextCursor");
661 sal_Bool SAL_CALL
SvxUnoTextCursor::supportsService( const OUString
& ServiceName
) throw(uno::RuntimeException
, std::exception
)
663 return cppu::supportsService( this, ServiceName
);
666 uno::Sequence
< OUString
> SAL_CALL
SvxUnoTextCursor::getSupportedServiceNames() throw(uno::RuntimeException
, std::exception
)
668 uno::Sequence
< OUString
> aSeq( SvxUnoTextRangeBase::getSupportedServiceNames() );
669 comphelper::ServiceInfoHelper::addToSequence( aSeq
, 4,"com.sun.star.style.ParagraphProperties",
670 "com.sun.star.style.ParagraphPropertiesComplex",
671 "com.sun.star.style.ParagraphPropertiesAsian",
672 "com.sun.star.text.TextCursor");
677 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */