xref: /AOO41X/main/editeng/source/uno/unotext2.cxx (revision 190118d08a3be86671f4129b3e9a490e144719cd)
1*190118d0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*190118d0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*190118d0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*190118d0SAndrew Rist  * distributed with this work for additional information
6*190118d0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*190118d0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*190118d0SAndrew Rist  * "License"); you may not use this file except in compliance
9*190118d0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*190118d0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*190118d0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*190118d0SAndrew Rist  * software distributed under the License is distributed on an
15*190118d0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*190118d0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*190118d0SAndrew Rist  * specific language governing permissions and limitations
18*190118d0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*190118d0SAndrew Rist  *************************************************************/
21*190118d0SAndrew Rist 
22*190118d0SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_editeng.hxx"
26cdf0e10cSrcweir #include <vcl/svapp.hxx>
27cdf0e10cSrcweir #include <vos/mutex.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #define _SVSTDARR_sal_uIt16S
30cdf0e10cSrcweir #include <svl/svstdarr.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <rtl/uuid.h>
33cdf0e10cSrcweir #include <rtl/memory.h>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <editeng/eeitem.hxx>
36cdf0e10cSrcweir #include <editeng/flditem.hxx>
37cdf0e10cSrcweir #include <editeng/unofield.hxx>
38cdf0e10cSrcweir #include <editeng/unotext.hxx>
39cdf0e10cSrcweir #include <comphelper/serviceinfohelper.hxx>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir using namespace ::rtl;
42cdf0e10cSrcweir using namespace ::vos;
43cdf0e10cSrcweir using namespace ::cppu;
44cdf0e10cSrcweir using namespace ::com::sun::star;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #define QUERYINT( xint ) \
47cdf0e10cSrcweir 	if( rType == ::getCppuType((const uno::Reference< xint >*)0) ) \
48cdf0e10cSrcweir         return uno::makeAny(uno::Reference< xint >(this))
49cdf0e10cSrcweir 
50cdf0e10cSrcweir // ====================================================================
51cdf0e10cSrcweir // SvxUnoTextContentEnumeration
52cdf0e10cSrcweir // ====================================================================
53cdf0e10cSrcweir 
SvxUnoTextContentEnumeration(const SvxUnoTextBase & _rText)54cdf0e10cSrcweir SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase& _rText ) throw()
55cdf0e10cSrcweir : mrText( _rText )
56cdf0e10cSrcweir {
57cdf0e10cSrcweir 	mxParentText = const_cast<SvxUnoTextBase*>(&_rText);
58cdf0e10cSrcweir 	if( mrText.GetEditSource() )
59cdf0e10cSrcweir 		mpEditSource = mrText.GetEditSource()->Clone();
60cdf0e10cSrcweir 	else
61cdf0e10cSrcweir 		mpEditSource = NULL;
62cdf0e10cSrcweir 	mnNextParagraph = 0;
63cdf0e10cSrcweir }
64cdf0e10cSrcweir 
~SvxUnoTextContentEnumeration()65cdf0e10cSrcweir SvxUnoTextContentEnumeration::~SvxUnoTextContentEnumeration() throw()
66cdf0e10cSrcweir {
67cdf0e10cSrcweir 	delete mpEditSource;
68cdf0e10cSrcweir }
69cdf0e10cSrcweir 
70cdf0e10cSrcweir // container::XEnumeration
hasMoreElements(void)71cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoTextContentEnumeration::hasMoreElements(void)
72cdf0e10cSrcweir 	throw( uno::RuntimeException )
73cdf0e10cSrcweir {
74cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
75cdf0e10cSrcweir 	if( mpEditSource && mpEditSource->GetTextForwarder() )
76cdf0e10cSrcweir         return mnNextParagraph < mpEditSource->GetTextForwarder()->GetParagraphCount();
77cdf0e10cSrcweir 	else
78cdf0e10cSrcweir 		return sal_False;
79cdf0e10cSrcweir }
80cdf0e10cSrcweir 
nextElement(void)81cdf0e10cSrcweir uno::Any SvxUnoTextContentEnumeration::nextElement(void) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
82cdf0e10cSrcweir {
83cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	if(!hasMoreElements())
86cdf0e10cSrcweir 		throw container::NoSuchElementException();
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	SvxUnoTextContent* pContent = 0;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	const SvxUnoTextRangeBaseList& rRanges( mpEditSource->getRanges() );
91cdf0e10cSrcweir 	SvxUnoTextRangeBaseList::const_iterator aIter;
92cdf0e10cSrcweir 	for( aIter = rRanges.begin(); (aIter != rRanges.end()) && (pContent == 0); aIter++ )
93cdf0e10cSrcweir 	{
94cdf0e10cSrcweir 		SvxUnoTextContent* pIterContent = dynamic_cast< SvxUnoTextContent* >( (*aIter ) );
95cdf0e10cSrcweir 		if( pIterContent && (pIterContent->mnParagraph == mnNextParagraph) )
96cdf0e10cSrcweir 			pContent = pIterContent;
97cdf0e10cSrcweir 	}
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	if( pContent == 0 )
100cdf0e10cSrcweir 	 pContent = new SvxUnoTextContent( mrText, mnNextParagraph );
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	mnNextParagraph++;
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	uno::Reference< text::XTextContent > xRef( pContent );
105cdf0e10cSrcweir 	return uno::makeAny( xRef );
106cdf0e10cSrcweir }
107cdf0e10cSrcweir 
108cdf0e10cSrcweir // ====================================================================
109cdf0e10cSrcweir // class SvxUnoTextContent
110cdf0e10cSrcweir // ====================================================================
111cdf0e10cSrcweir uno::Reference< text::XText > xDummyText;
112cdf0e10cSrcweir uno::Sequence< uno::Type > SvxUnoTextContent::maTypeSequence;
113cdf0e10cSrcweir 
getDummyText()114cdf0e10cSrcweir static SvxUnoText* getDummyText() throw()
115cdf0e10cSrcweir {
116cdf0e10cSrcweir 	if(!xDummyText.is())
117cdf0e10cSrcweir 		xDummyText = new SvxUnoText();
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 	return SvxUnoText::getImplementation( xDummyText );
120cdf0e10cSrcweir }
121cdf0e10cSrcweir 
SvxUnoTextContent()122cdf0e10cSrcweir SvxUnoTextContent::SvxUnoTextContent() throw()
123cdf0e10cSrcweir :	SvxUnoTextRangeBase(*getDummyText())
124cdf0e10cSrcweir ,	mnParagraph(0)
125cdf0e10cSrcweir ,	mrParentText(*getDummyText())
126cdf0e10cSrcweir ,	maDisposeListeners(maDisposeContainerMutex)
127cdf0e10cSrcweir ,	mbDisposing( false )
128cdf0e10cSrcweir {
129cdf0e10cSrcweir }
130cdf0e10cSrcweir 
SvxUnoTextContent(const SvxUnoTextBase & rText,sal_uInt16 nPara)131cdf0e10cSrcweir SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw()
132cdf0e10cSrcweir :	SvxUnoTextRangeBase(rText)
133cdf0e10cSrcweir ,	mnParagraph(nPara)
134cdf0e10cSrcweir ,	mrParentText(rText)
135cdf0e10cSrcweir ,	maDisposeListeners(maDisposeContainerMutex)
136cdf0e10cSrcweir ,	mbDisposing( false )
137cdf0e10cSrcweir {
138cdf0e10cSrcweir 	mxParentText = const_cast<SvxUnoTextBase*>(&rText);
139cdf0e10cSrcweir 	if( GetEditSource() && GetEditSource()->GetTextForwarder() )
140cdf0e10cSrcweir 		SetSelection( ESelection( mnParagraph,0, mnParagraph, GetEditSource()->GetTextForwarder()->GetTextLen( mnParagraph ) ) );
141cdf0e10cSrcweir }
142cdf0e10cSrcweir 
SvxUnoTextContent(const SvxUnoTextContent & rContent)143cdf0e10cSrcweir SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextContent& rContent ) throw()
144cdf0e10cSrcweir :	SvxUnoTextRangeBase(rContent)
145cdf0e10cSrcweir ,	text::XTextContent()
146cdf0e10cSrcweir ,	container::XEnumerationAccess()
147cdf0e10cSrcweir ,	lang::XTypeProvider()
148cdf0e10cSrcweir ,	cppu::OWeakAggObject()
149cdf0e10cSrcweir ,	mrParentText(rContent.mrParentText)
150cdf0e10cSrcweir ,	maDisposeListeners(maDisposeContainerMutex)
151cdf0e10cSrcweir ,	mbDisposing( false )
152cdf0e10cSrcweir {
153cdf0e10cSrcweir 	mxParentText = rContent.mxParentText;
154cdf0e10cSrcweir 	mnParagraph  = rContent.mnParagraph;
155cdf0e10cSrcweir 	SetSelection( rContent.GetSelection() );
156cdf0e10cSrcweir }
157cdf0e10cSrcweir 
~SvxUnoTextContent()158cdf0e10cSrcweir SvxUnoTextContent::~SvxUnoTextContent() throw()
159cdf0e10cSrcweir {
160cdf0e10cSrcweir }
161cdf0e10cSrcweir 
162cdf0e10cSrcweir // uno::XInterface
queryAggregation(const uno::Type & rType)163cdf0e10cSrcweir uno::Any SAL_CALL SvxUnoTextContent::queryAggregation( const uno::Type & rType ) throw( uno::RuntimeException )
164cdf0e10cSrcweir {
165cdf0e10cSrcweir 	QUERYINT( text::XTextRange );
166cdf0e10cSrcweir 	else QUERYINT( beans::XMultiPropertyStates );
167cdf0e10cSrcweir 	else QUERYINT( beans::XPropertySet );
168cdf0e10cSrcweir 	else QUERYINT( beans::XMultiPropertySet );
169cdf0e10cSrcweir 	else QUERYINT( beans::XPropertyState );
170cdf0e10cSrcweir 	else QUERYINT( text::XTextContent );
171cdf0e10cSrcweir 	else QUERYINT( text::XTextRangeCompare );
172cdf0e10cSrcweir 	else QUERYINT( lang::XComponent );
173cdf0e10cSrcweir 	else QUERYINT( container::XEnumerationAccess );
174cdf0e10cSrcweir 	else QUERYINT( container::XElementAccess );
175cdf0e10cSrcweir 	else QUERYINT( lang::XServiceInfo );
176cdf0e10cSrcweir 	else QUERYINT( lang::XTypeProvider );
177cdf0e10cSrcweir 	else QUERYINT( lang::XUnoTunnel );
178cdf0e10cSrcweir 	else
179cdf0e10cSrcweir 		return OWeakAggObject::queryAggregation( rType );
180cdf0e10cSrcweir }
181cdf0e10cSrcweir 
queryInterface(const uno::Type & rType)182cdf0e10cSrcweir uno::Any SAL_CALL SvxUnoTextContent::queryInterface( const uno::Type & rType ) throw( uno::RuntimeException )
183cdf0e10cSrcweir {
184cdf0e10cSrcweir 	return OWeakAggObject::queryInterface(rType);
185cdf0e10cSrcweir }
186cdf0e10cSrcweir 
acquire()187cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::acquire() throw( )
188cdf0e10cSrcweir {
189cdf0e10cSrcweir 	OWeakAggObject::acquire();
190cdf0e10cSrcweir }
191cdf0e10cSrcweir 
release()192cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::release() throw( )
193cdf0e10cSrcweir {
194cdf0e10cSrcweir 	OWeakAggObject::release();
195cdf0e10cSrcweir }
196cdf0e10cSrcweir 
197cdf0e10cSrcweir // XTypeProvider
198cdf0e10cSrcweir 
getTypes()199cdf0e10cSrcweir uno::Sequence< uno::Type > SAL_CALL SvxUnoTextContent::getTypes()
200cdf0e10cSrcweir 	throw (uno::RuntimeException)
201cdf0e10cSrcweir {
202cdf0e10cSrcweir 	if( maTypeSequence.getLength() == 0 )
203cdf0e10cSrcweir 	{
204cdf0e10cSrcweir 		maTypeSequence.realloc( 11 ); // !DANGER! keep this updated
205cdf0e10cSrcweir 		uno::Type* pTypes = maTypeSequence.getArray();
206cdf0e10cSrcweir 
207cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
208cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
209cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
210cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
211cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
212cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
213cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextContent >*)0);
214cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0);
215cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
216cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
217cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
218cdf0e10cSrcweir 	}
219cdf0e10cSrcweir 	return maTypeSequence;
220cdf0e10cSrcweir }
221cdf0e10cSrcweir 
getImplementationId()222cdf0e10cSrcweir uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextContent::getImplementationId()
223cdf0e10cSrcweir 	throw (uno::RuntimeException)
224cdf0e10cSrcweir {
225cdf0e10cSrcweir 	static uno::Sequence< sal_Int8 > aId;
226cdf0e10cSrcweir 	if( aId.getLength() == 0 )
227cdf0e10cSrcweir 	{
228cdf0e10cSrcweir 		aId.realloc( 16 );
229cdf0e10cSrcweir 		rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
230cdf0e10cSrcweir 	}
231cdf0e10cSrcweir 	return aId;
232cdf0e10cSrcweir }
233cdf0e10cSrcweir 
234cdf0e10cSrcweir // text::XTextRange
235cdf0e10cSrcweir 
getText()236cdf0e10cSrcweir uno::Reference< text::XText > SAL_CALL SvxUnoTextContent::getText()
237cdf0e10cSrcweir 	throw(uno::RuntimeException)
238cdf0e10cSrcweir {
239cdf0e10cSrcweir 	return mxParentText;
240cdf0e10cSrcweir }
241cdf0e10cSrcweir 
242cdf0e10cSrcweir // text::XTextContent
attach(const uno::Reference<text::XTextRange> &)243cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::attach( const uno::Reference< text::XTextRange >& )
244cdf0e10cSrcweir 	throw(lang::IllegalArgumentException, uno::RuntimeException)
245cdf0e10cSrcweir {
246cdf0e10cSrcweir }
247cdf0e10cSrcweir 
getAnchor()248cdf0e10cSrcweir uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextContent::getAnchor() throw( uno::RuntimeException )
249cdf0e10cSrcweir {
250cdf0e10cSrcweir 	return uno::Reference< text::XTextRange >::query( mxParentText );
251cdf0e10cSrcweir }
252cdf0e10cSrcweir 
253cdf0e10cSrcweir // XComponent
254cdf0e10cSrcweir 
dispose()255cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::dispose()
256cdf0e10cSrcweir 	throw(uno::RuntimeException)
257cdf0e10cSrcweir {
258cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
259cdf0e10cSrcweir 
260cdf0e10cSrcweir 	if( mbDisposing )
261cdf0e10cSrcweir 		return;	// catched a recursion
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 	mbDisposing = true;
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 	lang::EventObject aEvt;
266cdf0e10cSrcweir 	aEvt.Source = *(OWeakAggObject*) this;
267cdf0e10cSrcweir 	maDisposeListeners.disposeAndClear(aEvt);
268cdf0e10cSrcweir 
269cdf0e10cSrcweir 	if( mxParentText.is() )
270cdf0e10cSrcweir 		mxParentText->removeTextContent( this );
271cdf0e10cSrcweir }
272cdf0e10cSrcweir 
addEventListener(const uno::Reference<lang::XEventListener> & xListener)273cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::addEventListener( const uno::Reference< lang::XEventListener >& xListener )
274cdf0e10cSrcweir 	throw(uno::RuntimeException)
275cdf0e10cSrcweir {
276cdf0e10cSrcweir 	maDisposeListeners.addInterface(xListener);
277cdf0e10cSrcweir }
278cdf0e10cSrcweir 
removeEventListener(const uno::Reference<lang::XEventListener> & aListener)279cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::removeEventListener( const uno::Reference< lang::XEventListener >& aListener )
280cdf0e10cSrcweir 	throw(uno::RuntimeException)
281cdf0e10cSrcweir {
282cdf0e10cSrcweir    maDisposeListeners.removeInterface(aListener);
283cdf0e10cSrcweir }
284cdf0e10cSrcweir 
285cdf0e10cSrcweir // XEnumerationAccess
286cdf0e10cSrcweir 
createEnumeration()287cdf0e10cSrcweir uno::Reference< container::XEnumeration > SAL_CALL SvxUnoTextContent::createEnumeration(  )
288cdf0e10cSrcweir 	throw(uno::RuntimeException)
289cdf0e10cSrcweir {
290cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	return new SvxUnoTextRangeEnumeration( mrParentText, mnParagraph );
293cdf0e10cSrcweir }
294cdf0e10cSrcweir 
295cdf0e10cSrcweir // XElementAccess ( container::XEnumerationAccess )
296cdf0e10cSrcweir 
getElementType()297cdf0e10cSrcweir uno::Type SAL_CALL SvxUnoTextContent::getElementType()
298cdf0e10cSrcweir 	throw(uno::RuntimeException)
299cdf0e10cSrcweir {
300cdf0e10cSrcweir 	return ::getCppuType((const uno::Reference< text::XTextRange >*)0);
301cdf0e10cSrcweir }
302cdf0e10cSrcweir 
hasElements()303cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoTextContent::hasElements()
304cdf0e10cSrcweir 	throw(uno::RuntimeException)
305cdf0e10cSrcweir {
306cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
307cdf0e10cSrcweir 
308cdf0e10cSrcweir 	SvxTextForwarder* pForwarder = GetEditSource() ? GetEditSource()->GetTextForwarder() : NULL;
309cdf0e10cSrcweir 	if( pForwarder )
310cdf0e10cSrcweir 	{
311cdf0e10cSrcweir 		SvUShorts aPortions;
312cdf0e10cSrcweir 		pForwarder->GetPortions( mnParagraph, aPortions );
313cdf0e10cSrcweir 		return aPortions.Count() > 0;
314cdf0e10cSrcweir 	}
315cdf0e10cSrcweir 	else
316cdf0e10cSrcweir 	{
317cdf0e10cSrcweir 		return 0;
318cdf0e10cSrcweir 	}
319cdf0e10cSrcweir }
320cdf0e10cSrcweir 
321cdf0e10cSrcweir // XPropertySet
322cdf0e10cSrcweir 
setPropertyValue(const OUString & aPropertyName,const uno::Any & aValue)323cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
324cdf0e10cSrcweir 	throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
325cdf0e10cSrcweir {
326cdf0e10cSrcweir 	_setPropertyValue( aPropertyName, aValue, mnParagraph );
327cdf0e10cSrcweir }
328cdf0e10cSrcweir 
getPropertyValue(const OUString & PropertyName)329cdf0e10cSrcweir uno::Any SAL_CALL SvxUnoTextContent::getPropertyValue( const OUString& PropertyName )
330cdf0e10cSrcweir 	throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
331cdf0e10cSrcweir {
332cdf0e10cSrcweir 	return _getPropertyValue( PropertyName, mnParagraph );
333cdf0e10cSrcweir }
334cdf0e10cSrcweir 
335cdf0e10cSrcweir // XMultiPropertySet
setPropertyValues(const uno::Sequence<::rtl::OUString> & aPropertyNames,const uno::Sequence<uno::Any> & aValues)336cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::setPropertyValues( const uno::Sequence< ::rtl::OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues ) throw (beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
337cdf0e10cSrcweir {
338cdf0e10cSrcweir 	_setPropertyValues( aPropertyNames, aValues, mnParagraph );
339cdf0e10cSrcweir }
340cdf0e10cSrcweir 
getPropertyValues(const uno::Sequence<::rtl::OUString> & aPropertyNames)341cdf0e10cSrcweir uno::Sequence< uno::Any > SAL_CALL SvxUnoTextContent::getPropertyValues( const uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (uno::RuntimeException)
342cdf0e10cSrcweir {
343cdf0e10cSrcweir 	return _getPropertyValues( aPropertyNames, mnParagraph );
344cdf0e10cSrcweir }
345cdf0e10cSrcweir 
346cdf0e10cSrcweir /*// XTolerantMultiPropertySet
347cdf0e10cSrcweir uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SvxUnoTextContent::setPropertyValuesTolerant( const uno::Sequence< ::rtl::OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues ) throw (lang::IllegalArgumentException, uno::RuntimeException)
348cdf0e10cSrcweir {
349cdf0e10cSrcweir     return _setPropertyValuesTolerant(aPropertyNames, aValues, mnParagraph);
350cdf0e10cSrcweir }
351cdf0e10cSrcweir 
352cdf0e10cSrcweir uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL SvxUnoTextContent::getPropertyValuesTolerant( const uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (uno::RuntimeException)
353cdf0e10cSrcweir {
354cdf0e10cSrcweir     return _getPropertyValuesTolerant(aPropertyNames, mnParagraph);
355cdf0e10cSrcweir }
356cdf0e10cSrcweir 
357cdf0e10cSrcweir uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SvxUnoTextContent::getDirectPropertyValuesTolerant( const uno::Sequence< ::rtl::OUString >& aPropertyNames )
358cdf0e10cSrcweir     throw (uno::RuntimeException)
359cdf0e10cSrcweir {
360cdf0e10cSrcweir     return _getDirectPropertyValuesTolerant(aPropertyNames, mnParagraph);
361cdf0e10cSrcweir }*/
362cdf0e10cSrcweir 
363cdf0e10cSrcweir // beans::XPropertyState
getPropertyState(const OUString & PropertyName)364cdf0e10cSrcweir beans::PropertyState SAL_CALL SvxUnoTextContent::getPropertyState( const OUString& PropertyName )
365cdf0e10cSrcweir 	throw(beans::UnknownPropertyException, uno::RuntimeException)
366cdf0e10cSrcweir {
367cdf0e10cSrcweir 	return _getPropertyState( PropertyName, mnParagraph );
368cdf0e10cSrcweir }
369cdf0e10cSrcweir 
getPropertyStates(const uno::Sequence<OUString> & aPropertyName)370cdf0e10cSrcweir uno::Sequence< beans::PropertyState > SAL_CALL SvxUnoTextContent::getPropertyStates( const uno::Sequence< OUString >& aPropertyName )
371cdf0e10cSrcweir 	throw(beans::UnknownPropertyException, uno::RuntimeException)
372cdf0e10cSrcweir {
373cdf0e10cSrcweir 	return _getPropertyStates( aPropertyName, mnParagraph );
374cdf0e10cSrcweir }
375cdf0e10cSrcweir 
setPropertyToDefault(const OUString & PropertyName)376cdf0e10cSrcweir void SAL_CALL SvxUnoTextContent::setPropertyToDefault( const OUString& PropertyName )
377cdf0e10cSrcweir 	throw(beans::UnknownPropertyException, uno::RuntimeException)
378cdf0e10cSrcweir {
379cdf0e10cSrcweir 	_setPropertyToDefault( PropertyName, mnParagraph );
380cdf0e10cSrcweir }
381cdf0e10cSrcweir 
382cdf0e10cSrcweir // lang::XServiceInfo
383cdf0e10cSrcweir 
getImplementationName()384cdf0e10cSrcweir OUString SAL_CALL SvxUnoTextContent::getImplementationName()
385cdf0e10cSrcweir 	throw(uno::RuntimeException)
386cdf0e10cSrcweir {
387cdf0e10cSrcweir 	return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoTextContent") );
388cdf0e10cSrcweir }
389cdf0e10cSrcweir 
getSupportedServiceNames()390cdf0e10cSrcweir uno::Sequence< OUString > SAL_CALL SvxUnoTextContent::getSupportedServiceNames()
391cdf0e10cSrcweir 	throw(uno::RuntimeException)
392cdf0e10cSrcweir {
393cdf0e10cSrcweir 	uno::Sequence< OUString > aSeq( SvxUnoTextRangeBase::getSupportedServiceNames() );
394cdf0e10cSrcweir 	comphelper::ServiceInfoHelper::addToSequence( aSeq, 5, "com.sun.star.style.ParagraphProperties",
395cdf0e10cSrcweir 												  "com.sun.star.style.ParagraphPropertiesComplex",
396cdf0e10cSrcweir 												  "com.sun.star.style.ParagraphPropertiesAsian",
397cdf0e10cSrcweir 												  "com.sun.star.text.TextContent",
398cdf0e10cSrcweir 												  "com.sun.star.text.Paragraph");
399cdf0e10cSrcweir 	return aSeq;
400cdf0e10cSrcweir }
401cdf0e10cSrcweir 
402cdf0e10cSrcweir // ====================================================================
403cdf0e10cSrcweir //  class SvxUnoTextRangeEnumeration
404cdf0e10cSrcweir // ====================================================================
405cdf0e10cSrcweir 
SvxUnoTextRangeEnumeration(const SvxUnoTextBase & rText,sal_uInt16 nPara)406cdf0e10cSrcweir SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw()
407cdf0e10cSrcweir :	mxParentText(  const_cast<SvxUnoTextBase*>(&rText) ),
408cdf0e10cSrcweir 	mrParentText( rText ),
409cdf0e10cSrcweir 	mnParagraph( nPara ),
410cdf0e10cSrcweir 	mnNextPortion( 0 )
411cdf0e10cSrcweir {
412cdf0e10cSrcweir 	mpEditSource = rText.GetEditSource() ? rText.GetEditSource()->Clone() : NULL;
413cdf0e10cSrcweir 
414cdf0e10cSrcweir 	if( mpEditSource && mpEditSource->GetTextForwarder() )
415cdf0e10cSrcweir 	{
416cdf0e10cSrcweir 		mpPortions = new SvUShorts;
417cdf0e10cSrcweir 		mpEditSource->GetTextForwarder()->GetPortions( nPara, *mpPortions );
418cdf0e10cSrcweir 	}
419cdf0e10cSrcweir 	else
420cdf0e10cSrcweir 	{
421cdf0e10cSrcweir 		mpPortions = NULL;
422cdf0e10cSrcweir 	}
423cdf0e10cSrcweir }
424cdf0e10cSrcweir 
~SvxUnoTextRangeEnumeration()425cdf0e10cSrcweir SvxUnoTextRangeEnumeration::~SvxUnoTextRangeEnumeration() throw()
426cdf0e10cSrcweir {
427cdf0e10cSrcweir 	delete mpEditSource;
428cdf0e10cSrcweir 	delete mpPortions;
429cdf0e10cSrcweir }
430cdf0e10cSrcweir 
431cdf0e10cSrcweir // container::XEnumeration
432cdf0e10cSrcweir 
hasMoreElements()433cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoTextRangeEnumeration::hasMoreElements()
434cdf0e10cSrcweir 	throw(uno::RuntimeException)
435cdf0e10cSrcweir {
436cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
437cdf0e10cSrcweir 
438cdf0e10cSrcweir 	return mpPortions && mnNextPortion < mpPortions->Count();
439cdf0e10cSrcweir }
440cdf0e10cSrcweir 
nextElement()441cdf0e10cSrcweir uno::Any SAL_CALL SvxUnoTextRangeEnumeration::nextElement()
442cdf0e10cSrcweir 	throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
443cdf0e10cSrcweir {
444cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
445cdf0e10cSrcweir 
446cdf0e10cSrcweir 	if( mpPortions == NULL || mnNextPortion >= mpPortions->Count() )
447cdf0e10cSrcweir 		throw container::NoSuchElementException();
448cdf0e10cSrcweir 
449cdf0e10cSrcweir 	sal_uInt16 nStartPos = 0;
450cdf0e10cSrcweir 	if (mnNextPortion > 0)
451cdf0e10cSrcweir 		nStartPos = mpPortions->GetObject(mnNextPortion-1);
452cdf0e10cSrcweir 	sal_uInt16 nEndPos = mpPortions->GetObject(mnNextPortion);
453cdf0e10cSrcweir 	ESelection aSel( mnParagraph, nStartPos, mnParagraph, nEndPos );
454cdf0e10cSrcweir 
455cdf0e10cSrcweir 	uno::Reference< text::XTextRange > xRange;
456cdf0e10cSrcweir 
457cdf0e10cSrcweir 	const SvxUnoTextRangeBaseList& rRanges( mpEditSource->getRanges() );
458cdf0e10cSrcweir 
459cdf0e10cSrcweir 	SvxUnoTextRange* pRange = 0;
460cdf0e10cSrcweir 
461cdf0e10cSrcweir 	SvxUnoTextRangeBaseList::const_iterator aIter;
462cdf0e10cSrcweir 	for( aIter = rRanges.begin(); (aIter != rRanges.end()) && (pRange == 0); aIter++ )
463cdf0e10cSrcweir 	{
464cdf0e10cSrcweir 		SvxUnoTextRange* pIterRange = dynamic_cast< SvxUnoTextRange* >( (*aIter ) );
465cdf0e10cSrcweir 		if( pIterRange && pIterRange->mbPortion && (aSel.IsEqual( pIterRange->maSelection ) ) )
466cdf0e10cSrcweir 			pRange = pIterRange;
467cdf0e10cSrcweir 	}
468cdf0e10cSrcweir 
469cdf0e10cSrcweir 	if( pRange == 0 )
470cdf0e10cSrcweir 	{
471cdf0e10cSrcweir 		pRange = new SvxUnoTextRange( mrParentText, sal_True );
472cdf0e10cSrcweir 		pRange->SetSelection(aSel);
473cdf0e10cSrcweir 	}
474cdf0e10cSrcweir 
475cdf0e10cSrcweir 	xRange = pRange;
476cdf0e10cSrcweir 
477cdf0e10cSrcweir 	mnNextPortion++;
478cdf0e10cSrcweir 
479cdf0e10cSrcweir 	return uno::makeAny( xRange );
480cdf0e10cSrcweir }
481cdf0e10cSrcweir 
482cdf0e10cSrcweir // ====================================================================
483cdf0e10cSrcweir // class SvxUnoTextCursor
484cdf0e10cSrcweir // ====================================================================
485cdf0e10cSrcweir 
486cdf0e10cSrcweir uno::Sequence< uno::Type > SvxUnoTextCursor::maTypeSequence;
487cdf0e10cSrcweir 
SvxUnoTextCursor_NewInstance()488cdf0e10cSrcweir uno::Reference< uno::XInterface > SvxUnoTextCursor_NewInstance()
489cdf0e10cSrcweir {
490cdf0e10cSrcweir 	SvxUnoText aText;
491cdf0e10cSrcweir 	uno::Reference< text::XText > xText( (text::XText*)new SvxUnoTextCursor( aText ) );
492cdf0e10cSrcweir 	uno::Reference< uno::XInterface > xInt( xText, uno::UNO_QUERY );
493cdf0e10cSrcweir 	return xInt;
494cdf0e10cSrcweir }
495cdf0e10cSrcweir 
SvxUnoTextCursor(const SvxUnoTextBase & rText)496cdf0e10cSrcweir SvxUnoTextCursor::SvxUnoTextCursor( const SvxUnoTextBase& rText ) throw()
497cdf0e10cSrcweir :	SvxUnoTextRangeBase(rText),
498cdf0e10cSrcweir 	mxParentText( const_cast<SvxUnoTextBase*>(&rText) )
499cdf0e10cSrcweir {
500cdf0e10cSrcweir }
501cdf0e10cSrcweir 
SvxUnoTextCursor(const SvxUnoTextCursor & rCursor)502cdf0e10cSrcweir SvxUnoTextCursor::SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) throw()
503cdf0e10cSrcweir :	SvxUnoTextRangeBase(rCursor)
504cdf0e10cSrcweir ,	text::XTextCursor()
505cdf0e10cSrcweir ,	lang::XTypeProvider()
506cdf0e10cSrcweir ,	cppu::OWeakAggObject()
507cdf0e10cSrcweir ,	mxParentText(rCursor.mxParentText)
508cdf0e10cSrcweir {
509cdf0e10cSrcweir }
510cdf0e10cSrcweir 
~SvxUnoTextCursor()511cdf0e10cSrcweir SvxUnoTextCursor::~SvxUnoTextCursor() throw()
512cdf0e10cSrcweir {
513cdf0e10cSrcweir }
514cdf0e10cSrcweir 
515cdf0e10cSrcweir // automatisch auskommentiert - [getIdlClass(es) or queryInterface] - Bitte XTypeProvider benutzen!
516cdf0e10cSrcweir //sal_Bool SvxUnoTextCursor::queryInterface( uno::Uik aUIK, Reference< uno::XInterface > & xRef)
queryAggregation(const uno::Type & rType)517cdf0e10cSrcweir uno::Any SAL_CALL SvxUnoTextCursor::queryAggregation( const uno::Type & rType )
518cdf0e10cSrcweir 	throw(uno::RuntimeException)
519cdf0e10cSrcweir {
520cdf0e10cSrcweir 	if( rType == ::getCppuType((const uno::Reference< text::XTextRange >*)0) )
521cdf0e10cSrcweir         return uno::makeAny(uno::Reference< text::XTextRange >((text::XText*)(this)));
522cdf0e10cSrcweir 	else QUERYINT( text::XTextCursor );
523cdf0e10cSrcweir 	else QUERYINT( beans::XMultiPropertyStates );
524cdf0e10cSrcweir 	else QUERYINT( beans::XPropertySet );
525cdf0e10cSrcweir 	else QUERYINT( beans::XMultiPropertySet );
526cdf0e10cSrcweir 	else QUERYINT( beans::XPropertyState );
527cdf0e10cSrcweir 	else QUERYINT( text::XTextRangeCompare );
528cdf0e10cSrcweir 	else QUERYINT( lang::XServiceInfo );
529cdf0e10cSrcweir 	else QUERYINT( lang::XTypeProvider );
530cdf0e10cSrcweir 	else QUERYINT( lang::XUnoTunnel );
531cdf0e10cSrcweir 	else
532cdf0e10cSrcweir 		return OWeakAggObject::queryAggregation( rType );
533cdf0e10cSrcweir }
534cdf0e10cSrcweir 
queryInterface(const uno::Type & rType)535cdf0e10cSrcweir uno::Any SAL_CALL SvxUnoTextCursor::queryInterface( const uno::Type & rType )
536cdf0e10cSrcweir 	throw(uno::RuntimeException)
537cdf0e10cSrcweir {
538cdf0e10cSrcweir 	return OWeakAggObject::queryInterface(rType);
539cdf0e10cSrcweir }
540cdf0e10cSrcweir 
acquire()541cdf0e10cSrcweir void SAL_CALL SvxUnoTextCursor::acquire() throw ( )
542cdf0e10cSrcweir {
543cdf0e10cSrcweir 	OWeakAggObject::acquire();
544cdf0e10cSrcweir }
545cdf0e10cSrcweir 
release()546cdf0e10cSrcweir void SAL_CALL SvxUnoTextCursor::release() throw ( )
547cdf0e10cSrcweir {
548cdf0e10cSrcweir 	OWeakAggObject::release();
549cdf0e10cSrcweir }
550cdf0e10cSrcweir 
551cdf0e10cSrcweir // XTypeProvider
getTypes()552cdf0e10cSrcweir uno::Sequence< uno::Type > SAL_CALL SvxUnoTextCursor::getTypes()
553cdf0e10cSrcweir 	throw(uno::RuntimeException)
554cdf0e10cSrcweir {
555cdf0e10cSrcweir 	if( maTypeSequence.getLength() == 0 )
556cdf0e10cSrcweir 	{
557cdf0e10cSrcweir 		maTypeSequence.realloc( 10 ); // !DANGER! keep this updated
558cdf0e10cSrcweir 		uno::Type* pTypes = maTypeSequence.getArray();
559cdf0e10cSrcweir 
560cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
561cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCursor >*)0);
562cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
563cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
564cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
565cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
566cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
567cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
568cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
569cdf0e10cSrcweir 		*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
570cdf0e10cSrcweir 	}
571cdf0e10cSrcweir 	return maTypeSequence;
572cdf0e10cSrcweir }
573cdf0e10cSrcweir 
getImplementationId()574cdf0e10cSrcweir uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextCursor::getImplementationId()
575cdf0e10cSrcweir 	throw (uno::RuntimeException)
576cdf0e10cSrcweir {
577cdf0e10cSrcweir 	static uno::Sequence< sal_Int8 > aId;
578cdf0e10cSrcweir 	if( aId.getLength() == 0 )
579cdf0e10cSrcweir 	{
580cdf0e10cSrcweir 		aId.realloc( 16 );
581cdf0e10cSrcweir 		rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
582cdf0e10cSrcweir 	}
583cdf0e10cSrcweir 	return aId;
584cdf0e10cSrcweir }
585cdf0e10cSrcweir 
586cdf0e10cSrcweir // text::XTextCursor
collapseToStart()587cdf0e10cSrcweir void SAL_CALL SvxUnoTextCursor::collapseToStart()
588cdf0e10cSrcweir 	throw(uno::RuntimeException)
589cdf0e10cSrcweir {
590cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
591cdf0e10cSrcweir 	CollapseToStart();
592cdf0e10cSrcweir }
593cdf0e10cSrcweir 
collapseToEnd()594cdf0e10cSrcweir void SAL_CALL SvxUnoTextCursor::collapseToEnd()
595cdf0e10cSrcweir 	throw(uno::RuntimeException)
596cdf0e10cSrcweir {
597cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
598cdf0e10cSrcweir 	CollapseToEnd();
599cdf0e10cSrcweir }
600cdf0e10cSrcweir 
isCollapsed()601cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoTextCursor::isCollapsed()
602cdf0e10cSrcweir 	throw(uno::RuntimeException)
603cdf0e10cSrcweir {
604cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
605cdf0e10cSrcweir 	return IsCollapsed();
606cdf0e10cSrcweir }
607cdf0e10cSrcweir 
goLeft(sal_Int16 nCount,sal_Bool bExpand)608cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoTextCursor::goLeft( sal_Int16 nCount, sal_Bool bExpand )
609cdf0e10cSrcweir 	throw(uno::RuntimeException)
610cdf0e10cSrcweir {
611cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
612cdf0e10cSrcweir 	return GoLeft( nCount, bExpand );
613cdf0e10cSrcweir }
614cdf0e10cSrcweir 
goRight(sal_Int16 nCount,sal_Bool bExpand)615cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoTextCursor::goRight( sal_Int16 nCount, sal_Bool bExpand )
616cdf0e10cSrcweir 	throw(uno::RuntimeException)
617cdf0e10cSrcweir {
618cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
619cdf0e10cSrcweir 	return GoRight( nCount, bExpand );
620cdf0e10cSrcweir }
621cdf0e10cSrcweir 
gotoStart(sal_Bool bExpand)622cdf0e10cSrcweir void SAL_CALL SvxUnoTextCursor::gotoStart( sal_Bool bExpand )
623cdf0e10cSrcweir 	throw(uno::RuntimeException)
624cdf0e10cSrcweir {
625cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
626cdf0e10cSrcweir 	GotoStart( bExpand );
627cdf0e10cSrcweir }
628cdf0e10cSrcweir 
gotoEnd(sal_Bool bExpand)629cdf0e10cSrcweir void SAL_CALL SvxUnoTextCursor::gotoEnd( sal_Bool bExpand )
630cdf0e10cSrcweir 	throw(uno::RuntimeException)
631cdf0e10cSrcweir {
632cdf0e10cSrcweir 	OGuard aGuard( Application::GetSolarMutex() );
633cdf0e10cSrcweir 	GotoEnd( bExpand );
634cdf0e10cSrcweir }
635cdf0e10cSrcweir 
gotoRange(const uno::Reference<text::XTextRange> & xRange,sal_Bool bExpand)636cdf0e10cSrcweir void SAL_CALL SvxUnoTextCursor::gotoRange( const uno::Reference< text::XTextRange >& xRange, sal_Bool bExpand )
637cdf0e10cSrcweir 	throw(uno::RuntimeException)
638cdf0e10cSrcweir {
639cdf0e10cSrcweir 	if( !xRange.is() )
640cdf0e10cSrcweir 		return;
641cdf0e10cSrcweir 
642cdf0e10cSrcweir 	SvxUnoTextRangeBase* pRange = SvxUnoTextRangeBase::getImplementation( xRange );
643cdf0e10cSrcweir 
644cdf0e10cSrcweir 	if( pRange )
645cdf0e10cSrcweir 	{
646cdf0e10cSrcweir 		ESelection aNewSel = pRange->GetSelection();
647cdf0e10cSrcweir 
648cdf0e10cSrcweir 		if( bExpand )
649cdf0e10cSrcweir 		{
650cdf0e10cSrcweir 			const ESelection& rOldSel = GetSelection();
651cdf0e10cSrcweir 			aNewSel.nStartPara = rOldSel.nStartPara;
652cdf0e10cSrcweir 			aNewSel.nStartPos  = rOldSel.nStartPos;
653cdf0e10cSrcweir 		}
654cdf0e10cSrcweir 
655cdf0e10cSrcweir 		SetSelection( aNewSel );
656cdf0e10cSrcweir 	}
657cdf0e10cSrcweir }
658cdf0e10cSrcweir 
659cdf0e10cSrcweir // text::XTextRange (rest in SvxTextRange)
getText(void)660cdf0e10cSrcweir uno::Reference< text::XText > SAL_CALL SvxUnoTextCursor::getText(void) throw( uno::RuntimeException )
661cdf0e10cSrcweir {
662cdf0e10cSrcweir 	return mxParentText;
663cdf0e10cSrcweir }
664cdf0e10cSrcweir 
getStart()665cdf0e10cSrcweir uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextCursor::getStart()
666cdf0e10cSrcweir 	throw(uno::RuntimeException)
667cdf0e10cSrcweir {
668cdf0e10cSrcweir 	return SvxUnoTextRangeBase::getStart();
669cdf0e10cSrcweir }
670cdf0e10cSrcweir 
getEnd()671cdf0e10cSrcweir uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextCursor::getEnd()
672cdf0e10cSrcweir 	throw(uno::RuntimeException)
673cdf0e10cSrcweir {
674cdf0e10cSrcweir 	return SvxUnoTextRangeBase::getEnd();
675cdf0e10cSrcweir }
676cdf0e10cSrcweir 
getString()677cdf0e10cSrcweir OUString SAL_CALL SvxUnoTextCursor::getString() throw( uno::RuntimeException )
678cdf0e10cSrcweir {
679cdf0e10cSrcweir 	return SvxUnoTextRangeBase::getString();
680cdf0e10cSrcweir }
681cdf0e10cSrcweir 
setString(const OUString & aString)682cdf0e10cSrcweir void SAL_CALL SvxUnoTextCursor::setString( const OUString& aString ) throw(uno::RuntimeException)
683cdf0e10cSrcweir {
684cdf0e10cSrcweir 	SvxUnoTextRangeBase::setString(aString);
685cdf0e10cSrcweir }
686cdf0e10cSrcweir // lang::XServiceInfo
getImplementationName()687cdf0e10cSrcweir OUString SAL_CALL SvxUnoTextCursor::getImplementationName() throw(uno::RuntimeException)
688cdf0e10cSrcweir {
689cdf0e10cSrcweir 	return OUString(RTL_CONSTASCII_USTRINGPARAM("SvxUnoTextCursor"));
690cdf0e10cSrcweir }
691cdf0e10cSrcweir 
supportsService(const OUString & ServiceName)692cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoTextCursor::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
693cdf0e10cSrcweir {
694cdf0e10cSrcweir 	return comphelper::ServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() );
695cdf0e10cSrcweir }
696cdf0e10cSrcweir 
getSupportedServiceNames()697cdf0e10cSrcweir uno::Sequence< OUString > SAL_CALL SvxUnoTextCursor::getSupportedServiceNames() throw(uno::RuntimeException)
698cdf0e10cSrcweir {
699cdf0e10cSrcweir 	uno::Sequence< OUString > aSeq( SvxUnoTextRangeBase::getSupportedServiceNames() );
700cdf0e10cSrcweir 	comphelper::ServiceInfoHelper::addToSequence( aSeq, 4,"com.sun.star.style.ParagraphProperties",
701cdf0e10cSrcweir 												  "com.sun.star.style.ParagraphPropertiesComplex",
702cdf0e10cSrcweir 												  "com.sun.star.style.ParagraphPropertiesAsian",
703cdf0e10cSrcweir 												 "com.sun.star.text.TextCursor");
704cdf0e10cSrcweir 	return aSeq;
705cdf0e10cSrcweir }
706cdf0e10cSrcweir 
707cdf0e10cSrcweir 
708