20#include <com/sun/star/text/XText.hpp>
38#include <unomodel.hxx>
54 SvxXMLTextImportContext( SvXMLImport& rImport, uno::Reference< XText > xText );
58 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
override;
61 const uno::Reference< XText >
mxText;
66SvxXMLTextImportContext::SvxXMLTextImportContext( SvXMLImport& rImport, uno::Reference< XText > xText )
71css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLTextImportContext::createFastChildContext(
73 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
78 pContext =
new SvxXMLTextImportContext( GetImport(), mxText );
80 else if( nElement ==
XML_ELEMENT(OFFICE, XML_AUTOMATIC_STYLES ) )
83 GetImport().GetTextImport()->SetAutoStyles(
static_cast<SvXMLStylesContext*
>(pContext) );
86 pContext = GetImport().GetTextImport()->CreateTextChildContext( GetImport(), nElement, xAttrList );
92class SvxXMLXTextImportComponent :
public SvXMLImport
95 SvxXMLXTextImportComponent(
96 const css::uno::Reference< css::uno::XComponentContext >& rContext,
97 uno::Reference< XText > xText );
100 const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList )
override;
103 const uno::Reference< XText >
mxText;
110 const uno::Reference< xml::sax::XFastAttributeList >& )
114 if(nElement ==
XML_ELEMENT(OFFICE, XML_DOCUMENT_CONTENT ) )
116 pContext =
new SvxXMLTextImportContext( *
this, mxText );
122SvxXMLXTextImportComponent::SvxXMLXTextImportComponent(
123 const css::uno::Reference< css::uno::XComponentContext >& xContext,
124 uno::Reference< XText > xText )
125: SvXMLImport(xContext,
""),
128 GetTextImport()->SetCursor(
mxText->createTextCursor() );
159 uno::Reference<text::XText > xParent;
161 pUnoText->SetSelection( aSel );
167 uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
206 xml::sax::InputSource aParserInput;
207 aParserInput.aInputStream = xInputStream;
209 xImport->parseStream( aParserInput );
226 catch(
const uno::Exception& )
const ContentNode * GetObject(sal_Int32 nPos) const
EditSelection CreateSelection(const ESelection &rSel)
static SfxItemPool & GetGlobalItemPool()
EditPaM InsertParaBreak(const EditSelection &rEditSelection)
void ParaAttribsToCharAttribs(ContentNode *pNode)
EditPaM ConnectParagraphs(ContentNode *pLeft, ContentNode *pRight, bool bBackward)
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
css::uno::Type const & get()
constexpr TypedWhichId< SfxBoolItem > EE_PARA_BULLETSTATE(EE_PARA_START+9)
constexpr TypedWhichId< SfxInt16Item > EE_PARA_OUTLLEVEL(EE_PARA_START+11)
constexpr TypedWhichId< SvxNumBulletItem > EE_PARA_NUMBULLET(EE_PARA_START+5)
Reference< text::XText > mxText
constexpr OUStringLiteral UNO_NAME_NUMBERING
constexpr OUStringLiteral UNO_NAME_NUMBERING_LEVEL
constexpr OUStringLiteral UNO_NAME_NUMBERING_RULES
#define SVX_UNOEDIT_CHAR_PROPERTIES
#define SVX_UNOEDIT_PARA_PROPERTIES
#define SVX_UNOEDIT_FONT_PROPERTIES
#define XML_ELEMENT(prefix, name)
EditPaM SvxReadXML(EditEngine &rEditEngine, SvStream &rStream, const ESelection &rSel)
this function imports xml from the stream into the selected of an edit engine