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 
71  case PortionType::Expand: return "PortionType::Expand";
72  case PortionType::Blank: return "PortionType::Blank";
73  case PortionType::PostIts: return "PortionType::PostIts";
74 
75  case PortionType::Hyphen: return "PortionType::Hyphen";
76  case PortionType::HyphenStr: return "PortionType::HyphenStr";
77  case PortionType::SoftHyphen: return "PortionType::SoftHyphen";
78  case PortionType::SoftHyphenStr: return "PortionType::SoftHyphenStr";
79  case PortionType::SoftHyphenComp: return "PortionType::SoftHyphenComp";
80 
81  case PortionType::Field: return "PortionType::Field";
82  case PortionType::Hidden: return "PortionType::Hidden";
83  case PortionType::QuoVadis: return "PortionType::QuoVadis";
84  case PortionType::ErgoSum: return "PortionType::ErgoSum";
85  case PortionType::Combined: return "PortionType::Combined";
86  case PortionType::Footnote: return "PortionType::Footnote";
87 
88  case PortionType::FootnoteNum: return "PortionType::FootnoteNum";
89  case PortionType::Number: return "PortionType::Number";
90  case PortionType::Bullet: return "PortionType::Bullet";
91  case PortionType::GrfNum: return "PortionType::GrfNum";
92 
93  case PortionType::Glue: return "PortionType::Glue";
94 
95  case PortionType::Margin: return "PortionType::Margin";
96 
97  case PortionType::Fix: return "PortionType::Fix";
98  case PortionType::Fly: return "PortionType::Fly";
99 
100  case PortionType::Table: return "PortionType::Table";
101 
102  case PortionType::TabRight: return "PortionType::TabRight";
103  case PortionType::TabCenter: return "PortionType::TabCenter";
104  case PortionType::TabDecimal: return "PortionType::TabDecimal";
105 
106  case PortionType::TabLeft: return "PortionType::TabLeft";
107  default:
108  return "Unknown";
109  }
110  }
111 
112  public:
113 
114  explicit XmlPortionDumper( xmlTextWriterPtr some_writer, const OUString& rText ):writer( some_writer ), ofs( 0 ), m_rText(rText)
115  {
116  }
117 
124  virtual void Text( TextFrameIndex nLength,
125  PortionType nType,
126  sal_Int32 nHeight,
127  sal_Int32 nWidth) override
128  {
129  xmlTextWriterStartElement( writer, BAD_CAST( "Text" ) );
130  xmlTextWriterWriteFormatAttribute( writer,
131  BAD_CAST( "nLength" ),
132  "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
133  xmlTextWriterWriteFormatAttribute( writer,
134  BAD_CAST( "nType" ),
135  "%s", getTypeName( nType ) );
136  if (nHeight > 0)
137  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nHeight"), "%i", static_cast<int>(nHeight));
138  if (nWidth > 0)
139  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nWidth"), "%i", static_cast<int>(nWidth));
140  if (nLength > TextFrameIndex(0))
141  xmlTextWriterWriteAttribute(writer, BAD_CAST("Portion"),
142  BAD_CAST(m_rText.copy(sal_Int32(ofs), sal_Int32(nLength)).toUtf8().getStr()));
143 
144  xmlTextWriterEndElement( writer );
145  m_aLine += m_rText.copy(sal_Int32(ofs), sal_Int32(nLength));
146  ofs += nLength;
147  }
148 
159  virtual void Special( TextFrameIndex nLength,
160  const OUString & rText,
161  PortionType nType,
162  sal_Int32 nHeight,
163  sal_Int32 nWidth,
164  const SwFont* pFont ) override
165  {
166  xmlTextWriterStartElement( writer, BAD_CAST( "Special" ) );
167  xmlTextWriterWriteFormatAttribute( writer,
168  BAD_CAST( "nLength" ),
169  "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
170  xmlTextWriterWriteFormatAttribute( writer,
171  BAD_CAST( "nType" ),
172  "%s", getTypeName( nType ) );
173  OString sText8 = OUStringToOString( rText, RTL_TEXTENCODING_UTF8 );
174  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ),
175  "%s", sText8.getStr( ) );
176 
177  if (nHeight > 0)
178  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nHeight"), "%i", static_cast<int>(nHeight));
179 
180  if (nWidth > 0)
181  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("nWidth"), "%i", static_cast<int>(nWidth));
182 
183  if (pFont)
184  pFont->dumpAsXml(writer);
185 
186  xmlTextWriterEndElement( writer );
187  m_aLine += rText;
188  ofs += nLength;
189  }
190 
191  virtual void LineBreak( sal_Int32 nWidth ) override
192  {
193  xmlTextWriterStartElement( writer, BAD_CAST( "LineBreak" ) );
194  if (nWidth > 0)
195  xmlTextWriterWriteFormatAttribute( writer,
196  BAD_CAST( "nWidth" ),
197  "%i", static_cast<int>(nWidth) );
198  if (!m_aLine.isEmpty())
199  {
200  xmlTextWriterWriteAttribute(writer, BAD_CAST("Line"),
201  BAD_CAST(m_aLine.toUtf8().getStr()));
202  m_aLine.clear();
203  }
204  xmlTextWriterEndElement( writer );
205  }
206 
211  virtual void Skip( TextFrameIndex nLength ) override
212  {
213  xmlTextWriterStartElement( writer, BAD_CAST( "Skip" ) );
214  xmlTextWriterWriteFormatAttribute( writer,
215  BAD_CAST( "nLength" ),
216  "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
217  xmlTextWriterEndElement( writer );
218  ofs += nLength;
219  }
220 
221  virtual void Finish( ) override
222  {
223  xmlTextWriterStartElement( writer, BAD_CAST( "Finish" ) );
224  xmlTextWriterEndElement( writer );
225  }
226 
227 };
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 (pRootFrame->GetCurrShell()->GetSfxViewShell() && 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  xmlTextWriterStartElement(writer, BAD_CAST("page_info"));
345  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("phyNum"), "%d", pPageFrame->GetPhyPageNum());
346  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("virtNum"), "%d", pPageFrame->GetVirtPageNum());
347  OUString aFormatName = pPageFrame->GetPageDesc()->GetName();
348  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("pageDesc"), "%s", BAD_CAST(OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr()));
349  xmlTextWriterEndElement(writer);
350  }
351 
352  if (IsTextFrame())
353  {
354  const SwTextFrame *pTextFrame = static_cast<const SwTextFrame *>(this);
355  sw::MergedPara const*const pMerged(pTextFrame->GetMergedPara());
356  if (pMerged)
357  {
358  xmlTextWriterStartElement( writer, BAD_CAST( "merged" ) );
359  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "paraPropsNodeIndex" ), "%" SAL_PRIuUINTPTR, pMerged->pParaPropsNode->GetIndex() );
360  for (auto const& e : pMerged->extents)
361  {
362  xmlTextWriterStartElement( writer, BAD_CAST( "extent" ) );
363  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), "%" SAL_PRIuUINTPTR, e.pNode->GetIndex() );
364  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "start" ), "%" SAL_PRIdINT32, e.nStart );
365  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "end" ), "%" SAL_PRIdINT32, e.nEnd );
366  xmlTextWriterEndElement( writer );
367  }
368  xmlTextWriterEndElement( writer );
369  }
370  }
371 
372  if (IsCellFrame())
373  {
374  SwCellFrame const* pCellFrame(static_cast<SwCellFrame const*>(this));
375  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rowspan" ), "%ld", pCellFrame->GetLayoutRowSpan() );
376  }
377 
378  xmlTextWriterStartElement( writer, BAD_CAST( "infos" ) );
379  dumpInfosAsXml( writer );
380  xmlTextWriterEndElement( writer );
381 
382  // Dump Anchored objects if any
383  const SwSortedObjs* pAnchored = GetDrawObjs();
384  if ( pAnchored && pAnchored->size() > 0 )
385  {
386  xmlTextWriterStartElement( writer, BAD_CAST( "anchored" ) );
387 
388  for (SwAnchoredObject* pObject : *pAnchored)
389  {
390  pObject->dumpAsXml( writer );
391  }
392 
393  xmlTextWriterEndElement( writer );
394  }
395 
396  // Dump the children
397  if ( IsTextFrame( ) )
398  {
399  const SwTextFrame *pTextFrame = static_cast<const SwTextFrame *>(this);
400  OUString aText = pTextFrame->GetText( );
401  for ( int i = 0; i < 32; i++ )
402  {
403  aText = aText.replace( i, '*' );
404  }
405  OString aText8 =OUStringToOString( aText,
406  RTL_TEXTENCODING_UTF8 );
407  xmlTextWriterWriteString( writer,
408  reinterpret_cast<const xmlChar *>(aText8.getStr( )) );
409  XmlPortionDumper pdumper( writer, aText );
410  pTextFrame->VisitPortions( pdumper );
411 
412  }
413  else
414  {
415  dumpChildrenAsXml( writer );
416  }
417  xmlTextWriterEndElement( writer );
418  }
419 
420  if ( bCreateWriter )
421  lcl_freeWriter( writer );
422 }
423 
425 {
426  // output the Frame
427  xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) );
429  xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFixSize"), BAD_CAST(OString::boolean(HasFixSize()).getStr()));
430  xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFrameAreaPositionValid"), BAD_CAST(OString::boolean(isFrameAreaPositionValid()).getStr()));
431  xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFrameAreaSizeValid"), BAD_CAST(OString::boolean(isFrameAreaSizeValid()).getStr()));
432  xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFramePrintAreaValid"), BAD_CAST(OString::boolean(isFramePrintAreaValid()).getStr()));
433  xmlTextWriterEndElement( writer );
434 
435  // output the print area
436  xmlTextWriterStartElement( writer, BAD_CAST( "prtBounds" ) );
438  xmlTextWriterEndElement( writer );
439 }
440 
441 // Hack: somehow conversion from "..." to va_list does
442 // bomb on two string literals in the format.
443 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 (IsSctFrame())
468  {
469  SwSectionFrame const*const pFrame(static_cast<SwSectionFrame const*>(this));
470  SwSectionNode const*const pNode(pFrame->GetSection()->GetFormat()->GetSectionNode());
471  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("sectionNodeIndex"), TMP_FORMAT, pNode ? pNode->GetIndex() : -1);
472  }
473  if ( IsTextFrame( ) )
474  {
475  const SwTextFrame *pTextFrame = static_cast<const SwTextFrame *>(this);
476  const SwTextNode *pTextNode = pTextFrame->GetTextNodeFirst();
477  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), TMP_FORMAT, pTextNode->GetIndex() );
478 
479  OString aMode = "Horizontal";
480  if (IsVertLRBT())
481  {
482  aMode = "VertBTLR";
483  }
484  else if (IsVertLR())
485  {
486  aMode = "VertLR";
487  }
488  else if (IsVertical())
489  {
490  aMode = "Vertical";
491  }
492  xmlTextWriterWriteAttribute(writer, BAD_CAST("WritingMode"), BAD_CAST(aMode.getStr()));
493  }
494  if (IsHeaderFrame() || IsFooterFrame())
495  {
496  const SwHeadFootFrame *pHeadFootFrame = static_cast<const SwHeadFootFrame*>(this);
497  OUString aFormatName = pHeadFootFrame->GetFormat()->GetName();
498  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "fmtName" ), "%s", BAD_CAST(OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr()));
499  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "fmtPtr" ), "%p", pHeadFootFrame->GetFormat());
500  }
501 }
502 
504 {
505  const SwFrame *pFrame = GetLower( );
506  for ( ; pFrame != nullptr; pFrame = pFrame->GetNext( ) )
507  {
508  pFrame->dumpAsXml( writer );
509  }
510 }
511 
513 {
514  bool bCreateWriter = ( nullptr == writer );
515  if ( bCreateWriter )
516  writer = lcl_createDefaultWriter();
517 
518  xmlTextWriterStartElement( writer, BAD_CAST( getElementName() ) );
519  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
520 
521  xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) );
523  xmlTextWriterEndElement( writer );
524 
525  if (const SdrObject* pObject = GetDrawObj())
526  pObject->dumpAsXml(writer);
527 
528  xmlTextWriterEndElement( writer );
529 
530  if ( bCreateWriter )
531  lcl_freeWriter( writer );
532 }
533 
535 {
536  xmlTextWriterStartElement(writer, BAD_CAST("SwFont"));
537  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("ptr"), "%p", this);
538  // do not use Color::AsRGBHexString() as that omits the transparency
539  xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("color"), "%08" SAL_PRIxUINT32, sal_uInt32(GetColor()));
540  xmlTextWriterEndElement(writer);
541 }
542 
544 {
546  if ( HasFollow() )
547  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
548 
549  if (m_pPrecede != nullptr)
550  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%" SAL_PRIuUINT32, static_cast<SwTextFrame*>(m_pPrecede)->GetFrameId() );
551 }
552 
554 {
556  if ( HasFollow() )
557  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
558 
559  if (m_pPrecede != nullptr)
560  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%" SAL_PRIuUINT32, static_cast<SwSectionFrame*>( m_pPrecede )->GetFrameId() );
561 }
562 
564 {
566  if ( HasFollow() )
567  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() );
568 
569  if (m_pPrecede != nullptr)
570  xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%" SAL_PRIuUINT32, static_cast<SwTabFrame*>( m_pPrecede )->GetFrameId() );
571 }
572 
573 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:297
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
sal_uLong GetIndex() const
Definition: node.hxx:282
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:545
bool IsRootFrame() const
Definition: frame.hxx:1152
SwFrameType GetType() const
Definition: frame.hxx:500
const SwRect & getFramePrintArea() const
Definition: frame.hxx:178
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:256
SwSectionFormat * GetFormat()
Definition: section.hxx:336
bool IsCellFrame() const
Definition: frame.hxx:1204
SfxViewShell * GetSfxViewShell() const
Definition: viewsh.hxx:442
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1283
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
Definition: xmldump.cxx:563
void dumpAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:534
EmbeddedObjectRef * pObject
The root element of a Writer document layout.
Definition: rootfrm.hxx:80
virtual void Text(TextFrameIndex nLength, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0)=0
(empty) destructor
bool IsFootnoteFrame() const
Definition: frame.hxx:1180
rtl::OUString getTypeName(rtl::OUString const &rEnvDcp)
virtual SwRect GetObjBoundRect() const =0
const OUString & GetName() const
Definition: pagedesc.hxx:187
bool IsVertLRBT() const
Definition: frame.hxx:961
virtual void Finish()=0
end of paragraph.
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:191
wrapper class for the positioning of Writer fly frames and drawing objects
bool IsInvalidFlyInCnt() const
Definition: pagefrm.hxx:220
const SwRect & getFrameArea() const
Definition: frame.hxx:177
SwSectionNode * GetSectionNode()
Definition: section.cxx:1003
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:1212
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:1192
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:512
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:846
bool IsInvalidContent() const
Definition: pagefrm.hxx:222
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:219
virtual const char * getElementName() const
The element name to show in the XML dump.
void dumpChildrenAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:503
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:160
size_t size() const
Definition: sortedobjs.cxx:42
void dumpTopMostAsXml(xmlTextWriterPtr writer=nullptr) const
Definition: xmldump.cxx:245
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:130
SwSection * GetSection()
Definition: sectfrm.hxx:84
SwLayoutFrame * GetUpper()
Definition: frame.hxx:658
bool isFramePrintAreaValid() const
Definition: frame.hxx:166
PortionType
Definition: txttypes.hxx:23
SwFrame * GetPrev()
Definition: frame.hxx:657
SwFlowFrame * m_pPrecede
Definition: flowfrm.hxx:118
bool isFrameAreaPositionValid() const
Definition: frame.hxx:164
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
Definition: xmldump.cxx:543
bool HasFixSize() const
Definition: frame.hxx:650
bool isFrameAreaSizeValid() const
Definition: frame.hxx:165
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:218
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
void dumpInfosAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:424
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
bool IsVertLR() const
Definition: frame.hxx:957
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:445
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:116
const SwContentFrame * GetRef() const
Definition: ftnfrm.cxx:2888
SwFrame * GetLower()
Definition: findfrm.cxx:169
bool IsPageFrame() const
Definition: frame.hxx:1156
const char * name
virtual void Skip(TextFrameIndex nLength)=0
skip characters.
const SwTabFrame * GetFollow() const
Definition: tabfrm.hxx:243
virtual SfxObjectShell * GetObjectShell() override
bool IsVertical() const
Definition: frame.hxx:951
const char *const TMP_FORMAT
Definition: xmldump.cxx:443
long GetLayoutRowSpan() const
Definition: tabfrm.cxx:5398
OString m_aLine
void VisitPortions(SwPortionHandler &rPH) const
Visit all portions for Accessibility.
Definition: txtfrm.cxx:3865
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:205
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:1172
sal_uInt32 GetFrameId() const
Definition: frame.hxx:172
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:30
bool IsInvalidLayout() const
Definition: pagefrm.hxx:221
Definition: view.hxx:144
void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
Definition: swrect.cxx:221
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
Definition: xmldump.cxx:553
bool IsHeaderFrame() const
Definition: frame.hxx:1168
virtual const SwFrameFormat * GetFormat() const
Definition: ssfrm.cxx:393
SwFrame * GetNext()
Definition: frame.hxx:656