29#include <oox/token/namespaces.hxx>
49class TextParagraphContext :
public ContextHandler2
52 TextParagraphContext( ContextHandler2Helper
const & rParent, TextParagraph& rPara );
54 virtual ContextHandlerRef onCreateContext( sal_Int32 aElementToken,
const AttributeList& rAttribs )
override;
62TextParagraphContext::TextParagraphContext( ContextHandler2Helper
const & rParent, TextParagraph& rPara )
63: ContextHandler2( rParent )
66 mbEnableTrimSpace =
false;
69ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken,
const AttributeList& rAttribs )
72 switch( aElementToken )
79 return new RegularTextRunContext( *
this, pRun );
86 return new RegularTextRunContext( *
this, pRun );
90 auto pField = std::make_shared<TextField>();
92 return new TextFieldContext( *
this, rAttribs, *pField );
97 return new TextParagraphPropertiesContext( *
this, rAttribs,
mrParagraph.getProperties() );
98 case A_TOKEN( endParaRPr ):
99 return new TextCharacterPropertiesContext( *this, rAttribs,
mrParagraph.getEndProperties() );
101 case W_TOKEN( sdtContent ):
107 case OOX_TOKEN(a14, m):
109 case W_TOKEN( hyperlink ):
111 TextRunPtr pRun = std::make_shared<TextRun>();
115 *
this, rAttribs, pRun->getTextCharacterProperties().maHyperlinkPropertyMap));
117 return new RegularTextRunContext(*
this, pRun);
120 SAL_WARN(
"oox",
"TextParagraphContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken));
126RegularTextRunContext::RegularTextRunContext( ContextHandler2Helper
const & rParent,
TextRunPtr pRunPtr )
128, mpRunPtr(
std::move( pRunPtr ))
135 switch( getCurrentElement() )
158 switch( aElementToken )
167 case W_TOKEN( drawing ):
170 SAL_WARN(
"oox",
"RegularTextRunContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken));
179, mrTextBody( rTextBody )
184 : TextBodyContext(rParent, *pShapePtr->getTextBody())
186 mpShapePtr = pShapePtr;
191 switch( aElementToken )
193 case A_TOKEN( bodyPr ):
200 case A_TOKEN( lstStyle ):
206 case W_TOKEN( sdtContent ):
208 case W_TOKEN( sdtPr ):
209 case W_TOKEN( sdtEndPr ):
214 SAL_WARN(
"oox",
"TextBodyContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken));
Provides access to attribute values of an element.
const css::uno::Reference< css::xml::sax::XFastAttributeList > & getFastAttributeList() const
Returns the wrapped com.sun.star.xml.sax.XFastAttributeList object.
virtual void onEndElement() override
virtual void onCharacters(const OUString &aChars) override
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
TextBodyContext(::oox::core::ContextHandler2Helper const &rParent, TextBody &rTextBody)
TextParagraph & addParagraph()
const TextListStyle & getTextListStyle() const
void setHasNoninheritedBodyProperties()
Flags textbody as having a non-empty bodyPr tag.
const TextBodyProperties & getTextProperties() const
const std::vector< sal_Int32 > & getFastAttributeTokens() const
#define SAL_WARN(area, stream)
::rtl::Reference< ContextHandler > ContextHandlerRef
std::shared_ptr< Shape > ShapePtr
std::shared_ptr< TextRun > TextRunPtr
rtl::Reference< core::ContextHandler > CreateLazyMathBufferingContext(core::ContextHandler const &rParent, drawingml::TextParagraph &rPara)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
TextParagraph & mrParagraph