LibreOffice Module sw (master)  1
pagedesc.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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <libxml/xmlwriter.h>
21 
22 #include <editeng/pbinitem.hxx>
23 #include <editeng/ulspitem.hxx>
24 #include <editeng/boxitem.hxx>
25 #include <editeng/shaditem.hxx>
26 #include <editeng/frmdiritem.hxx>
27 #include <sal/log.hxx>
28 #include <fmtclds.hxx>
29 #include <fmtfsize.hxx>
30 #include <pagefrm.hxx>
31 #include <pagedesc.hxx>
32 #include <swtable.hxx>
33 #include <frmatr.hxx>
34 #include <frmtool.hxx>
35 #include <doc.hxx>
36 #include <node.hxx>
37 #include <strings.hrc>
40 #include <poolfmt.hxx>
41 #include <calbck.hxx>
42 #include <hints.hxx>
43 
44 SwPageDesc::SwPageDesc(const OUString& rName, SwFrameFormat *pFormat, SwDoc *const pDoc)
45  : SwModify()
46  , m_StyleName( rName )
47  , m_Master( pDoc->GetAttrPool(), rName, pFormat )
48  , m_Left( pDoc->GetAttrPool(), rName, pFormat )
49  , m_FirstMaster( pDoc->GetAttrPool(), rName, pFormat )
50  , m_FirstLeft( pDoc->GetAttrPool(), rName, pFormat )
51  , m_aDepends(*this)
52  , m_pTextFormatColl(nullptr)
53  , m_pFollow( this )
54  , m_nRegHeight( 0 )
55  , m_nRegAscent( 0 )
56  , m_nVerticalAdjustment( drawing::TextVerticalAdjust_TOP )
58  , m_IsLandscape( false )
59  , m_IsHidden( false )
60  , m_pdList( nullptr )
61 {
62 }
63 
65  : SwModify()
66  , BroadcasterMixin()
67  , m_StyleName( rCpy.GetName() )
68  , m_NumType( rCpy.GetNumType() )
69  , m_Master( rCpy.GetMaster() )
70  , m_Left( rCpy.GetLeft() )
71  , m_FirstMaster( rCpy.GetFirstMaster() )
72  , m_FirstLeft( rCpy.GetFirstLeft() )
73  , m_aDepends(*this)
74  , m_pTextFormatColl(nullptr)
75  , m_pFollow( rCpy.m_pFollow )
76  , m_nRegHeight( rCpy.GetRegHeight() )
77  , m_nRegAscent( rCpy.GetRegAscent() )
78  , m_nVerticalAdjustment( rCpy.GetVerticalAdjustment() )
79  , m_eUse( rCpy.ReadUseOn() )
80  , m_IsLandscape( rCpy.GetLandscape() )
81  , m_IsHidden( rCpy.IsHidden() )
82  , m_FootnoteInfo( rCpy.GetFootnoteInfo() )
83  , m_pdList( nullptr )
84 {
86  {
88  m_aDepends.StartListening(const_cast<SwTextFormatColl*>(m_pTextFormatColl));
89  }
90 }
91 
93 {
94  if(this == &rSrc)
95  return *this;
96 
97  m_StyleName = rSrc.m_StyleName;
98  m_NumType = rSrc.m_NumType;
99  m_Master = rSrc.m_Master;
100  m_Left = rSrc.m_Left;
102  m_FirstLeft = rSrc.m_FirstLeft;
105  {
107  m_aDepends.StartListening(const_cast<SwTextFormatColl*>(m_pTextFormatColl));
108  }
109  else
110  m_pTextFormatColl = nullptr;
111 
112  if (rSrc.m_pFollow == &rSrc)
113  m_pFollow = this;
114  else
115  m_pFollow = rSrc.m_pFollow;
116 
117  m_nRegHeight = rSrc.m_nRegHeight;
118  m_nRegAscent = rSrc.m_nRegAscent;
120  m_eUse = rSrc.m_eUse;
122  return *this;
123 }
124 
126 {
127 }
128 
129 bool SwPageDesc::SetName( const OUString& rNewName )
130 {
131  bool renamed = true;
132  if (m_pdList) {
134  if( m_pdList->end() == it ) {
135  SAL_WARN( "sw", "SwPageDesc not found in expected m_pdList" );
136  return false;
137  }
138  renamed = m_pdList->m_PosIndex.modify( it,
139  change_name( rNewName ), change_name( m_StyleName ) );
140  }
141  else
142  m_StyleName = rNewName;
143  return renamed;
144 }
145 
149 {
150  //Only the margins are mirrored, all other values are just copied.
152  const SvxLRSpaceItem &rLR = m_Master.GetLRSpace();
153  aLR.SetLeft( rLR.GetRight() );
154  aLR.SetRight( rLR.GetLeft() );
155 
158  aSet.Put( aLR );
159  aSet.Put( m_Master.GetFrameSize() );
160  aSet.Put( m_Master.GetPaperBin() );
161  aSet.Put( m_Master.GetULSpace() );
162  aSet.Put( m_Master.GetBox() );
163  aSet.Put( *m_Master.makeBackgroundBrushItem() );
164  aSet.Put( m_Master.GetShadow() );
165  aSet.Put( m_Master.GetCol() );
166  aSet.Put( m_Master.GetFrameDir() );
167  m_Left.SetFormatAttr( aSet );
168 }
169 
171 {
172  SwFrameFormat& rFormat = GetMaster();
173 
174  // #i73790# - method renamed
175  rFormat.ResetAllFormatAttr();
176  rFormat.SetFormatAttr( SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR) );
177 }
178 
179 // gets information from Modify
180 bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const
181 {
182  if (!m_Master.GetInfo(rInfo))
183  return false; // found
184  if (!m_Left.GetInfo(rInfo))
185  return false ;
186  if ( !m_FirstMaster.GetInfo( rInfo ) )
187  return false;
188  return m_FirstLeft.GetInfo( rInfo );
189 }
190 
193 {
194  if(pFormat != m_pTextFormatColl)
195  {
197  m_pTextFormatColl = pFormat;
198  m_aDepends.StartListening(const_cast<SwTextFormatColl*>(m_pTextFormatColl));
199  RegisterChange();
200  }
201 }
202 
205 {
207  m_pTextFormatColl = nullptr;
208  return m_pTextFormatColl;
209 }
210 
213 {
214  // #117072# - During destruction of the document <SwDoc>
215  // the page description is modified. Thus, do nothing, if the document
216  // is in destruction respectively if no viewshell exists.
217  SwDoc* pDoc = GetMaster().GetDoc();
218  if ( !pDoc || pDoc->IsInDtor() )
219  {
220  return;
221  }
223  if ( !pSh )
224  {
225  return;
226  }
227 
228  m_nRegHeight = 0;
229  {
231  for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
232  {
233  if( pLast->IsPageFrame() )
234  static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
235  }
236  }
237  {
239  for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
240  {
241  if( pLast->IsPageFrame() )
242  static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
243  }
244  }
245  {
247  for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
248  {
249  if( pLast->IsPageFrame() )
250  static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
251  }
252  }
253  {
255  for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
256  {
257  if( pLast->IsPageFrame() )
258  static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
259  }
260  }
261 }
262 
264 void SwPageDesc::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
265 {
266  if(auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
267  {
268  const sal_uInt16 nWhich = pLegacyHint->m_pOld
269  ? pLegacyHint->m_pOld->Which()
270  : pLegacyHint->m_pNew
271  ? pLegacyHint->m_pNew->Which()
272  : 0;
273  NotifyClients(pLegacyHint->m_pOld, pLegacyHint->m_pNew);
274  if((RES_ATTRSET_CHG == nWhich)
275  || (RES_FMT_CHG == nWhich)
276  || isCHRATR(nWhich)
277  || (RES_PARATR_LINESPACING == nWhich))
278  RegisterChange();
279  }
280  else if (auto pModifyChangedHint = dynamic_cast<const sw::ModifyChangedHint*>(&rHint))
281  {
282  if(m_pTextFormatColl == &rModify)
283  m_pTextFormatColl = static_cast<const SwTextFormatColl*>(pModifyChangedHint->m_pNew);
284  else
285  assert(false);
286  }
287 }
288 
289 static const SwFrame* lcl_GetFrameOfNode( const SwNode& rNd )
290 {
291  const SwModify* pMod;
292  SwFrameType nFrameType = FRM_CNTNT;
293 
294  if( rNd.IsContentNode() )
295  {
296  pMod = &static_cast<const SwContentNode&>(rNd);
297  }
298  else if( rNd.IsTableNode() )
299  {
300  pMod = static_cast<const SwTableNode&>(rNd).GetTable().GetFrameFormat();
301  nFrameType = SwFrameType::Tab;
302  }
303  else
304  pMod = nullptr;
305 
306  Point aNullPt;
307  std::pair<Point, bool> const tmp(aNullPt, false);
308  return pMod ? ::GetFrameOfModify(nullptr, *pMod, nFrameType, nullptr, &tmp)
309  : nullptr;
310 }
311 
313 {
314  const SwPageDesc* pRet = nullptr;
315  const SwFrame* pChkFrame = lcl_GetFrameOfNode( rNd );
316  if (pChkFrame && nullptr != (pChkFrame = pChkFrame->FindPageFrame()))
317  pRet = static_cast<const SwPageFrame*>(pChkFrame)->GetPageDesc();
318  return pRet;
319 }
320 
322  bool bCheckForThisPgDc ) const
323 {
324  // which PageDescFormat is valid for this node?
325  const SwFrameFormat* pRet;
326  const SwFrame* pChkFrame = lcl_GetFrameOfNode( rNd );
327 
328  if( pChkFrame && nullptr != ( pChkFrame = pChkFrame->FindPageFrame() ))
329  {
330  const SwPageDesc* pPd = bCheckForThisPgDc ? this :
331  static_cast<const SwPageFrame*>(pChkFrame)->GetPageDesc();
332  pRet = &pPd->GetMaster();
333  OSL_ENSURE( static_cast<const SwPageFrame*>(pChkFrame)->GetPageDesc() == pPd, "Wrong node for detection of page format!" );
334  // this page is assigned to which format?
335  if( !pChkFrame->KnowsFormat(*pRet) )
336  {
337  pRet = &pPd->GetLeft();
338  OSL_ENSURE( pChkFrame->KnowsFormat(*pRet), "Wrong node for detection of page format!" );
339  }
340  }
341  else
342  pRet = &GetMaster();
343  return pRet;
344 }
345 
347 {
348  bool bRet = false;
349  if( GetFollow() && this != GetFollow() )
350  {
351  const SwFrame* pChkFrame = lcl_GetFrameOfNode( rNd );
352  if( pChkFrame && nullptr != ( pChkFrame = pChkFrame->FindPageFrame() ) &&
353  pChkFrame->IsPageFrame() &&
354  ( !pChkFrame->GetNext() || GetFollow() ==
355  static_cast<const SwPageFrame*>(pChkFrame->GetNext())->GetPageDesc() ))
356  // the page on which the follow points was found
357  bRet = true;
358  }
359  return bRet;
360 }
361 
363 {
364  return (UseOnPage::Left & m_eUse)
365  ? (bFirst ? &m_FirstLeft : &m_Left)
366  : nullptr;
367 }
368 
370 {
371  return (UseOnPage::Right & m_eUse)
372  ? (bFirst ? &m_FirstMaster : &m_Master)
373  : nullptr;
374 }
375 
377 {
378  return bool(m_eUse & UseOnPage::FirstShare);
379 }
380 
381 void SwPageDesc::ChgFirstShare( bool bNew )
382 {
383  if ( bNew )
385  else
387 }
388 
389 // Page styles
390 static const char* STR_POOLPAGE[] =
391 {
392  STR_POOLPAGE_STANDARD,
393  STR_POOLPAGE_FIRST,
394  STR_POOLPAGE_LEFT,
395  STR_POOLPAGE_RIGHT,
396  STR_POOLPAGE_JAKET,
397  STR_POOLPAGE_REGISTER,
398  STR_POOLPAGE_HTML,
399  STR_POOLPAGE_FOOTNOTE,
400  STR_POOLPAGE_ENDNOTE,
401  STR_POOLPAGE_LANDSCAPE
402 };
403 
404 SwPageDesc* SwPageDesc::GetByName(SwDoc& rDoc, const OUString& rName)
405 {
406  const size_t nDCount = rDoc.GetPageDescCnt();
407 
408  for( size_t i = 0; i < nDCount; i++ )
409  {
410  SwPageDesc* pDsc = &rDoc.GetPageDesc( i );
411  if(pDsc->GetName() == rName)
412  {
413  return pDsc;
414  }
415  }
416 
417  for (size_t i = 0; i < SAL_N_ELEMENTS(STR_POOLPAGE); ++i)
418  {
419  if (rName == SwResId(STR_POOLPAGE[i]))
420  {
421  return rDoc.getIDocumentStylePoolAccess().GetPageDescFromPool( static_cast< sal_uInt16 >(
422  i + RES_POOLPAGE_BEGIN) );
423  }
424  }
425 
426  return nullptr;
427 }
428 
430 {
431  xmlTextWriterStartElement(pWriter, BAD_CAST("SwPageDesc"));
432  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
433  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("m_StyleName"), "%s",
434  BAD_CAST(m_StyleName.toUtf8().getStr()));
435  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("m_pFollow"), "%p", m_pFollow);
436  xmlTextWriterWriteFormatAttribute(
437  pWriter, BAD_CAST("m_eUse"), "0x%s",
438  BAD_CAST(OString::number(static_cast<int>(m_eUse), 16).getStr()));
439 
440  xmlTextWriterStartElement(pWriter, BAD_CAST("m_Master"));
441  m_Master.dumpAsXml(pWriter);
442  xmlTextWriterEndElement(pWriter);
443 
444  xmlTextWriterStartElement(pWriter, BAD_CAST("m_Left"));
445  m_Left.dumpAsXml(pWriter);
446  xmlTextWriterEndElement(pWriter);
447 
448  xmlTextWriterStartElement(pWriter, BAD_CAST("m_FirstMaster"));
449  m_FirstMaster.dumpAsXml(pWriter);
450  xmlTextWriterEndElement(pWriter);
451 
452  xmlTextWriterStartElement(pWriter, BAD_CAST("m_FirstLeft"));
453  m_FirstLeft.dumpAsXml(pWriter);
454  xmlTextWriterEndElement(pWriter);
455 
456  xmlTextWriterEndElement(pWriter);
457 }
458 
460  : m_nMaxHeight( 0 )
461  , m_nLineWidth(10)
462  , m_eLineStyle( SvxBorderLineStyle::SOLID )
463  , m_Width( 25, 100 )
464  , m_nTopDist( 57 ) //1mm
465  , m_nBottomDist( 57 )
466 {
467  m_eAdjust = SvxFrameDirection::Horizontal_RL_TB == GetDefaultFrameDirection(GetAppLanguage()) ?
468  css::text::HorizontalAdjust_RIGHT :
469  css::text::HorizontalAdjust_LEFT;
470 }
471 
473  : m_nMaxHeight(rCpy.GetHeight())
474  , m_nLineWidth(rCpy.m_nLineWidth)
475  , m_eLineStyle(rCpy.m_eLineStyle)
476  , m_LineColor(rCpy.m_LineColor)
477  , m_Width(rCpy.GetWidth())
478  , m_eAdjust(rCpy.GetAdj())
479  , m_nTopDist(rCpy.GetTopDist())
480  , m_nBottomDist(rCpy.GetBottomDist())
481 {
482 }
483 
485 {
486  m_nMaxHeight = rCpy.GetHeight();
487  m_nLineWidth = rCpy.m_nLineWidth;
488  m_eLineStyle = rCpy.m_eLineStyle;
489  m_LineColor = rCpy.m_LineColor;
490  m_Width = rCpy.GetWidth();
491  m_eAdjust = rCpy.GetAdj();
492  m_nTopDist = rCpy.GetTopDist();
493  m_nBottomDist = rCpy.GetBottomDist();
494  return *this;
495 }
496 
498 {
499  return m_nMaxHeight == rCmp.GetHeight()
500  && m_nLineWidth == rCmp.m_nLineWidth
501  && m_eLineStyle == rCmp.m_eLineStyle
502  && m_LineColor == rCmp.m_LineColor
503  && m_Width == rCmp.GetWidth()
504  && m_eAdjust == rCmp.GetAdj()
505  && m_nTopDist == rCmp.GetTopDist()
506  && m_nBottomDist== rCmp.GetBottomDist();
507 }
508 
509 SwPageDescExt::SwPageDescExt(const SwPageDesc & rPageDesc, SwDoc *const pDoc)
510  : m_PageDesc(rPageDesc)
511  , m_pDoc(pDoc)
512 {
513  SetPageDesc(rPageDesc);
514 }
515 
517  : m_PageDesc(rSrc.m_PageDesc)
518  , m_pDoc(rSrc.m_pDoc)
519 {
520  SetPageDesc(rSrc.m_PageDesc);
521 }
522 
524 {
525 }
526 
527 OUString const & SwPageDescExt::GetName() const
528 {
529  return m_PageDesc.GetName();
530 }
531 
532 void SwPageDescExt::SetPageDesc(const SwPageDesc & rPageDesc)
533 {
534  m_PageDesc = rPageDesc;
535 
536  if (m_PageDesc.GetFollow())
538 }
539 
541 {
542  SetPageDesc(rSrc);
543 
544  return *this;
545 }
546 
548 {
549  operator=(rSrc.m_PageDesc);
550  return *this;
551 }
552 
553 SwPageDescExt::operator SwPageDesc() const
554 {
555  SwPageDesc aResult(m_PageDesc);
556 
557  SwPageDesc * pPageDesc = m_pDoc->FindPageDesc(m_sFollow);
558 
559  if ( nullptr != pPageDesc )
560  aResult.SetFollow(pPageDesc);
561 
562  return aResult;
563 }
564 
566  : m_PosIndex( m_Array.get<0>() )
567  , m_NameIndex( m_Array.get<1>() )
568 {
569 }
570 
572 {
573  for(const_iterator it = begin(); it != end(); ++it)
574  delete *it;
575 }
576 
577 SwPageDescs::iterator SwPageDescs::find_(const OUString &name) const
578 {
579  ByName::iterator it = m_NameIndex.find( name );
580  return m_Array.iterator_to( *it );
581 }
582 
583 std::pair<SwPageDescs::const_iterator,bool> SwPageDescs::push_back( const value_type& x )
584 {
585  // SwPageDesc is not already in a SwPageDescs list!
586  assert( x->m_pdList == nullptr );
587 
588  std::pair<iterator,bool> res = m_PosIndex.push_back( x );
589  if( res.second )
590  x->m_pdList = this;
591  return res;
592 }
593 
595 {
596  // SwPageDesc is not in this SwPageDescs list!
597  assert( x->m_pdList == this );
598 
599  iterator const ret = find_( x->GetName() );
600  if (ret != end())
601  m_PosIndex.erase( ret );
602  else
603  SAL_WARN( "sw", "SwPageDesc is not in SwPageDescs m_pdList!" );
604  x->m_pdList = nullptr;
605 }
606 
607 void SwPageDescs::erase( const_iterator const& position )
608 {
609  // SwPageDesc is not in this SwPageDescs list!
610  assert( (*position)->m_pdList == this );
611 
612  (*position)->m_pdList = nullptr;
613  m_PosIndex.erase( position );
614 }
615 
617 {
618  erase( begin() + index_ );
619 }
620 
622 {
623  xmlTextWriterStartElement(pWriter, BAD_CAST("SwPageDescs"));
624 
625  for (const auto& pPageDesc : m_PosIndex)
626  {
627  pPageDesc->dumpAsXml(pWriter);
628  }
629 
630  xmlTextWriterEndElement(pWriter);
631 }
632 
633 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long GetLeft() const
Base class of the Writer layout elements.
Definition: frame.hxx:297
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
static const char * STR_POOLPAGE[]
Definition: pagedesc.cxx:390
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
const_iterator end() const
Definition: pagedesc.hxx:435
SwTwips m_nBottomDist
distance between separator and first footnote
Definition: pagedesc.hxx:58
static const SwPageDesc * GetPageDescOfNode(const SwNode &rNd)
Given a SwNode return the pagedesc in use at that location.
Definition: pagedesc.cxx:312
const_iterator begin() const
Definition: pagedesc.hxx:434
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:218
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:471
SwPageDescsBase::value_type value_type
Definition: pagedesc.hxx:412
iterator find_(const OUString &name) const
Definition: pagedesc.cxx:577
ByName & m_NameIndex
Definition: pagedesc.hxx:407
#define FRM_CNTNT
Definition: frame.hxx:101
SwTwips GetBottomDist() const
Definition: pagedesc.hxx:68
const SvxFrameDirectionItem & GetFrameDir(bool=true) const
Definition: frmatr.hxx:94
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:219
Definition: doc.hxx:186
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: pagedesc.cxx:429
TElementType * Next()
Definition: calbck.hxx:351
bool KnowsFormat(const SwFormat &rFormat) const
Definition: wsfrm.cxx:330
SwPageDescExt(const SwPageDesc &rPageDesc, SwDoc *pDoc)
Definition: pagedesc.cxx:509
WW8LvlType GetNumType(sal_uInt8 nWwLevelNo)
Definition: ww8par2.cxx:868
sal_uInt16 m_nRegAscent
For grid alignment (Registerhaltigkeit).
Definition: pagedesc.hxx:156
SwPageDesc & operator=(const SwPageDesc &)
Definition: pagedesc.cxx:92
virtual bool GetInfo(SfxPoolItem &) const override
Definition: calbck.cxx:206
SwPageDescExt & operator=(const SwPageDescExt &rSrc)
Definition: pagedesc.cxx:547
void SetFollow(const SwPageDesc *pNew)
Definition: pagedesc.hxx:293
SwTwips GetTopDist() const
Definition: pagedesc.hxx:67
const OUString & GetName() const
Definition: pagedesc.hxx:187
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:84
SwDoc * m_pDoc
Definition: docbm.cxx:1192
UseOnPage
Definition: pagedesc.hxx:120
SvxBorderLineStyle
ByPos::iterator iterator
Definition: pagedesc.hxx:401
SAL_DLLPRIVATE SwPageDesc(const OUString &, SwFrameFormat *, SwDoc *pDc)
Definition: pagedesc.cxx:44
std::unique_ptr< SvxBrushItem > makeBackgroundBrushItem(bool=true) const
Definition: format.cxx:782
void SetLeft(const long nL, const sal_uInt16 nProp=100)
bool IsFollowNextPageOfNode(const SwNode &rNd) const
Definition: pagedesc.cxx:346
std::pair< const_iterator, bool > push_back(const value_type &x)
Definition: pagedesc.cxx:583
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:425
ByPos::const_iterator const_iterator
Definition: pagedesc.hxx:410
sw::WriterMultiListener m_aDepends
Because of grid alignment (Registerhaltigkeit).
Definition: pagedesc.hxx:152
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(161)
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
special handling if the style of the grid alignment changes
Definition: pagedesc.cxx:264
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(160)
SwTwips GetHeight() const
Definition: pagedesc.hxx:61
drawing::TextVerticalAdjust m_nVerticalAdjustment
Definition: pagedesc.hxx:157
SwAttrPool * GetPool() const
Definition: swatrset.hxx:190
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:821
virtual ~SwPageDesc() override
Definition: pagedesc.cxx:125
virtual sal_uInt16 ResetAllFormatAttr()
Takes all hints from Delta-Array,.
Definition: format.cxx:683
#define SAL_N_ELEMENTS(arr)
SwFrameFormat m_FirstMaster
Definition: pagedesc.hxx:150
SwPageDesc m_PageDesc
Definition: pagedesc.hxx:358
bool IsContentNode() const
Definition: node.hxx:628
void SetPageDesc(const SwPageDesc &rPageDesc)
Definition: pagedesc.cxx:532
struct _xmlTextWriter * xmlTextWriterPtr
void SetRight(const long nR, const sal_uInt16 nProp=100)
Style of a layout element.
Definition: frmfmt.hxx:57
void erase(const value_type &x)
Definition: pagedesc.cxx:594
int i
Color m_LineColor
color of the separator line
Definition: pagedesc.hxx:54
SwFrameType
Definition: frame.hxx:72
SvxNumberType m_NumType
Definition: pagedesc.hxx:146
sal_uInt16 m_nRegHeight
Sentence spacing and fontascent of style.
Definition: pagedesc.hxx:155
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:880
SAL_DLLPRIVATE void Mirror()
Called for mirroring of Chg (doc).
Definition: pagedesc.cxx:148
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
bool IsListeningTo(const SwModify *const pDepend) const
Definition: calbck.cxx:342
void ChgFirstShare(bool bNew)
Definition: pagedesc.cxx:381
SwFrameFormat * GetLeftFormat(bool const bFirst=false)
Definition: pagedesc.cxx:362
TElementType * First()
Definition: calbck.hxx:343
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: pagedesc.cxx:621
size_t GetPageDescCnt() const
Definition: doc.hxx:879
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
Definition: pagedesc.cxx:204
SwPageDescsBase m_Array
Definition: pagedesc.hxx:405
ByPos & m_PosIndex
Definition: pagedesc.hxx:406
UseOnPage m_eUse
Definition: pagedesc.hxx:158
SwPageDescsBase::size_type size_type
Definition: pagedesc.hxx:411
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
static SwPageDesc * GetByName(SwDoc &rDoc, const OUString &rName)
Definition: pagedesc.cxx:404
bool m_IsLandscape
Definition: pagedesc.hxx:159
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
SwPageFootnoteInfo & operator=(const SwPageFootnoteInfo &)
Definition: pagedesc.cxx:484
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: atrfrm.cxx:2794
A page of the document layout.
Definition: pagefrm.hxx:40
SwFrameFormat m_Left
Definition: pagedesc.hxx:148
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
static const SwFrame * lcl_GetFrameOfNode(const SwNode &rNd)
Definition: pagedesc.cxx:289
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:246
void NotifyClients(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.cxx:167
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
void StartListening(SwModify *pDepend)
Definition: calbck.cxx:335
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
Footnote information.
Definition: pagedesc.hxx:48
const Fraction & GetWidth() const
Definition: pagedesc.hxx:65
const SwFrameFormat * GetPageFormatOfNode(const SwNode &rNd, bool bCheckForThisPgDc=true) const
Definition: pagedesc.cxx:321
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual bool GetInfo(SfxPoolItem &) const override
Query information from Client.
Definition: pagedesc.cxx:180
OUString m_StyleName
Definition: pagedesc.hxx:145
OUString const & GetName() const
Definition: pagedesc.cxx:527
OUString m_sFollow
Definition: pagedesc.hxx:361
SwFrameFormat & GetFirstLeft()
Definition: pagedesc.hxx:220
css::text::HorizontalAdjust GetAdj() const
Definition: pagedesc.hxx:66
SwFrameFormat * GetRightFormat(bool const bFirst=false)
Layout uses the following methods to obtain a format in order to be able to create a page...
Definition: pagedesc.cxx:369
LanguageType GetAppLanguage()
Definition: init.cxx:729
SwPageDesc * m_pFollow
Definition: pagedesc.hxx:154
const SvxPaperBinItem & GetPaperBin(bool=true) const
Definition: frmatr.hxx:72
SwFrameFormat m_Master
Definition: pagedesc.hxx:147
bool IsPageFrame() const
Definition: frame.hxx:1156
bool SetName(const OUString &rNewName)
Definition: pagedesc.cxx:129
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
Fraction m_Width
percentage width of the separator line.
Definition: pagedesc.hxx:55
const SwTextFormatColl * m_pTextFormatColl
Definition: pagedesc.hxx:153
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
long GetRight() const
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
Return the AutoCollection by its Id.
Definition: poolfmt.cxx:77
const sal_uInt16 * GetRanges() const
bool IsInDtor() const
Definition: doc.hxx:400
SwFrameFormat m_FirstLeft
Definition: pagedesc.hxx:151
#define SAL_WARN(area, stream)
SvxBorderLineStyle m_eLineStyle
Style of the separator line.
Definition: pagedesc.hxx:53
bool IsTableNode() const
Definition: node.hxx:640
SAL_DLLPRIVATE void ResetAllAttr()
Definition: pagedesc.cxx:170
bool IsFirstShared() const
Definition: pagedesc.cxx:376
void RegisterChange()
notify all affected page frames
Definition: pagedesc.cxx:212
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
sal_uLong m_nLineWidth
width of separator line
Definition: pagedesc.hxx:52
SwPageDescs * m_pdList
Backref to the assigned SwPageDescs list to handle renames.
Definition: pagedesc.hxx:166
SwTwips m_nTopDist
distance between body and separator.
Definition: pagedesc.hxx:57
css::text::HorizontalAdjust m_eAdjust
line adjustment.
Definition: pagedesc.hxx:56
SwTwips m_nMaxHeight
maximum height of the footnote area.
Definition: pagedesc.hxx:51
SwFrame * GetFrameOfModify(const SwRootFrame *pLayout, SwModify const &, SwFrameType const nFrameType, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr)
bool operator==(const SwPageFootnoteInfo &) const
Definition: pagedesc.cxx:497
void SetRegisterFormatColl(const SwTextFormatColl *rFormat)
set the style for the grid alignment
Definition: pagedesc.cxx:192
SwFrame * GetNext()
Definition: frame.hxx:656
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
Base class of the Writer document model elements.
Definition: node.hxx:79
const SvxShadowItem & GetShadow(bool=true) const
Definition: frmatr.hxx:88