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>
27#include <osl/diagnose.h>
28#include <sal/log.hxx>
29#include <fmtclds.hxx>
30#include <fmtfsize.hxx>
31#include <pagefrm.hxx>
32#include <pagedesc.hxx>
33#include <swtable.hxx>
34#include <frmatr.hxx>
35#include <frmtool.hxx>
36#include <doc.hxx>
37#include <node.hxx>
38#include <strings.hrc>
41#include <poolfmt.hxx>
42#include <calbck.hxx>
43
44SwPageDesc::SwPageDesc(const OUString& rName, SwFrameFormat *pFormat, SwDoc *const pDoc)
45 : sw::BroadcastingModify()
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_aStashedHeader()
52 , m_aStashedFooter()
53 , m_aDepends(*this)
54 , m_pTextFormatColl(nullptr)
55 , m_pFollow( this )
56 , m_nRegHeight( 0 )
57 , m_nRegAscent( 0 )
58 , m_nVerticalAdjustment( drawing::TextVerticalAdjust_TOP )
60 , m_IsLandscape( false )
61 , m_IsHidden( false )
62 , m_pdList( nullptr )
63{
64}
65
67 : sw::BroadcastingModify()
68 , m_StyleName( rCpy.GetName() )
69 , m_NumType( rCpy.GetNumType() )
70 , m_Master( rCpy.GetMaster() )
71 , m_Left( rCpy.GetLeft() )
72 , m_FirstMaster( rCpy.GetFirstMaster() )
73 , m_FirstLeft( rCpy.GetFirstLeft() )
74 , m_aDepends(*this)
75 , m_pTextFormatColl(nullptr)
76 , m_pFollow( rCpy.m_pFollow )
77 , m_nRegHeight( rCpy.GetRegHeight() )
78 , m_nRegAscent( rCpy.GetRegAscent() )
79 , m_nVerticalAdjustment( rCpy.GetVerticalAdjustment() )
80 , m_eUse( rCpy.ReadUseOn() )
81 , m_IsLandscape( rCpy.GetLandscape() )
82 , m_IsHidden( rCpy.IsHidden() )
83 , m_FootnoteInfo( rCpy.GetFootnoteInfo() )
84 , m_pdList( nullptr )
85{
89
93
95 {
98 }
99}
100
102{
103 if(this == &rSrc)
104 return *this;
105
107 m_NumType = rSrc.m_NumType;
108 m_Master = rSrc.m_Master;
109 m_Left = rSrc.m_Left;
112
116
120
123 {
126 }
127 else
128 m_pTextFormatColl = nullptr;
129
130 if (rSrc.m_pFollow == &rSrc)
131 m_pFollow = this;
132 else
133 m_pFollow = rSrc.m_pFollow;
134
138 m_eUse = rSrc.m_eUse;
140 return *this;
141}
142
144{
145}
146
147bool SwPageDesc::SetName( const OUString& rNewName )
148{
149 bool renamed = true;
150 if (m_pdList) {
152 if( m_pdList->end() == it ) {
153 SAL_WARN( "sw", "SwPageDesc not found in expected m_pdList" );
154 return false;
155 }
156 renamed = m_pdList->m_PosIndex.modify( it,
157 change_name( rNewName ), change_name( m_StyleName ) );
158 }
159 else
160 m_StyleName = rNewName;
161 return renamed;
162}
163
167{
168 //Only the margins are mirrored, all other values are just copied.
170 const SvxLRSpaceItem &rLR = m_Master.GetLRSpace();
171 aLR.SetLeft( rLR.GetRight() );
172 aLR.SetRight( rLR.GetLeft() );
174
177 aSet.Put( aLR );
178 aSet.Put( m_Master.GetFrameSize() );
179 aSet.Put( m_Master.GetPaperBin() );
180 aSet.Put( m_Master.GetULSpace() );
181 aSet.Put( m_Master.GetBox() );
183 aSet.Put( m_Master.GetShadow() );
184 aSet.Put( m_Master.GetCol() );
185 aSet.Put( m_Master.GetFrameDir() );
186 m_Left.SetFormatAttr( aSet );
187}
188
190{
191 SwFrameFormat& rFormat = GetMaster();
192
193 // #i73790# - method renamed
194 rFormat.ResetAllFormatAttr();
195 rFormat.SetFormatAttr( SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR) );
196}
197
198// gets information from Modify
199bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const
200{
201 if (!m_Master.GetInfo(rInfo))
202 return false; // found
203 if (!m_Left.GetInfo(rInfo))
204 return false ;
205 if ( !m_FirstMaster.GetInfo( rInfo ) )
206 return false;
207 return m_FirstLeft.GetInfo( rInfo );
208}
209
212{
213 if(pFormat != m_pTextFormatColl)
214 {
216 m_pTextFormatColl = pFormat;
219 }
220}
221
224{
226 m_pTextFormatColl = nullptr;
227 return m_pTextFormatColl;
228}
229
232{
233 // #117072# - During destruction of the document <SwDoc>
234 // the page description is modified. Thus, do nothing, if the document
235 // is in destruction respectively if no viewshell exists.
236 SwDoc* pDoc = GetMaster().GetDoc();
237 if ( !pDoc || pDoc->IsInDtor() )
238 {
239 return;
240 }
242 if ( !pSh )
243 {
244 return;
245 }
246
247 m_nRegHeight = 0;
248 {
250 for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
251 {
252 if( pLast->IsPageFrame() )
253 static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
254 }
255 }
256 {
258 for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
259 {
260 if( pLast->IsPageFrame() )
261 static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
262 }
263 }
264 {
266 for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
267 {
268 if( pLast->IsPageFrame() )
269 static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
270 }
271 }
272 {
274 for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
275 {
276 if( pLast->IsPageFrame() )
277 static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
278 }
279 }
280}
281
283void SwPageDesc::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
284{
285 if (rHint.GetId() == SfxHintId::SwLegacyModify)
286 {
287 auto pLegacyHint = static_cast<const sw::LegacyModifyHint*>(&rHint);
288 const sal_uInt16 nWhich = pLegacyHint->m_pOld
289 ? pLegacyHint->m_pOld->Which()
290 : pLegacyHint->m_pNew
291 ? pLegacyHint->m_pNew->Which()
292 : 0;
293 CallSwClientNotify(rHint);
294 if((RES_ATTRSET_CHG == nWhich)
295 || (RES_FMT_CHG == nWhich)
296 || isCHRATR(nWhich)
297 || (RES_PARATR_LINESPACING == nWhich))
299 }
300 else if (auto pModifyChangedHint = dynamic_cast<const sw::ModifyChangedHint*>(&rHint))
301 {
302 if(m_pTextFormatColl == &rModify)
303 m_pTextFormatColl = static_cast<const SwTextFormatColl*>(pModifyChangedHint->m_pNew);
304 else
305 assert(false);
306 }
307}
308
309static const SwFrame* lcl_GetFrameOfNode( const SwNode& rNd )
310{
311 const sw::BroadcastingModify* pMod;
312 SwFrameType nFrameType = FRM_CNTNT;
313
314 if( rNd.IsContentNode() )
315 {
316 pMod = &static_cast<const SwContentNode&>(rNd);
317 }
318 else if( rNd.IsTableNode() )
319 {
320 pMod = static_cast<const SwTableNode&>(rNd).GetTable().GetFrameFormat();
321 nFrameType = SwFrameType::Tab;
322 }
323 else
324 pMod = nullptr;
325
326 Point aNullPt;
327 std::pair<Point, bool> const tmp(aNullPt, false);
328 return pMod ? ::GetFrameOfModify(nullptr, *pMod, nFrameType, nullptr, &tmp)
329 : nullptr;
330}
331
333{
334 const SwPageDesc* pRet = nullptr;
335 const SwFrame* pChkFrame = lcl_GetFrameOfNode( rNd );
336 if (pChkFrame && nullptr != (pChkFrame = pChkFrame->FindPageFrame()))
337 pRet = static_cast<const SwPageFrame*>(pChkFrame)->GetPageDesc();
338 return pRet;
339}
340
342 bool bCheckForThisPgDc ) const
343{
344 // which PageDescFormat is valid for this node?
345 const SwFrameFormat* pRet;
346 const SwFrame* pChkFrame = lcl_GetFrameOfNode( rNd );
347
348 if( pChkFrame && nullptr != ( pChkFrame = pChkFrame->FindPageFrame() ))
349 {
350 const SwPageDesc* pPd = bCheckForThisPgDc ? this :
351 static_cast<const SwPageFrame*>(pChkFrame)->GetPageDesc();
352 pRet = &pPd->GetMaster();
353 OSL_ENSURE( static_cast<const SwPageFrame*>(pChkFrame)->GetPageDesc() == pPd, "Wrong node for detection of page format!" );
354 // this page is assigned to which format?
355 if( !pChkFrame->KnowsFormat(*pRet) )
356 {
357 pRet = &pPd->GetLeft();
358 OSL_ENSURE( pChkFrame->KnowsFormat(*pRet), "Wrong node for detection of page format!" );
359 }
360 }
361 else
362 pRet = &GetMaster();
363 return pRet;
364}
365
367{
368 bool bRet = false;
369 if( GetFollow() && this != GetFollow() )
370 {
371 const SwFrame* pChkFrame = lcl_GetFrameOfNode( rNd );
372 if( pChkFrame && nullptr != ( pChkFrame = pChkFrame->FindPageFrame() ) &&
373 pChkFrame->IsPageFrame() &&
374 ( !pChkFrame->GetNext() || GetFollow() ==
375 static_cast<const SwPageFrame*>(pChkFrame->GetNext())->GetPageDesc() ))
376 // the page on which the follow points was found
377 bRet = true;
378 }
379 return bRet;
380}
381
383{
384 return (UseOnPage::Left & m_eUse)
385 ? (bFirst ? &m_FirstLeft : &m_Left)
386 : nullptr;
387}
388
390{
391 return (UseOnPage::Right & m_eUse)
392 ? (bFirst ? &m_FirstMaster : &m_Master)
393 : nullptr;
394}
395
397{
398 return bool(m_eUse & UseOnPage::FirstShare);
399}
400
402{
403 if ( bNew )
405 else
407}
408
409void SwPageDesc::StashFrameFormat(const SwFrameFormat& rFormat, bool bHeader, bool bLeft, bool bFirst)
410{
411 assert(rFormat.GetRegisteredIn());
412 std::shared_ptr<SwFrameFormat>* pFormat = nullptr;
413
414 if (bHeader)
415 {
416 if (bLeft && !bFirst)
418 else if (!bLeft && bFirst)
420 else if (bLeft && bFirst)
422 }
423 else
424 {
425 if (bLeft && !bFirst)
427 else if (!bLeft && bFirst)
429 else if (bLeft && bFirst)
431 }
432
433 if (pFormat)
434 {
435 *pFormat = std::make_shared<SwFrameFormat>(rFormat);
436 }
437 else
438 {
439 SAL_WARN(
440 "sw",
441 "SwPageDesc::StashFrameFormat: Stashing the right page header/footer is pointless.");
442 }
443}
444
445const SwFrameFormat* SwPageDesc::GetStashedFrameFormat(bool bHeader, bool bLeft, bool bFirst) const
446{
447 std::shared_ptr<SwFrameFormat>* pFormat = nullptr;
448
449 if (bLeft && !bFirst)
450 {
452 }
453 else if (!bLeft && bFirst)
454 {
456 }
457 else if (bLeft && bFirst)
458 {
460 }
461
462 if (pFormat)
463 {
464 return pFormat->get();
465 }
466 else
467 {
468 SAL_WARN("sw", "SwPageDesc::GetStashedFrameFormat: Right page format is never stashed.");
469 return nullptr;
470 }
471}
472
473bool SwPageDesc::HasStashedFormat(bool bHeader, bool bLeft, bool bFirst)
474{
475 if (bHeader)
476 {
477 if (bLeft && !bFirst)
478 {
479 return m_aStashedHeader.m_pStashedLeft != nullptr;
480 }
481 else if (!bLeft && bFirst)
482 {
483 return m_aStashedHeader.m_pStashedFirst != nullptr;
484 }
485 else if (bLeft && bFirst)
486 {
487 return m_aStashedHeader.m_pStashedFirstLeft != nullptr;
488 }
489 else
490 {
491 SAL_WARN("sw", "SwPageDesc::HasStashedFormat: Right page format is never stashed.");
492 return false;
493 }
494 }
495 else
496 {
497 if (bLeft && !bFirst)
498 {
499 return m_aStashedFooter.m_pStashedLeft != nullptr;
500 }
501 else if (!bLeft && bFirst)
502 {
503 return m_aStashedFooter.m_pStashedFirst != nullptr;
504 }
505 else if (bLeft && bFirst)
506 {
507 return m_aStashedFooter.m_pStashedFirstLeft != nullptr;
508 }
509 else
510 {
511 SAL_WARN("sw", "SwPageDesc::HasStashedFormat: Right page format is never stashed.");
512 return false;
513 }
514 }
515}
516
517void SwPageDesc::RemoveStashedFormat(bool bHeader, bool bLeft, bool bFirst)
518{
519 if (bHeader)
520 {
521 if (bLeft && !bFirst)
522 {
524 }
525 else if (!bLeft && bFirst)
526 {
528 }
529 else if (bLeft && bFirst)
530 {
532 }
533 else
534 {
535 SAL_WARN("sw", "SwPageDesc::RemoveStashedFormat: Right page format is never stashed.");
536 }
537 }
538 else
539 {
540 if (bLeft && !bFirst)
541 {
543 }
544 else if (!bLeft && bFirst)
545 {
547 }
548 else if (bLeft && bFirst)
549 {
551 }
552 else
553 {
554 SAL_WARN("sw", "SwPageDesc::RemoveStashedFormat: Right page format is never stashed.");
555 }
556 }
557}
558
559// Page styles
561{
562 STR_POOLPAGE_STANDARD,
563 STR_POOLPAGE_FIRST,
564 STR_POOLPAGE_LEFT,
565 STR_POOLPAGE_RIGHT,
566 STR_POOLPAGE_ENVELOPE,
567 STR_POOLPAGE_REGISTER,
568 STR_POOLPAGE_HTML,
569 STR_POOLPAGE_FOOTNOTE,
570 STR_POOLPAGE_ENDNOTE,
571 STR_POOLPAGE_LANDSCAPE
572};
573
574SwPageDesc* SwPageDesc::GetByName(SwDoc& rDoc, std::u16string_view rName)
575{
576 const size_t nDCount = rDoc.GetPageDescCnt();
577
578 for( size_t i = 0; i < nDCount; i++ )
579 {
580 SwPageDesc* pDsc = &rDoc.GetPageDesc( i );
581 if(pDsc->GetName() == rName)
582 {
583 return pDsc;
584 }
585 }
586
587 for (size_t i = 0; i < SAL_N_ELEMENTS(STR_POOLPAGE); ++i)
588 {
589 if (rName == SwResId(STR_POOLPAGE[i]))
590 {
591 return rDoc.getIDocumentStylePoolAccess().GetPageDescFromPool( static_cast< sal_uInt16 >(
593 }
594 }
595
596 return nullptr;
597}
598
600{
601 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwPageDesc"));
602 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
603 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("m_StyleName"), "%s",
604 BAD_CAST(m_StyleName.toUtf8().getStr()));
605 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("m_pFollow"), "%p", m_pFollow);
606 (void)xmlTextWriterWriteFormatAttribute(
607 pWriter, BAD_CAST("m_eUse"), "0x%s",
608 BAD_CAST(OString::number(static_cast<int>(m_eUse), 16).getStr()));
609
610 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_Master"));
611 m_Master.dumpAsXml(pWriter);
612 (void)xmlTextWriterEndElement(pWriter);
613
614 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_Left"));
615 m_Left.dumpAsXml(pWriter);
616 (void)xmlTextWriterEndElement(pWriter);
617
618 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_FirstMaster"));
619 m_FirstMaster.dumpAsXml(pWriter);
620 (void)xmlTextWriterEndElement(pWriter);
621
622 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_FirstLeft"));
623 m_FirstLeft.dumpAsXml(pWriter);
624 (void)xmlTextWriterEndElement(pWriter);
625
626 (void)xmlTextWriterEndElement(pWriter);
627}
628
630 : m_nMaxHeight( 0 )
631 , m_nLineWidth(10)
632 , m_eLineStyle( SvxBorderLineStyle::SOLID )
633 , m_Width( 25, 100 )
634 , m_nTopDist( 57 ) //1mm
635 , m_nBottomDist( 57 )
636{
637 m_eAdjust = SvxFrameDirection::Horizontal_RL_TB == GetDefaultFrameDirection(GetAppLanguage()) ?
638 css::text::HorizontalAdjust_RIGHT :
639 css::text::HorizontalAdjust_LEFT;
640}
641
643 : m_nMaxHeight(rCpy.GetHeight())
644 , m_nLineWidth(rCpy.m_nLineWidth)
645 , m_eLineStyle(rCpy.m_eLineStyle)
646 , m_LineColor(rCpy.m_LineColor)
647 , m_Width(rCpy.GetWidth())
648 , m_eAdjust(rCpy.GetAdj())
649 , m_nTopDist(rCpy.GetTopDist())
650 , m_nBottomDist(rCpy.GetBottomDist())
651{
652}
653
655{
656 m_nMaxHeight = rCpy.GetHeight();
660 m_Width = rCpy.GetWidth();
661 m_eAdjust = rCpy.GetAdj();
662 m_nTopDist = rCpy.GetTopDist();
664 return *this;
665}
666
668{
669 return m_nMaxHeight == rCmp.GetHeight()
670 && m_nLineWidth == rCmp.m_nLineWidth
671 && m_eLineStyle == rCmp.m_eLineStyle
672 && m_LineColor == rCmp.m_LineColor
673 && m_Width == rCmp.GetWidth()
674 && m_eAdjust == rCmp.GetAdj()
675 && m_nTopDist == rCmp.GetTopDist()
676 && m_nBottomDist== rCmp.GetBottomDist();
677}
678
679SwPageDescExt::SwPageDescExt(const SwPageDesc & rPageDesc, SwDoc *const pDoc)
680 : m_PageDesc(rPageDesc)
681 , m_pDoc(pDoc)
682{
683 SetPageDesc(rPageDesc);
684}
685
687 : m_PageDesc(rSrc.m_PageDesc)
688 , m_pDoc(rSrc.m_pDoc)
689{
691}
692
694{
695}
696
697OUString const & SwPageDescExt::GetName() const
698{
699 return m_PageDesc.GetName();
700}
701
703{
704 m_PageDesc = rPageDesc;
705
706 if (m_PageDesc.GetFollow())
708}
709
711{
712 SetPageDesc(rSrc);
713
714 return *this;
715}
716
718{
719 operator=(rSrc.m_PageDesc);
720 return *this;
721}
722
723SwPageDescExt::operator SwPageDesc() const
724{
725 SwPageDesc aResult(m_PageDesc);
726
727 SwPageDesc * pPageDesc = m_pDoc->FindPageDesc(m_sFollow);
728
729 if ( nullptr != pPageDesc )
730 aResult.SetFollow(pPageDesc);
731
732 return aResult;
733}
734
736 : m_PosIndex( m_Array.get<0>() )
737 , m_NameIndex( m_Array.get<1>() )
738{
739}
740
742{
743 for(const_iterator it = begin(); it != end(); ++it)
744 delete *it;
745}
746
747SwPageDescs::iterator SwPageDescs::find_(const OUString &name) const
748{
749 ByName::iterator it = m_NameIndex.find( name );
750 return m_Array.iterator_to( *it );
751}
752
753std::pair<SwPageDescs::const_iterator,bool> SwPageDescs::push_back( const value_type& x )
754{
755 // SwPageDesc is not already in a SwPageDescs list!
756 assert( x->m_pdList == nullptr );
757
758 std::pair<iterator,bool> res = m_PosIndex.push_back( x );
759 if( res.second )
760 x->m_pdList = this;
761 return res;
762}
763
765{
766 // SwPageDesc is not in this SwPageDescs list!
767 assert( x->m_pdList == this );
768
769 iterator const ret = find_( x->GetName() );
770 if (ret != end())
771 m_PosIndex.erase( ret );
772 else
773 SAL_WARN( "sw", "SwPageDesc is not in SwPageDescs m_pdList!" );
774 x->m_pdList = nullptr;
775}
776
777void SwPageDescs::erase( const_iterator const& position )
778{
779 // SwPageDesc is not in this SwPageDescs list!
780 assert( (*position)->m_pdList == this );
781
782 (*position)->m_pdList = nullptr;
783 m_PosIndex.erase( position );
784}
785
787{
788 erase( begin() + index_ );
789}
790
792{
793 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwPageDescs"));
794
795 for (const auto& pPageDesc : m_PosIndex)
796 {
797 pPageDesc->dumpAsXml(pWriter);
798 }
799
800 (void)xmlTextWriterEndElement(pWriter);
801}
802
803/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxBorderLineStyle
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
SfxHintId GetId() const
const WhichRangesContainer & GetRanges() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 Which() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
void SetRightGutterMargin(const tools::Long nRightGutterMargin)
tools::Long GetGutterMargin() const
tools::Long GetLeft() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
SwAttrPool * GetPool() const
Definition: swatrset.hxx:190
Definition: doc.hxx:197
bool IsInDtor() const
Definition: doc.hxx:417
size_t GetPageDescCnt() const
Definition: doc.hxx:895
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:440
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:896
const SvxFrameDirectionItem & GetFrameDir(bool=true) const
Definition: frmatr.hxx:118
const SvxPaperBinItem & GetPaperBin(bool=true) const
Definition: frmatr.hxx:84
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:108
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:98
const SvxShadowItem & GetShadow(bool=true) const
Definition: frmatr.hxx:112
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:100
virtual sal_uInt16 ResetAllFormatAttr()
Takes all hints from Delta-Array,.
Definition: format.cxx:646
std::unique_ptr< SvxBrushItem > makeBackgroundBrushItem(bool=true) const
Definition: format.cxx:736
Style of a layout element.
Definition: frmfmt.hxx:72
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: atrfrm.cxx:2892
Base class of the Writer layout elements.
Definition: frame.hxx:315
SwFrame * GetNext()
Definition: frame.hxx:682
bool IsPageFrame() const
Definition: frame.hxx:1184
bool KnowsFormat(const SwFormat &rFormat) const
Definition: wsfrm.cxx:333
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
TElementType * Next()
Definition: calbck.hxx:380
TElementType * First()
Definition: calbck.hxx:372
Base class of the Writer document model elements.
Definition: node.hxx:98
bool IsContentNode() const
Definition: node.hxx:188
bool IsTableNode() const
Definition: node.hxx:191
OUString const & GetName() const
Definition: pagedesc.cxx:697
void SetPageDesc(const SwPageDesc &rPageDesc)
Definition: pagedesc.cxx:702
SwPageDescExt & operator=(const SwPageDescExt &rSrc)
Definition: pagedesc.cxx:717
SwPageDescExt(const SwPageDesc &rPageDesc, SwDoc *pDoc)
Definition: pagedesc.cxx:679
SwPageDesc m_PageDesc
Definition: pagedesc.hxx:379
OUString m_sFollow
Definition: pagedesc.hxx:382
SvxNumberType m_NumType
Definition: pagedesc.hxx:145
SwFrameFormat m_Left
Definition: pagedesc.hxx:147
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: pagedesc.cxx:599
SwPageDescs * m_pdList
Backref to the assigned SwPageDescs list to handle renames.
Definition: pagedesc.hxx:176
void StashFrameFormat(const SwFrameFormat &rFormat, bool bHeader, bool bLeft, bool bFirst)
Remember original header/footer formats even when they are hidden by "sharing".
Definition: pagedesc.cxx:409
const OUString & GetName() const
Definition: pagedesc.hxx:196
sal_uInt16 m_nRegAscent
For grid alignment (Registerhaltigkeit).
Definition: pagedesc.hxx:166
UseOnPage m_eUse
Definition: pagedesc.hxx:168
drawing::TextVerticalAdjust m_nVerticalAdjustment
Definition: pagedesc.hxx:167
void SetFollow(const SwPageDesc *pNew)
Definition: pagedesc.hxx:314
SwFrameFormat m_FirstMaster
Definition: pagedesc.hxx:149
SwFrameFormat m_Master
Definition: pagedesc.hxx:146
SAL_DLLPRIVATE void Mirror()
Called for mirroring of Chg (doc).
Definition: pagedesc.cxx:166
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
const SwFrameFormat * GetPageFormatOfNode(const SwNode &rNd, bool bCheckForThisPgDc=true) const
Definition: pagedesc.cxx:341
SwFrameFormat m_FirstLeft
Definition: pagedesc.hxx:150
bool IsFirstShared() const
Definition: pagedesc.cxx:396
SwPageDesc & operator=(const SwPageDesc &)
Definition: pagedesc.cxx:101
SwFrameFormat & GetFirstLeft()
Definition: pagedesc.hxx:241
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:240
void RegisterChange()
notify all affected page frames
Definition: pagedesc.cxx:231
SAL_DLLPRIVATE SwPageDesc(const OUString &, SwFrameFormat *, SwDoc *pDc)
Definition: pagedesc.cxx:44
bool HasStashedFormat(bool bHeader, bool bLeft, bool bFirst)
Checks if the pagedescriptor has a stashed format according to the parameters or not.
Definition: pagedesc.cxx:473
bool SetName(const OUString &rNewName)
Definition: pagedesc.cxx:147
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:389
SwPageDesc * m_pFollow
Definition: pagedesc.hxx:164
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:239
void ChgFirstShare(bool bNew)
Definition: pagedesc.cxx:401
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:267
sw::WriterMultiListener m_aDepends
Because of grid alignment (Registerhaltigkeit).
Definition: pagedesc.hxx:162
static const SwPageDesc * GetPageDescOfNode(const SwNode &rNd)
Given a SwNode return the pagedesc in use at that location.
Definition: pagedesc.cxx:332
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
special handling if the style of the grid alignment changes
Definition: pagedesc.cxx:283
void RemoveStashedFormat(bool bHeader, bool bLeft, bool bFirst)
Gives the feature of removing the stashed format by hand if it is necessary.
Definition: pagedesc.cxx:517
bool m_IsLandscape
Definition: pagedesc.hxx:169
bool IsFollowNextPageOfNode(const SwNode &rNd) const
Definition: pagedesc.cxx:366
sal_uInt16 m_nRegHeight
Sentence spacing and fontascent of style.
Definition: pagedesc.hxx:165
static SwPageDesc * GetByName(SwDoc &rDoc, std::u16string_view rName)
Definition: pagedesc.cxx:574
void SetRegisterFormatColl(const SwTextFormatColl *rFormat)
set the style for the grid alignment
Definition: pagedesc.cxx:211
SAL_DLLPRIVATE void ResetAllAttr()
Definition: pagedesc.cxx:189
OUString m_StyleName
Definition: pagedesc.hxx:144
virtual ~SwPageDesc() override
Definition: pagedesc.cxx:143
const SwTextFormatColl * m_pTextFormatColl
Definition: pagedesc.hxx:163
SwFrameFormat * GetLeftFormat(bool const bFirst=false)
Definition: pagedesc.cxx:382
virtual bool GetInfo(SfxPoolItem &) const override
Query information from Client.
Definition: pagedesc.cxx:199
StashedPageDesc m_aStashedFooter
Definition: pagedesc.hxx:160
const SwFrameFormat * GetStashedFrameFormat(bool bHeader, bool bLeft, bool bFirst) const
Used to restore hidden header/footer formats.
Definition: pagedesc.cxx:445
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
Definition: pagedesc.cxx:223
StashedPageDesc m_aStashedHeader
Definition: pagedesc.hxx:159
SwPageDescsBase::value_type value_type
Definition: pagedesc.hxx:433
SwPageDescsBase::size_type size_type
Definition: pagedesc.hxx:432
ByName & m_NameIndex
Definition: pagedesc.hxx:428
std::pair< const_iterator, bool > push_back(const value_type &x)
Definition: pagedesc.cxx:753
const_iterator begin() const
Definition: pagedesc.hxx:455
void erase(const value_type &x)
Definition: pagedesc.cxx:764
ByPos & m_PosIndex
Definition: pagedesc.hxx:427
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: pagedesc.cxx:791
iterator find_(const OUString &name) const
Definition: pagedesc.cxx:747
const_iterator end() const
Definition: pagedesc.hxx:456
SwPageDescsBase m_Array
Definition: pagedesc.hxx:426
ByPos::const_iterator const_iterator
Definition: pagedesc.hxx:431
ByPos::iterator iterator
Definition: pagedesc.hxx:422
Footnote information.
Definition: pagedesc.hxx:49
SwPageFootnoteInfo & operator=(const SwPageFootnoteInfo &)
Definition: pagedesc.cxx:654
SwTwips m_nMaxHeight
maximum height of the footnote area.
Definition: pagedesc.hxx:51
SwTwips m_nBottomDist
distance between separator and first footnote
Definition: pagedesc.hxx:58
SwTwips GetHeight() const
Definition: pagedesc.hxx:61
SwTwips GetTopDist() const
Definition: pagedesc.hxx:67
Fraction m_Width
percentage width of the separator line.
Definition: pagedesc.hxx:55
css::text::HorizontalAdjust GetAdj() const
Definition: pagedesc.hxx:66
SvxBorderLineStyle m_eLineStyle
Style of the separator line.
Definition: pagedesc.hxx:53
SwTwips m_nTopDist
distance between body and separator.
Definition: pagedesc.hxx:57
bool operator==(const SwPageFootnoteInfo &) const
Definition: pagedesc.cxx:667
sal_uLong m_nLineWidth
width of separator line
Definition: pagedesc.hxx:52
Color m_LineColor
color of the separator line
Definition: pagedesc.hxx:54
css::text::HorizontalAdjust m_eAdjust
line adjustment.
Definition: pagedesc.hxx:56
SwTwips GetBottomDist() const
Definition: pagedesc.hxx:68
const Fraction & GetWidth() const
Definition: pagedesc.hxx:65
A page of the document layout.
Definition: pagefrm.hxx:60
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:147
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
bool IsListeningTo(const SwModify *const pDepend) const
Definition: calbck.cxx:276
void StartListening(SwModify *pDepend)
Definition: calbck.cxx:269
struct _xmlTextWriter * xmlTextWriterPtr
virtual OUString GetName() const override
float x
constexpr OUStringLiteral IsHidden(u"IsHidden")
#define FRM_CNTNT
Definition: frame.hxx:103
SwFrameType
Definition: frame.hxx:75
SwFrame * GetFrameOfModify(const SwRootFrame *pLayout, sw::BroadcastingModify const &, SwFrameType const nFrameType, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr)
Definition: frmtool.cxx:3813
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:468
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(169)
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
const char * name
LanguageType GetAppLanguage()
Definition: init.cxx:741
sal_uInt32 index_
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
def position(n=-1)
int i
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Dialog to specify the properties of date form field.
const TranslateId STR_POOLPAGE[]
Definition: pagedesc.cxx:560
static const SwFrame * lcl_GetFrameOfNode(const SwNode &rNd)
Definition: pagedesc.cxx:309
UseOnPage
Definition: pagedesc.hxx:121
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
Return the AutoCollection by its Id.
Definition: poolfmt.cxx:79
@ RES_POOLPAGE_BEGIN
Definition: poolfmt.hxx:168
std::shared_ptr< SwFrameFormat > m_pStashedFirst
Definition: pagedesc.hxx:154
std::shared_ptr< SwFrameFormat > m_pStashedFirstLeft
Definition: pagedesc.hxx:156
std::shared_ptr< SwFrameFormat > m_pStashedLeft
Definition: pagedesc.hxx:155
const SfxPoolItem * m_pOld
Definition: calbck.hxx:77
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
WW8LvlType GetNumType(sal_uInt8 nWwLevelNo)
Definition: ww8par2.cxx:853