20 #include <libxml/xmlwriter.h>
27 #include <osl/diagnose.h>
38 #include <strings.hrc>
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 )
52 , m_pTextFormatColl(nullptr)
56 , m_nVerticalAdjustment(
drawing::TextVerticalAdjust_TOP )
58 , m_IsLandscape( false )
65 :
sw::BroadcastingModify()
66 , m_StyleName( rCpy.GetName() )
68 , m_Master( rCpy.GetMaster() )
69 , m_Left( rCpy.GetLeft() )
70 , m_FirstMaster( rCpy.GetFirstMaster() )
71 , m_FirstLeft( rCpy.GetFirstLeft() )
73 , m_pTextFormatColl(nullptr)
74 , m_pFollow( rCpy.m_pFollow )
75 , m_nRegHeight( rCpy.GetRegHeight() )
76 , m_nRegAscent( rCpy.GetRegAscent() )
77 , m_nVerticalAdjustment( rCpy.GetVerticalAdjustment() )
78 , m_eUse( rCpy.ReadUseOn() )
79 , m_IsLandscape( rCpy.GetLandscape() )
81 , m_FootnoteInfo( rCpy.GetFootnoteInfo() )
134 SAL_WARN(
"sw",
"SwPageDesc not found in expected m_pdList" );
233 if( pLast->IsPageFrame() )
234 static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
241 if( pLast->IsPageFrame() )
242 static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
249 if( pLast->IsPageFrame() )
250 static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
257 if( pLast->IsPageFrame() )
258 static_cast<SwPageFrame*>(pLast)->PrepareRegisterChg();
266 if(
auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
268 const sal_uInt16 nWhich = pLegacyHint->m_pOld
269 ? pLegacyHint->m_pOld->Which()
270 : pLegacyHint->m_pNew
271 ? pLegacyHint->m_pNew->Which()
280 else if (
auto pModifyChangedHint = dynamic_cast<const sw::ModifyChangedHint*>(&rHint))
300 pMod =
static_cast<const SwTableNode&
>(rNd).GetTable().GetFrameFormat();
307 std::pair<Point, bool>
const tmp(aNullPt,
false);
316 if (pChkFrame &&
nullptr != (pChkFrame = pChkFrame->
FindPageFrame()))
317 pRet =
static_cast<const SwPageFrame*
>(pChkFrame)->GetPageDesc();
322 bool bCheckForThisPgDc )
const
328 if( pChkFrame &&
nullptr != ( pChkFrame = pChkFrame->
FindPageFrame() ))
330 const SwPageDesc* pPd = bCheckForThisPgDc ?
this :
331 static_cast<const SwPageFrame*
>(pChkFrame)->GetPageDesc();
333 OSL_ENSURE( static_cast<const SwPageFrame*>(pChkFrame)->GetPageDesc() == pPd,
"Wrong node for detection of page format!" );
338 OSL_ENSURE( pChkFrame->
KnowsFormat(*pRet),
"Wrong node for detection of page format!" );
352 if( pChkFrame &&
nullptr != ( pChkFrame = pChkFrame->
FindPageFrame() ) &&
392 STR_POOLPAGE_STANDARD,
396 STR_POOLPAGE_ENVELOPE,
397 STR_POOLPAGE_REGISTER,
399 STR_POOLPAGE_FOOTNOTE,
400 STR_POOLPAGE_ENDNOTE,
401 STR_POOLPAGE_LANDSCAPE
408 for(
size_t i = 0;
i < nDCount;
i++ )
431 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwPageDesc"));
432 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
433 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"m_StyleName"),
"%s",
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()));
440 xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_Master"));
442 xmlTextWriterEndElement(pWriter);
444 xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_Left"));
446 xmlTextWriterEndElement(pWriter);
448 xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_FirstMaster"));
450 xmlTextWriterEndElement(pWriter);
452 xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_FirstLeft"));
454 xmlTextWriterEndElement(pWriter);
456 xmlTextWriterEndElement(pWriter);
465 , m_nBottomDist( 57 )
468 css::text::HorizontalAdjust_RIGHT :
469 css::text::HorizontalAdjust_LEFT;
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())
510 : m_PageDesc(rPageDesc)
517 : m_PageDesc(rSrc.m_PageDesc)
518 , m_pDoc(rSrc.m_pDoc)
557 SwPageDesc * pPageDesc = m_pDoc->FindPageDesc(m_sFollow);
559 if (
nullptr != pPageDesc )
566 : m_PosIndex( m_Array.
get<0>() )
567 , m_NameIndex( m_Array.
get<1>() )
580 return m_Array.iterator_to( *it );
586 assert( x->m_pdList ==
nullptr );
588 std::pair<iterator,bool> res =
m_PosIndex.push_back( x );
597 assert( x->m_pdList ==
this );
603 SAL_WARN(
"sw",
"SwPageDesc is not in SwPageDescs m_pdList!" );
604 x->m_pdList =
nullptr;
610 assert( (*position)->m_pdList ==
this );
612 (*position)->m_pdList =
nullptr;
623 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwPageDescs"));
627 pPageDesc->dumpAsXml(pWriter);
630 xmlTextWriterEndElement(pWriter);
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Base class of the Writer layout elements.
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
static const char * STR_POOLPAGE[]
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
Represents the style of a paragraph.
const_iterator end() const
static const SwPageDesc * GetPageDescOfNode(const SwNode &rNd)
Given a SwNode return the pagedesc in use at that location.
const_iterator begin() const
SwFrameFormat & GetLeft()
bool isCHRATR(const sal_uInt16 nWhich)
SwPageDescsBase::value_type value_type
iterator find_(const OUString &name) const
tools::Long GetRight() const
SwFrameFormat & GetFirstMaster()
void dumpAsXml(xmlTextWriterPtr pWriter) const
bool KnowsFormat(const SwFormat &rFormat) const
SwPageDescExt(const SwPageDesc &rPageDesc, SwDoc *pDoc)
WW8LvlType GetNumType(sal_uInt8 nWwLevelNo)
sal_uInt16 m_nRegAscent
For grid alignment (Registerhaltigkeit).
Dialog to specify the properties of date form field.
SwPageDesc & operator=(const SwPageDesc &)
virtual bool GetInfo(SfxPoolItem &) const override
SwPageDescExt & operator=(const SwPageDescExt &rSrc)
void SetFollow(const SwPageDesc *pNew)
const OUString & GetName() const
SAL_DLLPRIVATE SwPageDesc(const OUString &, SwFrameFormat *, SwDoc *pDc)
tools::Long GetGutterMargin() const
static SwPageDesc * GetByName(SwDoc &rDoc, std::u16string_view rName)
bool IsFollowNextPageOfNode(const SwNode &rNd) const
std::pair< const_iterator, bool > push_back(const value_type &x)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
ByPos::const_iterator const_iterator
sw::WriterMultiListener m_aDepends
Because of grid alignment (Registerhaltigkeit).
constexpr OUStringLiteral IsHidden(u"IsHidden")
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
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(160)
drawing::TextVerticalAdjust m_nVerticalAdjustment
exports com.sun.star. drawing
SwAttrPool * GetPool() const
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
virtual ~SwPageDesc() override
#define SAL_N_ELEMENTS(arr)
SwFrameFormat m_FirstMaster
bool IsContentNode() const
void SetPageDesc(const SwPageDesc &rPageDesc)
struct _xmlTextWriter * xmlTextWriterPtr
void erase(const value_type &x)
sal_uInt16 m_nRegHeight
Sentence spacing and fontascent of style.
const SwPageDesc & GetPageDesc(const size_t i) const
SAL_DLLPRIVATE void Mirror()
Called for mirroring of Chg (doc).
SwPageFrame * FindPageFrame()
bool IsListeningTo(const SwModify *const pDepend) const
void ChgFirstShare(bool bNew)
SwFrameFormat * GetLeftFormat(bool const bFirst=false)
tools::Long GetLeft() const
void dumpAsXml(xmlTextWriterPtr pWriter) const
size_t GetPageDescCnt() const
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
SwPageDescsBase::size_type size_type
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
OUString SwResId(const char *pId)
A page of the document layout.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
static const SwFrame * lcl_GetFrameOfNode(const SwNode &rNd)
const SwPageDesc * GetFollow() const
void SetRightGutterMargin(const tools::Long nRightGutterMargin)
void StartListening(SwModify *pDepend)
SwFrameFormat & GetMaster()
const SwFrameFormat * GetPageFormatOfNode(const SwNode &rNd, bool bCheckForThisPgDc=true) const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual bool GetInfo(SfxPoolItem &) const override
Query information from Client.
OUString const & GetName() const
SwFrameFormat & GetFirstLeft()
SwFrameFormat * GetRightFormat(bool const bFirst=false)
Layout uses the following methods to obtain a format in order to be able to create a page...
LanguageType GetAppLanguage()
bool SetName(const OUString &rNewName)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
const SwTextFormatColl * m_pTextFormatColl
virtual void CallSwClientNotify(const SfxHint &rHint) const override
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
Return the AutoCollection by its Id.
const sal_uInt16 * GetRanges() const
SwFrameFormat m_FirstLeft
#define SAL_WARN(area, stream)
SAL_DLLPRIVATE void ResetAllAttr()
bool IsFirstShared() const
void RegisterChange()
notify all affected page frames
SwPageDescs * m_pdList
Backref to the assigned SwPageDescs list to handle renames.
void SetRegisterFormatColl(const SwTextFormatColl *rFormat)
set the style for the grid alignment
Base class of the Writer document model elements.