LibreOffice Module sw (master)  1
xmldump.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #include <frame.hxx>
11 #include <frmfmt.hxx>
12 #include <ftnfrm.hxx>
13 #include <sectfrm.hxx>
14 #include <tabfrm.hxx>
15 #include <pagefrm.hxx>
16 #include <txtfrm.hxx>
17 #include <cellfrm.hxx>
18 #include <hffrm.hxx>
19 #include <rootfrm.hxx>
20 #include <ndtxt.hxx>
21 #include <sortedobjs.hxx>
22 #include <swfont.hxx>
23 #include <txttypes.hxx>
24 #include <anchoredobject.hxx>
25 #include <libxml/xmlwriter.h>
26 #include <SwPortionHandler.hxx>
27 #include <view.hxx>
28 #include <svx/svdobj.hxx>
29 
30 namespace {
31 
32 class XmlPortionDumper:public SwPortionHandler
33 {
34  private:
35  xmlTextWriterPtr writer;
36  TextFrameIndex ofs;
37  const OUString& m_rText;
38  OUString m_aLine;
39 
40  static const char* getTypeName( PortionType nType )
41  {
42  switch ( nType )
43  {
44  case PortionType::NONE: return "PortionType::NONE";
45  case PortionType::FlyCnt: return "PortionType::FlyCnt";
46 
47  case PortionType::Hole: return "PortionType::Hole";
48  case PortionType::TempEnd: return "PortionType::TempEnd";
49  case PortionType::Break: return "PortionType::Break";
50  case PortionType::Kern: return "PortionType::Kern";
51  case PortionType::Arrow: return "PortionType::Arrow";
52  case PortionType::Multi: return "PortionType::Multi";
53  case PortionType::HiddenText: return "PortionType::HiddenText";
54  case PortionType::ControlChar: return "PortionType::ControlChar";
55  case PortionType::Bookmark: return "PortionType::Bookmark";
56 
57  case PortionType::Text: return "PortionType::Text";
58  case PortionType::Lay: return "PortionType::Lay";
59  case PortionType::Para: return "PortionType::Para";
60  case PortionType::Hanging: return "PortionType::Hanging";
61 
62  case PortionType::Drop: return "PortionType::Drop";
63  case PortionType::Tox: return "PortionType::Tox";
64  case PortionType::IsoTox: return "PortionType::IsoTox";
65  case PortionType::Ref: return "PortionType::Ref";
66  case PortionType::IsoRef: return "PortionType::IsoRef";
67  case PortionType::Meta: return "PortionType::Meta";
68  case PortionType::FieldMark: return "PortionType::FieldMark";
69  case PortionType::FieldFormCheckbox: return "PortionType::FieldFormCheckbox";
70  case PortionType::InputField: return "PortionType::InputField";
71 
72  case PortionType::Expand: return "PortionType::Expand";
73  case PortionType::Blank: return "PortionType::Blank";
74  case PortionType::PostIts: return "PortionType::PostIts";
75 
76  case PortionType::Hyphen: return "PortionType::Hyphen";
77  case PortionType::HyphenStr: return "PortionType::HyphenStr";
78  case PortionType::SoftHyphen: return "PortionType::SoftHyphen";
79  case PortionType::SoftHyphenStr: return "PortionType::SoftHyphenStr";
80  case PortionType::SoftHyphenComp: return "PortionType::SoftHyphenComp";
81 
82  case PortionType::Field: return "PortionType::Field";
83  case PortionType::Hidden: return "PortionType::Hidden";
84  case PortionType::QuoVadis: return "PortionType::QuoVadis";
85  case PortionType::ErgoSum: return "PortionType::ErgoSum";
86  case PortionType::Combined: return "PortionType::Combined";
87  case PortionType::Footnote: return "PortionType::Footnote";
88 
89  case PortionType::FootnoteNum: return "PortionType::FootnoteNum";
90  case PortionType::Number: return "PortionType::Number";
91  case PortionType::Bullet: return "PortionType::Bullet";
92  case PortionType::GrfNum: return "PortionType::GrfNum";
93 
94  case PortionType::Glue: return "PortionType::Glue";
95 
96  case PortionType::Margin: return "PortionType::Margin";
97 
98  case PortionType::Fix: return "PortionType::Fix";
99  case PortionType::Fly: return "PortionType::Fly";
100 
101  case PortionType::Table: return "PortionType::Table";
102 
103  case PortionType::TabRight: return "PortionType::TabRight";
104  case PortionType::TabCenter: return "PortionType::TabCenter";
105  case PortionType::TabDecimal: return "PortionType::TabDecimal";
106 
107  case PortionType::TabLeft: return "PortionType::TabLeft";
108  default:
109  return "Unknown";
110  }
111  }
112 
113  public:
114 
115  explicit XmlPortionDumper( xmlTextWriterPtr some_writer, const OUString& rText ):writer( some_writer ), ofs( 0 ), m_rText(rText)
116  {
117  }
118 
125  virtual void Text( TextFrameIndex nLength,
126  PortionType nType,
127  sal_Int32 nHeight,
128  sal_Int32 nWidth) override
129  {
130  xmlTextWriterStartElement( writer, BAD_CAST( "Text" ) );
131  xmlTextWriterWriteFormatAttribute( writer,
132  BAD_CAST( "nLength" ),
133  "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
134  xmlTextWriterWriteFormatAttribute( writer,
135  BAD_CAST( "nType" ),
136  "%s", getTypeName( nType ) );
137  if (nHeight > 0)
138  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nHeight"), "%i", static_cast<int>(nHeight));
139  if (nWidth > 0)
140  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nWidth"), "%i", static_cast<int>(nWidth));
141  if (nLength > TextFrameIndex(0))
142  xmlTextWriterWriteAttribute(writer, BAD_CAST("Portion"),
143  BAD_CAST(m_rText.copy(sal_Int32(ofs), sal_Int32(nLength)).toUtf8().getStr()));
144 
145  xmlTextWriterEndElement( writer );
146  m_aLine += m_rText.subView(sal_Int32(ofs), sal_Int32(nLength));
147  ofs += nLength;
148  }
149 
160  virtual void Special( TextFrameIndex nLength,
161  const OUString & rText,
162  PortionType nType,
163  sal_Int32 nHeight,
164  sal_Int32 nWidth,
165  const SwFont* pFont ) override
166  {
167  xmlTextWriterStartElement( writer, BAD_CAST( "Special" ) );
168  xmlTextWriterWriteFormatAttribute( writer,
169  BAD_CAST( "nLength" ),
170  "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
171  xmlTextWriterWriteFormatAttribute( writer,
172  BAD_CAST( "nType" ),
173  "%s", getTypeName( nType ) );
174  OString sText8 = OUStringToOString( rText, RTL_TEXTENCODING_UTF8 );
175  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ),
176  "%s", sText8.getStr( ) );
177 
178  if (nHeight > 0)
179  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nHeight"), "%i", static_cast<int>(nHeight));
180 
181  if (nWidth > 0)
182  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nWidth"), "%i", static_cast<int>(nWidth));
183 
184  if (pFont)
185  pFont->dumpAsXml(writer);
186 
187  xmlTextWriterEndElement( writer );
188  m_aLine += rText;
189  ofs += nLength;
190  }
191 
192  virtual void LineBreak( sal_Int32 nWidth ) override
193  {
194  xmlTextWriterStartElement( writer, BAD_CAST( "LineBreak" ) );
195  if (nWidth > 0)
196  xmlTextWriterWriteFormatAttribute( writer,
197  BAD_CAST( "nWidth" ),
198  "%i", static_cast<int>(nWidth) );
199  if (!m_aLine.isEmpty())
200  {
201  xmlTextWriterWriteAttribute(writer, BAD_CAST("Line"),
202  BAD_CAST(m_aLine.toUtf8().getStr()));
203  m_aLine.clear();
204  }
205  xmlTextWriterEndElement( writer );
206  }
207 
212  virtual void Skip( TextFrameIndex nLength ) override
213  {
214  xmlTextWriterStartElement( writer, BAD_CAST( "Skip" ) );
215  xmlTextWriterWriteFormatAttribute( writer,
216  BAD_CAST( "nLength" ),
217  "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
218  xmlTextWriterEndElement( writer );
219  ofs += nLength;
220  }
221 
222  virtual void Finish( ) override
223  {
224  xmlTextWriterStartElement( writer, BAD_CAST( "Finish" ) );
225  xmlTextWriterEndElement( writer );
226  }
227 
228 };
229 
230  xmlTextWriterPtr lcl_createDefaultWriter()
231  {
232  xmlTextWriterPtr writer = xmlNewTextWriterFilename( "layout.xml", 0 );
233  xmlTextWriterSetIndent(writer,1);
234  xmlTextWriterSetIndentString(writer, BAD_CAST(" "));
235  xmlTextWriterStartDocument( writer, nullptr, nullptr, nullptr );
236  return writer;
237  }
238 
239  void lcl_freeWriter( xmlTextWriterPtr writer )
240  {
241  xmlTextWriterEndDocument( writer );
242  xmlFreeTextWriter( writer );
243  }
244 }
245 
247 {
248  const SwFrame* pFrame = this;
249  while (pFrame->GetUpper())
250  {
251  pFrame = pFrame->GetUpper();
252  }
253 
254  pFrame->dumpAsXml(writer);
255 }
256 
258 {
259  bool bCreateWriter = ( nullptr == writer );
260  if ( bCreateWriter )
261  writer = lcl_createDefaultWriter();
262 
263  const char *name = nullptr;
264 
265  switch ( GetType( ) )
266  {
267  case SwFrameType::Root:
268  name = "root";
269  break;
270  case SwFrameType::Page:
271  name = "page";
272  break;
273  case SwFrameType::Column:
274  name = "column";
275  break;
276  case SwFrameType::Header:
277  name = "header";
278  break;
279  case SwFrameType::Footer:
280  name = "footer";
281  break;
283  name = "ftncont";
284  break;
285  case SwFrameType::Ftn:
286  name = "ftn";
287  break;
288  case SwFrameType::Body:
289  name = "body";
290  break;
291  case SwFrameType::Fly:
292  name = "fly";
293  break;
295  name = "section";
296  break;
297  case SwFrameType::Tab:
298  name = "tab";
299  break;
300  case SwFrameType::Row:
301  name = "row";
302  break;
303  case SwFrameType::Cell:
304  name = "cell";
305  break;
306  case SwFrameType::Txt:
307  name = "txt";
308  break;
309  case SwFrameType::NoTxt:
310  name = "notxt";
311  break;
312  default: break;
313  }
314 
315  if ( name != nullptr )
316  {
317  xmlTextWriterStartElement( writer, reinterpret_cast<const xmlChar *>(name) );
318 
319  dumpAsXmlAttributes( writer );
320 
321  if (IsRootFrame())
322  {
323  const SwRootFrame* pRootFrame = static_cast<const SwRootFrame*>(this);
324  xmlTextWriterStartElement(writer, BAD_CAST("sfxViewShells"));
325  SwView* pView = static_cast<SwView*>(SfxViewShell::GetFirst(true, checkSfxViewShell<SwView>));
326  while (pView)
327  {
328  if (pRootFrame->GetCurrShell()->GetSfxViewShell() && pView->GetObjectShell() == pRootFrame->GetCurrShell()->GetSfxViewShell()->GetObjectShell())
329  pView->dumpAsXml(writer);
330  pView = static_cast<SwView*>(SfxViewShell::GetNext(*pView, true, checkSfxViewShell<SwView>));
331  }
332  xmlTextWriterEndElement(writer);
333  }
334 
335  if (IsPageFrame())
336  {
337  const SwPageFrame* pPageFrame = static_cast<const SwPageFrame*>(this);
338  xmlTextWriterStartElement(writer, BAD_CAST("page_status"));
339  xmlTextWriterWriteAttribute(writer, BAD_CAST("ValidFlyLayout"), BAD_CAST(OString::boolean(!pPageFrame->IsInvalidFlyLayout()).getStr()));
340  xmlTextWriterWriteAttribute(writer, BAD_CAST("ValidFlyContent"), BAD_CAST(OString::boolean(!pPageFrame->IsInvalidFlyContent()).getStr()));
341  xmlTextWriterWriteAttribute(writer, BAD_CAST("ValidFlyInCnt"), BAD_CAST(OString::boolean(!pPageFrame->IsInvalidFlyInCnt()).getStr()));
342  xmlTextWriterWriteAttribute(writer, BAD_CAST("ValidLayout"), BAD_CAST(OString::boolean(!pPageFrame->IsInvalidLayout()).getStr()));
343  xmlTextWriterWriteAttribute(writer, BAD_CAST("ValidContent"), BAD_CAST(OString::boolean(!pPageFrame->IsInvalidContent()).getStr()));
344  xmlTextWriterEndElement(writer);
345  xmlTextWriterStartElement(writer, BAD_CAST("page_info"));
346  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("phyNum"), "%d", pPageFrame->GetPhyPageNum());
347  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("virtNum"), "%d", pPageFrame->GetVirtPageNum());
348  OUString aFormatName = pPageFrame->GetPageDesc()->GetName();
349  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("pageDesc"), "%s", BAD_CAST(OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr()));
350  xmlTextWriterEndElement(writer);
351  }
352 
353  if (IsTextFrame())
354  {
355  const SwTextFrame *pTextFrame = static_cast<const SwTextFrame *>(this);
356  sw::MergedPara const*const pMerged(pTextFrame->GetMergedPara());
357  if (pMerged)
358  {
359  xmlTextWriterStartElement( writer, BAD_CAST( "merged" ) );
360  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "paraPropsNodeIndex" ), "%" SAL_PRIuUINTPTR, pMerged->pParaPropsNode->GetIndex() );
361  for (auto const& e : pMerged->extents)
362  {
363  xmlTextWriterStartElement( writer, BAD_CAST( "extent" ) );
364  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), "%" SAL_PRIuUINTPTR, e.pNode->GetIndex() );
365  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "start" ), "%" SAL_PRIdINT32, e.nStart );
366  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "end" ), "%" SAL_PRIdINT32, e.nEnd );
367  xmlTextWriterEndElement( writer );
368  }
369  xmlTextWriterEndElement( writer );
370  }
371  }
372 
373  if (IsCellFrame())
374  {
375  SwCellFrame const* pCellFrame(static_cast<SwCellFrame const*>(this));
376  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rowspan" ), "%ld", pCellFrame->GetLayoutRowSpan() );
377  }
378 
379  xmlTextWriterStartElement( writer, BAD_CAST( "infos" ) );
380  dumpInfosAsXml( writer );
381  xmlTextWriterEndElement( writer );
382 
383  // Dump Anchored objects if any
384  const SwSortedObjs* pAnchored = GetDrawObjs();
385  if ( pAnchored && pAnchored->size() > 0 )
386  {
387  xmlTextWriterStartElement( writer, BAD_CAST( "anchored" ) );
388 
389  for (SwAnchoredObject* pObject : *pAnchored)
390  {
391  pObject->dumpAsXml( writer );
392  }
393 
394  xmlTextWriterEndElement( writer );
395  }
396 
397  // Dump the children
398  if ( IsTextFrame( ) )
399  {
400  const SwTextFrame *pTextFrame = static_cast<const SwTextFrame *>(this);
401  OUString aText = pTextFrame->GetText( );
402  for ( int i = 0; i < 32; i++ )
403  {
404  aText = aText.replace( i, '*' );
405  }
406  OString aText8 =OUStringToOString( aText,
407  RTL_TEXTENCODING_UTF8 );
408  xmlTextWriterWriteString( writer,
409  reinterpret_cast<const xmlChar *>(aText8.getStr( )) );
410  XmlPortionDumper pdumper( writer, aText );
411  pTextFrame->VisitPortions( pdumper );
412 
413  }
414  else
415  {
416  dumpChildrenAsXml( writer );
417  }
418  xmlTextWriterEndElement( writer );
419  }
420 
421  if ( bCreateWriter )
422  lcl_freeWriter( writer );
423 }
424 
426 {
427  // output the Frame
428  xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) );
430  xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFixSize"), BAD_CAST(OString::boolean(HasFixSize()).getStr()));
431  xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFrameAreaPositionValid"), BAD_CAST(OString::boolean(isFrameAreaPositionValid()).getStr()));
432  xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFrameAreaSizeValid"), BAD_CAST(OString::boolean(isFrameAreaSizeValid()).getStr()));
433  xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFramePrintAreaValid"), BAD_CAST(OString::boolean(isFramePrintAreaValid()).getStr()));
434  xmlTextWriterEndElement( writer );
435 
436  // output the print area
437  xmlTextWriterStartElement( writer, BAD_CAST( "prtBounds" ) );
439  xmlTextWriterEndElement( writer );
440 }
441 
442 // Hack: somehow conversion from "..." to va_list does
443 // bomb on two string literals in the format.
444 const char* const TMP_FORMAT = "%" SAL_PRIuUINTPTR;
445 
447 {
448  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
449  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "id" ), "%" SAL_PRIuUINT32, GetFrameId() );
450  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "symbol" ), "%s", BAD_CAST( typeid( *this ).name( ) ) );
451  if ( GetNext( ) )
452  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "next" ), "%" SAL_PRIuUINT32, GetNext()->GetFrameId() );
453  if ( GetPrev( ) )
454  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "prev" ), "%" SAL_PRIuUINT32, GetPrev()->GetFrameId() );
455  if ( GetUpper( ) )
456  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "upper" ), "%" SAL_PRIuUINT32, GetUpper()->GetFrameId() );
457  if ( GetLower( ) )
458  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "lower" ), "%" SAL_PRIuUINT32, GetLower()->GetFrameId() );
459  if (IsFootnoteFrame())
460  {
461  SwFootnoteFrame const*const pFF(static_cast<SwFootnoteFrame const*>(this));
462  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("ref"), "%" SAL_PRIuUINT32, pFF->GetRef()->GetFrameId() );
463  if (pFF->GetMaster())
464  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("master"), "%" SAL_PRIuUINT32, pFF->GetMaster()->GetFrameId() );
465  if (pFF->GetFollow())
466  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("follow"), "%" SAL_PRIuUINT32, pFF->GetFollow()->GetFrameId() );
467  }
468  if (IsSctFrame())
469  {
470  SwSectionFrame const*const pFrame(static_cast<SwSectionFrame const*>(this));
471  SwSectionNode const*const pNode(pFrame->GetSection() ? pFrame->GetSection()->GetFormat()->GetSectionNode() : nullptr);
472  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("sectionNodeIndex"), TMP_FORMAT, pNode ? pNode->GetIndex() : -1);
473  }
474  if ( IsTextFrame( ) )
475  {
476  const SwTextFrame *pTextFrame = static_cast<const SwTextFrame *>(this);
477  const SwTextNode *pTextNode = pTextFrame->GetTextNodeFirst();
478  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), TMP_FORMAT, pTextNode->GetIndex() );
479 
480  OString aMode = "Horizontal";
481  if (IsVertLRBT())
482  {
483  aMode = "VertBTLR";
484  }
485  else if (IsVertLR())
486  {
487  aMode = "VertLR";
488  }
489  else if (IsVertical())
490  {
491  aMode = "Vertical";
492  }
493  xmlTextWriterWriteAttribute(writer, BAD_CAST("WritingMode"), BAD_CAST(aMode.getStr()));
494  }
495  if (IsHeaderFrame() || IsFooterFrame())
496  {
497  const SwHeadFootFrame *pHeadFootFrame = static_cast<const SwHeadFootFrame*>(this);
498  OUString aFormatName = pHeadFootFrame->GetFormat()->GetName();
499  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "fmtName" ), "%s", BAD_CAST(OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr()));
500  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "fmtPtr" ), "%p", pHeadFootFrame->GetFormat());
501  }
502 }
503 
505 {
506  const SwFrame *pFrame = GetLower( );
507  for ( ; pFrame != nullptr; pFrame = pFrame->GetNext( ) )
508  {
509  pFrame->dumpAsXml( writer );
510  }
511 }
512 
514 {
515  bool bCreateWriter = ( nullptr == writer );
516  if ( bCreateWriter )
517  writer = lcl_createDefaultWriter();
518 
519  xmlTextWriterStartElement( writer, BAD_CAST( getElementName() ) );
520  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
521 
522  xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) );
524  xmlTextWriterEndElement( writer );
525 
526  if (const SdrObject* pObject = GetDrawObj())
527  pObject->dumpAsXml(writer);
528 
529  xmlTextWriterEndElement( writer );
530 
531  if ( bCreateWriter )
532  lcl_freeWriter( writer );
533 }
534 
536 {
537  xmlTextWriterStartElement(writer, BAD_CAST("SwFont"));
538  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("ptr"), "%p", this);
539  // do not use Color::AsRGBHexString() as that omits the transparency
540  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("color"), "%08" SAL_PRIxUINT32, sal_uInt32(GetColor()));
541  xmlTextWriterEndElement(writer);
542 }
543 
545 {
547  if ( HasFollow() )
548  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
549 
550  if (m_pPrecede != nullptr)
551  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%" SAL_PRIuUINT32, static_cast<SwTextFrame*>(m_pPrecede)->GetFrameId() );
552 }
553 
555 {
557  if ( HasFollow() )
558  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
559 
560  if (m_pPrecede != nullptr)
561  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%" SAL_PRIuUINT32, static_cast<SwSectionFrame*>( m_pPrecede )->GetFrameId() );
562 }
563 
565 {
567  if ( HasFollow() )
568  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
569 
570  if (m_pPrecede != nullptr)
571  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%" SAL_PRIuUINT32, static_cast<SwTabFrame*>( m_pPrecede )->GetFrameId() );
572 }
573 
574 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:298
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
sal_uLong GetIndex() const
Definition: node.hxx:290
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:548
bool IsRootFrame() const
Definition: frame.hxx:1155
SwFrameType GetType() const
Definition: frame.hxx:503
const SwRect & getFramePrintArea() const
Definition: frame.hxx:179
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:441
bool HasFollow() const
Definition: flowfrm.hxx:165
virtual void dumpAsXml(xmlTextWriterPtr writer=nullptr) const
Definition: xmldump.cxx:257
SwSectionFormat * GetFormat()
Definition: section.hxx:336
bool IsCellFrame() const
Definition: frame.hxx:1207
SfxViewShell * GetSfxViewShell() const
Definition: viewsh.hxx:441
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1285
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
Definition: xmldump.cxx:564
void dumpAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:535
EmbeddedObjectRef * pObject
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
virtual void Text(TextFrameIndex nLength, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0)=0
(empty) destructor
bool IsFootnoteFrame() const
Definition: frame.hxx:1183
rtl::OUString getTypeName(rtl::OUString const &rEnvDcp)
virtual SwRect GetObjBoundRect() const =0
const OUString & GetName() const
Definition: pagedesc.hxx:186
bool IsVertLRBT() const
Definition: frame.hxx:964
virtual void Finish()=0
end of paragraph.
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:188
wrapper class for the positioning of Writer fly frames and drawing objects
bool IsInvalidFlyInCnt() const
Definition: pagefrm.hxx:217
const SwRect & getFrameArea() const
Definition: frame.hxx:178
SwSectionNode * GetSectionNode()
Definition: section.cxx:957
const OUString & GetName() const
Definition: format.hxx:132
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
bool IsTextFrame() const
Definition: frame.hxx:1215
virtual void LineBreak(sal_Int32 nWidth)=0
line break.
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
Definition: txtfrm.hxx:947
bool IsSctFrame() const
Definition: frame.hxx:1195
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Dump a bunch of useful data to an XML representation to ease layout understanding, debugging and testing.
Definition: xmldump.cxx:513
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:846
tools::Long GetLayoutRowSpan() const
Definition: tabfrm.cxx:5483
bool IsInvalidContent() const
Definition: pagefrm.hxx:219
virtual void Special(TextFrameIndex nLength, const OUString &rText, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0, const SwFont *pFont=nullptr)=0
special portion.
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1805
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:448
struct _xmlTextWriter * xmlTextWriterPtr
bool IsInvalidFlyContent() const
Definition: pagefrm.hxx:216
virtual const char * getElementName() const
The element name to show in the XML dump.
void dumpChildrenAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:504
const SdrObject * GetDrawObj() const
int i
void dumpAsXml(xmlTextWriterPtr pWriter) const override
See SfxViewShell::dumpAsXml().
Definition: viewprt.cxx:267
const SwSectionFrame * GetFollow() const
Definition: sectfrm.hxx:158
size_t size() const
Definition: sortedobjs.cxx:42
void dumpTopMostAsXml(xmlTextWriterPtr writer=nullptr) const
Definition: xmldump.cxx:246
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:127
SwSection * GetSection()
Definition: sectfrm.hxx:82
SwLayoutFrame * GetUpper()
Definition: frame.hxx:661
bool isFramePrintAreaValid() const
Definition: frame.hxx:167
PortionType
Definition: txttypes.hxx:23
SwFrame * GetPrev()
Definition: frame.hxx:660
SwFlowFrame * m_pPrecede
Definition: flowfrm.hxx:118
bool isFrameAreaPositionValid() const
Definition: frame.hxx:165
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
Definition: xmldump.cxx:544
bool HasFixSize() const
Definition: frame.hxx:653
bool isFrameAreaSizeValid() const
Definition: frame.hxx:166
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
const Color & GetColor() const
Definition: swfont.hxx:273
A page of the document layout.
Definition: pagefrm.hxx:41
const SwFootnoteFrame * GetMaster() const
Definition: ftnfrm.hxx:119
bool IsInvalidFlyLayout() const
Definition: pagefrm.hxx:215
void dumpInfosAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:425
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
bool IsVertLR() const
Definition: frame.hxx:960
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:446
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:116
const SwContentFrame * GetRef() const
Definition: ftnfrm.cxx:2889
SwFrame * GetLower()
Definition: findfrm.cxx:170
bool IsPageFrame() const
Definition: frame.hxx:1159
const char * name
virtual void Skip(TextFrameIndex nLength)=0
skip characters.
const SwTabFrame * GetFollow() const
Definition: tabfrm.hxx:242
virtual SfxObjectShell * GetObjectShell() override
bool IsVertical() const
Definition: frame.hxx:954
const char *const TMP_FORMAT
Definition: xmldump.cxx:444
OString m_aLine
void VisitPortions(SwPortionHandler &rPH) const
Visit all portions for Accessibility.
Definition: txtfrm.cxx:3866
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:208
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
class for collecting anchored objects
Definition: sortedobjs.hxx:48
bool IsFooterFrame() const
Definition: frame.hxx:1175
sal_uInt32 GetFrameId() const
Definition: frame.hxx:173
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:30
bool IsInvalidLayout() const
Definition: pagefrm.hxx:218
Definition: view.hxx:144
void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
Definition: swrect.cxx:221
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
Definition: xmldump.cxx:554
bool IsHeaderFrame() const
Definition: frame.hxx:1171
virtual const SwFrameFormat * GetFormat() const
Definition: ssfrm.cxx:394
SwFrame * GetNext()
Definition: frame.hxx:659