29 #include <oox/token/namespaces.hxx>
48 class TextParagraphContext :
public ContextHandler2
51 TextParagraphContext( ContextHandler2Helper
const & rParent, TextParagraph& rPara );
53 virtual ContextHandlerRef onCreateContext( sal_Int32 aElementToken,
const AttributeList& rAttribs )
override;
61 TextParagraphContext::TextParagraphContext( ContextHandler2Helper
const & rParent, TextParagraph& rPara )
62 : ContextHandler2( rParent )
65 mbEnableTrimSpace =
false;
68 ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken,
const AttributeList& rAttribs )
71 switch( aElementToken )
78 return new RegularTextRunContext( *
this, pRun );
85 return new RegularTextRunContext( *
this, pRun );
89 auto pField = std::make_shared<TextField>();
91 return new TextFieldContext( *
this, rAttribs, *pField );
96 return new TextParagraphPropertiesContext( *
this, rAttribs,
mrParagraph.getProperties() );
97 case A_TOKEN( endParaRPr ):
98 return new TextCharacterPropertiesContext( *this, rAttribs,
mrParagraph.getEndProperties() );
100 case W_TOKEN( sdtContent ):
106 case OOX_TOKEN(a14, m):
108 case W_TOKEN( hyperlink ):
110 TextRunPtr pRun = std::make_shared<TextRun>();
114 *
this, rAttribs, pRun->getTextCharacterProperties().maHyperlinkPropertyMap));
116 return new RegularTextRunContext(*
this, pRun);
119 SAL_WARN(
"oox",
"TextParagraphContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken));
127 , mpRunPtr( pRunPtr )
128 , mbIsInText(
false )
157 switch( aElementToken )
169 SAL_WARN(
"oox",
"RegularTextRunContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken));
178 , mrTextBody( rTextBody )
183 : TextBodyContext(rParent, *pShapePtr->getTextBody())
185 mpShapePtr = pShapePtr;
190 switch( aElementToken )
192 case A_TOKEN( bodyPr ):
199 case A_TOKEN( lstStyle ):
205 case W_TOKEN( sdtContent ):
207 case W_TOKEN( sdtPr ):
208 case W_TOKEN( sdtEndPr ):
213 SAL_WARN(
"oox",
"TextBodyContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken));
TextParagraph & mrParagraph
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
std::shared_ptr< TextRun > TextRunPtr
exports com.sun.star. drawing
virtual void onEndElement() override
Will be called when the current element is about to be left.
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
TextParagraph & addParagraph()
sal_Int32 getCurrentElement() const
Returns the identifier of the currently processed element.
Provides access to attribute values of an element.
virtual void onCharacters(const OUString &aChars) override
Will be called before a new child element starts, or if the current element is about to be left...
rtl::Reference< core::ContextHandler > CreateLazyMathBufferingContext(core::ContextHandler const &rParent, drawingml::TextParagraph &rPara)
const TextListStyle & getTextListStyle() const
::rtl::Reference< ContextHandler > ContextHandlerRef
const css::uno::Reference< css::xml::sax::XFastAttributeList > & getFastAttributeList() const
Returns the wrapped com.sun.star.xml.sax.XFastAttributeList object.
TextBodyContext(::oox::core::ContextHandler2Helper const &rParent, TextBody &rTextBody)
#define SAL_WARN(area, stream)
std::shared_ptr< Shape > ShapePtr
Helper class that provides a context stack.
const TextBodyProperties & getTextProperties() const
void setHasNoninheritedBodyProperties()
Flags textbody as having a non-empty bodyPr tag.
bool m_bDetectedRangeSegmentation false