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