From c963d7e642c24f40c19fb9dc227db5da96728c12 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 17 Jan 2014 17:11:45 +0100 Subject: bool improvements Change-Id: I9324483db587be43238af79c2148d724397a4622 --- sw/inc/PostItMgr.hxx | 2 +- sw/inc/edglbldc.hxx | 4 +- sw/inc/fmtcol.hxx | 4 +- sw/inc/ndarr.hxx | 8 +- sw/inc/ndhints.hxx | 4 +- sw/inc/node.hxx | 4 +- sw/inc/redline.hxx | 22 +- sw/inc/swatrset.hxx | 4 +- sw/inc/swcrsr.hxx | 2 +- sw/inc/swevent.hxx | 4 +- sw/inc/txatbase.hxx | 2 +- sw/source/core/attr/format.cxx | 6 +- sw/source/core/attr/swatrset.cxx | 8 +- sw/source/core/crsr/crsrsh.cxx | 2 +- sw/source/core/crsr/findattr.cxx | 34 ++-- sw/source/core/crsr/findcoll.cxx | 4 +- sw/source/core/crsr/findtxt.cxx | 4 +- sw/source/core/crsr/swcrsr.cxx | 8 +- sw/source/core/doc/docbm.cxx | 4 +- sw/source/core/doc/doccomp.cxx | 8 +- sw/source/core/doc/docedt.cxx | 6 +- sw/source/core/doc/docfld.cxx | 2 +- sw/source/core/doc/docnum.cxx | 2 +- sw/source/core/doc/docredln.cxx | 32 +-- sw/source/core/doc/doctxm.cxx | 12 +- sw/source/core/doc/fmtcol.cxx | 12 +- sw/source/core/doc/swserv.cxx | 4 +- sw/source/core/doc/tblrwcl.cxx | 20 +- sw/source/core/docnode/ndcopy.cxx | 2 +- sw/source/core/docnode/ndtbl.cxx | 2 +- sw/source/core/docnode/ndtbl1.cxx | 12 +- sw/source/core/docnode/node.cxx | 24 +-- sw/source/core/docnode/nodes.cxx | 8 +- sw/source/core/docnode/swbaslnk.cxx | 2 +- sw/source/core/draw/drawdoc.cxx | 2 +- sw/source/core/fields/authfld.cxx | 4 +- sw/source/core/graphic/ndgrf.cxx | 2 +- sw/source/core/inc/UndoManager.hxx | 2 +- sw/source/core/inc/docfld.hxx | 2 +- sw/source/core/inc/mvsave.hxx | 4 +- sw/source/core/inc/rolbck.hxx | 2 +- sw/source/core/layout/frmtool.cxx | 2 +- sw/source/core/layout/tabfrm.cxx | 2 +- sw/source/core/table/swtable.cxx | 2 +- sw/source/core/txtnode/txatbase.cxx | 2 +- sw/source/core/txtnode/txtatr2.cxx | 2 +- sw/source/core/txtnode/txtedt.cxx | 12 +- sw/source/core/undo/rolbck.cxx | 2 +- sw/source/core/unocore/unoframe.cxx | 4 +- sw/source/filter/ascii/parasc.cxx | 4 +- sw/source/filter/basflt/iodetect.cxx | 8 +- sw/source/filter/basflt/shellio.cxx | 2 +- sw/source/filter/html/htmlatr.cxx | 2 +- sw/source/filter/html/swhtml.cxx | 4 +- sw/source/filter/html/swhtml.hxx | 2 +- sw/source/filter/inc/wrtswtbl.hxx | 16 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 2 +- sw/source/filter/ww8/wrtw8sty.cxx | 2 +- sw/source/filter/ww8/wrtww8.cxx | 2 +- sw/source/filter/ww8/wrtww8.hxx | 2 +- sw/source/filter/ww8/ww8graf2.cxx | 2 +- sw/source/filter/ww8/ww8par2.cxx | 2 +- sw/source/filter/ww8/ww8par6.cxx | 10 +- sw/source/filter/ww8/ww8scan.cxx | 8 +- sw/source/filter/ww8/ww8scan.hxx | 306 ++++++++++++++-------------- sw/source/filter/ww8/ww8struc.hxx | 24 +-- sw/source/ui/app/docst.cxx | 2 +- sw/source/ui/app/docstyle.cxx | 2 +- sw/source/ui/dbui/dbinsdlg.cxx | 2 +- sw/source/ui/dbui/dbmgr.cxx | 2 +- sw/source/ui/dialog/uiregionsw.cxx | 4 +- sw/source/ui/dochdl/swdtflvr.cxx | 12 +- sw/source/ui/fldui/flddok.cxx | 2 +- sw/source/ui/inc/dbinsdlg.hxx | 4 +- sw/source/ui/inc/pview.hxx | 2 +- sw/source/ui/inc/swdtflvr.hxx | 8 +- sw/source/ui/inc/wrtsh.hxx | 6 +- sw/source/ui/shells/basesh.cxx | 6 +- sw/source/ui/shells/tabsh.cxx | 2 +- sw/source/ui/shells/textsh1.cxx | 2 +- sw/source/ui/uiview/pview.cxx | 15 +- sw/source/ui/utlui/attrdesc.cxx | 2 +- sw/source/ui/utlui/unotools.cxx | 2 +- sw/source/ui/wrtsh/select.cxx | 6 +- sw/source/ui/wrtsh/wrtsh1.cxx | 2 +- 85 files changed, 400 insertions(+), 405 deletions(-) (limited to 'sw') diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index a87a9ba8c5c0..faf101432635 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -146,7 +146,7 @@ class SwPostItMgr: public SfxListener sw::sidebarwindows::SwSidebarWin* mpActivePostIt; bool mbLayout; long mbLayoutHeight; - long mbLayouting; + bool mbLayouting; bool mbReadOnly; bool mbDeleteNote; FieldShadowState mShadowState; diff --git a/sw/inc/edglbldc.hxx b/sw/inc/edglbldc.hxx index 16cf557396ee..56ecb9b61b92 100644 --- a/sw/inc/edglbldc.hxx +++ b/sw/inc/edglbldc.hxx @@ -54,9 +54,9 @@ public: sal_uLong GetDocPos() const { return nDocPos; } /// For sorting. - inline int operator==( const SwGlblDocContent& rCmp ) const + inline bool operator==( const SwGlblDocContent& rCmp ) const { return GetDocPos() == rCmp.GetDocPos(); } - inline int operator<( const SwGlblDocContent& rCmp ) const + inline bool operator<( const SwGlblDocContent& rCmp ) const { return GetDocPos() < rCmp.GetDocPos(); } }; diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index 0db5c3658313..d973d3903619 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -209,8 +209,8 @@ private: SwCollCondition & operator= (const SwCollCondition &); public: - int operator==( const SwCollCondition& rCmp ) const; - int operator!=( const SwCollCondition& rCmp ) const + bool operator==( const SwCollCondition& rCmp ) const; + bool operator!=( const SwCollCondition& rCmp ) const { return ! (*this == rCmp); } sal_uLong GetCondition() const { return nCondition; } diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index 4e8501f01e52..ad510d6083b8 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -201,10 +201,10 @@ public: /** Go to next content-node that is not protected or hidden (Both set FALSE ==> GoNext/GoPrevious!!!). */ - SwCntntNode* GoNextSection( SwNodeIndex *, int bSkipHidden = sal_True, - int bSkipProtect = sal_True ) const; - SwCntntNode* GoPrevSection( SwNodeIndex *, int bSkipHidden = sal_True, - int bSkipProtect = sal_True ) const; + SwCntntNode* GoNextSection( SwNodeIndex *, bool bSkipHidden = sal_True, + bool bSkipProtect = sal_True ) const; + SwCntntNode* GoPrevSection( SwNodeIndex *, bool bSkipHidden = sal_True, + bool bSkipProtect = sal_True ) const; /** Create an empty section of Start- and EndNote. It may be called only if a new section with content is to be created, diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx index 4230c4969ac1..3800258c602f 100644 --- a/sw/inc/ndhints.hxx +++ b/sw/inc/ndhints.hxx @@ -35,8 +35,8 @@ class SfxItemSet; class SwDoc; typedef enum { - COPY = true, - NEW = false, + COPY = int(true), + NEW = int(false), } CopyOrNew_t; /// if COPY then pTxtNode must be given! diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index ee28196e338a..9dea06353c6f 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -394,8 +394,8 @@ public: virtual SwCntntNode *JoinPrev(); /** Is it possible to join two nodes? In pIdx the second position can be returned. */ - int CanJoinNext( SwNodeIndex* pIdx =0 ) const; - int CanJoinPrev( SwNodeIndex* pIdx =0 ) const; + bool CanJoinNext( SwNodeIndex* pIdx =0 ) const; + bool CanJoinPrev( SwNodeIndex* pIdx =0 ) const; void MakeStartIndex( SwIndex * pIdx ) { pIdx->Assign( this, 0 ); } void MakeEndIndex( SwIndex * pIdx ) { pIdx->Assign( this, Len() ); } diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 73f3884879d9..b946618a5b0d 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -46,7 +46,7 @@ public: virtual void Accept( SwPaM& rPam ) const; virtual void Reject( SwPaM& rPam ) const; - virtual int operator == ( const SwRedlineExtraData& ) const; + virtual bool operator == ( const SwRedlineExtraData& ) const; }; class SwRedlineExtraData_FmtColl : public SwRedlineExtraData @@ -60,7 +60,7 @@ public: virtual ~SwRedlineExtraData_FmtColl(); virtual SwRedlineExtraData* CreateNew() const; virtual void Reject( SwPaM& rPam ) const; - virtual int operator == ( const SwRedlineExtraData& ) const; + virtual bool operator == ( const SwRedlineExtraData& ) const; void SetItemSet( const SfxItemSet& rSet ); }; @@ -76,7 +76,7 @@ public: virtual ~SwRedlineExtraData_Format(); virtual SwRedlineExtraData* CreateNew() const; virtual void Reject( SwPaM& rPam ) const; - virtual int operator == ( const SwRedlineExtraData& ) const; + virtual bool operator == ( const SwRedlineExtraData& ) const; }; /* @@ -98,7 +98,7 @@ public: virtual ~SwRedlineExtraData_FormattingChanges(); virtual SwRedlineExtraData* CreateNew() const; virtual void Reject( SwPaM& rPam ) const; - virtual int operator == ( const SwRedlineExtraData& ) const; + virtual bool operator == ( const SwRedlineExtraData& ) const; SfxItemSet* GetItemSet( ) const; }; @@ -125,7 +125,7 @@ public: ~SwRedlineData(); - int operator==( const SwRedlineData& rCmp ) const + bool operator==( const SwRedlineData& rCmp ) const { return nAuthor == rCmp.nAuthor && eType == rCmp.eType && @@ -136,7 +136,7 @@ public: ( pExtraData && rCmp.pExtraData && *pExtraData == *rCmp.pExtraData )); } - int operator!=( const SwRedlineData& rCmp ) const + bool operator!=( const SwRedlineData& rCmp ) const { return !operator==( rCmp ); } RedlineType_t GetType() const @@ -152,7 +152,7 @@ public: void SetAutoFmtFlag() { eType = (RedlineType_t)(eType | nsRedlineType_t::REDLINE_FORM_AUTOFMT); } - int CanCombine( const SwRedlineData& rCmp ) const + bool CanCombine( const SwRedlineData& rCmp ) const { return nAuthor == rCmp.nAuthor && eType == rCmp.eType && @@ -230,9 +230,9 @@ public: sal_Bool HasValidRange() const; const SwRedlineData& GetRedlineData(sal_uInt16 nPos = 0) const; - int operator==( const SwRedlineData& rCmp ) const + bool operator==( const SwRedlineData& rCmp ) const { return *pRedlineData == rCmp; } - int operator!=( const SwRedlineData& rCmp ) const + bool operator!=( const SwRedlineData& rCmp ) const { return *pRedlineData != rCmp; } void SetAutoFmtFlag() { pRedlineData->SetAutoFmtFlag(); } @@ -295,8 +295,8 @@ public: */ OUString GetDescr(sal_uInt16 nPos = 0); - int operator==( const SwRangeRedline& ) const; - int operator<( const SwRangeRedline& ) const; + bool operator==( const SwRangeRedline& ) const; + bool operator<( const SwRangeRedline& ) const; }; class SW_DLLPUBLIC SwRedlineHint : public SfxHint diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx index 4e20e75ba393..72e77cfffbc5 100644 --- a/sw/inc/swatrset.hxx +++ b/sw/inc/swatrset.hxx @@ -178,8 +178,8 @@ public: virtual SfxItemSet* Clone(sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0) const; - int Put_BC( const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew ); - int Put_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ); + bool Put_BC( const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew ); + bool Put_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ); // Delete an item or a range. sal_uInt16 ClearItem_BC( sal_uInt16 nWhich, SwAttrSet* pOld, SwAttrSet* pNew ); diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 69f476ac72d6..d2ce2bdee566 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -42,7 +42,7 @@ const int FIND_NO_RING = 2; struct SwFindParas { virtual int Find( SwPaM*, SwMoveFn, const SwPaM*, sal_Bool ) = 0; - virtual int IsReplaceMode() const = 0; + virtual bool IsReplaceMode() const = 0; protected: ~SwFindParas() {} diff --git a/sw/inc/swevent.hxx b/sw/inc/swevent.hxx index 8bb787ef5ca3..e89c89e73755 100644 --- a/sw/inc/swevent.hxx +++ b/sw/inc/swevent.hxx @@ -99,13 +99,13 @@ struct SwCallMouseEvent void Set( const SwFmtINetFmt* pINetAttr ) { eType = EVENT_OBJECT_INETATTR; PTR.pINetAttr = pINetAttr; PTR.IMAP.pIMapObj = 0; } - int operator==( const SwCallMouseEvent& rEvent ) const + bool operator==( const SwCallMouseEvent& rEvent ) const { return eType == rEvent.eType && PTR.pFmt == rEvent.PTR.pFmt && PTR.IMAP.pIMapObj == rEvent.PTR.IMAP.pIMapObj; } - int operator!=( const SwCallMouseEvent& rEvent ) const + bool operator!=( const SwCallMouseEvent& rEvent ) const { return !( *this == rEvent ); } void Clear() diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx index fb274bc68b12..603b45618aac 100644 --- a/sw/inc/txatbase.hxx +++ b/sw/inc/txatbase.hxx @@ -108,7 +108,7 @@ public: inline SfxPoolItem& GetAttr(); inline sal_uInt16 Which() const { return GetAttr().Which(); } - virtual int operator==( const SwTxtAttr& ) const; + virtual bool operator==( const SwTxtAttr& ) const; inline const SwFmtCharFmt &GetCharFmt() const; inline const SwFmtAutoFmt &GetAutoFmt() const; diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index e5b019ce53f9..025faf79a9cc 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -196,7 +196,7 @@ void SwFmt::CopyAttrs( const SwFmt& rFmt, sal_Bool bReplace ) SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), aNew( *aSet.GetPool(), aSet.GetRanges() ); - if ( 0 != aSet.Put_BC( *pChgSet, &aOld, &aNew ) ) + if ( aSet.Put_BC( *pChgSet, &aOld, &aNew ) ) { // a few special treatments for attributes aSet.SetModifyAtAttr( this ); @@ -412,7 +412,7 @@ bool SwFmt::SetFmtAttr( const SfxPoolItem& rAttr ) SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), aNew( *aSet.GetPool(), aSet.GetRanges() ); - bRet = 0 != aSet.Put_BC( rAttr, &aOld, &aNew ); + bRet = aSet.Put_BC( rAttr, &aOld, &aNew ); if( bRet ) { // some special treatments for attributes @@ -459,7 +459,7 @@ bool SwFmt::SetFmtAttr( const SfxItemSet& rSet ) { SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), aNew( *aSet.GetPool(), aSet.GetRanges() ); - bRet = 0 != aSet.Put_BC( rSet, &aOld, &aNew ); + bRet = aSet.Put_BC( rSet, &aOld, &aNew ); if( bRet ) { // some special treatments for attributes diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index 4bce88845fac..9f41cd6a7df0 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -111,23 +111,23 @@ SfxItemSet* SwAttrSet::Clone( sal_Bool bItems, SfxItemPool *pToPool ) const : new SwAttrSet( *GetPool(), GetRanges() ); } -int SwAttrSet::Put_BC( const SfxPoolItem& rAttr, +bool SwAttrSet::Put_BC( const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew ) { pNewSet = pNew; pOldSet = pOld; - int nRet = 0 != SfxItemSet::Put( rAttr ); + bool nRet = 0 != SfxItemSet::Put( rAttr ); pOldSet = pNewSet = 0; return nRet; } -int SwAttrSet::Put_BC( const SfxItemSet& rSet, +bool SwAttrSet::Put_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ) { pNewSet = pNew; pOldSet = pOld; - int nRet = 0 != SfxItemSet::Put( rSet ); + bool nRet = 0 != SfxItemSet::Put( rSet ); pOldSet = pNewSet = 0; return nRet; } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index f6988d8159d2..d4e1987709a8 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -2838,7 +2838,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText ) ( !IsReadOnlyAvailable() && pSectNd->GetSection().IsProtectFlag() )) ) { - typedef SwCntntNode* (SwNodes:: *FNGoSection)( SwNodeIndex *, int, int ) const; + typedef SwCntntNode* (SwNodes:: *FNGoSection)( SwNodeIndex *, bool, bool ) const; FNGoSection funcGoSection = &SwNodes::GoNextSection; bOk = sal_False; diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 3393fb409530..1aade536a9bf 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -49,7 +49,7 @@ using namespace ::com::sun::star::util; typedef std::set SwpFmts; // Special case for SvxFontItem: only compare the name -int CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 ) +bool CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 ) { switch( rItem1.Which() ) { @@ -196,15 +196,15 @@ class SwAttrCheckArr sal_Bool bForward; public: - SwAttrCheckArr( const SfxItemSet& rSet, int bForward, int bNoCollections ); + SwAttrCheckArr( const SfxItemSet& rSet, bool bForward, bool bNoCollections ); ~SwAttrCheckArr(); void SetNewSet( const SwTxtNode& rTxtNd, const SwPaM& rPam ); /// how many attributes are there in total? sal_uInt16 Count() const { return aCmpSet.Count(); } - int Found() const { return nFound == aCmpSet.Count(); } - int CheckStack(); + bool Found() const { return nFound == aCmpSet.Count(); } + bool CheckStack(); sal_Int32 Start() const; sal_Int32 End() const; @@ -212,17 +212,17 @@ public: sal_Int32 GetNdStt() const { return nNdStt; } sal_Int32 GetNdEnd() const { return nNdEnd; } - int SetAttrFwd( const SwTxtAttr& rAttr ); - int SetAttrBwd( const SwTxtAttr& rAttr ); + bool SetAttrFwd( const SwTxtAttr& rAttr ); + bool SetAttrBwd( const SwTxtAttr& rAttr ); }; -SwAttrCheckArr::SwAttrCheckArr( const SfxItemSet& rSet, int bFwd, - int bNoCollections ) +SwAttrCheckArr::SwAttrCheckArr( const SfxItemSet& rSet, bool bFwd, + bool bNoCollections ) : aCmpSet( *rSet.GetPool(), RES_CHRATR_BEGIN, RES_TXTATR_END-1 ) { aCmpSet.Put( rSet, sal_False ); - bNoColls = 0 != bNoCollections; - bForward = 0 != bFwd; + bNoColls = bNoCollections; + bForward = bFwd; // determine area of Fnd/Stack array (Min/Max) SfxItemIter aIter( aCmpSet ); @@ -324,7 +324,7 @@ lcl_IsAttributeIgnorable(sal_Int32 const nNdStart, sal_Int32 const nNdEnd, : ((rTmp.nEnd <= nNdStart) || (nNdEnd <= rTmp.nStt))); } -int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) +bool SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) { _SwSrchChrAttr aTmp( rAttr.GetAttr(), *rAttr.GetStart(), *rAttr.GetAnyEnd() ); @@ -477,7 +477,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) return Found(); } -int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) +bool SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) { _SwSrchChrAttr aTmp( rAttr.GetAttr(), *rAttr.GetStart(), *rAttr.GetAnyEnd() ); @@ -650,10 +650,10 @@ sal_Int32 SwAttrCheckArr::End() const return nEnd; } -int SwAttrCheckArr::CheckStack() +bool SwAttrCheckArr::CheckStack() { if( !nStackCnt ) - return sal_False; + return false; sal_uInt16 n; const sal_Int32 nSttPos = Start(); @@ -877,7 +877,7 @@ bool SwPaM::Find( const SfxPoolItem& rAttr, bool bValue, SwMoveFn fnMove, { // determine which attribute is searched: const sal_uInt16 nWhich = rAttr.Which(); - int bCharAttr = isCHRATR(nWhich) || isTXTATR(nWhich); + bool bCharAttr = isCHRATR(nWhich) || isTXTATR(nWhich); SwPaM* pPam = MakeRegion( fnMove, pRegion ); @@ -1065,7 +1065,7 @@ struct SwFindParaAttr : public SwFindParas virtual ~SwFindParaAttr() { delete pSTxt; } virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly ); - virtual int IsReplaceMode() const; + virtual bool IsReplaceMode() const; }; int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, @@ -1206,7 +1206,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, return FIND_FOUND; } -int SwFindParaAttr::IsReplaceMode() const +bool SwFindParaAttr::IsReplaceMode() const { return ( pSearchOpt && !pSearchOpt->replaceString.isEmpty() ) || ( pReplSet && pReplSet->Count() ); diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx index 0c0f6ca79d7d..17ba627e2813 100644 --- a/sw/source/core/crsr/findcoll.cxx +++ b/sw/source/core/crsr/findcoll.cxx @@ -37,7 +37,7 @@ struct SwFindParaFmtColl : public SwFindParas {} virtual ~SwFindParaFmtColl() {} virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly ); - virtual int IsReplaceMode() const; + virtual bool IsReplaceMode() const; }; int SwFindParaFmtColl::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, @@ -57,7 +57,7 @@ int SwFindParaFmtColl::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion return nRet; } -int SwFindParaFmtColl::IsReplaceMode() const +bool SwFindParaFmtColl::IsReplaceMode() const { return 0 != pReplColl; } diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 6cf17f9f2854..b3ca32c1dd8c 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -548,7 +548,7 @@ struct SwFindParaText : public SwFindParas : rSearchOpt( rOpt ), rCursor( rCrsr ), aSTxt( rOpt ), bReplace( 0 != bRepl ), bSearchInNotes( bSearchNotes ) {} virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly ); - virtual int IsReplaceMode() const; + virtual bool IsReplaceMode() const; virtual ~SwFindParaText(); }; @@ -601,7 +601,7 @@ int SwFindParaText::Find( SwPaM* pCrsr, SwMoveFn fnMove, return bFnd ? FIND_FOUND : FIND_NOT_FOUND; } -int SwFindParaText::IsReplaceMode() const +bool SwFindParaText::IsReplaceMode() const { return bReplace; } diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index fd1609c9b313..b0f1ff0f8b97 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -64,7 +64,7 @@ struct _PercentHdl : pDSh(pSh), bBack(false), bNodeIdx(false) { nActPos = nStt; - if( 0 != ( bBack = (nStt > nEnd )) ) + if( ( bBack = (nStt > nEnd )) ) { sal_uLong n = nStt; nStt = nEnd; nEnd = n; } @@ -88,7 +88,7 @@ struct _PercentHdl nEnd = rPam.GetPoint()->nNode.GetIndex(); } nActPos = nStt; - if( 0 != ( bBack = (nStt > nEnd )) ) + if( ( bBack = (nStt > nEnd )) ) { sal_uLong n = nStt; nStt = nEnd; nEnd = n; } @@ -588,7 +588,7 @@ GoNextCell: ++aCellStt; if( 0 == ( pCNd = aCellStt.GetNode().GetCntntNode() )) pCNd = aCellStt.GetNodes().GoNext( &aCellStt ); - if( 0 == ( bProt = pCNd->IsProtect() )) + if( !( bProt = pCNd->IsProtect() )) break; aCellStt.Assign( *pCNd->FindTableBoxStartNode()->EndOfSectionNode(), 1 ); } while( bProt ); @@ -637,7 +637,7 @@ GoPrevCell: aCellStt.Assign( *pNd->StartOfSectionNode(), +1 ); if( 0 == ( pCNd = aCellStt.GetNode().GetCntntNode() )) pCNd = pNd->GetNodes().GoNext( &aCellStt ); - if( 0 == ( bProt = pCNd->IsProtect() )) + if( !( bProt = pCNd->IsProtect() )) break; aCellStt.Assign( *pNd->FindTableBoxStartNode(), -1 ); } while( bProt ); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index e7d5cdc596c6..faae1a5b5ae4 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -719,7 +719,7 @@ namespace sw { namespace mark vMarksToDelete.push_back(ppMark); } } - else if ( bIsPosInRange ^ bIsOtherPosInRange ) + else if ( bIsPosInRange != bIsOtherPosInRange ) { // the bookmark is partitially in the range // move position of that is in the range out of it @@ -1190,7 +1190,7 @@ namespace return nReturn; } - static inline int lcl_Greater( const SwPosition& rPos, const SwNodeIndex& rNdIdx, const SwIndex* pIdx ) + static inline bool lcl_Greater( const SwPosition& rPos, const SwNodeIndex& rNdIdx, const SwIndex* pIdx ) { return rPos.nNode > rNdIdx || ( pIdx && rPos.nNode == rNdIdx && rPos.nContent > pIdx->GetIndex() ); } diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 4900f69d3c49..24b2ae21b13f 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -101,8 +101,7 @@ public: bool GetChanged( size_t nLine ) const { return (pChangedFlag && nLine < aLines.size()) - ? pChangedFlag[ nLine ] - : 0; + && pChangedFlag[ nLine ]; } size_t GetLineCount() const { return aLines.size(); } @@ -1725,9 +1724,8 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo ) if( rSttEnd == rEndStt || (!rEndStt.nContent.GetIndex() && rEndStt.nNode.GetIndex() - 1 == rSttEnd.nNode.GetIndex() && - 0 != ( pCNd = rSttEnd.nNode.GetNode().GetCntntNode() ) - ? rSttEnd.nContent.GetIndex() == pCNd->Len() - : 0 )) + 0 != ( pCNd = rSttEnd.nNode.GetNode().GetCntntNode() ) && + rSttEnd.nContent.GetIndex() == pCNd->Len())) { if( pTmp->GetNext() == pInsRing ) { diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index fdba68e54dbd..2816f8db427d 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -260,7 +260,7 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos, } else if( ( rSttNdIdx.GetIndex() + nSttOff <= pAPos->nNode.GetIndex() && pAPos->nNode.GetIndex() <= rEndNdIdx.GetIndex() - nOff ) || - 0 != ( bInsPos = rInsPos == pAPos->nNode )) + ( bInsPos = rInsPos == pAPos->nNode )) { _SaveFly aSave( pAPos->nNode.GetIndex() - rSttNdIdx.GetIndex(), @@ -863,7 +863,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags ) } - int bUpdateFtn = sal_False; + bool bUpdateFtn = false; SwFtnIdxs aTmpFntIdx; SwUndoMove * pUndoMove = 0; @@ -1079,7 +1079,7 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos, // Or else delete the Frames for all footnotes that are being moved // and have it rebuild after the Move (footnotes can change pages). // Additionally we have to correct the FtnIdx array's sorting. - int bUpdateFtn = sal_False; + bool bUpdateFtn = false; SwFtnIdxs aTmpFntIdx; SwUndoMove* pUndo = 0; diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index f8c6e83305ec..190c1c9cf8bd 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -2193,7 +2193,7 @@ void SwDocUpdtFld::InsDelFldInFldLst( bool bIns, const SwTxtFld& rFld ) } } -void SwDocUpdtFld::MakeFldList( SwDoc& rDoc, int bAll, int eGetMode ) +void SwDocUpdtFld::MakeFldList( SwDoc& rDoc, bool bAll, int eGetMode ) { if( !pFldSortLst || bAll || !( eGetMode & nFldLstGetMode ) || rDoc.GetNodes().Count() != nNodes ) diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 9e7c1eaa1c04..c694880aaa17 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1468,7 +1468,7 @@ static bool lcl_GotoNextPrevNum( SwPosition& rPos, bool bNext, aIdx--, pLast = 0; while( bNext ? ( aIdx.GetIndex() < aIdx.GetNodes().Count() - 1 ) - : aIdx.GetIndex() ) + : aIdx.GetIndex() != 0 ) { if( aIdx.GetNode().IsTxtNode() ) { diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index a994c03b2787..6e3f940006f0 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -2837,9 +2837,9 @@ void SwRedlineExtraData::Reject( SwPaM& ) const { } -int SwRedlineExtraData::operator == ( const SwRedlineExtraData& ) const +bool SwRedlineExtraData::operator == ( const SwRedlineExtraData& ) const { - return sal_False; + return false; } SwRedlineExtraData_FmtColl::SwRedlineExtraData_FmtColl( const OUString& rColl, @@ -2898,7 +2898,7 @@ void SwRedlineExtraData_FmtColl::Reject( SwPaM& rPam ) const } } -int SwRedlineExtraData_FmtColl::operator == ( const SwRedlineExtraData& r) const +bool SwRedlineExtraData_FmtColl::operator == ( const SwRedlineExtraData& r) const { const SwRedlineExtraData_FmtColl& rCmp = (SwRedlineExtraData_FmtColl&)r; return sFmtNm == rCmp.sFmtNm && nPoolId == rCmp.nPoolId && @@ -2962,17 +2962,17 @@ void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const pDoc->SetRedlineMode_intern( eOld ); } -int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) const +bool SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) const { - int nRet = 1; + bool nRet = true; size_t nEnd = aWhichIds.size(); if( nEnd != ((SwRedlineExtraData_Format&)rCmp).aWhichIds.size() ) - nRet = 0; + nRet = false; else for( size_t n = 0; n < nEnd; ++n ) if( ((SwRedlineExtraData_Format&)rCmp).aWhichIds[n] != aWhichIds[n]) { - nRet = 0; + nRet = false; break; } return nRet; @@ -3015,21 +3015,21 @@ void SwRedlineExtraData_FormattingChanges::Reject( SwPaM& rPam ) const // ToDo: Add 'Reject' logic } -int SwRedlineExtraData_FormattingChanges::operator == ( const SwRedlineExtraData& rExtraData ) const +bool SwRedlineExtraData_FormattingChanges::operator == ( const SwRedlineExtraData& rExtraData ) const { const SwRedlineExtraData_FormattingChanges& rCmp = (SwRedlineExtraData_FormattingChanges&)rExtraData; if ( !pSet && !rCmp.pSet ) { // Both SfxItemSet are null - return 1; + return true; } else if ( pSet && rCmp.pSet && *pSet == *rCmp.pSet ) { // Both SfxItemSet exist and are equal - return 1; + return true; } - return 0; + return false; } SfxItemSet* SwRedlineExtraData_FormattingChanges::GetItemSet( ) const @@ -3792,20 +3792,20 @@ const OUString& SwRangeRedline::GetComment( sal_uInt16 nPos ) const return GetRedlineData(nPos).sComment; } -int SwRangeRedline::operator==( const SwRangeRedline& rCmp ) const +bool SwRangeRedline::operator==( const SwRangeRedline& rCmp ) const { return this == &rCmp; } -int SwRangeRedline::operator<( const SwRangeRedline& rCmp ) const +bool SwRangeRedline::operator<( const SwRangeRedline& rCmp ) const { - sal_Bool nResult = sal_False; + bool nResult = false; if (*Start() < *rCmp.Start()) - nResult = sal_True; + nResult = true; else if (*Start() == *rCmp.Start()) if (*End() < *rCmp.End()) - nResult = sal_True; + nResult = true; return nResult; } diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index de4ccae0faae..8bd196569428 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -193,20 +193,20 @@ public: CompareNodeCntnt( sal_uLong nNd, sal_Int32 nCnt ) : nNode( nNd ), nCntnt( nCnt ) {} - int operator==( const CompareNodeCntnt& rCmp ) const + bool operator==( const CompareNodeCntnt& rCmp ) const { return nNode == rCmp.nNode && nCntnt == rCmp.nCntnt; } - int operator!=( const CompareNodeCntnt& rCmp ) const + bool operator!=( const CompareNodeCntnt& rCmp ) const { return nNode != rCmp.nNode || nCntnt != rCmp.nCntnt; } - int operator< ( const CompareNodeCntnt& rCmp ) const + bool operator< ( const CompareNodeCntnt& rCmp ) const { return nNode < rCmp.nNode || ( nNode == rCmp.nNode && nCntnt < rCmp.nCntnt); } - int operator<=( const CompareNodeCntnt& rCmp ) const + bool operator<=( const CompareNodeCntnt& rCmp ) const { return nNode < rCmp.nNode || ( nNode == rCmp.nNode && nCntnt <= rCmp.nCntnt); } - int operator> ( const CompareNodeCntnt& rCmp ) const + bool operator> ( const CompareNodeCntnt& rCmp ) const { return nNode > rCmp.nNode || ( nNode == rCmp.nNode && nCntnt > rCmp.nCntnt); } - int operator>=( const CompareNodeCntnt& rCmp ) const + bool operator>=( const CompareNodeCntnt& rCmp ) const { return nNode > rCmp.nNode || ( nNode == rCmp.nNode && nCntnt >= rCmp.nCntnt); } }; diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 80823a88ac93..dddc0d525873 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -203,13 +203,13 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) this, pNewNumRuleItem ); } - int bContinue = sal_True; + bool bContinue = true; // Check against the own attributes if( pNewLRSpace && SFX_ITEM_SET == GetItemState( RES_LR_SPACE, sal_False, (const SfxPoolItem**)&pOldLRSpace )) { - int bChg = sal_False; + bool bChg = false; if( pOldLRSpace != pNewLRSpace ) // Avoid recursion (SetAttr!) { SvxLRSpaceItem aNew( *pOldLRSpace ); @@ -252,7 +252,7 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) pOldULSpace != pNewULSpace ) // Avoid recursion (SetAttr!) { SvxULSpaceItem aNew( *pOldULSpace ); - int bChg = sal_False; + bool bChg = false; // We had a relative value -> recalculate if( 100 != aNew.GetPropUpper() ) { @@ -502,9 +502,9 @@ void SwCollCondition::RegisterToFormat( SwFmt& rFmt ) rFmt.Add( this ); } -int SwCollCondition::operator==( const SwCollCondition& rCmp ) const +bool SwCollCondition::operator==( const SwCollCondition& rCmp ) const { - int nRet = 0; + bool nRet = false; if( nCondition == rCmp.nCondition ) { if( USRFLD_EXPRESSION & nCondition ) @@ -528,7 +528,7 @@ int SwCollCondition::operator==( const SwCollCondition& rCmp ) const } else if( aSubCondition.nSubCondition == rCmp.aSubCondition.nSubCondition ) - nRet = 1; + nRet = true; } return nRet; } diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index 74e6525c82f2..8f0c4593fada 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -116,7 +116,7 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos ) // Is someone interested in our changes? if( HasDataLinks() ) { - int bCall = sal_False; + bool bCall = false; const SwStartNode* pNd = 0; switch( eType ) { @@ -152,7 +152,7 @@ void SwServerObject::SendDataChanged( const SwPaM& rRange ) // Is someone interested in our changes? if( HasDataLinks() ) { - int bCall = sal_False; + bool bCall = false; const SwStartNode* pNd = 0; const SwPosition* pStt = rRange.Start(), *pEnd = rRange.End(); switch( eType ) diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index d9d8df701ef2..f0a11b6d5f05 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -889,7 +889,7 @@ lcl_FndNxtPrvDelBox( const SwTableLines& rTblLns, --*pCurPos; pAllDelBoxes->erase( pAllDelBoxes->begin() + nFndPos ); } - } while( bNxt ? ( nLinePos + 1 < (sal_uInt16)rTblLns.size() ) : nLinePos ); + } while( bNxt ? ( nLinePos + 1 < (sal_uInt16)rTblLns.size() ) : nLinePos != 0 ); return pFndBox; } @@ -1550,7 +1550,7 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara) // If there are already Lines, then these need to go into a new Line and Box nMvPos = pRMBox->GetTabLines().GetPos( pInsLine ); - if( pULPara->bUL ? nMvPos + if( pULPara->bUL ? nMvPos != 0 : nMvPos+1 < (sal_uInt16)pRMBox->GetTabLines().size() ) { // Merge all Lines into a new Line and Box @@ -2452,7 +2452,7 @@ static bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, return false; // Collect all "ContentBoxes" - if( ( 0 != ( bGreaterBox = TBLFIX_CHGABS != rParam.nMode && ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide)) || + if( (bGreaterBox = TBLFIX_CHGABS != rParam.nMode && ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide) || ( !rParam.bBigger && ( std::abs( nDist + (( rParam.nMode && rParam.bLeft ) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) ) ) { rParam.bAnyBoxFnd = true; @@ -2486,8 +2486,8 @@ static bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, rParam.nLowerDiff = nOldLower; if( nLowerDiff || - ( 0 != ( bGreaterBox = !nOldLower && TBLFIX_CHGABS != rParam.nMode && - ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide)) || + (bGreaterBox = !nOldLower && TBLFIX_CHGABS != rParam.nMode && + ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide) || ( std::abs( nDist + ( (rParam.nMode && rParam.bLeft) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY )) { @@ -3671,7 +3671,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType, } } else if( bInsDel || - ( bLeft ? nDist : std::abs( rSz.GetWidth() - nDist ) > COLFUZZY ) ) + ( bLeft ? nDist != 0 : std::abs( rSz.GetWidth() - nDist ) > COLFUZZY ) ) { bRet = true; if( bLeft && TBLFIX_CHGABS == eTblChgMode && !bInsDel ) @@ -3812,7 +3812,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType, eTblChgMode = eOld; return bRet; } - else if( bInsDel || ( bLeft ? nDist + else if( bInsDel || ( bLeft ? nDist != 0 : (rSz.GetWidth() - nDist) > COLFUZZY )) { if( bLeft && TBLFIX_CHGABS == eTblChgMode && !bInsDel ) @@ -3824,7 +3824,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType, while( pLine->GetUpper() ) { sal_uInt16 nPos = pLine->GetTabBoxes().GetPos( pBox ); - if( bLeft ? nPos : nPos + 1 != (sal_uInt16)pLine->GetTabBoxes().size() ) + if( bLeft ? nPos != 0 : nPos + 1 != (sal_uInt16)pLine->GetTabBoxes().size() ) break; pBox = pLine->GetUpper(); @@ -3846,7 +3846,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType, // First, see if there is enough room at all if( bInsDel ) { - if( 0 != ( bRet = bLeft ? nDist != 0 + if( ( bRet = bLeft ? nDist != 0 : ( rSz.GetWidth() - nDist ) > COLFUZZY ) && !aParam.bBigger ) { @@ -4317,7 +4317,7 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType, } else { - if( bTop ? nEnd : nStt < nEnd ) + if( bTop ? nEnd != 0 : nStt < nEnd ) { if( bTop ) nStt = nEnd - 1; diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 3840c19bdc50..ab5056d46be3 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -1604,7 +1604,7 @@ void SwDoc::CopyFlyInFlyImpl( { const SwFrmFmt *pFmtN = (*nIt).GetFmt(); const SwFmtChain &rChain = pFmtN->GetChain(); - int nCnt = 0 != rChain.GetPrev(); + int nCnt = int(0 != rChain.GetPrev()); nCnt += rChain.GetNext() ? 1: 0; size_t k = 0; for (::std::set< _ZSortFly >::const_iterator kIt=aSet.begin() ; kIt != aSet.end(); ++kIt, ++k ) diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 4933b9dbdd1a..6892e2b029d5 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -4477,7 +4477,7 @@ sal_Bool SwDoc::UnProtectTbls( const SwPaM& rPam ) // Check whether the Table is within the Selection if( bHasSel ) { - int bFound = sal_False; + bool bFound = false; SwPaM* pTmp = (SwPaM*)&rPam; do { const SwPosition *pStt = pTmp->Start(), diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index f8d797ab69d3..9a135869104f 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -986,7 +986,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const } else if ((aSetBox.GetTop() && rBox.GetTop() && !(*aSetBox.GetTop() == *rBox.GetTop())) || - ((!aSetBox.GetTop()) ^ (!rBox.GetTop()))) // XOR expression is sal_True, if one of the two pointers is 0 + ((!aSetBox.GetTop()) != (!rBox.GetTop()))) // XOR expression is sal_True, if one of the two pointers is 0 { aSetBoxInfo.SetValid(VALID_TOP, sal_False ); aSetBox.SetLine( 0, BOX_LINE_TOP ); @@ -1005,7 +1005,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const } else if ((aSetBox.GetLeft() && rBox.GetLeft() && !(*aSetBox.GetLeft() == *rBox.GetLeft())) || - ((!aSetBox.GetLeft()) ^ (!rBox.GetLeft()))) + ((!aSetBox.GetLeft()) != (!rBox.GetLeft()))) { aSetBoxInfo.SetValid(VALID_LEFT, sal_False ); aSetBox.SetLine( 0, BOX_LINE_LEFT ); @@ -1022,7 +1022,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const } else if ((aSetBoxInfo.GetVert() && rBox.GetLeft() && !(*aSetBoxInfo.GetVert() == *rBox.GetLeft())) || - ((!aSetBoxInfo.GetVert()) ^ (!rBox.GetLeft()))) + ((!aSetBoxInfo.GetVert()) != (!rBox.GetLeft()))) { aSetBoxInfo.SetValid( VALID_VERT, sal_False ); aSetBoxInfo.SetLine( 0, BOXINFO_LINE_VERT ); } @@ -1038,7 +1038,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const } else if ((aSetBox.GetRight() && rBox.GetRight() && !(*aSetBox.GetRight() == *rBox.GetRight())) || - (!aSetBox.GetRight() ^ !rBox.GetRight())) + (!aSetBox.GetRight() != !rBox.GetRight())) { aSetBoxInfo.SetValid( VALID_RIGHT, sal_False ); aSetBox.SetLine( 0, BOX_LINE_RIGHT ); } @@ -1055,7 +1055,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const } else if ((aSetBox.GetBottom() && rBox.GetBottom() && !(*aSetBox.GetBottom() == *rBox.GetBottom())) || - (!aSetBox.GetBottom() ^ !rBox.GetBottom())) + (!aSetBox.GetBottom() != !rBox.GetBottom())) { aSetBoxInfo.SetValid( VALID_BOTTOM, sal_False ); aSetBox.SetLine( 0, BOX_LINE_BOTTOM ); } @@ -1073,7 +1073,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const } else if ((aSetBoxInfo.GetHori() && rBox.GetBottom() && !(*aSetBoxInfo.GetHori() == *rBox.GetBottom())) || - ((!aSetBoxInfo.GetHori()) ^ (!rBox.GetBottom()))) + ((!aSetBoxInfo.GetHori()) != (!rBox.GetBottom()))) { aSetBoxInfo.SetValid( VALID_HORI, sal_False ); aSetBoxInfo.SetLine( 0, BOXINFO_LINE_HORI ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 4f8bebb0d299..e2f6ecab9383 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -167,7 +167,7 @@ int Put( boost::shared_ptr& mrpAttrSet, const SwCntntNode& rNo return nRet; } -int Put_BC( boost::shared_ptr& mrpAttrSet, +bool Put_BC( boost::shared_ptr& mrpAttrSet, const SwCntntNode& rNode, const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -178,7 +178,7 @@ int Put_BC( boost::shared_ptr& mrpAttrSet, if( rNode.GetModifyAtAttr() ) aNewSet.SetModifyAtAttr( &rNode ); - const int nRet = aNewSet.Put_BC( rAttr, pOld, pNew ); + const bool nRet = aNewSet.Put_BC( rAttr, pOld, pNew ); if ( nRet ) GetNewAutoStyle( mrpAttrSet, rNode, aNewSet ); @@ -186,7 +186,7 @@ int Put_BC( boost::shared_ptr& mrpAttrSet, return nRet; } -int Put_BC( boost::shared_ptr& mrpAttrSet, +bool Put_BC( boost::shared_ptr& mrpAttrSet, const SwCntntNode& rNode, const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -205,7 +205,7 @@ int Put_BC( boost::shared_ptr& mrpAttrSet, if( rNode.GetModifyAtAttr() ) aNewSet.SetModifyAtAttr( &rNode ); - const int nRet = aNewSet.Put_BC( rSet, pOld, pNew ); + const bool nRet = aNewSet.Put_BC( rSet, pOld, pNew ); // #i76273# Robust if ( pStyleNames ) @@ -1367,7 +1367,7 @@ sal_Bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) { SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ), aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); - if( 0 != ( bRet = 0 != AttrSetHandleHelper::Put_BC( mpAttrSet, *this, rAttr, &aOld, &aNew ) )) + if( 0 != ( bRet = AttrSetHandleHelper::Put_BC( mpAttrSet, *this, rAttr, &aOld, &aNew ) )) { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); @@ -1443,7 +1443,7 @@ sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet ) { SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ), aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); - if( 0 != (bRet = 0 != AttrSetHandleHelper::Put_BC( mpAttrSet, *this, rSet, &aOld, &aNew )) ) + if( 0 != (bRet = AttrSetHandleHelper::Put_BC( mpAttrSet, *this, rSet, &aOld, &aNew )) ) { // Some special treatment for Attributes SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); @@ -1654,7 +1654,7 @@ static bool lcl_CheckMaxLength(SwNode const& rPrev, SwNode const& rNext) /// Can we join two Nodes? /// We can return the 2nd position in pIdx. -int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const +bool SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const { const SwNodes& rNds = GetNodes(); SwNodeIndex aIdx( *this, 1 ); @@ -1666,19 +1666,19 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const ++aIdx; if (rNds.Count()-1 == aIdx.GetIndex()) - return sal_False; + return false; if (!lcl_CheckMaxLength(*this, *pNd)) { return false; } if( pIdx ) *pIdx = aIdx; - return sal_True; + return true; } /// Can we join two Nodes? /// We can return the 2nd position in pIdx. -int SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const +bool SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const { SwNodeIndex aIdx( *this, -1 ); @@ -1689,14 +1689,14 @@ int SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const aIdx--; if (0 == aIdx.GetIndex()) - return sal_False; + return false; if (!lcl_CheckMaxLength(*pNd, *this)) { return false; } if( pIdx ) *pIdx = aIdx; - return sal_True; + return true; } //FEATURE::CONDCOLL diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 064545ff7450..2d6e9ad8da50 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -1317,7 +1317,7 @@ SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) const return (SwCntntNode*)pNd; } -inline int TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, sal_uLong nStt, sal_uLong nEnd ) +inline bool TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, sal_uLong nStt, sal_uLong nEnd ) { return nStt < nSttIdx && nEnd >= nSttIdx && nStt < nEndIdx && nEnd >= nEndIdx; @@ -1924,7 +1924,7 @@ SwStartNode* SwNodes::MakeTextSection( const SwNodeIndex & rWhere, //TODO: provide better documentation /** go to next section that is not protected nor hidden * - * @note if bSkipHidden == false and bSkipProtect == false, use GoNext/GoPrevious + * @note if !bSkipHidden and !bSkipProtect, use GoNext/GoPrevious * * @param pIdx * @param bSkipHidden @@ -1935,7 +1935,7 @@ SwStartNode* SwNodes::MakeTextSection( const SwNodeIndex & rWhere, * @see SwNodes::GoNextSection (TODO: seems to be C&P programming here) */ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx, - int bSkipHidden, int bSkipProtect ) const + bool bSkipHidden, bool bSkipProtect ) const { bool bFirst = true; SwNodeIndex aTmp( *pIdx ); @@ -1989,7 +1989,7 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx, ///@see SwNodes::GoNextSection (TODO: seems to be C&P programming here) SwCntntNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx, - int bSkipHidden, int bSkipProtect ) const + bool bSkipHidden, bool bSkipProtect ) const { bool bFirst = true; SwNodeIndex aTmp( *pIdx ); diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 32c9da99e48c..b2cf46b6ff3d 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -72,7 +72,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) if( pLast ) // Were we able to jump to the beginning? { do { - if( (0 == n) ^ ( 0 != pLast->ISA( SwCntntFrm )) ) + if( (0 == n) != ( 0 != pLast->ISA( SwCntntFrm )) ) pLast->ModifyNotification( &rItem, &rItem ); } while( 0 != ( pLast = ++aIter )); } diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx index 3b554a7fba50..695805d66694 100644 --- a/sw/source/core/draw/drawdoc.cxx +++ b/sw/source/core/draw/drawdoc.cxx @@ -133,7 +133,7 @@ SwDrawDocument::~SwDrawDocument() */ SdrPage* SwDrawDocument::AllocPage(bool bMasterPage) { - SwDPage* pPage = new SwDPage(*this, 0 != bMasterPage); + SwDPage* pPage = new SwDPage(*this, bMasterPage); pPage->SetName(OUString("Controls")); return pPage; } diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 5ca28294d261..c83a82fdee05 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -445,7 +445,7 @@ bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId ) case FIELD_PROP_LOCALE: { com::sun::star::lang::Locale aLocale; - if( 0 != (bRet = rAny >>= aLocale )) + if( (bRet = rAny >>= aLocale )) SetLanguage( LanguageTag::convertToLanguageType( aLocale )); } break; @@ -453,7 +453,7 @@ bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId ) case FIELD_PROP_PROP_SEQ: { Sequence aSeq; - if( 0 != (bRet = rAny >>= aSeq) ) + if( (bRet = rAny >>= aSeq) ) { m_SortKeyArr.clear(); const PropertyValues* pValues = aSeq.getConstArray(); diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 150177d03434..06a10dab51bf 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -513,7 +513,7 @@ StreamAndStorageNames lcl_GetStreamStorageNames( const OUString sUserData ) short SwGrfNode::SwapIn( sal_Bool bWaitForData ) { if( bInSwapIn ) // not recursively! - return !maGrfObj.IsSwappedOut(); + return short(!maGrfObj.IsSwappedOut()); short nRet = 0; bInSwapIn = sal_True; diff --git a/sw/source/core/inc/UndoManager.hxx b/sw/source/core/inc/UndoManager.hxx index 2ab0bf7fef5b..4514b2895668 100644 --- a/sw/source/core/inc/UndoManager.hxx +++ b/sw/source/core/inc/UndoManager.hxx @@ -98,7 +98,7 @@ private: /// position in Undo-Array at which Doc was saved (and is not modified) UndoStackMark m_UndoSaveMark; - typedef enum { UNDO = true, REDO = false } UndoOrRedo_t; + typedef enum { UNDO = int(true), REDO = int(false) } UndoOrRedo_t; bool impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo); // UGLY: should not be called diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx index cee98d607c84..fec0a0a417dd 100644 --- a/sw/source/core/inc/docfld.hxx +++ b/sw/source/core/inc/docfld.hxx @@ -159,7 +159,7 @@ public: const _SetGetExpFlds* GetSortLst() const { return pFldSortLst; } - void MakeFldList( SwDoc& rDoc, int bAll, int eGetMode ); + void MakeFldList( SwDoc& rDoc, bool bAll, int eGetMode ); void InsDelFldInFldLst( bool bIns, const SwTxtFld& rFld ); diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index e79d83eb8468..b86726a13ae7 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -164,8 +164,8 @@ public: return *this; } - int operator==( const _ZSortFly& ) const { return sal_False; } - int operator<( const _ZSortFly& rCmp ) const + bool operator==( const _ZSortFly& ) const { return false; } + bool operator<( const _ZSortFly& rCmp ) const { return nOrdNum < rCmp.nOrdNum; } const SwFrmFmt* GetFmt() const { return pFmt; } diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx index 817f3d9e4481..aebed31ff82d 100644 --- a/sw/source/core/inc/rolbck.hxx +++ b/sw/source/core/inc/rolbck.hxx @@ -179,7 +179,7 @@ class SwHistorySetTOXMark : public SwHistoryHint public: SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNode ); virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); - int IsEqual( const SwTOXMark& rCmp ) const; + bool IsEqual( const SwTOXMark& rCmp ) const; }; diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index d3aebafc4d90..9dee8b83da2c 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2043,7 +2043,7 @@ void SwBorderAttrs::_IsLine() |* sind identisch. |* |*************************************************************************/ -inline int CmpLines( const editeng::SvxBorderLine *pL1, const editeng::SvxBorderLine *pL2 ) +inline bool CmpLines( const editeng::SvxBorderLine *pL1, const editeng::SvxBorderLine *pL2 ) { return ( ((pL1 && pL2) && (*pL1 == *pL2)) || (!pL1 && !pL2) ); } diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 2db4406cf806..9d3275ef8926 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -4633,7 +4633,7 @@ bool SwRowFrm::IsRowSplitAllowed() const const SwTableLineFmt* pFrmFmt = (SwTableLineFmt*)GetTabLine()->GetFrmFmt(); const SwFmtRowSplit& rLP = pFrmFmt->GetRowSplit(); - return 0 != rLP.GetValue(); + return rLP.GetValue(); } /************************************************************************* diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 57551f76335d..c03c3c61228a 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1623,7 +1623,7 @@ void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt ) pRow == pTab->GetFirstNonHeadlineRow(); if ( bInFirstNonHeadlineRow || !pRow->GetNext() || - 0 != ( bInFollowFlowRow = pRow->IsInFollowFlowRow() ) || + ( bInFollowFlowRow = pRow->IsInFollowFlowRow() ) || 0 != pRow->IsInSplitTableRow() ) { if ( bInFirstNonHeadlineRow || bInFollowFlowRow ) diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx index 8a96fc248573..7fe27c238cef 100644 --- a/sw/source/core/txtnode/txatbase.cxx +++ b/sw/source/core/txtnode/txatbase.cxx @@ -57,7 +57,7 @@ void SwTxtAttr::Destroy( SwTxtAttr * pToDestroy, SfxItemPool& rPool ) rPool.Remove( *pAttr ); } -int SwTxtAttr::operator==( const SwTxtAttr& rAttr ) const +bool SwTxtAttr::operator==( const SwTxtAttr& rAttr ) const { return GetAttr() == rAttr.GetAttr(); } diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 0a2c4c529d71..9776533d5cf2 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -306,7 +306,7 @@ SwTxtMeta::CreateTxtMeta( sal_Int32 const i_nEnd, bool const i_bIsCopy) { - if (COPY == i_bIsCopy) + if (i_bIsCopy) { // i_rAttr is already cloned, now call DoCopy to copy the sw::Meta OSL_ENSURE(i_pTargetTxtNode, "cannot copy Meta without target node"); i_rAttr.DoCopy(i_rTargetDocManager, *i_pTargetTxtNode); diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index ec912000a9ba..6707eb5a35a7 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -150,7 +150,7 @@ lcl_MaskRedlinesAndHiddenText( const SwTxtNode& rNode, OUStringBuffer& rText, sal_uInt16 nHiddenCharsMasked = 0; const SwDoc& rDoc = *rNode.GetDoc(); - const bool bShowChg = 0 != IDocumentRedlineAccess::IsShowChanges( rDoc.GetRedlineMode() ); + const bool bShowChg = IDocumentRedlineAccess::IsShowChanges( rDoc.GetRedlineMode() ); // If called from word count or from spell checking, deleted redlines // should be masked: @@ -2253,7 +2253,7 @@ void SwTxtNode::SetParaNumberOfCharsExcludingSpaces( sal_uLong nNew ) const bool SwTxtNode::IsWordCountDirty() const { - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->bWordCountDirty : 0; + return m_pParaIdleData_Impl && m_pParaIdleData_Impl->bWordCountDirty; } void SwTxtNode::SetWrongDirty( bool bNew ) const @@ -2266,7 +2266,7 @@ void SwTxtNode::SetWrongDirty( bool bNew ) const bool SwTxtNode::IsWrongDirty() const { - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->bWrongDirty : 0; + return m_pParaIdleData_Impl && m_pParaIdleData_Impl->bWrongDirty; } void SwTxtNode::SetGrammarCheckDirty( bool bNew ) const @@ -2279,7 +2279,7 @@ void SwTxtNode::SetGrammarCheckDirty( bool bNew ) const bool SwTxtNode::IsGrammarCheckDirty() const { - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->bGrammarCheckDirty : 0; + return m_pParaIdleData_Impl && m_pParaIdleData_Impl->bGrammarCheckDirty; } void SwTxtNode::SetSmartTagDirty( bool bNew ) const @@ -2292,7 +2292,7 @@ void SwTxtNode::SetSmartTagDirty( bool bNew ) const bool SwTxtNode::IsSmartTagDirty() const { - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->bSmartTagDirty : 0; + return m_pParaIdleData_Impl && m_pParaIdleData_Impl->bSmartTagDirty; } void SwTxtNode::SetAutoCompleteWordDirty( bool bNew ) const @@ -2305,7 +2305,7 @@ void SwTxtNode::SetAutoCompleteWordDirty( bool bNew ) const bool SwTxtNode::IsAutoCompleteWordDirty() const { - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->bAutoComplDirty : 0; + return m_pParaIdleData_Impl && m_pParaIdleData_Impl->bAutoComplDirty; } // <-- Paragraph statistics end diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index a4d535c271f9..ed71456592c0 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -381,7 +381,7 @@ void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool ) nsSetAttrMode::SETATTR_NOTXTATRCHR ); } -int SwHistorySetTOXMark::IsEqual( const SwTOXMark& rCmp ) const +bool SwHistorySetTOXMark::IsEqual( const SwTOXMark& rCmp ) const { return m_TOXName == rCmp.GetTOXType()->GetTypeName() && m_eTOXTypes == rCmp.GetTOXType()->GetType() && diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 6a27effc1f9f..eab4e48f4b7e 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1281,7 +1281,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: } } } - else if(0 != (bNextFrame = (rPropertyName == UNO_NAME_CHAIN_NEXT_NAME)) + else if((bNextFrame = (rPropertyName == UNO_NAME_CHAIN_NEXT_NAME)) || rPropertyName == UNO_NAME_CHAIN_PREV_NAME) { OUString sChainName; @@ -1953,7 +1953,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) pFmt->SetFmtAttr(aSet); } } - else if(0 != (bNextFrame = (rPropertyName == UNO_NAME_CHAIN_NEXT_NAME)) + else if((bNextFrame = (rPropertyName == UNO_NAME_CHAIN_NEXT_NAME)) || rPropertyName == UNO_NAME_CHAIN_PREV_NAME) { SwDoc* pDoc = pFmt->GetDoc(); diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 3f13b5031458..320447832169 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -61,7 +61,7 @@ class SwASCIIParser public: SwASCIIParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn, - int bReadNewDoc, const SwAsciiOptions& rOpts ); + bool bReadNewDoc, const SwAsciiOptions& rOpts ); ~SwASCIIParser(); sal_uLong CallParser(); @@ -88,7 +88,7 @@ sal_uLong AsciiReader::Read( SwDoc &rDoc, const OUString&, SwPaM &rPam, const OU } SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn, - int bReadNewDoc, const SwAsciiOptions& rOpts) + bool bReadNewDoc, const SwAsciiOptions& rOpts) : pDoc(pD), rInput(rIn), rOpt(rOpts), nFileSize(0), nScript(0) , bNewDoc(bReadNewDoc) { diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index a71587ed0e9d..0b95aabab2e4 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -65,7 +65,7 @@ OUString SwIoDetect::IsReader(const sal_Char* pHeader, sal_uLong nLen_) const sal_Bool fComplexGet() { return static_cast< sal_Bool >((fFlagsGet() >> 2) & 1); } }; - int bRet = sal_False; + bool bRet = false; if ( sHTML == sName ) bRet = HTMLParser::IsHTMLFormat( pHeader, sal_True, RTL_TEXTENCODING_DONTKNOW ); else if ( FILTER_RTF == sName ) @@ -164,9 +164,9 @@ sal_Bool SwIoSystem::IsValidStgFilter(SotStorage& rStg, const SfxFilter& rFilter /* Bug 62703 - und auch WinWord Docs ohne ClipBoardId! */ if (rFilter.GetUserData() == FILTER_WW8 || rFilter.GetUserData() == sWW6) { - bRet = !((rStg.IsContained( OUString("0Table")) || - rStg.IsContained( OUString("1Table"))) ^ - (rFilter.GetUserData() == FILTER_WW8)); + bRet = (rStg.IsContained(OUString("0Table")) + || rStg.IsContained(OUString("1Table"))) + == (rFilter.GetUserData() == FILTER_WW8); if (bRet && !rFilter.IsAllowedAsTemplate()) { SotStorageStreamRef xRef = diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 76f8fef62e46..62917757bfa8 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -218,7 +218,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) else pUndoPam->GetPoint()->nContent.Assign( 0, 0 ); - int bChkHeaderFooter = pNd->FindHeaderStartNode() || + bool bChkHeaderFooter = pNd->FindHeaderStartNode() || pNd->FindFooterStartNode(); // Suche alle neuen Fly's und speicher sie als einzelne Undo diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index a933c0629368..bf65c4f83251 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -236,7 +236,7 @@ SwHTMLFmtInfo::SwHTMLFmtInfo( const SwFmt *pF, SwDoc *pDoc, SwDoc *pTemplate, nRefPoolId ); OSL_ENSURE( nDeep ? !aToken.isEmpty() : aToken.isEmpty(), "Hier stimmt doch was mit dem Token nicht!" ); - OSL_ENSURE( nDeep ? nRefPoolId : !nRefPoolId, + OSL_ENSURE( nDeep ? nRefPoolId != 0 : nRefPoolId == 0, "Hier stimmt doch was mit der Vergleichs-Vorlage nicht!" ); sal_Bool bTxtColl = pFmt->Which() == RES_TXTFMTCOLL || diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 0dd7fc0bedb1..434619df6787 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -232,10 +232,10 @@ sal_uLong HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam, SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCrsr, SvStream& rIn, const OUString& rPath, const OUString& rBaseURL, - int bReadNewDoc, + bool bReadNewDoc, SfxMedium* pMed, sal_Bool bReadUTF8, sal_Bool bNoHTMLComments ) - : SfxHTMLParser( rIn, static_cast< sal_Bool >(bReadNewDoc), pMed ), + : SfxHTMLParser( rIn, bReadNewDoc, pMed ), SwClient( 0 ), aPathToFile( rPath ), sBaseURL( rBaseURL ), diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 0552155cdb92..6a2304d4701d 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -900,7 +900,7 @@ public: SwHTMLParser( SwDoc* pD, SwPaM & rCrsr, SvStream& rIn, const OUString& rFileName, const OUString& rBaseURL, - int bReadNewDoc = sal_True, + bool bReadNewDoc = true, SfxMedium* pMed = 0, sal_Bool bReadUTF8 = sal_False, sal_Bool bIgnoreHTMLComments = sal_False ); diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx index 6c25b8a4e82e..de63e3e691f7 100644 --- a/sw/source/filter/inc/wrtswtbl.hxx +++ b/sw/source/filter/inc/wrtswtbl.hxx @@ -145,18 +145,18 @@ public: long GetPos() const { return nPos; } const SwWriteTableCells& GetCells() const { return aCells; } - inline int operator==( const SwWriteTableRow& rRow ) const; - inline int operator<( const SwWriteTableRow& rRow2 ) const; + inline bool operator==( const SwWriteTableRow& rRow ) const; + inline bool operator<( const SwWriteTableRow& rRow2 ) const; }; -inline int SwWriteTableRow::operator==( const SwWriteTableRow& rRow ) const +inline bool SwWriteTableRow::operator==( const SwWriteTableRow& rRow ) const { // etwas Unschaerfe zulassen return (nPos >= rRow.nPos ? nPos - rRow.nPos : rRow.nPos - nPos ) <= (mbUseLayoutHeights ? 0 : ROWFUZZY); } -inline int SwWriteTableRow::operator<( const SwWriteTableRow& rRow ) const +inline bool SwWriteTableRow::operator<( const SwWriteTableRow& rRow ) const { // Da wir hier nur die Wahrheits-Grade 0 und 1 kennen, lassen wir lieber // auch nicht zu, dass x==y und x= rCol.nPos ? nPos - rCol.nPos : rCol.nPos - nPos ) <= COLFUZZY; } -inline int SwWriteTableCol::operator<( const SwWriteTableCol& rCol ) const +inline bool SwWriteTableCol::operator<( const SwWriteTableCol& rCol ) const { // Da wir hier nur die Wahrheits-Grade 0 und 1 kennen, lassen wir lieber // auch nicht zu, dass x==y und xGetRowSplit( ); // The rtf default is to allow a row to break - if (rSplittable.GetValue() == 0) + if (!rSplittable.GetValue()) m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRKEEP); } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 1dc12174589c..b46ebe40d334 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1398,7 +1398,7 @@ void MSWordSections::CheckForFacinPg( WW8Export& rWrt ) const } } -int MSWordSections::HasBorderItem( const SwFmt& rFmt ) +bool MSWordSections::HasBorderItem( const SwFmt& rFmt ) { const SfxPoolItem* pItem; return SFX_ITEM_SET == rFmt.GetItemState(RES_BOX, true, &pItem) && diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 028044565a2d..9ccd4d7eea86 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -414,7 +414,7 @@ static void WriteDop( WW8Export& rWrt ) rDop.cParasFtnEdn = rDStat.nPara; rDop.cLinesFtnEdn = rDStat.nPara; - rDop.fDontUseHTMLAutoSpacing = (rWrt.pDoc->get(IDocumentSettingAccess::PARA_SPACE_MAX) != 0); + rDop.fDontUseHTMLAutoSpacing = rWrt.pDoc->get(IDocumentSettingAccess::PARA_SPACE_MAX); rDop.fExpShRtn = !rWrt.pDoc->get(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK); // #i56856# diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index ea56f3204cda..df34b50fef3d 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -215,7 +215,7 @@ public: sal_uInt8 nFlag ); /// Should we output borders? - static int HasBorderItem( const SwFmt& rFmt ); + static bool HasBorderItem( const SwFmt& rFmt ); }; class WW8_WrPlcSepx : public MSWordSections diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index 6c54dbccbe95..18c290b372ff 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -290,7 +290,7 @@ bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, Graphic*& rpGraphic, if (nData > 0) { rpGraphic = new Graphic(); - if (0 == (bOk = SwWW8ImplReader::GetPictGrafFromStream(*rpGraphic, *pSt))) + if (!(bOk = SwWW8ImplReader::GetPictGrafFromStream(*rpGraphic, *pSt))) DELETEZ(rpGraphic); } return bOk; // Grafik drin diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 0adb29940afa..ff49237697da 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2237,7 +2237,7 @@ void WW8TabDesc::CalcDefaults() pR->bLEmptyCol = pR->nCenter[0] - nMinLeft >= MINLAY; pR->bREmptyCol = (nMaxRight - pR->nCenter[pR->nWwCols] - nRightMaxThickness) >= MINLAY; - short nAddCols = pR->bLEmptyCol + pR->bREmptyCol; + short nAddCols = short(pR->bLEmptyCol) + short(pR->bREmptyCol); sal_uInt16 i; sal_uInt16 j = ( pR->bLEmptyCol ) ? 1 : 0; for (i = 0; i < pR->nWwCols; ++i) diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index e2b7ea400339..808148a60b87 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -651,7 +651,7 @@ SwSectionFmt *wwSectionManager::InsertSection( SfxItemSet aSet( mrReader.rDoc.GetAttrPool(), aFrmFmtSetRange ); - sal_uInt8 nRTLPgn = maSegments.empty() ? 0 : maSegments.back().IsBiDi(); + bool nRTLPgn = !maSegments.empty() && maSegments.back().IsBiDi(); aSet.Put(SvxFrameDirectionItem( nRTLPgn ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR)); @@ -898,7 +898,7 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/) { // sprmSFEvenlySpaced aNewSection.maSep.fEvenlySpaced = - ReadBSprm(pSep, (eVer <= ww::eWW7 ? 138 : 0x3005), 1) ? true : false; + sal_uInt8(ReadBSprm(pSep, (eVer <= ww::eWW7 ? 138 : 0x3005), 1) ? true : false); const sal_uInt8 numrgda = SAL_N_ELEMENTS(aNewSection.maSep.rgdxaColumnWidthSpacing); if (aNewSection.maSep.ccolM1 > 0 && !aNewSection.maSep.fEvenlySpaced) @@ -1230,7 +1230,7 @@ static sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRC* brc, WW8PLCFx_Cp_FKP* pPa pSprm[0], pSprm[1], pSprm[2], pSprm[3] ) ) { for( int i = 0; i < 4; ++i ) - nBorder |= (_SetWW8_BRC( bVer67, brc[ i ], pSprm[ i ] ))<HasSprm( *pIds )))<HasSprm( *pIds )))<HasParaSprm( *pIds )))<HasParaSprm( *pIds )))<nVersion) || (0 != rBase.pWw8Fib->fComplex) ) + bComplex( (7 < rBase.pWw8Fib->nVersion) || rBase.pWw8Fib->fComplex ) { ResetAttrStartEnd(); @@ -3384,7 +3384,7 @@ void WW8PLCFx_SEPX::SetIdx( sal_uLong nIdx ) bool WW8PLCFx_SEPX::SeekPos(WW8_CP nCpPos) { - return pPLCF ? pPLCF->SeekPos( nCpPos ) : 0; + return pPLCF && pPLCF->SeekPos( nCpPos ); } WW8_CP WW8PLCFx_SEPX::Where() @@ -7175,10 +7175,10 @@ void WW8DopTypography::ReadFromMem(sal_uInt8 *&pData) void WW8DopTypography::WriteToMem(sal_uInt8 *&pData) const { - sal_uInt16 a16Bit = fKerningPunct; + sal_uInt16 a16Bit = sal_uInt16(fKerningPunct); a16Bit |= (iJustification << 1) & 0x0006; a16Bit |= (iLevelOfKinsoku << 3) & 0x0018; - a16Bit |= (f2on1 << 5) & 0x0020; + a16Bit |= (int(f2on1) << 5) & 0x0020; a16Bit |= (reserved1 << 6) & 0x03C0; a16Bit |= (reserved2 << 10) & 0xFC00; Set_UInt16(pData,a16Bit); diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index e20af3ee703a..50d5e5854a80 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -163,8 +163,8 @@ struct WW8FieldDesc WW8_CP nLRes; ///< Laenge ( == 0, falls kein Ergebnis ) sal_uInt16 nId; ///< WW-Id fuer Felder sal_uInt8 nOpt; ///< WW-Flags ( z.B.: vom User geaendert ) - sal_uInt8 bCodeNest:1; ///< Befehl rekursiv verwendet - sal_uInt8 bResNest:1; ///< Befehl in Resultat eingefuegt + bool bCodeNest:1; ///< Befehl rekursiv verwendet + bool bResNest:1; ///< Befehl in Resultat eingefuegt }; struct WW8PLCFxSave1 @@ -1047,15 +1047,15 @@ public: sal_Int16 lid; // 0x6 language stamp---localized version; WW8_PN pnNext; // 0x8 - sal_uInt16 fDot :1; // 0xa 0001 - sal_uInt16 fGlsy :1; - sal_uInt16 fComplex :1; // 0004 when 1, file is in complex, fast-saved format. - sal_uInt16 fHasPic :1; // 0008 file contains 1 or more pictures + bool fDot :1; // 0xa 0001 + bool fGlsy :1; + bool fComplex :1; // 0004 when 1, file is in complex, fast-saved format. + bool fHasPic :1; // 0008 file contains 1 or more pictures sal_uInt16 cQuickSaves :4; // 00F0 count of times file was quicksaved - sal_uInt16 fEncrypted :1; //0100 1 if file is encrypted, 0 if not - sal_uInt16 fWhichTblStm :1; //0200 When 0, this fib refers to the table stream - sal_uInt16 fReadOnlyRecommended :1; - sal_uInt16 fWriteReservation :1; + bool fEncrypted :1; //0100 1 if file is encrypted, 0 if not + bool fWhichTblStm :1; //0200 When 0, this fib refers to the table stream + bool fReadOnlyRecommended :1; + bool fWriteReservation :1; // named "0Table", when 1, this fib refers to the // table stream named "1Table". Normally, a file // will have only one table stream, but under unusual @@ -1063,22 +1063,22 @@ public: // both names. In that case, this flag must be used // to decide which table stream is valid. - sal_uInt16 fExtChar :1; // 1000 =1, when using extended character set in file - sal_uInt16 fFarEast :1; // 4000 =1, probably, when far-East language vaiants of Word is used to create a file #i90932# + bool fExtChar :1; // 1000 =1, when using extended character set in file + bool fFarEast :1; // 4000 =1, probably, when far-East language vaiants of Word is used to create a file #i90932# - sal_uInt16 fObfuscated :1; // 8000=1. specifies whether the document is obfuscated using XOR obfuscation. otherwise this bit MUST be ignored. + bool fObfuscated :1; // 8000=1. specifies whether the document is obfuscated using XOR obfuscation. otherwise this bit MUST be ignored. sal_uInt16 nFibBack; // 0xc sal_uInt16 nHash; // 0xe file encrypted hash sal_uInt16 nKey; // 0x10 file encrypted key sal_uInt8 envr; // 0x12 environment in which file was created // 0 created by Win Word / 1 created by Mac Word - sal_uInt8 fMac :1; // 0x13 when 1, this file was last saved in the Mac environment - sal_uInt8 fEmptySpecial :1; - sal_uInt8 fLoadOverridePage :1; - sal_uInt8 fFuturesavedUndo :1; - sal_uInt8 fWord97Saved :1; - sal_uInt8 fWord2000Saved :1; + bool fMac :1; // 0x13 when 1, this file was last saved in the Mac environment + bool fEmptySpecial :1; + bool fLoadOverridePage :1; + bool fFuturesavedUndo :1; + bool fWord97Saved :1; + bool fWord2000Saved :1; sal_uInt8 :2; sal_uInt16 chse; // 0x14 default extended character set id for text in document stream. (overidden by chp.chse) @@ -1489,14 +1489,14 @@ public: // Initialisier-Dummy: sal_uInt8 nDataStart; //------------------------- - sal_uInt16 fFacingPages : 1; // 1 when facing pages should be printed + bool fFacingPages : 1; // 1 when facing pages should be printed - sal_uInt16 fWidowControl : 1; //a: orig 97 docs say + bool fWidowControl : 1; //a: orig 97 docs say // 1 when widow control is in effect. 0 when widow control disabled. //b: MS-DOC: Word Binary File Format (.doc) Structure Specification 2008 says // B - unused1 (1 bit): Undefined and MUST be ignored. - sal_uInt16 fPMHMainDoc : 1; // 1 when doc is a main doc for Print Merge Helper, 0 when not; default=0 + bool fPMHMainDoc : 1; // 1 when doc is a main doc for Print Merge Helper, 0 when not; default=0 sal_uInt16 grfSuppression : 2; // 0 Default line suppression storage; 0= form letter line suppression; 1= no line suppression; default=0 sal_uInt16 fpc : 2; // 1 footnote position code: 0 as endnotes, 1 at bottom of page, 2 immediately beneath text sal_uInt16 : 1; // 0 unused @@ -1505,46 +1505,46 @@ public: //------------------------- sal_uInt16 rncFtn : 2; // 0 restart index for footnotes, 0 don't restart note numbering, 1 section, 2 page sal_uInt16 nFtn : 14; // 1 initial footnote number for document - sal_uInt16 fOutlineDirtySave : 1; // when 1, indicates that information in the hPLCFpad should be refreshed since outline has been dirtied + bool fOutlineDirtySave : 1; // when 1, indicates that information in the hPLCFpad should be refreshed since outline has been dirtied sal_uInt16 : 7; // reserved - sal_uInt16 fOnlyMacPics : 1; // when 1, Word believes all pictures recorded in the document were created on a Macintosh - sal_uInt16 fOnlyWinPics : 1; // when 1, Word believes all pictures recorded in the document were created in Windows - sal_uInt16 fLabelDoc : 1; // when 1, document was created as a print merge labels document - sal_uInt16 fHyphCapitals : 1; // when 1, Word is allowed to hyphenate words that are capitalized. When 0, capitalized may not be hyphenated - sal_uInt16 fAutoHyphen : 1; // when 1, Word will hyphenate newly typed text as a background task - sal_uInt16 fFormNoFields : 1; - sal_uInt16 fLinkStyles : 1; // when 1, Word will merge styles from its template - sal_uInt16 fRevMarking : 1; // when 1, Word will mark revisions as the document is edited - sal_uInt16 fBackup : 1; // always make backup when document saved when 1. - sal_uInt16 fExactCWords : 1; - sal_uInt16 fPagHidden : 1; // - sal_uInt16 fPagResults : 1; - sal_uInt16 fLockAtn : 1; // when 1, annotations are locked for editing - sal_uInt16 fMirrorMargins : 1; // swap margins on left/right pages when 1. - sal_uInt16 fReadOnlyRecommended : 1;// user has recommended that this doc be opened read-only when 1 - sal_uInt16 fDfltTrueType : 1; // when 1, use TrueType fonts by default (flag obeyed only when doc was created by WinWord 2.x) - sal_uInt16 fPagSuppressTopSpacing : 1;//when 1, file created with SUPPRESSTOPSPACING=YES in win.ini. (flag obeyed only when doc was created by WinWord 2.x). - sal_uInt16 fProtEnabled : 1; // when 1, document is protected from edit operations - sal_uInt16 fDispFormFldSel : 1;// when 1, restrict selections to occur only within form fields - sal_uInt16 fRMView : 1; // when 1, show revision markings on screen - sal_uInt16 fRMPrint : 1; // when 1, print revision marks when document is printed - sal_uInt16 fWriteReservation : 1; - sal_uInt16 fLockRev : 1; // when 1, the current revision marking state is locked - sal_uInt16 fEmbedFonts : 1; // when 1, document contains embedded True Type fonts + bool fOnlyMacPics : 1; // when 1, Word believes all pictures recorded in the document were created on a Macintosh + bool fOnlyWinPics : 1; // when 1, Word believes all pictures recorded in the document were created in Windows + bool fLabelDoc : 1; // when 1, document was created as a print merge labels document + bool fHyphCapitals : 1; // when 1, Word is allowed to hyphenate words that are capitalized. When 0, capitalized may not be hyphenated + bool fAutoHyphen : 1; // when 1, Word will hyphenate newly typed text as a background task + bool fFormNoFields : 1; + bool fLinkStyles : 1; // when 1, Word will merge styles from its template + bool fRevMarking : 1; // when 1, Word will mark revisions as the document is edited + bool fBackup : 1; // always make backup when document saved when 1. + bool fExactCWords : 1; + bool fPagHidden : 1; // + bool fPagResults : 1; + bool fLockAtn : 1; // when 1, annotations are locked for editing + bool fMirrorMargins : 1; // swap margins on left/right pages when 1. + bool fReadOnlyRecommended : 1;// user has recommended that this doc be opened read-only when 1 + bool fDfltTrueType : 1; // when 1, use TrueType fonts by default (flag obeyed only when doc was created by WinWord 2.x) + bool fPagSuppressTopSpacing : 1;//when 1, file created with SUPPRESSTOPSPACING=YES in win.ini. (flag obeyed only when doc was created by WinWord 2.x). + bool fProtEnabled : 1; // when 1, document is protected from edit operations + bool fDispFormFldSel : 1;// when 1, restrict selections to occur only within form fields + bool fRMView : 1; // when 1, show revision markings on screen + bool fRMPrint : 1; // when 1, print revision marks when document is printed + bool fWriteReservation : 1; + bool fLockRev : 1; // when 1, the current revision marking state is locked + bool fEmbedFonts : 1; // when 1, document contains embedded True Type fonts // compatability options - sal_uInt16 copts_fNoTabForInd : 1; // when 1, don't add automatic tab stops for hanging indent - sal_uInt16 copts_fNoSpaceRaiseLower : 1; // when 1, don't add extra space for raised or lowered characters - sal_uInt16 copts_fSupressSpbfAfterPgBrk : 1; // when 1, supress the paragraph Space Before and Space After options after a page break - sal_uInt16 copts_fWrapTrailSpaces : 1; // when 1, wrap trailing spaces at the end of a line to the next line - sal_uInt16 copts_fMapPrintTextColor : 1; // when 1, print colors as black on non-color printers - sal_uInt16 copts_fNoColumnBalance : 1; // when 1, don't balance columns for Continuous Section starts - sal_uInt16 copts_fConvMailMergeEsc : 1; - sal_uInt16 copts_fSupressTopSpacing : 1; // when 1, supress extra line spacing at top of page - sal_uInt16 copts_fOrigWordTableRules : 1; // when 1, combine table borders like Word 5.x for the Macintosh - sal_uInt16 copts_fTransparentMetafiles : 1; // when 1, don't blank area between metafile pictures - sal_uInt16 copts_fShowBreaksInFrames : 1; // when 1, show hard page or column breaks in frames - sal_uInt16 copts_fSwapBordersFacingPgs : 1; // when 1, swap left and right pages on odd facing pages - sal_uInt16 copts_fExpShRtn : 1; // when 1, expand character spaces on the line ending SHIFT+RETURN // #i56856# + bool copts_fNoTabForInd : 1; // when 1, don't add automatic tab stops for hanging indent + bool copts_fNoSpaceRaiseLower : 1; // when 1, don't add extra space for raised or lowered characters + bool copts_fSupressSpbfAfterPgBrk : 1; // when 1, supress the paragraph Space Before and Space After options after a page break + bool copts_fWrapTrailSpaces : 1; // when 1, wrap trailing spaces at the end of a line to the next line + bool copts_fMapPrintTextColor : 1; // when 1, print colors as black on non-color printers + bool copts_fNoColumnBalance : 1; // when 1, don't balance columns for Continuous Section starts + bool copts_fConvMailMergeEsc : 1; + bool copts_fSupressTopSpacing : 1; // when 1, supress extra line spacing at top of page + bool copts_fOrigWordTableRules : 1; // when 1, combine table borders like Word 5.x for the Macintosh + bool copts_fTransparentMetafiles : 1; // when 1, don't blank area between metafile pictures + bool copts_fShowBreaksInFrames : 1; // when 1, show hard page or column breaks in frames + bool copts_fSwapBordersFacingPgs : 1; // when 1, swap left and right pages on odd facing pages + bool copts_fExpShRtn : 1; // when 1, expand character spaces on the line ending SHIFT+RETURN // #i56856# sal_Int16 dxaTab; // 720 twips - default tab width sal_uInt16 wSpare; // @@ -1564,11 +1564,11 @@ public: sal_uInt16 nEdn : 14; // beginning endnote number sal_uInt16 epc : 2; // endnote position code: 0 at end of section, 3 at end of document - sal_uInt16 fPrintFormData : 1; // only print data inside of form fields - sal_uInt16 fSaveFormData : 1; // only save document data that is inside of a form field. - sal_uInt16 fShadeFormData : 1; // shade form fields + bool fPrintFormData : 1; // only print data inside of form fields + bool fSaveFormData : 1; // only save document data that is inside of a form field. + bool fShadeFormData : 1; // shade form fields sal_uInt16 : 2; // reserved - sal_uInt16 fWCFtnEdn : 1; // when 1, include footnotes and endnotes in word count + bool fWCFtnEdn : 1; // when 1, include footnotes and endnotes in word count sal_Int32 cLines; // count of lines tallied by last Word Count operation sal_Int32 cWordsFtnEnd; // count of words in footnotes and endnotes tallied by last Word Count operation sal_Int32 cChFtnEdn; // count of characters in footnotes and endnotes tallied by last Word Count operation @@ -1579,47 +1579,47 @@ public: sal_uInt16 wvkSaved : 3; // document view kind: 0 Normal view, 1 Outline view, 2 Page View sal_uInt16 wScaleSaved : 9; ///< Specifies the zoom percentage that was in use when the document was saved. sal_uInt16 zkSaved : 2; - sal_uInt16 fRotateFontW6 : 1; - sal_uInt16 iGutterPos : 1 ; + bool fRotateFontW6 : 1; + bool iGutterPos : 1 ; // hier sollte bei nFib < 103 Schluss sein, sonst ist Datei fehlerhaft! /* bei nFib >= 103 gehts weiter: */ - sal_uInt32 fNoTabForInd : 1; // see above in compatability options - sal_uInt32 fNoSpaceRaiseLower : 1; // see above - sal_uInt32 fSupressSpbfAfterPageBreak : 1; // see above - sal_uInt32 fWrapTrailSpaces : 1; // see above - sal_uInt32 fMapPrintTextColor : 1; // see above - sal_uInt32 fNoColumnBalance : 1; // see above - sal_uInt32 fConvMailMergeEsc : 1; // see above - sal_uInt32 fSupressTopSpacing : 1; // see above - sal_uInt32 fOrigWordTableRules : 1; // see above - sal_uInt32 fTransparentMetafiles : 1; // see above - sal_uInt32 fShowBreaksInFrames : 1; // see above - sal_uInt32 fSwapBordersFacingPgs : 1; // see above - sal_uInt32 fCompatabilityOptions_Unknown1_13 : 1; // #i78591# - sal_uInt32 fExpShRtn : 1; // #i78591# and #i56856# - sal_uInt32 fCompatabilityOptions_Unknown1_15 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_16 : 1; // #i78591# - sal_uInt32 fSuppressTopSpacingMac5 : 1; // Suppress extra line spacing at top + bool fNoTabForInd : 1; // see above in compatability options + bool fNoSpaceRaiseLower : 1; // see above + bool fSupressSpbfAfterPageBreak : 1; // see above + bool fWrapTrailSpaces : 1; // see above + bool fMapPrintTextColor : 1; // see above + bool fNoColumnBalance : 1; // see above + bool fConvMailMergeEsc : 1; // see above + bool fSupressTopSpacing : 1; // see above + bool fOrigWordTableRules : 1; // see above + bool fTransparentMetafiles : 1; // see above + bool fShowBreaksInFrames : 1; // see above + bool fSwapBordersFacingPgs : 1; // see above + bool fCompatabilityOptions_Unknown1_13 : 1; // #i78591# + bool fExpShRtn : 1; // #i78591# and #i56856# + bool fCompatabilityOptions_Unknown1_15 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_16 : 1; // #i78591# + bool fSuppressTopSpacingMac5 : 1; // Suppress extra line spacing at top // of page like MacWord 5.x - sal_uInt32 fTruncDxaExpand : 1; // Expand/Condense by whole number of points - sal_uInt32 fPrintBodyBeforeHdr : 1; // Print body text before header/footer - sal_uInt32 fNoLeading : 1; // Don't add extra spacebetween rows of text - sal_uInt32 fCompatabilityOptions_Unknown1_21 : 1; // #i78591# - sal_uInt32 fMWSmallCaps : 1; // Use larger small caps like MacWord 5.x - sal_uInt32 fCompatabilityOptions_Unknown1_23 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_24 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_25 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_26 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_27 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_28 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_29 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_30 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown1_31 : 1; // #i78591# - sal_uInt32 fUsePrinterMetrics : 1; //The magic option + bool fTruncDxaExpand : 1; // Expand/Condense by whole number of points + bool fPrintBodyBeforeHdr : 1; // Print body text before header/footer + bool fNoLeading : 1; // Don't add extra spacebetween rows of text + bool fCompatabilityOptions_Unknown1_21 : 1; // #i78591# + bool fMWSmallCaps : 1; // Use larger small caps like MacWord 5.x + bool fCompatabilityOptions_Unknown1_23 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_24 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_25 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_26 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_27 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_28 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_29 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_30 : 1; // #i78591# + bool fCompatabilityOptions_Unknown1_31 : 1; // #i78591# + bool fUsePrinterMetrics : 1; //The magic option // hier sollte bei nFib <= 105 Schluss sein, sonst ist Datei fehlerhaft! @@ -1635,15 +1635,15 @@ public: sal_uInt16 : 1; // reserved sal_uInt16 lvl : 4; // Which outline levels are showing in outline view sal_uInt16 : 4; // reserved - sal_uInt16 fHtmlDoc : 1; // This file is based upon an HTML file + bool fHtmlDoc : 1; // This file is based upon an HTML file sal_uInt16 : 1; // reserved - sal_uInt16 fSnapBorder : 1; // Snap table and page borders to page border - sal_uInt16 fIncludeHeader : 1; // Place header inside page border - sal_uInt16 fIncludeFooter : 1; // Place footer inside page border - sal_uInt16 fForcePageSizePag : 1; // Are we in online view - sal_uInt16 fMinFontSizePag : 1; // Are we auto-promoting fonts to >= hpsZoonFontPag? - sal_uInt16 fHaveVersions : 1; // versioning is turned on - sal_uInt16 fAutoVersion : 1; // autoversioning is enabled + bool fSnapBorder : 1; // Snap table and page borders to page border + bool fIncludeHeader : 1; // Place header inside page border + bool fIncludeFooter : 1; // Place footer inside page border + bool fForcePageSizePag : 1; // Are we in online view + bool fMinFontSizePag : 1; // Are we auto-promoting fonts to >= hpsZoonFontPag? + bool fHaveVersions : 1; // versioning is turned on + bool fAutoVersion : 1; // autoversioning is enabled sal_uInt16 : 14; // reserved // Skip 12 Bytes here: ASUMI sal_Int32 cChWS; @@ -1658,56 +1658,56 @@ public: sal_Int16 hpsZoonFontPag; sal_Int16 dywDispPag; - sal_uInt32 fCompatabilityOptions_Unknown2_1 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_2 : 1; // #i78591# - sal_uInt32 fDontUseHTMLAutoSpacing : 1; - sal_uInt32 fCompatabilityOptions_Unknown2_4 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_5 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_6 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_7 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_8 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_9 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_10 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_11 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_12 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_13 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_14 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_15 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_16 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_17 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_18 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_19 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_20 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_21 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_22 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_23 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_24 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_25 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_26 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_27 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_28 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_29 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_30 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_31 : 1; // #i78591# - sal_uInt32 fCompatabilityOptions_Unknown2_32 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_1 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_2 : 1; // #i78591# + bool fDontUseHTMLAutoSpacing : 1; + bool fCompatabilityOptions_Unknown2_4 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_5 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_6 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_7 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_8 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_9 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_10 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_11 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_12 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_13 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_14 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_15 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_16 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_17 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_18 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_19 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_20 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_21 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_22 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_23 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_24 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_25 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_26 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_27 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_28 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_29 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_30 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_31 : 1; // #i78591# + bool fCompatabilityOptions_Unknown2_32 : 1; // #i78591# sal_uInt16 fUnknown3 : 15; - sal_uInt16 fUseBackGroundInAllmodes : 1; - - sal_uInt16 fDoNotEmbedSystemFont : 1; - sal_uInt16 fWordCompat : 1; - sal_uInt16 fLiveRecover : 1; - sal_uInt16 fEmbedFactoids : 1; - sal_uInt16 fFactoidXML : 1; - sal_uInt16 fFactoidAllDone : 1; - sal_uInt16 fFolioPrint : 1; - sal_uInt16 fReverseFolio : 1; + bool fUseBackGroundInAllmodes : 1; + + bool fDoNotEmbedSystemFont : 1; + bool fWordCompat : 1; + bool fLiveRecover : 1; + bool fEmbedFactoids : 1; + bool fFactoidXML : 1; + bool fFactoidAllDone : 1; + bool fFolioPrint : 1; + bool fReverseFolio : 1; sal_uInt16 iTextLineEnding : 3; - sal_uInt16 fHideFcc : 1; - sal_uInt16 fAcetateShowMarkup : 1; - sal_uInt16 fAcetateShowAtn : 1; - sal_uInt16 fAcetateShowInsDel : 1; - sal_uInt16 fAcetateShowProps : 1; + bool fHideFcc : 1; + bool fAcetateShowMarkup : 1; + bool fAcetateShowAtn : 1; + bool fAcetateShowInsDel : 1; + bool fAcetateShowProps : 1; // 2. Initialisier-Dummy: sal_uInt8 nDataEnd; diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx index 7f1b08bca4fc..2e9f18beb8d8 100644 --- a/sw/source/filter/ww8/ww8struc.hxx +++ b/sw/source/filter/ww8/ww8struc.hxx @@ -168,11 +168,11 @@ struct WW8_STD { // Base part of STD: sal_uInt16 sti : 12; // invariant style identifier - sal_uInt16 fScratch : 1; // spare field for any temporary use, + bool fScratch : 1; // spare field for any temporary use, // always reset back to zero! - sal_uInt16 fInvalHeight : 1; // PHEs of all text with this style are wrong - sal_uInt16 fHasUpe : 1; // UPEs have been generated - sal_uInt16 fMassCopy : 1; // std has been mass-copied; if unused at + bool fInvalHeight : 1; // PHEs of all text with this style are wrong + bool fHasUpe : 1; // UPEs have been generated + bool fMassCopy : 1; // std has been mass-copied; if unused at // save time, style should be deleted sal_uInt16 sgc : 4; // style type code sal_uInt16 istdBase : 12; // base style @@ -181,8 +181,8 @@ struct WW8_STD sal_uInt16 bchUpe; // offset to end of upx's, start of upe's //-------- jetzt neu: // ab Ver8 gibts zwei Felder mehr: - sal_uInt16 fAutoRedef : 1; /* auto redefine style when appropriate */ - sal_uInt16 fHidden : 1; /* hidden from UI? */ + bool fAutoRedef : 1; /* auto redefine style when appropriate */ + bool fHidden : 1; /* hidden from UI? */ sal_uInt16 : 14; /* unused bits */ // Variable length part of STD: @@ -287,7 +287,7 @@ public: //Maps what I think is the language this is to affect to the OOo language sal_uInt16 GetConvertedLang() const; - sal_uInt16 fKerningPunct : 1; // true if we're kerning punctuation + bool fKerningPunct : 1; // true if we're kerning punctuation sal_uInt16 iJustification : 2; // Kinsoku method of justification: // 0 = always expand // 1 = compress punctuation @@ -296,7 +296,7 @@ public: // 0 = Level 1 // 1 = Level 2 // 2 = Custom - sal_uInt16 f2on1 : 1; // 2-page-on-1 feature is turned on. + bool f2on1 : 1; // 2-page-on-1 feature is turned on. sal_uInt16 reserved1 : 4; // in 97 its marked as reserved BUT sal_uInt16 reserved2 : 6; // reserved ? //we find that the following applies, @@ -805,7 +805,7 @@ public: sal_Int32 nYaTop; //top of rectangle enclosing shape relative to the origin of the shape sal_Int32 nXaRight; //right of rectangle enclosing shape relative to the origin of the shape sal_Int32 nYaBottom;//bottom of the rectangle enclosing shape relative to the origin of the shape - sal_uInt16 bHdr:1; + bool bHdr:1; //0001 1 in the undo doc when shape is from the header doc, 0 otherwise (undefined when not in the undo doc) sal_uInt16 nbx:2; //0006 x position of shape relative to anchor CP @@ -833,13 +833,13 @@ public: //1 wrap only on left //2 wrap only on right //3 wrap only on largest side - sal_uInt16 bRcaSimple:1; + bool bRcaSimple:1; //2000 when set, temporarily overrides bx, by, forcing the xaLeft, xaRight, yaTop, and yaBottom fields to all be page relative. - sal_uInt16 bBelowText:1; + bool bBelowText:1; //4000 //1 shape is below text //0 shape is above text - sal_uInt16 bAnchorLock:1; + bool bAnchorLock:1; //8000 1 anchor is locked // 0 anchor is not locked sal_Int32 nTxbx; //count of textboxes in shape (undo doc only) diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index 30ed690933d8..8074d43f4d70 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -483,7 +483,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) } if(rReq.IsAPI()) // Basic only gets TRUE or FALSE - rReq.SetReturnValue(SfxUInt16Item(nSlot, nRet !=0)); + rReq.SetReturnValue(SfxUInt16Item(nSlot, sal_uInt16(nRet !=0))); else rReq.SetReturnValue(SfxUInt16Item(nSlot, nRet)); } diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index d7599fca43ea..1bf5c7a87f8c 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -898,7 +898,7 @@ bool SwDocStyleSheet::SetName( const OUString& rStr) else if(!bPhysical) FillStyleSheet( FillPhysical ); - int bChg = false; + bool bChg = false; switch(nFamily) { case SFX_STYLE_FAMILY_CHAR : diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index c1cf61b9908b..0d535023adf8 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -180,7 +180,7 @@ private: _DB_ColumnConfigData& operator =( const _DB_ColumnConfigData& ); }; -int SwInsDBColumn::operator<( const SwInsDBColumn& rCmp ) const +bool SwInsDBColumn::operator<( const SwInsDBColumn& rCmp ) const { return 0 > GetAppCollator().compareString( sColumn, rCmp.sColumn ); } diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 0225dcee6e9d..057b69149515 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -2683,7 +2683,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, // check the availability of all data in the config item uno::Reference< XResultSet> xResultSet = rMMConfig.GetResultSet(); if(!xResultSet.is()) - return false; + return 0; bInMerge = sal_True; sal_Int32 nRet = 0; pImpl->pMergeData = new SwDSParam( diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 2d9a4090af6a..5cff3e04baf5 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1407,7 +1407,7 @@ IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent *, pEvent ) Image SwEditRegionDlg::BuildBitmap( sal_Bool bProtect, sal_Bool bHidden ) { ImageList& rImgLst = aImageIL; - return rImgLst.GetImage((!bHidden+(bProtect<<1)) + 1); + return rImgLst.GetImage((int(!bHidden)+(bProtect<<1)) + 1); } /*-------------------------------------------------------------------- @@ -1602,7 +1602,7 @@ void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh) { const OUString sSectionName(pSectionData->GetSectionName()); m_pCurName->SetText(rSh.GetUniqueSectionName(&sSectionName)); - m_pProtectCB->Check( 0 != pSectionData->IsProtectFlag() ); + m_pProtectCB->Check( pSectionData->IsProtectFlag() ); m_sFileName = pSectionData->GetLinkFileName(); m_sFilePasswd = pSectionData->GetLinkFilePassword(); m_pFileCB->Check( !m_sFileName.isEmpty() ); diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 1182eca1d056..00be9a021642 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -2731,12 +2731,12 @@ sal_Bool SwTransferable::IsPasteSpecial( const SwWrtShell& rWrtShell, return aClipboardFmtItem.Count() > 0; } -int SwTransferable::PasteFormat( SwWrtShell& rSh, +bool SwTransferable::PasteFormat( SwWrtShell& rSh, TransferableDataHelper& rData, sal_uLong nFormat ) { SwWait aWait( *rSh.GetView().GetDocShell(), false ); - int nRet = 0; + bool nRet = false; sal_uLong nPrivateFmt = FORMAT_PRIVATE; SwTransferable *pClipboard = GetSwTransferable( rData ); @@ -2773,7 +2773,7 @@ int SwTransferable::PasteFormat( SwWrtShell& rSh, return nRet; } -int SwTransferable::_TestAllowedFormat( const TransferableDataHelper& rData, +bool SwTransferable::_TestAllowedFormat( const TransferableDataHelper& rData, sal_uLong nFormat, sal_uInt16 nDestination ) { sal_uInt16 nAction = EXCHG_INOUT_ACTION_NONE, nEventAction; @@ -2811,15 +2811,15 @@ static sal_uInt16 aPasteSpecialIds[] = 0 }; -int SwTransferable::PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& rData ) +bool SwTransferable::PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& rData ) { // Plain text == unformatted return SwTransferable::PasteFormat( rSh, rData, SOT_FORMAT_STRING ); } -int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData, sal_uLong& rFormatUsed ) +bool SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData, sal_uLong& rFormatUsed ) { - int nRet = 0; + bool nRet = false; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SfxAbstractPasteDialog* pDlg = pFact->CreatePasteDialog( &rSh.GetView().GetEditWin() ); diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index 464542d17ed5..e83684580f38 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -420,7 +420,7 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl) m_pFixedCB->Enable(bFixed); if (IsFldEdit()) - m_pFixedCB->Check( static_cast< sal_Bool >(((GetCurField()->GetFormat() & AF_FIXED) != 0) & bFixed)); + m_pFixedCB->Check( (GetCurField()->GetFormat() & AF_FIXED) != 0 && bFixed ); if (m_pNumFormatLB->GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND) m_pNumFormatLB->SelectEntryPos(0); diff --git a/sw/source/ui/inc/dbinsdlg.hxx b/sw/source/ui/inc/dbinsdlg.hxx index 0b78b306b181..6622e7ed6409 100644 --- a/sw/source/ui/inc/dbinsdlg.hxx +++ b/sw/source/ui/inc/dbinsdlg.hxx @@ -75,9 +75,9 @@ struct SwInsDBColumn bIsDBFmt(sal_True) {} - int operator==( const SwInsDBColumn& rCmp ) const + bool operator==( const SwInsDBColumn& rCmp ) const { return sColumn == rCmp.sColumn; } - int operator<( const SwInsDBColumn& rCmp ) const; + bool operator<( const SwInsDBColumn& rCmp ) const; }; class SwInsDBColumns : public o3tl::sorted_vector > diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx index dd4f519cef0d..83ea13c1eccb 100644 --- a/sw/source/ui/inc/pview.hxx +++ b/sw/source/ui/inc/pview.hxx @@ -187,7 +187,7 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * ); SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * ); SW_DLLPRIVATE DECL_LINK( BtnPage, Button * ); - SW_DLLPRIVATE int ChgPage( int eMvMode, int bUpdateScrollbar = sal_True ); + SW_DLLPRIVATE bool ChgPage( int eMvMode, int bUpdateScrollbar = sal_True ); SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False ); diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx index 6a4f6054449d..0c1fdeebe6ee 100644 --- a/sw/source/ui/inc/swdtflvr.hxx +++ b/sw/source/ui/inc/swdtflvr.hxx @@ -86,7 +86,7 @@ class SW_DLLPUBLIC SwTransferable : public TransferableHelper static void SetSelInShell( SwWrtShell& , sal_Bool , const Point* ); static sal_Bool _CheckForURLOrLNKFile( TransferableDataHelper& rData, OUString& rFileName, OUString* pTitle = 0 ); - static int _TestAllowedFormat( const TransferableDataHelper& rData, + static bool _TestAllowedFormat( const TransferableDataHelper& rData, sal_uLong nFormat, sal_uInt16 nDestination ); static bool _PasteFileContent( TransferableDataHelper&, @@ -180,9 +180,9 @@ public: static sal_Bool IsPasteSpecial( const SwWrtShell& rWrtShell, const TransferableDataHelper& ); - static int PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& ); - static int PasteSpecial( SwWrtShell& rSh, TransferableDataHelper&, sal_uLong& rFormatUsed ); - static int PasteFormat( SwWrtShell& rSh, TransferableDataHelper& rData, + static bool PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& ); + static bool PasteSpecial( SwWrtShell& rSh, TransferableDataHelper&, sal_uLong& rFormatUsed ); + static bool PasteFormat( SwWrtShell& rSh, TransferableDataHelper& rData, sal_uLong nFormat ); static void FillClipFmtItem( const SwWrtShell& rSh, diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 2a4f2e28f312..894e9f560fc4 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -130,17 +130,17 @@ public: void EnterExtMode(); void LeaveExtMode(); - long ToggleExtMode(); + bool ToggleExtMode(); sal_Bool IsExtMode() const { return bExtMode; } void EnterAddMode(); void LeaveAddMode(); - long ToggleAddMode(); + bool ToggleAddMode(); sal_Bool IsAddMode() const { return bAddMode; } void EnterBlockMode(); void LeaveBlockMode(); - long ToggleBlockMode(); + bool ToggleBlockMode(); sal_Bool IsBlockMode() const { return bBlockMode; } void SetInsMode( sal_Bool bOn = sal_True ); diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 06b3467249bb..a284b793d49a 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -325,8 +325,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) SwView* pView = &rView; rReq.Ignore(); bIgnore = true; - int nRet = SwTransferable::PasteUnformatted( rSh, aDataHelper ); - if(nRet) + if(SwTransferable::PasteUnformatted( rSh, aDataHelper )) { SfxViewFrame* pViewFrame = pView->GetViewFrame(); uno::Reference< frame::XDispatchRecorder > xRecorder = @@ -361,8 +360,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) sal_uLong nFormatId = 0; rReq.Ignore(); bIgnore = true; - int nRet = SwTransferable::PasteSpecial( rSh, aDataHelper, nFormatId ); - if(nRet) + if(SwTransferable::PasteSpecial( rSh, aDataHelper, nFormatId )) { SfxViewFrame* pViewFrame = pView->GetViewFrame(); uno::Reference< frame::XDispatchRecorder > xRecorder = diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 44ddfca35e2e..9df537263f51 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -1308,7 +1308,7 @@ void SwTableShell::GetState(SfxItemSet &rSet) case RES_ROW_SPLIT: { const SwFmtLayoutSplit& rTabSplit = pFmt->GetLayoutSplit(); - if ( 0 == rTabSplit.GetValue() ) + if ( !rTabSplit.GetValue() ) { rSet.DisableItem( nSlot ); } diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 5a3a2367c7f2..e50646a5daff 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -1263,7 +1263,7 @@ void SwTextShell::Execute(SfxRequest &rReq) bool bSetBlockMode = !rWrtSh.IsBlockMode(); if( pArgs && SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem)) bSetBlockMode = ((const SfxBoolItem*)pItem)->GetValue(); - if( ( nSlot == FN_SELECTION_MODE_DEFAULT ) ^ bSetBlockMode ) + if( ( nSlot == FN_SELECTION_MODE_DEFAULT ) != bSetBlockMode ) rWrtSh.EnterBlockMode(); else rWrtSh.EnterStdMode(); diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 0dd3fee00c7d..99bcc10a06c4 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -238,7 +238,7 @@ void SwPagePreviewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol ) // If changes have taken place at the columns, the special case "single column" // must be considered and corrected if necessary. - if( (1 == nOldCol) ^ (1 == mnCol) ) + if( (1 == nOldCol) != (1 == mnCol) ) mrView.ScrollDocSzChg(); // Order must be maintained! @@ -834,8 +834,7 @@ void SwPagePreview::Execute( SfxRequest &rReq ) { pViewWin->SetSelectedPage( nNewSelectedPage ); pViewWin->SetSttPage( nNewStartPage ); - int nRet = ChgPage( SwPagePreviewWin::MV_SELPAGE, sal_True ); - bRefresh = 0 != nRet; + bRefresh = ChgPage( SwPagePreviewWin::MV_SELPAGE, sal_True ); } GetViewShell()->ShowPreviewSelection( nNewSelectedPage ); // invalidate page status. @@ -869,12 +868,12 @@ void SwPagePreview::Execute( SfxRequest &rReq ) eMvMode = SwPagePreviewWin::MV_DOC_END; bRetVal = true; goto MOVEPAGE; MOVEPAGE: { - int nRet = ChgPage( eMvMode, sal_True ); + bool nRet = ChgPage( eMvMode, sal_True ); // return value fuer Basic if(bRetVal) - rReq.SetReturnValue(SfxBoolItem(rReq.GetSlot(), nRet == 0)); + rReq.SetReturnValue(SfxBoolItem(rReq.GetSlot(), !nRet)); - bRefresh = 0 != nRet; + bRefresh = nRet; rReq.Done(); } break; @@ -1253,10 +1252,10 @@ int SwPagePreview::_CreateScrollbar( sal_Bool bHori ) return 1; } -int SwPagePreview::ChgPage( int eMvMode, int bUpdateScrollbar ) +bool SwPagePreview::ChgPage( int eMvMode, int bUpdateScrollbar ) { Rectangle aPixVisArea( pViewWin->LogicToPixel( aVisArea ) ); - int bChg = pViewWin->MovePage( eMvMode ) || + bool bChg = pViewWin->MovePage( eMvMode ) || eMvMode == SwPagePreviewWin::MV_CALC || eMvMode == SwPagePreviewWin::MV_NEWWINSIZE; aVisArea = pViewWin->PixelToLogic( aPixVisArea ); diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx index 946325022e68..8b8a3e94c2d5 100644 --- a/sw/source/ui/utlui/attrdesc.cxx +++ b/sw/source/ui/utlui/attrdesc.cxx @@ -1144,7 +1144,7 @@ SfxItemPresentation SwInvertGrf::GetPresentation( case SFX_ITEM_PRESENTATION_COMPLETE: if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) { - sal_uInt16 nId = 0 != GetValue() ? STR_INVERT : STR_INVERT_NOT; + sal_uInt16 nId = GetValue() ? STR_INVERT : STR_INVERT_NOT; rText = SW_RESSTR( nId ); } break; diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index 360e793ee6b4..ebc2affdc408 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -341,7 +341,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) uno::Any aPFamily = xStyles->getByName( "PageStyles" ); uno::Reference< container::XNameContainer > xPFamily; - if( 0 == (EX_SHOW_DEFAULT_PAGE == nStyleFlags) + if( EX_SHOW_DEFAULT_PAGE != nStyleFlags && (aPFamily >>= xPFamily) && !sPageStyle.isEmpty() ) { uno::Any aPStyle = xPFamily->getByName( sPageStyle ); diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index f60d86f20e07..d18ffdad6f88 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -733,21 +733,21 @@ long SwWrtShell::UpdateLayoutFrm(const Point *pPt, sal_Bool ) // Handler for toggling the modes. Returns back the old mode. -long SwWrtShell::ToggleAddMode() +bool SwWrtShell::ToggleAddMode() { bAddMode ? LeaveAddMode(): EnterAddMode(); Invalidate(); return !bAddMode; } -long SwWrtShell::ToggleBlockMode() +bool SwWrtShell::ToggleBlockMode() { bBlockMode ? LeaveBlockMode(): EnterBlockMode(); Invalidate(); return !bBlockMode; } -long SwWrtShell::ToggleExtMode() +bool SwWrtShell::ToggleExtMode() { bExtMode ? LeaveExtMode() : EnterExtMode(); Invalidate(); diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 7472a6d49698..4f03d0dc84ce 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -1644,7 +1644,7 @@ sal_Bool SwWrtShell::Pop( sal_Bool bOldCrsr ) bool SwWrtShell::CanInsert() { - return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL))); + return (!(IsSelFrmMode() || IsObjSelected() || (GetView().GetDrawFuncPtr() != NULL) || (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL))); } void SwWrtShell::ChgDBData(const SwDBData& aDBData) -- cgit