sw/source/core/doc/notxtfrm.cxx | 2 - sw/source/core/inc/frame.hxx | 54 ++++++++++++-------------------------- sw/source/core/inc/hffrm.hxx | 4 +- sw/source/core/inc/layfrm.hxx | 4 +- sw/source/core/layout/colfrm.cxx | 2 - sw/source/core/layout/fly.cxx | 2 - sw/source/core/layout/ftnfrm.cxx | 4 +- sw/source/core/layout/hffrm.cxx | 2 - sw/source/core/layout/newfrm.cxx | 2 - sw/source/core/layout/pagechg.cxx | 4 +- sw/source/core/layout/sectfrm.cxx | 4 +- sw/source/core/layout/tabfrm.cxx | 8 ++--- sw/source/core/layout/wsfrm.cxx | 2 - sw/source/core/text/txtfrm.cxx | 2 - 14 files changed, 39 insertions(+), 57 deletions(-)
New commits: commit b3b4bbaf6cbd2226b659fea7d6ae473ccf84e9dd Author: Noel Grandin <n...@peralex.com> Date: Fri Jan 9 14:06:24 2015 +0200 remove FRMC_ #defines using a compressed 4-bit representation of an existing flagset is a pointless opimisation when the structure has half a dozen pointers in it. Change-Id: I17522c2d6c5f32c803183f3518d8711503bd9994 diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index c296fc9..07c9772 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -152,7 +152,7 @@ SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode, SwFrm* pSib ) /// Initialization: Currently add the Frame to the Cache void SwNoTxtFrm::InitCtor() { - mnType = FRMC_NOTXT; + mnFrmType = FRM_NOTXT; } SwCntntFrm *SwNoTxtNode::MakeFrm( SwFrm* pSib ) diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index de0d1b2..0df4434 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -89,25 +89,6 @@ typedef struct _xmlTextWriter *xmlTextWriterPtr; #define FRM_FTNBOSS 0x0006 #define FRM_ACCESSIBLE (FRM_HEADER|FRM_FOOTER|FRM_FTN|FRM_TXT|FRM_ROOT|FRM_FLY|FRM_TAB|FRM_CELL|FRM_PAGE) -// The type of the frame is internal represented by the 4-bit value mnType, -// which can expanded to the types above by shifting a bit (0x1 << mnType) -// Here are the corresponding defines for the compressed representation: -#define FRMC_ROOT 0 -#define FRMC_PAGE 1 -#define FRMC_COLUMN 2 -#define FRMC_HEADER 3 -#define FRMC_FOOTER 4 -#define FRMC_FTNCONT 5 -#define FRMC_FTN 6 -#define FRMC_BODY 7 -#define FRMC_FLY 8 -#define FRMC_SECTION 9 -#define FRMC_TAB 11 -#define FRMC_ROW 12 -#define FRMC_CELL 13 -#define FRMC_TXT 14 -#define FRMC_NOTXT 15 - #define FRM_NEIGHBOUR 0x2004 #define FRM_NOTE_VERT 0x7a60 #define FRM_HEADFOOT 0x0018 @@ -344,6 +325,8 @@ protected: SwRect maFrm; // absolute position in document and size of the Frm SwRect maPrt; // position relatively to Frm and size of PrtArea + sal_uInt16 mnFrmType; //Who am I? + bool mbReverse : 1; // Next line above/at the right side instead // under/at the left side of the previous line bool mbInvalidR2L : 1; @@ -354,7 +337,6 @@ protected: bool mbVertical : 1; bool mbVertLR : 1; - sal_uInt16 mnType : 4; //Who am I? bool mbValidPos : 1; bool mbValidPrtArea : 1; @@ -443,7 +425,7 @@ public: TYPEINFO_OVERRIDE(); // already in base class - sal_uInt16 GetType() const { return 0x1 << mnType; } + sal_uInt16 GetType() const { return mnFrmType; } static SwCache &GetCache() { return *mpCache; } static SwCache *GetCachePtr() { return mpCache; } @@ -1102,15 +1084,15 @@ inline bool SwFrm::IsLayoutFrm() const } inline bool SwFrm::IsRootFrm() const { - return mnType == FRMC_ROOT; + return mnFrmType == FRM_ROOT; } inline bool SwFrm::IsPageFrm() const { - return mnType == FRMC_PAGE; + return mnFrmType == FRM_PAGE; } inline bool SwFrm::IsColumnFrm() const { - return mnType == FRMC_COLUMN; + return mnFrmType == FRM_COLUMN; } inline bool SwFrm::IsFtnBossFrm() const { @@ -1118,43 +1100,43 @@ inline bool SwFrm::IsFtnBossFrm() const } inline bool SwFrm::IsHeaderFrm() const { - return mnType == FRMC_HEADER; + return mnFrmType == FRM_HEADER; } inline bool SwFrm::IsFooterFrm() const { - return mnType == FRMC_FOOTER; + return mnFrmType == FRM_FOOTER; } inline bool SwFrm::IsFtnContFrm() const { - return mnType == FRMC_FTNCONT; + return mnFrmType == FRM_FTNCONT; } inline bool SwFrm::IsFtnFrm() const { - return mnType == FRMC_FTN; + return mnFrmType == FRM_FTN; } inline bool SwFrm::IsBodyFrm() const { - return mnType == FRMC_BODY; + return mnFrmType == FRM_BODY; } inline bool SwFrm::IsFlyFrm() const { - return mnType == FRMC_FLY; + return mnFrmType == FRM_FLY; } inline bool SwFrm::IsSctFrm() const { - return mnType == FRMC_SECTION; + return mnFrmType == FRM_SECTION; } inline bool SwFrm::IsTabFrm() const { - return mnType == FRMC_TAB; + return mnFrmType == FRM_TAB; } inline bool SwFrm::IsRowFrm() const { - return mnType == FRMC_ROW; + return mnFrmType == FRM_ROW; } inline bool SwFrm::IsCellFrm() const { - return mnType == FRMC_CELL; + return mnFrmType == FRM_CELL; } inline bool SwFrm::IsCntntFrm() const { @@ -1162,11 +1144,11 @@ inline bool SwFrm::IsCntntFrm() const } inline bool SwFrm::IsTxtFrm() const { - return mnType == FRMC_TXT; + return mnFrmType == FRM_TXT; } inline bool SwFrm::IsNoTxtFrm() const { - return mnType == FRMC_NOTXT; + return mnFrmType == FRM_NOTXT; } inline bool SwFrm::IsFlowFrm() const { diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx index 650113c..e9e3096 100644 --- a/sw/source/core/inc/hffrm.hxx +++ b/sw/source/core/inc/hffrm.hxx @@ -44,7 +44,7 @@ public: class SwHeaderFrm: public SwHeadFootFrm { public: - SwHeaderFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRMC_HEADER) {}; + SwHeaderFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRM_HEADER) {}; DECL_FIXEDMEMPOOL_NEWDEL(SwHeaderFrm) }; @@ -53,7 +53,7 @@ public: class SwFooterFrm: public SwHeadFootFrm { public: - SwFooterFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRMC_FOOTER) {}; + SwFooterFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRM_FOOTER) {}; DECL_FIXEDMEMPOOL_NEWDEL(SwFooterFrm) }; diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx index fa16b14..2488f99 100644 --- a/sw/source/core/inc/layfrm.hxx +++ b/sw/source/core/inc/layfrm.hxx @@ -214,12 +214,12 @@ inline SwFrm* SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections ) */ inline bool SwFrm::IsColBodyFrm() const { - return mnType == FRMC_BODY && GetUpper()->IsColumnFrm(); + return mnFrmType == FRM_BODY && GetUpper()->IsColumnFrm(); } inline bool SwFrm::IsPageBodyFrm() const { - return mnType == FRMC_BODY && GetUpper()->IsPageFrm(); + return mnFrmType == FRM_BODY && GetUpper()->IsPageFrm(); } inline SwFrm* SwLayoutFrm::GetLastLower() diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index fae9adf..b0823d3 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -35,7 +35,7 @@ SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt, SwFrm* pSib ): SwFtnBossFrm( pFmt, pSib ) { - mnType = FRMC_COLUMN; + mnFrmType = FRM_COLUMN; SwBodyFrm* pColBody = new SwBodyFrm( pFmt->GetDoc()->GetDfltFrmFmt(), pSib ); pColBody->InsertBehind( this, 0 ); // ColumnFrms now with BodyFrm SetMaxFtnHeight( LONG_MAX ); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index ddec469..3743a33 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -81,7 +81,7 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) : bLockDeleteContent( false ), m_bValidContentPos( false ) { - mnType = FRMC_FLY; + mnFrmType = FRM_FLY; bInvalid = bNotifyBack = true; bLocked = bMinHeight = diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 8f9f8c8..880cc9b 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -145,7 +145,7 @@ static sal_uInt16 lcl_ColumnNum( const SwFrm* pBoss ) SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt, SwFrm* pSib ): SwLayoutFrm( pFmt, pSib ) { - mnType = FRMC_FTNCONT; + mnFrmType = FRM_FTNCONT; } @@ -427,7 +427,7 @@ SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwCntntFrm *pCnt, SwTxtFtn *pAt // #i49383# mbUnlockPosOfLowerObjs( true ) { - mnType = FRMC_FTN; + mnFrmType = FRM_FTN; } void SwFtnFrm::InvalidateNxtFtnCnts( SwPageFrm *pPage ) diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 2b08f30..9e4f1ee 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -96,7 +96,7 @@ static void lcl_LayoutFrmEnsureMinHeight(SwLayoutFrm & rFrm, SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, SwFrm* pSib, sal_uInt16 nTypeIn) : SwLayoutFrm( pFmt, pSib ) { - mnType = nTypeIn; + mnFrmType = nTypeIn; SetDerivedVert( false ); const SwFmtCntnt &rCnt = pFmt->GetCntnt(); diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 041267a..58dabc8 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -469,7 +469,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, SwViewShell * pSh ) : nPhyPageNums( 0 ), nAccessibleShells( 0 ) { - mnType = FRMC_ROOT; + mnFrmType = FRM_ROOT; setRootFrm( this ); } diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 427213e..062d7c5 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -61,7 +61,7 @@ using namespace ::com::sun::star; SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt, SwFrm* pSib ): SwLayoutFrm( pFmt, pSib ) { - mnType = FRMC_BODY; + mnFrmType = FRM_BODY; } void SwBodyFrm::Format( const SwBorderAttrs * ) @@ -170,7 +170,7 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwPageDesc *pPgDsc ) : bHasGrid = false; SetMaxFtnHeight( pPgDsc->GetFtnInfo().GetHeight() ? pPgDsc->GetFtnInfo().GetHeight() : LONG_MAX ), - mnType = FRMC_PAGE; + mnFrmType = FRM_PAGE; bInvalidLayout = bInvalidCntnt = bInvalidSpelling = bInvalidSmartTags = bInvalidAutoCmplWrds = bInvalidWordCount = true; bInvalidFlyLayout = bInvalidFlyCntnt = bInvalidFlyInCnt = bFtnPage = bEndNotePage = false; diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 53a50b8..f0a6c85 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -50,7 +50,7 @@ SwSectionFrm::SwSectionFrm( SwSection &rSect, SwFrm* pSib ) , bOwnFtnNum(false) , bFtnLock(false) { - mnType = FRMC_SECTION; + mnFrmType = FRM_SECTION; CalcFtnAtEndFlag(); CalcEndAtEndFlag(); @@ -66,7 +66,7 @@ SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, bool bMaster ) : bOwnFtnNum( false ), bFtnLock( false ) { - mnType = FRMC_SECTION; + mnFrmType = FRM_SECTION; PROTOCOL( this, PROT_SECTION, bMaster ? ACT_CREATE_MASTER : ACT_CREATE_FOLLOW, &rSect ) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 84a3de1..705411b 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -77,7 +77,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ) , m_bInRecalcLowerRow(false) { mbFixSize = false; //Don't fall for import filter again. - mnType = FRMC_TAB; + mnFrmType = FRM_TAB; //Create the lines and insert them. const SwTableLines &rLines = rTab.GetTabLines(); @@ -115,7 +115,7 @@ SwTabFrm::SwTabFrm( SwTabFrm &rTab ) , m_bInRecalcLowerRow(false) { mbFixSize = false; //Don't fall for import filter again. - mnType = FRMC_TAB; + mnFrmType = FRM_TAB; SetFollow( rTab.GetFollow() ); rTab.SetFollow( this ); @@ -3506,7 +3506,7 @@ SwRowFrm::SwRowFrm(const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent) , m_bIsRepeatedHeadline( false ) , m_bIsRowSpanLine( false ) { - mnType = FRMC_ROW; + mnFrmType = FRM_ROW; //Create the boxes and insert them. const SwTableBoxes &rBoxes = rLine.GetTabBoxes(); @@ -4384,7 +4384,7 @@ SwCellFrm::SwCellFrm(const SwTableBox &rBox, SwFrm* pSib, bool bInsertContent) : SwLayoutFrm( rBox.GetFrmFmt(), pSib ) , m_pTabBox( &rBox ) { - mnType = FRMC_CELL; + mnFrmType = FRM_CELL; if ( !bInsertContent ) return; diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index a6e3cbf..ada2e1e 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -63,7 +63,7 @@ SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) : mpNext( 0 ), mpPrev( 0 ), mpDrawObjs( 0 ), - mnType(0), + mnFrmType(0), mbInfBody( false ), mbInfTab ( false ), mbInfFly ( false ), diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index bfe74b5..5b379f3 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -373,7 +373,7 @@ SwTxtFrm::SwTxtFrm(SwTxtNode * const pNode, SwFrm* pSib ) , bIsSwapped( false ) , mbFollowFormatAllowed( true ) // OD 14.03.2003 #i11760# { - mnType = FRMC_TXT; + mnFrmType = FRM_TXT; } SwTxtFrm::~SwTxtFrm() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits