diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-23 18:43:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-23 18:43:53 +0100 |
commit | e3133ae2371b6e2d4b47daa6a3487ea4f2753315 (patch) | |
tree | f9a000ee6542fb470733bfed28199092a36c26c5 /sw | |
parent | 14f4e2fa22a0a2576808bab08edaf2e12f761cd8 (diff) |
Let C++ inline functions return bool instead of sal_Bool
...to improve diagnosing misuses of boolean expressions in client code (cf.
compilerplugins/clang/implicitboolconversion.cxx). This change should be
transparent to client code.
Missing overloads of insert() for bool have been added to OStringBuffer and
OUStringBuffer (which required dropping one !VALID_CONVERSION check that would
now pick that overload, but would be flagged by
compilerplugins/clang/pointertobool.cxx).
Change-Id: I2d64cd923b8f47bfaa31e753def6515c29a3f8c9
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/chrdlg/chardlg.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/config/optcomp.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/inc/chrdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/inc/swcont.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 2 |
7 files changed, 11 insertions, 12 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 6707eb5a35a7..d043f7e7a6ae 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -2017,8 +2017,7 @@ bool SwTxtNode::CountWords( SwDocStat& rStat, while ( aScanner.NextWord() ) { - // 1 is len(CH_TXTATR_BREAKWORD) : match returns length of match - if( 1 != aExpandText.match(aBreakWord, aScanner.GetBegin() )) + if( !aExpandText.match(aBreakWord, aScanner.GetBegin() )) { ++nTmpWords; const OUString &rWord = aScanner.GetWord(); diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 0f9175fb4f0f..f419d217d974 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1001,7 +1001,7 @@ sal_Int32 SwXCell::getError(void) throw( uno::RuntimeException ) { SolarMutexGuard aGuard; OUString sContent = getString(); - return sContent.equals(SwViewShell::GetShellRes()->aCalc_Error); + return sal_Int32(sContent.equals(SwViewShell::GetShellRes()->aCalc_Error)); } uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno::RuntimeException ) diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index f5cf92841338..d2b0e210888e 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -139,7 +139,7 @@ void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) SwCharURLPage::SwCharURLPage(Window* pParent, const SfxItemSet& rCoreSet) : SfxTabPage(pParent, "CharURLPage", "modules/swriter/ui/charurlpage.ui", rCoreSet) , pINetItem(0) - , bModified(sal_False) + , bModified(false) { get(m_pURLED, "urled"); @@ -268,14 +268,14 @@ sal_Bool SwCharURLPage::FillItemSet(SfxItemSet& rSet) aINetFmt.SetMacroTbl( &pINetItem->GetMacroTable() ); if(m_pVisitedLB->GetSavedValue() != m_pVisitedLB->GetSelectEntryPos()) - bModified = sal_True; + bModified = true; if(m_pNotVisitedLB->GetSavedValue() != m_pNotVisitedLB->GetSelectEntryPos()) - bModified = sal_True; + bModified = true; if(m_pTextED->IsModified()) { - bModified = sal_True; + bModified = true; rSet.Put(SfxStringItem(FN_PARAM_SELECTION, m_pTextED->GetText())); } if(bModified) diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 7adb09ef5e08..958a613f8064 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -269,8 +269,8 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) bAddSpacingAtPages, bUseOurTabStops, bNoExtLeading, bUseLineSpacing, bAddTableSpacing, bUseObjPos, bUseOurTextWrapping, bConsiderWrappingStyle, bExpandWordSpace, - ( sName.equals( DEFAULT_ENTRY ) != sal_False ), - ( sName.equals( USER_ENTRY ) != sal_False ) ); + sName.equals( DEFAULT_ENTRY ), + sName.equals( USER_ENTRY ) ); m_pImpl->m_aList.push_back( aItem ); if ( aItem.m_bIsDefault ) diff --git a/sw/source/ui/inc/chrdlg.hxx b/sw/source/ui/inc/chrdlg.hxx index 4b13eb2b8a3b..c01cc2d16357 100644 --- a/sw/source/ui/inc/chrdlg.hxx +++ b/sw/source/ui/inc/chrdlg.hxx @@ -72,7 +72,7 @@ class SwCharURLPage : public SfxTabPage VclContainer* m_pCharStyleContainer; SvxMacroItem* pINetItem; - sal_Bool bModified; + bool bModified; DECL_LINK(InsertFileHdl, void *); DECL_LINK(EventHdl, void *); diff --git a/sw/source/ui/inc/swcont.hxx b/sw/source/ui/inc/swcont.hxx index 32987a5b0a4b..ce9566f8c18c 100644 --- a/sw/source/ui/inc/swcont.hxx +++ b/sw/source/ui/inc/swcont.hxx @@ -84,7 +84,7 @@ public: // they're never equal, otherwise they'd fall out of the array return sal_False; } - int operator<(const SwContent& rCont) const + bool operator<(const SwContent& rCont) const { // at first sort by position and then by name return nYPosition != rCont.nYPosition ? diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index c76cce8a8650..706b0de750ed 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1233,7 +1233,7 @@ IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl) //insert or update the SwAuthorityField... if(pSh) { - sal_Bool bDifferent = sal_False; + bool bDifferent = false; OSL_ENSURE(!m_sFields[AUTH_FIELD_IDENTIFIER].isEmpty() , "No Id is set!"); OSL_ENSURE(!m_sFields[AUTH_FIELD_AUTHORITY_TYPE].isEmpty() , "No authority type is set!"); //check if the entry already exists with different content |