26#include <libxml/xmlwriter.h>
39 return "PortionType::NONE";
41 return "PortionType::FlyCnt";
44 return "PortionType::Hole";
46 return "PortionType::TempEnd";
48 return "PortionType::Break";
50 return "PortionType::Kern";
52 return "PortionType::Arrow";
54 return "PortionType::Multi";
56 return "PortionType::HiddenText";
58 return "PortionType::ControlChar";
60 return "PortionType::Bookmark";
63 return "PortionType::Text";
65 return "PortionType::Lay";
67 return "PortionType::Para";
69 return "PortionType::Hanging";
72 return "PortionType::Drop";
74 return "PortionType::Tox";
76 return "PortionType::IsoTox";
78 return "PortionType::Ref";
80 return "PortionType::IsoRef";
82 return "PortionType::Meta";
84 return "PortionType::ContentControl";
86 return "PortionType::FieldMark";
88 return "PortionType::FieldFormCheckbox";
90 return "PortionType::InputField";
93 return "PortionType::Expand";
95 return "PortionType::Blank";
97 return "PortionType::PostIts";
100 return "PortionType::Hyphen";
102 return "PortionType::HyphenStr";
104 return "PortionType::SoftHyphen";
106 return "PortionType::SoftHyphenStr";
108 return "PortionType::SoftHyphenComp";
111 return "PortionType::Field";
113 return "PortionType::Hidden";
115 return "PortionType::QuoVadis";
117 return "PortionType::ErgoSum";
119 return "PortionType::Combined";
121 return "PortionType::Footnote";
124 return "PortionType::FootnoteNum";
126 return "PortionType::Number";
128 return "PortionType::Bullet";
130 return "PortionType::GrfNum";
133 return "PortionType::Glue";
136 return "PortionType::Margin";
139 return "PortionType::Fix";
141 return "PortionType::Fly";
144 return "PortionType::Tab";
147 return "PortionType::TabRight";
149 return "PortionType::TabCenter";
151 return "PortionType::TabDecimal";
154 return "PortionType::TabLeft";
174 (void)xmlTextWriterStartElement( writer, BAD_CAST(
"bounds" ) );
176 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"mbFixSize"), BAD_CAST(OString::boolean(
HasFixSize()).getStr()));
177 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"mbFrameAreaPositionValid"), BAD_CAST(OString::boolean(
isFrameAreaPositionValid()).getStr()));
178 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"mbFrameAreaSizeValid"), BAD_CAST(OString::boolean(
isFrameAreaSizeValid()).getStr()));
179 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"mbFramePrintAreaValid"), BAD_CAST(OString::boolean(
isFramePrintAreaValid()).getStr()));
180 (void)xmlTextWriterEndElement( writer );
183 (void)xmlTextWriterStartElement( writer, BAD_CAST(
"prtBounds" ) );
185 (void)xmlTextWriterEndElement( writer );
190 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"ptr" ),
"%p", this );
191 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"id" ),
"%" SAL_PRIuUINT32,
GetFrameId() );
192 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"symbol" ),
"%s", BAD_CAST(
typeid( *this ).name( ) ) );
194 (
void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"next" ),
"%" SAL_PRIuUINT32,
GetNext()->
GetFrameId() );
196 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"prev" ),
"%" SAL_PRIuUINT32,
GetPrev()->
GetFrameId() );
198 (
void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"upper" ),
"%" SAL_PRIuUINT32,
GetUpper()->
GetFrameId() );
200 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"lower" ),
"%" SAL_PRIuUINT32,
GetLower()->
GetFrameId() );
204 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"ref"),
"%" SAL_PRIuUINT32, pFF->
GetRef()->
GetFrameId() );
206 (
void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"master"),
"%" SAL_PRIuUINT32, pFF->
GetMaster()->
GetFrameId() );
208 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"follow"),
"%" SAL_PRIuUINT32, pFF->
GetFollow()->
GetFrameId() );
214 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"sectionNodeIndex"),
"%" SAL_PRIdINT32, pNode ? sal_Int32(pNode->
GetIndex()) : -1);
220 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"txtNodeIndex" ),
"%" SAL_PRIdINT32, sal_Int32(pTextNode->
GetIndex()) );
222 OString aMode =
"Horizontal";
235 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"WritingMode"), BAD_CAST(aMode.getStr()));
241 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"fmtName" ),
"%s", BAD_CAST(
OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr()));
242 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"fmtPtr" ),
"%p", pHeadFootFrame->
GetFormat());
249 for ( ; pFrame !=
nullptr; pFrame = pFrame->
GetNext( ) )
257 (void)xmlTextWriterStartElement( writer, BAD_CAST(
getElementName() ) );
258 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"ptr" ),
"%p", this );
259 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"anchor-frame"), BAD_CAST(OString::number(
mpAnchorFrame->
GetFrameId()).getStr()));
262 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"page-frame"), BAD_CAST(OString::number(
mpPageFrame->
GetFrameId()).getStr()));
265 if (pAnchorCharFrame)
267 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"anchor-char-frame"), BAD_CAST(OString::number(pAnchorCharFrame->
GetFrameId()).getStr()));
270 (void)xmlTextWriterStartElement( writer, BAD_CAST(
"bounds" ) );
273 (void)xmlTextWriterEndElement( writer );
278 (void)xmlTextWriterEndElement( writer );
283 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"SwFont"));
284 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"ptr"),
"%p",
this);
286 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"color"),
"%08" SAL_PRIxUINT32, sal_uInt32(
GetColor()));
287 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"height"), BAD_CAST(OString::number(
GetSize(
GetActual()).
Height()).getStr()));
288 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"width"), BAD_CAST(OString::number(
GetSize(
GetActual()).
Width()).getStr()));
290 std::stringstream ss;
292 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"weight"), BAD_CAST(ss.str().c_str()));
294 (void)xmlTextWriterEndElement(writer);
301 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"follow" ),
"%" SAL_PRIuUINT32,
GetFollow()->
GetFrameId() );
303 if (m_pPrecede !=
nullptr)
304 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"precede" ),
"%" SAL_PRIuUINT32,
static_cast<SwTextFrame*
>(m_pPrecede)->
GetFrameId() );
306 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"offset"), BAD_CAST(OString::number(
static_cast<sal_Int32
>(
mnOffset)).getStr()));
313 if (m_pFollow !=
nullptr)
315 (void)xmlTextWriterWriteAttribute(
316 pWriter, BAD_CAST(
"follow"),
317 BAD_CAST(OString::number(m_pFollow->GetFrame().GetFrameId()).getStr()));
319 if (m_pPrecede !=
nullptr)
321 (void)xmlTextWriterWriteAttribute(
322 pWriter, BAD_CAST(
"precede"),
323 BAD_CAST(OString::number(m_pPrecede->GetFrame().GetFrameId()).getStr()));
331 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"follow" ),
"%" SAL_PRIuUINT32,
GetFollow()->
GetFrameId() );
333 if (m_pPrecede !=
nullptr)
334 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"precede" ),
"%" SAL_PRIuUINT32,
static_cast<SwSectionFrame*
>( m_pPrecede )->
GetFrameId() );
341 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"follow" ),
"%" SAL_PRIuUINT32,
GetFollow()->
GetFrameId() );
343 if (m_pPrecede !=
nullptr)
344 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"precede" ),
"%" SAL_PRIuUINT32,
static_cast<SwTabFrame*
>( m_pPrecede )->
GetFrameId() );
wrapper class for the positioning of Writer fly frames and drawing objects
SwTextFrame * FindAnchorCharFrame()
get frame, which contains the anchor character, if the object is anchored at-character or as-characte...
virtual void dumpAsXml(xmlTextWriterPtr pWriter=nullptr) const
Dump a bunch of useful data to an XML representation to ease layout understanding,...
virtual const char * getElementName() const
The element name to show in the XML dump.
SwPageFrame * mpPageFrame
const SdrObject * GetDrawObj() const
SwFrame * mpAnchorFrame
Frame the object is anchored at.
void dumpAsXmlAttributes(xmlTextWriterPtr pWriter) const override
void dumpAsXml(xmlTextWriterPtr writer) const
const Size & GetSize(SwFontScript nWhich) const
SwFontScript GetActual() const
FontWeight GetWeight() const
const Color & GetColor() const
const SwRect & getFrameArea() const
bool isFrameAreaPositionValid() const
const SwRect & getFramePrintArea() const
bool isFramePrintAreaValid() const
bool isFrameAreaSizeValid() const
sal_uInt32 GetFrameId() const
Base class of the Writer layout elements.
virtual void dumpAsXml(xmlTextWriterPtr writer=nullptr) const =0
bool IsHeaderFrame() const
void dumpInfosAsXml(xmlTextWriterPtr writer) const
bool IsFooterFrame() const
bool IsFootnoteFrame() const
SwLayoutFrame * GetUpper()
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
void dumpTopMostAsXml(xmlTextWriterPtr writer=nullptr) const
void dumpChildrenAsXml(xmlTextWriterPtr writer) const
virtual const SwFrameFormat * GetFormat() const
SwNodeOffset GetIndex() const
Of course Writer needs its own rectangles.
void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
const SwSectionFrame * GetFollow() const
A section node represents the start of a section on the UI, i.e.
SwSectionFormat * GetFormat()
SwTabFrame is one table in the document layout, containing rows (which contain cells).
const SwTabFrame * GetFollow() const
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
Represents the visualization of a paragraph.
SwTextFrame * GetFollow()
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
SwTextNode * GetTextNodeFirst()
SwTextNode is a paragraph in the document model.
struct _xmlTextWriter * xmlTextWriterPtr
EmbeddedObjectRef * pObject
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const char * PortionTypeToString(PortionType nType)