diff options
-rw-r--r-- | sw/inc/pagedesc.hxx | 138 | ||||
-rw-r--r-- | sw/source/core/doc/docdesc.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/pagedesc.cxx | 139 |
3 files changed, 139 insertions, 140 deletions
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index ecb91ef4aaab..b25e9af8ca11 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -79,29 +79,29 @@ public: }; /* - * Use of UseOnPage (eUse) and of FrmFmts + * Use of UseOnPage (m_eUse) and of FrmFmts * - * RIGHT - aMaster only for right hand (odd) pages, left hand (even) pages + * RIGHT - m_Master only for right hand (odd) pages, left hand (even) pages * always empty. - * LEFT - aLeft for left-hand pages, right-hand pages always empty. - * aLeft is a copy of master. - * ALL - aMaster for right hand pages, aLeft for left hand pages. - * - aLeft is a copy of master. - * MIRROR - aMaster for right hand pages, aLeft for left hand pagers. - * aLeft is a copy of master, margins are mirrored. + * LEFT - m_Left for left-hand pages, right-hand pages always empty. + * m_Left is a copy of master. + * ALL - m_Master for right hand pages, m_Left for left hand pages. + * - m_Left is a copy of master. + * MIRROR - m_Master for right hand pages, m_Left for left hand pagers. + * m_Left is a copy of master, margins are mirrored. * - * UI works exclusively on master! aLeft is adjusted on Chg at document - * according to eUse. + * UI works exclusively on master! m_Left is adjusted on Chg at document + * according to m_eUse. * * In order to simplify the work of the filters some more values are placed - * into eUse: + * into m_eUse: * * HEADERSHARE - Content of header is equal on left and right hand pages. * FOOTERSHARE - Content of footer is equal on left and right hand pages. * * The values are masked out in the respective getter and setter methods. - * Access to complete eUse including the information on header and footer - * via ReadUseOn(), WriteUseOn() (fuer Filter und CopyCTor)! + * Access to complete m_eUse including the information on header and footer + * via ReadUseOn(), WriteUseOn() (for Filter and CopyCTor)! * * The Frmformats for header/footer are adjusted by the UI according to * the attributes for header and footer at master (height, margin, back- @@ -132,23 +132,23 @@ class SW_DLLPUBLIC SwPageDesc : public SwModify { friend class SwDoc; - OUString aDescName; - SvxNumberType aNumType; - SwFrmFmt aMaster; - SwFrmFmt aLeft; + OUString m_StyleName; + SvxNumberType m_NumType; + SwFrmFmt m_Master; + SwFrmFmt m_Left; // FIXME epicycles growing here - page margins need to be stored differently SwFrmFmt m_FirstMaster; SwFrmFmt m_FirstLeft; - SwDepend aDepend; ///< Because of grid alignment (Registerhaltigkeit). - SwPageDesc *pFollow; - sal_uInt16 nRegHeight; ///< Sentence spacing and fontascent of style. - sal_uInt16 nRegAscent; ///< For grid alignment (Registerhaltigkeit). - UseOnPage eUse; - bool bLandscape; - bool bHidden; + SwDepend m_Depend; ///< Because of grid alignment (Registerhaltigkeit). + SwPageDesc *m_pFollow; + sal_uInt16 m_nRegHeight; ///< Sentence spacing and fontascent of style. + sal_uInt16 m_nRegAscent; ///< For grid alignment (Registerhaltigkeit). + UseOnPage m_eUse; + bool m_IsLandscape; + bool m_IsHidden; /// Footnote information. - SwPageFtnInfo aFtnInfo; + SwPageFtnInfo m_IsFtnInfo; /** Called for mirroring of Chg (doc). No adjustment at any other place. */ @@ -162,19 +162,19 @@ protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue ) SAL_OVERRIDE; public: - OUString GetName() const { return aDescName; } - bool HasName( const OUString& rThisName ) const { return aDescName == rThisName; } - void SetName( const OUString& rNewName ) { aDescName = rNewName; } + OUString GetName() const { return m_StyleName; } + bool HasName(const OUString& rThisName) const { return m_StyleName == rThisName; } + void SetName(const OUString& rNewName) { m_StyleName = rNewName; } - bool GetLandscape() const { return bLandscape; } - void SetLandscape( bool bNew ) { bLandscape = bNew; } + bool GetLandscape() const { return m_IsLandscape; } + void SetLandscape( bool bNew ) { m_IsLandscape = bNew; } - const SvxNumberType &GetNumType() const { return aNumType; } - void SetNumType( const SvxNumberType& rNew ) { aNumType = rNew; } + const SvxNumberType &GetNumType() const { return m_NumType; } + void SetNumType(const SvxNumberType& rNew) { m_NumType = rNew; } - const SwPageFtnInfo &GetFtnInfo() const { return aFtnInfo; } - SwPageFtnInfo &GetFtnInfo() { return aFtnInfo; } - void SetFtnInfo( const SwPageFtnInfo &rNew ) { aFtnInfo = rNew; } + const SwPageFtnInfo &GetFtnInfo() const { return m_IsFtnInfo; } + SwPageFtnInfo &GetFtnInfo() { return m_IsFtnInfo; } + void SetFtnInfo(const SwPageFtnInfo &rNew) { m_IsFtnInfo = rNew; } inline bool IsHeaderShared() const; inline bool IsFooterShared() const; @@ -183,22 +183,22 @@ public: bool IsFirstShared() const; void ChgFirstShare( bool bNew ); - bool IsHidden( ) const { return bHidden; } - void SetHidden( bool bValue ) { bHidden = bValue; } + bool IsHidden() const { return m_IsHidden; } + void SetHidden(bool const bValue) { m_IsHidden = bValue; } inline void SetUseOn( UseOnPage eNew ); inline UseOnPage GetUseOn() const; - void WriteUseOn( UseOnPage eNew ) { eUse = eNew; } - UseOnPage ReadUseOn () const { return eUse; } + void WriteUseOn(UseOnPage const eNew) { m_eUse = eNew; } + UseOnPage ReadUseOn() const { return m_eUse; } - SwFrmFmt &GetMaster() { return aMaster; } - SwFrmFmt &GetLeft() { return aLeft; } - SwFrmFmt &GetFirstMaster() { return m_FirstMaster; } + SwFrmFmt &GetMaster() { return m_Master; } + SwFrmFmt &GetLeft() { return m_Left; } + SwFrmFmt &GetFirstMaster() { return m_FirstMaster; } SwFrmFmt &GetFirstLeft() { return m_FirstLeft; } - const SwFrmFmt &GetMaster() const { return aMaster; } - const SwFrmFmt &GetLeft() const { return aLeft; } - const SwFrmFmt &GetFirstMaster() const { return m_FirstMaster; } + const SwFrmFmt &GetMaster() const { return m_Master; } + const SwFrmFmt &GetLeft() const { return m_Left; } + const SwFrmFmt &GetFirstMaster() const { return m_FirstMaster; } const SwFrmFmt &GetFirstLeft() const { return m_FirstLeft; } /** Reset all attrs of the format but keep the ones a pagedesc @@ -213,26 +213,26 @@ public: SwFrmFmt *GetLeftFmt(bool const bFirst = false); inline const SwFrmFmt *GetLeftFmt(bool const bFirst = false) const; - sal_uInt16 GetRegHeight() const { return nRegHeight; } - sal_uInt16 GetRegAscent() const { return nRegAscent; } - void SetRegHeight( sal_uInt16 nNew ){ nRegHeight = nNew; } - void SetRegAscent( sal_uInt16 nNew ){ nRegAscent = nNew; } + sal_uInt16 GetRegHeight() const { return m_nRegHeight; } + sal_uInt16 GetRegAscent() const { return m_nRegAscent; } + void SetRegHeight(sal_uInt16 const nNew) { m_nRegHeight = nNew; } + void SetRegAscent(sal_uInt16 const nNew) { m_nRegAscent = nNew; } inline void SetFollow( const SwPageDesc* pNew ); - const SwPageDesc* GetFollow() const { return pFollow; } - SwPageDesc* GetFollow() { return pFollow; } + const SwPageDesc* GetFollow() const { return m_pFollow; } + SwPageDesc* GetFollow() { return m_pFollow; } void SetRegisterFmtColl( const SwTxtFmtColl* rFmt ); const SwTxtFmtColl* GetRegisterFmtColl() const; void RegisterChange(); /// Query and set PoolFormat-Id. - sal_uInt16 GetPoolFmtId() const { return aMaster.GetPoolFmtId(); } - void SetPoolFmtId( sal_uInt16 nId ) { aMaster.SetPoolFmtId( nId ); } - sal_uInt16 GetPoolHelpId() const { return aMaster.GetPoolHelpId(); } - void SetPoolHelpId( sal_uInt16 nId ) { aMaster.SetPoolHelpId( nId ); } - sal_uInt8 GetPoolHlpFileId() const { return aMaster.GetPoolHlpFileId(); } - void SetPoolHlpFileId( sal_uInt8 nId ) { aMaster.SetPoolHlpFileId( nId ); } + sal_uInt16 GetPoolFmtId() const { return m_Master.GetPoolFmtId(); } + void SetPoolFmtId(sal_uInt16 const nId) { m_Master.SetPoolFmtId(nId); } + sal_uInt16 GetPoolHelpId() const { return m_Master.GetPoolHelpId(); } + void SetPoolHelpId(sal_uInt16 const nId){ m_Master.SetPoolHelpId(nId); } + sal_uInt8 GetPoolHlpFileId() const { return m_Master.GetPoolHlpFileId(); } + void SetPoolHlpFileId(sal_uInt8 const nId) { m_Master.SetPoolHlpFileId(nId); } /// Query information from Client. virtual bool GetInfo( SfxPoolItem& ) const SAL_OVERRIDE; @@ -254,46 +254,46 @@ public: inline void SwPageDesc::SetFollow( const SwPageDesc* pNew ) { - pFollow = pNew ? const_cast<SwPageDesc*>(pNew) : this; + m_pFollow = pNew ? const_cast<SwPageDesc*>(pNew) : this; } inline bool SwPageDesc::IsHeaderShared() const { - return (eUse & nsUseOnPage::PD_HEADERSHARE) != 0; + return (m_eUse & nsUseOnPage::PD_HEADERSHARE) != 0; } inline bool SwPageDesc::IsFooterShared() const { - return (eUse & nsUseOnPage::PD_FOOTERSHARE) != 0; + return (m_eUse & nsUseOnPage::PD_FOOTERSHARE) != 0; } inline void SwPageDesc::ChgHeaderShare( bool bNew ) { if ( bNew ) - eUse = (UseOnPage) (eUse | nsUseOnPage::PD_HEADERSHARE); + m_eUse = (UseOnPage) (m_eUse | nsUseOnPage::PD_HEADERSHARE); else - eUse = (UseOnPage) (eUse & nsUseOnPage::PD_NOHEADERSHARE); + m_eUse = (UseOnPage) (m_eUse & nsUseOnPage::PD_NOHEADERSHARE); } inline void SwPageDesc::ChgFooterShare( bool bNew ) { if ( bNew ) - eUse = (UseOnPage) (eUse | nsUseOnPage::PD_FOOTERSHARE); + m_eUse = (UseOnPage) (m_eUse | nsUseOnPage::PD_FOOTERSHARE); else - eUse = (UseOnPage) (eUse & nsUseOnPage::PD_NOFOOTERSHARE); + m_eUse = (UseOnPage) (m_eUse & nsUseOnPage::PD_NOFOOTERSHARE); } inline void SwPageDesc::SetUseOn( UseOnPage eNew ) { UseOnPage eTmp = nsUseOnPage::PD_NONE; - if ( eUse & nsUseOnPage::PD_HEADERSHARE ) + if (m_eUse & nsUseOnPage::PD_HEADERSHARE) eTmp = nsUseOnPage::PD_HEADERSHARE; - if ( eUse & nsUseOnPage::PD_FOOTERSHARE ) + if (m_eUse & nsUseOnPage::PD_FOOTERSHARE) eTmp = (UseOnPage) (eTmp | nsUseOnPage::PD_FOOTERSHARE); - if ( eUse & nsUseOnPage::PD_FIRSTSHARE ) + if (m_eUse & nsUseOnPage::PD_FIRSTSHARE) eTmp = (UseOnPage) (eTmp | nsUseOnPage::PD_FIRSTSHARE); - eUse = (UseOnPage) (eTmp | eNew); + m_eUse = (UseOnPage) (eTmp | eNew); } inline UseOnPage SwPageDesc::GetUseOn() const { - UseOnPage eRet = eUse; + UseOnPage eRet = m_eUse; eRet = (UseOnPage) (eRet & nsUseOnPage::PD_NOHEADERSHARE); eRet = (UseOnPage) (eRet & nsUseOnPage::PD_NOFOOTERSHARE); eRet = (UseOnPage) (eRet & nsUseOnPage::PD_NOFIRSTSHARE); diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 6cc694395523..18147a2e1484 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -487,7 +487,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) } } else - { rDesc.SetFollow( rChged.pFollow ); + { rDesc.SetFollow( rChged.m_pFollow ); bFollow = true; } } diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index e97a3bf8eb7d..a130835dc62c 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -38,61 +38,60 @@ using namespace ::com::sun::star; -SwPageDesc::SwPageDesc( const OUString& rName, SwFrmFmt *pFmt, SwDoc *pDc ) : - SwModify( 0 ), - aDescName( rName ), - aMaster( pDc->GetAttrPool(), rName, pFmt ), - aLeft( pDc->GetAttrPool(), rName, pFmt ), - m_FirstMaster( pDc->GetAttrPool(), rName, pFmt ), - m_FirstLeft( pDc->GetAttrPool(), rName, pFmt ), - aDepend( this, 0 ), - pFollow( this ), - nRegHeight( 0 ), - nRegAscent( 0 ), - eUse( (UseOnPage)(nsUseOnPage::PD_ALL | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE | nsUseOnPage::PD_FIRSTSHARE ) ), - bLandscape( false ), - bHidden( false ), - aFtnInfo() -{ -} - -SwPageDesc::SwPageDesc( const SwPageDesc &rCpy ) : - SwModify( 0 ), - aDescName( rCpy.GetName() ), - aNumType( rCpy.GetNumType() ), - aMaster( rCpy.GetMaster() ), - aLeft( rCpy.GetLeft() ), - m_FirstMaster( rCpy.GetFirstMaster() ), - m_FirstLeft( rCpy.GetFirstLeft() ), - aDepend( this, const_cast<SwModify*>(rCpy.aDepend.GetRegisteredIn()) ), - pFollow( rCpy.pFollow ), - nRegHeight( rCpy.GetRegHeight() ), - nRegAscent( rCpy.GetRegAscent() ), - eUse( rCpy.ReadUseOn() ), - bLandscape( rCpy.GetLandscape() ), - bHidden( rCpy.IsHidden() ), - aFtnInfo( rCpy.GetFtnInfo() ) +SwPageDesc::SwPageDesc(const OUString& rName, SwFrmFmt *pFmt, SwDoc *const pDoc) + : SwModify(nullptr) + , m_StyleName( rName ) + , m_Master( pDoc->GetAttrPool(), rName, pFmt ) + , m_Left( pDoc->GetAttrPool(), rName, pFmt ) + , m_FirstMaster( pDoc->GetAttrPool(), rName, pFmt ) + , m_FirstLeft( pDoc->GetAttrPool(), rName, pFmt ) + , m_Depend( this, 0 ) + , m_pFollow( this ) + , m_nRegHeight( 0 ) + , m_nRegAscent( 0 ) + , m_eUse( (UseOnPage)(nsUseOnPage::PD_ALL | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE | nsUseOnPage::PD_FIRSTSHARE) ) + , m_IsLandscape( false ) + , m_IsHidden( false ) +{ +} + +SwPageDesc::SwPageDesc( const SwPageDesc &rCpy ) + : SwModify(nullptr) + , m_StyleName( rCpy.GetName() ) + , m_NumType( rCpy.GetNumType() ) + , m_Master( rCpy.GetMaster() ) + , m_Left( rCpy.GetLeft() ) + , m_FirstMaster( rCpy.GetFirstMaster() ) + , m_FirstLeft( rCpy.GetFirstLeft() ) + , m_Depend( this, const_cast<SwModify*>(rCpy.m_Depend.GetRegisteredIn()) ) + , m_pFollow( rCpy.m_pFollow ) + , m_nRegHeight( rCpy.GetRegHeight() ) + , m_nRegAscent( rCpy.GetRegAscent() ) + , m_eUse( rCpy.ReadUseOn() ) + , m_IsLandscape( rCpy.GetLandscape() ) + , m_IsHidden( rCpy.IsHidden() ) + , m_IsFtnInfo( rCpy.GetFtnInfo() ) { } SwPageDesc & SwPageDesc::operator = (const SwPageDesc & rSrc) { - aDescName = rSrc.aDescName; - aNumType = rSrc.aNumType; - aMaster = rSrc.aMaster; - aLeft = rSrc.aLeft; + m_StyleName = rSrc.m_StyleName; + m_NumType = rSrc.m_NumType; + m_Master = rSrc.m_Master; + m_Left = rSrc.m_Left; m_FirstMaster = rSrc.m_FirstMaster; m_FirstLeft = rSrc.m_FirstLeft; - if (rSrc.pFollow == &rSrc) - pFollow = this; + if (rSrc.m_pFollow == &rSrc) + m_pFollow = this; else - pFollow = rSrc.pFollow; + m_pFollow = rSrc.m_pFollow; - nRegHeight = rSrc.nRegHeight; - nRegAscent = rSrc.nRegAscent; - eUse = rSrc.eUse; - bLandscape = rSrc.bLandscape; + m_nRegHeight = rSrc.m_nRegHeight; + m_nRegAscent = rSrc.m_nRegAscent; + m_eUse = rSrc.m_eUse; + m_IsLandscape = rSrc.m_IsLandscape; return *this; } @@ -106,22 +105,22 @@ void SwPageDesc::Mirror() { //Only the margins are mirrored, all other values are just copied. SvxLRSpaceItem aLR( RES_LR_SPACE ); - const SvxLRSpaceItem &rLR = aMaster.GetLRSpace(); + const SvxLRSpaceItem &rLR = m_Master.GetLRSpace(); aLR.SetLeft( rLR.GetRight() ); aLR.SetRight( rLR.GetLeft() ); - SfxItemSet aSet( *aMaster.GetAttrSet().GetPool(), - aMaster.GetAttrSet().GetRanges() ); + SfxItemSet aSet( *m_Master.GetAttrSet().GetPool(), + m_Master.GetAttrSet().GetRanges() ); aSet.Put( aLR ); - aSet.Put( aMaster.GetFrmSize() ); - aSet.Put( aMaster.GetPaperBin() ); - aSet.Put( aMaster.GetULSpace() ); - aSet.Put( aMaster.GetBox() ); - aSet.Put( aMaster.makeBackgroundBrushItem() ); - aSet.Put( aMaster.GetShadow() ); - aSet.Put( aMaster.GetCol() ); - aSet.Put( aMaster.GetFrmDir() ); // #112217# - aLeft.SetFmtAttr( aSet ); + aSet.Put( m_Master.GetFrmSize() ); + aSet.Put( m_Master.GetPaperBin() ); + aSet.Put( m_Master.GetULSpace() ); + aSet.Put( m_Master.GetBox() ); + aSet.Put( m_Master.makeBackgroundBrushItem() ); + aSet.Put( m_Master.GetShadow() ); + aSet.Put( m_Master.GetCol() ); + aSet.Put( m_Master.GetFrmDir() ); // #112217# + m_Left.SetFmtAttr( aSet ); } void SwPageDesc::ResetAllAttr( bool bLeft ) @@ -136,9 +135,9 @@ void SwPageDesc::ResetAllAttr( bool bLeft ) // gets information from Modify bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const { - if( !aMaster.GetInfo( rInfo ) ) + if (!m_Master.GetInfo(rInfo)) return false; // found - if ( !aLeft.GetInfo( rInfo ) ) + if (!m_Left.GetInfo(rInfo)) return false ; if ( !m_FirstMaster.GetInfo( rInfo ) ) return false; @@ -151,9 +150,9 @@ void SwPageDesc::SetRegisterFmtColl( const SwTxtFmtColl* pFmt ) if( pFmt != GetRegisterFmtColl() ) { if( pFmt ) - const_cast<SwTxtFmtColl*>(pFmt)->Add( &aDepend ); + const_cast<SwTxtFmtColl*>(pFmt)->Add(&m_Depend); else - const_cast<SwTxtFmtColl*>(GetRegisterFmtColl())->Remove( &aDepend ); + const_cast<SwTxtFmtColl*>(GetRegisterFmtColl())->Remove(&m_Depend); RegisterChange(); } @@ -162,7 +161,7 @@ void SwPageDesc::SetRegisterFmtColl( const SwTxtFmtColl* pFmt ) /// retrieve the style for the grid alignment const SwTxtFmtColl* SwPageDesc::GetRegisterFmtColl() const { - const SwModify* pReg = aDepend.GetRegisteredIn(); + const SwModify* pReg = m_Depend.GetRegisteredIn(); return static_cast<const SwTxtFmtColl*>(pReg); } @@ -183,7 +182,7 @@ void SwPageDesc::RegisterChange() return; } - nRegHeight = 0; + m_nRegHeight = 0; { SwIterator<SwFrm,SwFmt> aIter( GetMaster() ); for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) @@ -305,29 +304,29 @@ bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const SwFrmFmt *SwPageDesc::GetLeftFmt(bool const bFirst) { - return (nsUseOnPage::PD_LEFT & eUse) - ? ((bFirst) ? &m_FirstLeft : &aLeft) + return (nsUseOnPage::PD_LEFT & m_eUse) + ? ((bFirst) ? &m_FirstLeft : &m_Left) : 0; } SwFrmFmt *SwPageDesc::GetRightFmt(bool const bFirst) { - return (nsUseOnPage::PD_RIGHT & eUse) - ? ((bFirst) ? &m_FirstMaster : &aMaster) + return (nsUseOnPage::PD_RIGHT & m_eUse) + ? ((bFirst) ? &m_FirstMaster : &m_Master) : 0; } bool SwPageDesc::IsFirstShared() const { - return (eUse & nsUseOnPage::PD_FIRSTSHARE) != 0; + return (m_eUse & nsUseOnPage::PD_FIRSTSHARE) != 0; } void SwPageDesc::ChgFirstShare( bool bNew ) { if ( bNew ) - eUse = (UseOnPage) (eUse | nsUseOnPage::PD_FIRSTSHARE); + m_eUse = (UseOnPage) (m_eUse | nsUseOnPage::PD_FIRSTSHARE); else - eUse = (UseOnPage) (eUse & nsUseOnPage::PD_NOFIRSTSHARE); + m_eUse = (UseOnPage) (m_eUse & nsUseOnPage::PD_NOFIRSTSHARE); } SwPageDesc* SwPageDesc::GetByName(SwDoc& rDoc, const OUString& rName) |