27class IndexingNodeHandler :
public ModelTraverseHandler
32 std::deque<SwNode*> maNodeStack;
36 : m_rXmlWriter(rXmlWriter)
40 void handleNode(
SwNode* pNode)
override
68 void handleOLENode(
const SwOLENode* pOleNode)
73 m_rXmlWriter.
attribute(
"name", pFrameFormat->GetName());
74 m_rXmlWriter.
attribute(
"object_type",
"ole");
78 void handleGraphicNode(
const SwGrfNode* pGraphicNode)
83 m_rXmlWriter.
attribute(
"name", pFrameFormat->GetName());
84 m_rXmlWriter.
attribute(
"object_type",
"graphic");
88 void handleTextNode(
const SwTextNode* pTextNode)
91 if (!maNodeStack.empty() && maNodeStack.back())
93 nParentIndex = maNodeStack.back()->GetIndex();
95 const OUString& rString
97 if (rString.isEmpty())
101 m_rXmlWriter.
attribute(
"node_type",
"writer");
103 m_rXmlWriter.
attribute(
"parent_index", sal_Int32(nParentIndex));
108 void handleSdrObject(
SdrObject* pObject)
override
110 if (
pObject->GetName().isEmpty())
116 m_rXmlWriter.
attribute(
"object_type",
"shape");
126 if (!pOutlinerParagraphObject)
130 for (sal_Int32 nParagraph = 0; nParagraph < aEdit.
GetParagraphCount(); ++nParagraph)
132 OUString sText = aEdit.
GetText(nParagraph);
135 m_rXmlWriter.
attribute(
"index", nParagraph);
136 m_rXmlWriter.
attribute(
"node_type",
"common");
151 m_rXmlWriter.
attribute(
"object_type",
"table");
154 maNodeStack.push_back(pTableNode);
162 m_rXmlWriter.
attribute(
"object_type",
"section");
165 maNodeStack.push_back(pSectionNode);
172 maNodeStack.pop_back();
180 : m_aModelTraverser(pDoc)
181 , m_aXmlWriter(&rStream)
virtual sal_Int32 GetParagraphCount() const=0
virtual OUString GetText(sal_Int32 nPara) const=0
const EditTextObject & GetTextObject() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
Ends a section of nodes in the document model.
OUString GetTitle() const
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
bool IsSectionNode() const
const SwStartNode * StartOfSectionNode() const
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
SwTableNode * GetTableNode()
A section node represents the start of a section on the UI, i.e.
const SwSection & GetSection() const
const OUString & GetSectionName() const
const SwTable & GetTable() const
SwTableFormat * GetFrameFormat()
SwTextNode is a paragraph in the document model.
const OUString & GetText() const
tools::XmlWriter m_aXmlWriter
IndexingExport(SvStream &rStream, SwDoc *pDoc)
ModelTraverser m_aModelTraverser
void addNodeHandler(std::shared_ptr< ModelTraverseHandler > pHandler)
EmbeddedObjectRef * pObject
#define CH_TXTATR_BREAKWORD
Dialog to specify the properties of date form field.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)