22#include <com/sun/star/text/XParagraphCursor.hpp>
29SwVbaAutoTextEntry::SwVbaAutoTextEntry(
const uno::Reference< ooo::vba::XHelperInterface >& rParent,
const uno::Reference< uno::XComponentContext >& rContext, uno::Reference< text::XAutoTextEntry > xEntry ) :
43 uno::Reference< text::XTextRange > xTextRange = pWhere->
getXTextRange();
44 xTextRange->setString(
"x" );
45 uno::Reference< text::XTextRange > xEndMarker = xTextRange->getEnd();
46 xEndMarker->setString(
"x" );
47 uno::Reference< text::XText > xText = pWhere->
getXText();
48 mxEntry->applyTo( xEndMarker->getStart() );
49 uno::Reference< text::XTextCursor > xTC = xText->createTextCursorByRange( xTextRange->getStart() );
50 xTC->goRight( 1,
true );
58 uno::Reference< text::XParagraphCursor > xParaCursor( xTC, uno::UNO_QUERY_THROW );
59 if( xParaCursor->isStartOfParagraph() && xParaCursor->isEndOfParagraph() )
64 uno::Reference< text::XTextRange > xCurrentRange( xTC->getEnd(), uno::UNO_SET_THROW );
65 xTVCursor->gotoRange( xCurrentRange,
false );
67 xTVCursor->gotoRange( xEndMarker->getEnd(),
false );
70 xEndMarker->setString(
"" );
71 xTC = xText->createTextCursorByRange( xEndMarker->getEnd() );
74 return uno::Reference< word::XRange >( pWhere );
80 return "SwVbaAutoTextEntry";
83uno::Sequence< OUString >
88 "ooo.vba.word.AutoTextEntry"
103uno::Reference< container::XEnumeration >
106 throw uno::RuntimeException(
"Not implemented" );
112 uno::Reference< text::XAutoTextEntry > xEntry( aSource, uno::UNO_QUERY_THROW );
119 return "SwVbaAutoTextEntries";
122css::uno::Sequence<OUString>
125 static uno::Sequence< OUString >
const sNames
127 "ooo.vba.word.AutoTextEntries"
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any createCollectionObject(const css::uno::Any &aSource) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual OUString getServiceImplName() override
virtual css::uno::Sequence< OUString > getServiceNames() override
SwVbaAutoTextEntries(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::container::XIndexAccess > &xIndexAccess)
css::uno::Reference< css::text::XAutoTextEntry > mxEntry
virtual css::uno::Reference< ooo::vba::word::XRange > SAL_CALL Insert(const css::uno::Reference< ooo::vba::word::XRange > &_where, const css::uno::Any &_richtext) override
SwVbaAutoTextEntry(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Reference< css::text::XAutoTextEntry > xEntry)
virtual OUString getServiceImplName() override
virtual ~SwVbaAutoTextEntry() override
virtual css::uno::Sequence< OUString > getServiceNames() override
void setXTextCursor(const css::uno::Reference< css::text::XTextCursor > &xTextCursor)
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() override
const css::uno::Reference< css::text::XText > & getXText() const
css::uno::Type const & get()
Sequence< OUString > aServiceNames
uno::Reference< text::XTextViewCursor > getXTextViewCursor(const uno::Reference< frame::XModel > &xModel)
VBAHELPER_DLLPUBLIC void dispatchRequests(const css::uno::Reference< css::frame::XModel > &xModel, const OUString &aUrl)
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentWordDoc(const css::uno::Reference< css::uno::XComponentContext > &xContext)
Reference< XModel > xModel