[Libreoffice-commits] core.git: basegfx/source chart2/source compilerplugins/clang cui/source editeng/source extensions/source forms/source include/svx sc/source sd/source svtools/source svx/source unoidl/source vcl/source vcl/unx writerfilter/source xmloff/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Apr 5 12:21:52 UTC 2017


 basegfx/source/polygon/b3dpolygon.cxx                 |    2 +-
 chart2/source/controller/dialogs/tp_Scale.cxx         |    4 ++--
 compilerplugins/clang/redundantcast.cxx               |    7 ++++---
 cui/source/dialogs/SpellDialog.cxx                    |    2 +-
 cui/source/tabpages/chardlg.cxx                       |    2 +-
 editeng/source/items/frmitems.cxx                     |    4 ++--
 editeng/source/items/textitem.cxx                     |   12 ++++++------
 extensions/source/propctrlr/cellbindinghandler.cxx    |    2 +-
 extensions/source/propctrlr/cellbindinghelper.cxx     |    2 +-
 forms/source/helper/formnavigation.cxx                |    2 +-
 include/svx/svdpntv.hxx                               |    8 ++++----
 sc/source/core/data/dpcache.cxx                       |    4 ++--
 sc/source/core/tool/dbdata.cxx                        |    6 +++---
 sc/source/ui/miscdlgs/acredlin.cxx                    |    4 ++--
 sc/source/ui/miscdlgs/warnbox.cxx                     |    2 +-
 sc/source/ui/unoobj/dapiuno.cxx                       |    2 +-
 sc/source/ui/view/tabcont.cxx                         |    2 +-
 sd/source/core/sdpage.cxx                             |    2 +-
 sd/source/filter/ppt/pptatom.hxx                      |    2 +-
 sd/source/ui/dlg/masterlayoutdlg.cxx                  |    8 ++++----
 sd/source/ui/func/futext.cxx                          |    2 +-
 sd/source/ui/unoidl/UnoDocumentSettings.cxx           |    2 +-
 svtools/source/brwbox/datwin.cxx                      |    2 +-
 svtools/source/control/fmtfield.cxx                   |    2 +-
 svtools/source/control/ruler.cxx                      |    2 +-
 svx/source/engine3d/obj3d.cxx                         |    2 +-
 svx/source/fmcomp/gridctrl.cxx                        |    2 +-
 svx/source/sdr/contact/displayinfo.cxx                |    6 +++---
 svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx |    4 ++--
 svx/source/sdr/overlay/overlayobject.cxx              |    6 +++---
 svx/source/svdraw/svddrgv.cxx                         |    2 +-
 svx/source/svdraw/svdoashp.cxx                        |    2 +-
 svx/source/svdraw/svdopath.cxx                        |    2 +-
 svx/source/svdraw/svdotext.cxx                        |    2 +-
 svx/source/svdraw/svdpage.cxx                         |    2 +-
 svx/source/svdraw/svdpntv.cxx                         |    8 ++++----
 unoidl/source/sourceprovider-scanner.hxx              |    4 ++--
 vcl/source/app/settings.cxx                           |    4 ++--
 vcl/source/window/split.cxx                           |    2 +-
 vcl/unx/generic/window/salframe.cxx                   |    4 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx     |    2 +-
 xmloff/source/style/xmlbahdl.cxx                      |    2 +-
 42 files changed, 73 insertions(+), 72 deletions(-)

New commits:
commit 572e9cde744e2b482a04ff4b457ad2cfde5f70d2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Apr 5 12:26:29 2017 +0200

    loplugin:redundantcast find c-style bool casts
    
    Change-Id: I3237b93babc67de12c3771aa84766c2141ca93b2
    Reviewed-on: https://gerrit.libreoffice.org/36137
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basegfx/source/polygon/b3dpolygon.cxx b/basegfx/source/polygon/b3dpolygon.cxx
index 5fb8bcd50097..acf1ec8c3458 100644
--- a/basegfx/source/polygon/b3dpolygon.cxx
+++ b/basegfx/source/polygon/b3dpolygon.cxx
@@ -875,7 +875,7 @@ public:
 
     void setClosed(bool bNew)
     {
-        if(bNew != (bool)mbIsClosed)
+        if(bNew != mbIsClosed)
         {
             mbIsClosed = bNew;
         }
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index 29ff3261a810..a0b8070f0cff 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -313,7 +313,7 @@ void ScaleTabPage::Reset(const SfxItemSet* rInAttrs)
 
     const SfxPoolItem *pPoolItem = nullptr;
     if (rInAttrs->GetItemState(SCHATTR_AXIS_ALLOW_DATEAXIS, true, &pPoolItem) == SfxItemState::SET)
-        m_bAllowDateAxis = (bool) static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+        m_bAllowDateAxis = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
     m_nAxisType=chart2::AxisType::REALNUMBER;
     if (rInAttrs->GetItemState(SCHATTR_AXISTYPE, true, &pPoolItem) == SfxItemState::SET)
         m_nAxisType = (int) static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
@@ -323,7 +323,7 @@ void ScaleTabPage::Reset(const SfxItemSet* rInAttrs)
     {
         bool bAutoDateAxis = false;
         if (rInAttrs->GetItemState(SCHATTR_AXIS_AUTO_DATEAXIS, true, &pPoolItem) == SfxItemState::SET)
-            bAutoDateAxis = (bool) static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+            bAutoDateAxis = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
 
         sal_uInt16 nPos = 0;
         if( m_nAxisType==chart2::AxisType::DATE )
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx
index 17e3bac33ca7..7b3b05d8aced 100644
--- a/compilerplugins/clang/redundantcast.cxx
+++ b/compilerplugins/clang/redundantcast.cxx
@@ -299,14 +299,15 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
     }
     auto t1 = getSubExprAsWritten(expr)->getType();
     auto t2 = expr->getTypeAsWritten();
-    if (loplugin::TypeCheck(t1).Enum() && loplugin::TypeCheck(t2).Enum() && t1 == t2) {
+    if (loplugin::TypeCheck(t1).Enum() && t1 == t2) {
         report(
             DiagnosticsEngine::Warning,
             "redundant cstyle enum cast from %0 to %1", expr->getExprLoc())
             << t1 << t2 << expr->getSourceRange();
         return true;
     }
-    if (loplugin::TypeCheck(t1).Typedef() && loplugin::TypeCheck(t2).Typedef() && t1 == t2)
+    bool bBuiltinTypeBool = t1->isSpecificBuiltinType(BuiltinType::Bool);
+    if ((bBuiltinTypeBool || loplugin::TypeCheck(t1).Typedef()) && t1 == t2)
     {
         // Ignore FD_ISSET expanding to "...(SOCKET)(fd)..." in some Microsoft
         // winsock2.h (TODO: improve heuristic of determining that the whole
@@ -332,7 +333,7 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
         }
         report(
             DiagnosticsEngine::Warning,
-            "redundant cstyle typedef cast from %0 to %1", expr->getExprLoc())
+            "redundant cstyle cast from %0 to %1", expr->getExprLoc())
             << t1 << t2 << expr->getSourceRange();
         return true;
     }
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 7c6dfe4083c7..cbab8a5d718d 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -382,7 +382,7 @@ void SpellDialog::UpdateBoxes_Impl()
         m_pExplainLink->Hide();
     }
 
-    if (bOldShowExplain != (bool) m_pExplainLink->IsVisible() || bOldShowGrammar != (bool) m_pCheckGrammarCB->IsVisible())
+    if (bOldShowExplain != m_pExplainLink->IsVisible() || bOldShowGrammar != m_pCheckGrammarCB->IsVisible())
         setOptimalLayoutSize();
 }
 
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index f0ee84891b5b..744b98135ada 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -2257,7 +2257,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
     if ( pOld )
     {
         const SvxWordLineModeItem& rItem = *static_cast<const SvxWordLineModeItem*>(pOld);
-        if ( rItem.GetValue() == (bool) m_pIndividualWordsBtn->IsChecked() )
+        if ( rItem.GetValue() == m_pIndividualWordsBtn->IsChecked() )
             bChanged = false;
     }
 
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index a17b172c523b..61bd4a58f3a1 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -467,7 +467,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             break;
 
         case MID_FIRST_AUTO:
-            rVal <<= (bool) IsAutoFirst();
+            rVal <<= IsAutoFirst();
             break;
 
         default:
@@ -1196,7 +1196,7 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             return false;
     }
 
-    rVal <<= (bool) bValue;
+    rVal <<= bValue;
     return true;
 }
 
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index dbab08c88270..f3380c46fe89 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -509,7 +509,7 @@ bool SvxPostureItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch( nMemberId )
     {
         case MID_ITALIC:
-            rVal <<= (bool)GetBoolValue();
+            rVal <<= GetBoolValue();
             break;
         case MID_POSTURE:
             rVal <<= vcl::unohelper::ConvertFontSlant(GetValue());
@@ -645,7 +645,7 @@ bool SvxWeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch( nMemberId )
     {
         case MID_BOLD   :
-            rVal <<= (bool)GetBoolValue();
+            rVal <<= GetBoolValue();
         break;
         case MID_WEIGHT:
         {
@@ -1274,7 +1274,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch(nMemberId)
     {
     case MID_TEXTLINED:
-        rVal <<= (bool)GetBoolValue();
+        rVal <<= GetBoolValue();
         break;
     case MID_TL_STYLE:
         rVal <<= (sal_Int16)(GetValue());
@@ -1283,7 +1283,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         rVal <<= (sal_Int32)( mColor.GetColor() );
         break;
     case MID_TL_HASCOLOR:
-        rVal <<= (bool) !mColor.GetTransparency();
+        rVal <<= !mColor.GetTransparency();
         break;
     }
     return true;
@@ -1475,7 +1475,7 @@ bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch(nMemberId)
     {
         case MID_CROSSED_OUT:
-            rVal <<= (bool) GetBoolValue();
+            rVal <<= GetBoolValue();
         break;
         case MID_CROSS_OUT:
             rVal <<= (sal_Int16)(GetValue());
@@ -2997,7 +2997,7 @@ bool SvxCharRotateItem::QueryValue( css::uno::Any& rVal,
         SvxTextRotateItem::QueryValue(rVal, nMemberId);
         break;
     case MID_FITTOLINE:
-        rVal <<= (bool) IsFitToLine();
+        rVal <<= IsFitToLine();
         break;
     default:
         bRet = false;
diff --git a/extensions/source/propctrlr/cellbindinghandler.cxx b/extensions/source/propctrlr/cellbindinghandler.cxx
index 930f717301c7..b45657864ab5 100644
--- a/extensions/source/propctrlr/cellbindinghandler.cxx
+++ b/extensions/source/propctrlr/cellbindinghandler.cxx
@@ -312,7 +312,7 @@ namespace pcr
                 if ( xBinding.is() )
                 {
                     bool bNeedIntegerBinding = ( nExchangeType == 1 );
-                    if ( (bool)bNeedIntegerBinding != CellBindingHelper::isCellIntegerBinding( xBinding ) )
+                    if ( bNeedIntegerBinding != CellBindingHelper::isCellIntegerBinding( xBinding ) )
                     {
                         CellAddress aAddress;
                         if ( m_pHelper->getAddressFromCellBinding( xBinding, aAddress ) )
diff --git a/extensions/source/propctrlr/cellbindinghelper.cxx b/extensions/source/propctrlr/cellbindinghelper.cxx
index d4c4d820bf35..47b146b0bc9c 100644
--- a/extensions/source/propctrlr/cellbindinghelper.cxx
+++ b/extensions/source/propctrlr/cellbindinghelper.cxx
@@ -306,7 +306,7 @@ namespace pcr
             OSL_ENSURE( xBindingProps.is() || !_rxBinding.is(), "CellBindingHelper::getAddressFromCellBinding: no property set for the binding!" );
             if ( xBindingProps.is() )
             {
-                bReturn = (bool)( xBindingProps->getPropertyValue( PROPERTY_BOUND_CELL ) >>= _rAddress );
+                bReturn = ( xBindingProps->getPropertyValue( PROPERTY_BOUND_CELL ) >>= _rAddress );
             }
         }
         catch( const Exception& )
diff --git a/forms/source/helper/formnavigation.cxx b/forms/source/helper/formnavigation.cxx
index 1a8cde45eaae..018d04c87b90 100644
--- a/forms/source/helper/formnavigation.cxx
+++ b/forms/source/helper/formnavigation.cxx
@@ -332,7 +332,7 @@ namespace frm
         if ( m_aSupportedFeatures.end() != aInfo )
             aInfo->second.aCachedAdditionalState >>= bState;
 
-        return (bool)bState;
+        return bState;
     }
 
 
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index b660297d573c..da219d703f8e 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -392,10 +392,10 @@ public:
     bool getHideChart() const { return mbHideChart; }
     bool getHideDraw() const { return mbHideDraw; }
     bool getHideFormControl() const { return mbHideFormControl; }
-    void setHideOle(bool bNew) { if(bNew != (bool)mbHideOle) mbHideOle = bNew; }
-    void setHideChart(bool bNew) { if(bNew != (bool)mbHideChart) mbHideChart = bNew; }
-    void setHideDraw(bool bNew) { if(bNew != (bool)mbHideDraw) mbHideDraw = bNew; }
-    void setHideFormControl(bool bNew) { if(bNew != (bool)mbHideFormControl) mbHideFormControl = bNew; }
+    void setHideOle(bool bNew) { if(bNew != mbHideOle) mbHideOle = bNew; }
+    void setHideChart(bool bNew) { if(bNew != mbHideChart) mbHideChart = bNew; }
+    void setHideDraw(bool bNew) { if(bNew != mbHideDraw) mbHideDraw = bNew; }
+    void setHideFormControl(bool bNew) { if(bNew != mbHideFormControl) mbHideFormControl = bNew; }
 
     void SetGridCoarse(const Size& rSiz) { maGridBig=rSiz; }
     void SetGridFine(const Size& rSiz) {
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 48dfa09f5150..ccd967b65c49 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -520,8 +520,8 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const
                 sal_Int32 nStart = 0;
                 sal_Int32 nEnd   = aCellStr.getLength();
 
-                bool bMatch = (bool) rEntry.GetSearchTextPtr( rParam.eSearchType, rParam.bCaseSens, bMatchWholeCell )
-                              ->SearchForward( aCellStr, &nStart, &nEnd );
+                bool bMatch = rEntry.GetSearchTextPtr( rParam.eSearchType, rParam.bCaseSens, bMatchWholeCell )
+                                ->SearchForward( aCellStr, &nStart, &nEnd );
                 // from 614 on, nEnd is behind the found text
                 if (bMatch && bMatchWholeCell
                     && (nStart != 0 || nEnd != aCellStr.getLength()))
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 7196db50201b..ccc19bcd1b49 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -496,9 +496,9 @@ bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion
 
 bool ScDBData::IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
 {
-    return (bool)((nTab == nTable)
-                    && (nCol1 == nStartCol) && (nRow1 == nStartRow)
-                    && (nCol2 == nEndCol) && (nRow2 == nEndRow));
+    return (nTab == nTable)
+           && (nCol1 == nStartCol) && (nRow1 == nStartRow)
+           && (nCol2 == nEndCol) && (nRow2 == nEndRow);
 }
 
 bool ScDBData::HasImportParam() const
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 307d7527d706..f33efa354854 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1627,8 +1627,8 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, UpdateSelectionHdl, Timer *, void)
         ScRedlinData* pEntryData = static_cast<ScRedlinData*>(pEntry->GetUserData());
         if( pEntryData )
         {
-            bRejectFlag &= (bool) pEntryData->bIsRejectable;
-            bAcceptFlag &= (bool) pEntryData->bIsAcceptable;
+            bRejectFlag &= pEntryData->bIsRejectable;
+            bAcceptFlag &= pEntryData->bIsAcceptable;
 
             const ScChangeAction* pScChangeAction = static_cast<ScChangeAction*>(pEntryData->pData);
             if( pScChangeAction && (pScChangeAction->GetType() != SC_CAT_DELETE_TABS) &&
diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index 22d2fb2ccdd9..55d473ef9720 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -37,7 +37,7 @@ ScReplaceWarnBox::ScReplaceWarnBox( vcl::Window* pParent ) :
 sal_Int16 ScReplaceWarnBox::Execute()
 {
     sal_Int16 nRet = RET_YES;
-    if( (bool) SC_MOD()->GetInputOptions().GetReplaceCellsWarn() )
+    if( SC_MOD()->GetInputOptions().GetReplaceCellsWarn() )
     {
         nRet = WarningBox::Execute();
         if (!GetCheckBoxState())
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 6c1efce1ca4d..cd6635af5133 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -3427,7 +3427,7 @@ Any SAL_CALL ScDataPilotItemObj::getPropertyValue( const OUString& aPropertyName
                 {
                     if (pMember && pMember->HasShowDetails())
                     {
-                        aRet <<= (bool)pMember->GetShowDetails();
+                        aRet <<= pMember->GetShowDetails();
                     }
                     else
                     {
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index c6aa46fb4a97..0329c023ef8a 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -383,7 +383,7 @@ void ScTabControl::UpdateStatus()
     {
         bModified = false;                                          // selection
         for (i=0; i<nMaxCnt && !bModified; i++)
-            if ( rMark.GetTableSelect(i) != (bool) IsPageSelected(static_cast<sal_uInt16>(i)+1) )
+            if ( rMark.GetTableSelect(i) != IsPageSelected(static_cast<sal_uInt16>(i)+1) )
                 bModified = true;
 
         if ( bModified )
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index afb247e441b2..3d5577608368 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2937,7 +2937,7 @@ bool SdPage::RestoreDefaultText( SdrObject* pObj )
                     // not changed object.
                     if(pTextObj
                         && pTextObj->GetOutlinerParaObject()
-                        && pTextObj->GetOutlinerParaObject()->IsVertical() != (bool)bVertical)
+                        && pTextObj->GetOutlinerParaObject()->IsVertical() != bVertical)
                     {
                         ::tools::Rectangle aObjectRect = pTextObj->GetSnapRect();
                         pTextObj->GetOutlinerParaObject()->SetVertical(bVertical);
diff --git a/sd/source/filter/ppt/pptatom.hxx b/sd/source/filter/ppt/pptatom.hxx
index c23e662442b1..c03882ed6994 100644
--- a/sd/source/filter/ppt/pptatom.hxx
+++ b/sd/source/filter/ppt/pptatom.hxx
@@ -97,7 +97,7 @@ inline const Atom* Atom::findNextChildAtom( const Atom* pLast )
 
 inline bool Atom::isContainer() const
 {
-    return (bool)maRecordHeader.IsContainer();
+    return maRecordHeader.IsContainer();
 }
 
 inline bool Atom::seekToContent() const
diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx
index 62f8a1578f60..7508b4c49dae 100644
--- a/sd/source/ui/dlg/masterlayoutdlg.cxx
+++ b/sd/source/ui/dlg/masterlayoutdlg.cxx
@@ -100,7 +100,7 @@ void MasterLayoutDialog::applyChanges()
 {
     mpDoc->BegUndo(GetText());
 
-    if( (mpCurrentPage->GetPageKind() != PageKind::Standard) && (mbOldHeader != (bool) mpCBHeader->IsChecked() ) )
+    if( (mpCurrentPage->GetPageKind() != PageKind::Standard) && (mbOldHeader != mpCBHeader->IsChecked() ) )
     {
         if( mbOldHeader )
             remove( PRESOBJ_HEADER );
@@ -108,7 +108,7 @@ void MasterLayoutDialog::applyChanges()
             create( PRESOBJ_HEADER );
     }
 
-    if( mbOldFooter != (bool) mpCBFooter->IsChecked() )
+    if( mbOldFooter != mpCBFooter->IsChecked() )
     {
         if( mbOldFooter )
             remove( PRESOBJ_FOOTER );
@@ -116,7 +116,7 @@ void MasterLayoutDialog::applyChanges()
             create( PRESOBJ_FOOTER );
     }
 
-    if( mbOldDate != (bool) mpCBDate->IsChecked() )
+    if( mbOldDate != mpCBDate->IsChecked() )
     {
         if( mbOldDate )
             remove( PRESOBJ_DATETIME );
@@ -124,7 +124,7 @@ void MasterLayoutDialog::applyChanges()
             create( PRESOBJ_DATETIME );
     }
 
-    if( mbOldPageNumber != (bool) mpCBPageNumber->IsChecked() )
+    if( mbOldPageNumber != mpCBPageNumber->IsChecked() )
     {
         if( mbOldPageNumber )
             remove( PRESOBJ_SLIDENUMBER );
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 9f1f57a02df2..4f9955ceea3a 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -699,7 +699,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
                 pPara = GetTextObj()->GetOutlinerParaObject();
             }
 
-            if(pPara && (bool)bVertical != pPara->IsVertical())
+            if(pPara && bVertical != pPara->IsVertical())
             {
                 // set ParaObject orientation accordingly
                 pPara->SetVertical(bVertical);
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index aacfa2b133c8..6d54f1cb47e9 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -252,7 +252,7 @@ void DocumentSettings::AssignURL( XPropertyListType t, const Any* pValue,
                                   bool *pOk, bool *pChanged )
 {
     OUString aURL;
-    if( !(bool)( *pValue >>= aURL ) )
+    if( !( *pValue >>= aURL ) )
         return;
 
     if( LoadList( t, aURL, ""/*TODO?*/, uno::Reference< embed::XStorage >() ) )
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 29a4f2a3d6ae..14070f1613cf 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -633,7 +633,7 @@ BrowserExecuteDropEvent::BrowserExecuteDropEvent( BrowserDataWin *pWindow, const
 void BrowserDataWin::SetUpdateMode( bool bMode )
 {
     DBG_ASSERT( !bUpdateMode || aInvalidRegion.empty(), "invalid region not empty" );
-    if ( (bool) bMode == bUpdateMode )
+    if ( bMode == bUpdateMode )
         return;
 
     bUpdateMode = bMode;
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index f747d80ce115..5deca350bbbe 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -636,7 +636,7 @@ void FormattedField::SetThousandsSep(bool _bUseSeparator)
     bool bThousand, IsRed;
     sal_uInt16 nPrecision, nAnzLeading;
     ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
-    if (bThousand == (bool)_bUseSeparator)
+    if (bThousand == _bUseSeparator)
         return;
 
     // we need the language for the following
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index ce1e4329ac11..717ec9109efa 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -2743,7 +2743,7 @@ void Ruler::DrawTab(vcl::RenderContext& rRenderContext, const Color &rFillColor,
 
 void Ruler::SetTextRTL(bool bRTL)
 {
-    if(mpData->bTextRTL != (bool) bRTL)
+    if(mpData->bTextRTL != bRTL)
     {
         mpData->bTextRTL = bRTL;
         if ( IsReallyVisible() && IsUpdateMode() )
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 959a39d9e67c..e1999f3b9a61 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -197,7 +197,7 @@ E3dObject::~E3dObject()
 
 void E3dObject::SetSelected(bool bNew)
 {
-    if((bool)mbIsSelected != bNew)
+    if(mbIsSelected != bNew)
     {
         mbIsSelected = bNew;
     }
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 0dc400b43024..275b19b96910 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2602,7 +2602,7 @@ void DbGridControl::AppendNew()
 
 void DbGridControl::SetDesignMode(bool bMode)
 {
-    if ((bool) IsDesignMode() != bMode)
+    if (IsDesignMode() != bMode)
     {
         // adjust Enable/Disable for design mode so that the headerbar remains configurable
         if (bMode)
diff --git a/svx/source/sdr/contact/displayinfo.cxx b/svx/source/sdr/contact/displayinfo.cxx
index 7904fa11a7bf..c3a219724d24 100644
--- a/svx/source/sdr/contact/displayinfo.cxx
+++ b/svx/source/sdr/contact/displayinfo.cxx
@@ -57,7 +57,7 @@ namespace sdr
 
         void DisplayInfo::SetControlLayerProcessingActive(bool bDoProcess)
         {
-            if((bool)mbControlLayerProcessingActive != bDoProcess)
+            if(mbControlLayerProcessingActive != bDoProcess)
             {
                 mbControlLayerProcessingActive = bDoProcess;
             }
@@ -65,7 +65,7 @@ namespace sdr
 
         void DisplayInfo::SetPageProcessingActive(bool bDoProcess)
         {
-            if((bool)mbPageProcessingActive != bDoProcess)
+            if(mbPageProcessingActive != bDoProcess)
             {
                 mbPageProcessingActive = bDoProcess;
             }
@@ -83,7 +83,7 @@ namespace sdr
 
         void DisplayInfo::SetSubContentActive(bool bNew)
         {
-            if((bool)mbSubContentActive != bNew)
+            if(mbSubContentActive != bNew)
             {
                 mbSubContentActive = bNew;
             }
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
index 871ede94b948..65f21ca3e438 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
@@ -438,7 +438,7 @@ bool ViewObjectContactOfPageGrid::isPrimitiveVisible(const DisplayInfo& rDisplay
         return false;
     }
 
-    if(static_cast< ViewContactOfGrid& >(GetViewContact()).getFront() != (bool)rView.IsGridFront())
+    if(static_cast< ViewContactOfGrid& >(GetViewContact()).getFront() != rView.IsGridFront())
     {
         return false;
     }
@@ -516,7 +516,7 @@ bool ViewObjectContactOfPageHelplines::isPrimitiveVisible(const DisplayInfo& rDi
         return false;
     }
 
-    if(static_cast< ViewContactOfHelplines& >(GetViewContact()).getFront() != (bool)rView.IsHlplFront())
+    if(static_cast< ViewContactOfHelplines& >(GetViewContact()).getFront() != rView.IsHlplFront())
     {
         return false;
     }
diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx
index 1eda46d241d2..aae05f9f0b96 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -78,7 +78,7 @@ namespace sdr
 
         void OverlayObject::allowAntiAliase(bool bNew)
         {
-            if(bNew != (bool)mbAllowsAntiAliase)
+            if(bNew != mbAllowsAntiAliase)
             {
                 // remember new value
                 mbAllowsAntiAliase = bNew;
@@ -136,7 +136,7 @@ namespace sdr
 
         void OverlayObject::setVisible(bool bNew)
         {
-            if(bNew != (bool)mbIsVisible)
+            if(bNew != mbIsVisible)
             {
                 // remember new value
                 mbIsVisible = bNew;
@@ -148,7 +148,7 @@ namespace sdr
 
         void OverlayObject::setHittable(bool bNew)
         {
-            if(bNew != (bool)mbIsHittable)
+            if(bNew != mbIsHittable)
             {
                 // remember new value
                 mbIsHittable = bNew;
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 787e7434ef9e..0a3a33f34b5a 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -884,7 +884,7 @@ void SdrDragView::SetMarkHandles(SfxViewShell* pOtherShell)
 
 void SdrDragView::SetSolidDragging(bool bOn)
 {
-    if((bool)mbSolidDragging != bOn)
+    if(mbSolidDragging != bOn)
     {
         mbSolidDragging = bOn;
     }
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index f0577a8b239e..0925ee583a62 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2190,7 +2190,7 @@ void SdrObjCustomShape::SetVerticalWriting( bool bVertical )
 
     if( pOutlinerParaObject )
     {
-        if(pOutlinerParaObject->IsVertical() != (bool)bVertical)
+        if(pOutlinerParaObject->IsVertical() != bVertical)
         {
             // get item settings
             const SfxItemSet& rSet = GetObjectItemSet();
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 595c004b531e..a14a864e2ed9 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -1796,7 +1796,7 @@ void SdrPathObj::ImpForceKind()
     {
         basegfx::B2DPolygon aCandidate(maPathPolygon.getB2DPolygon(a));
 
-        if((bool)IsClosed() != aCandidate.isClosed())
+        if(IsClosed() != aCandidate.isClosed())
         {
             // #i80213# really change polygon geometry; else e.g. the last point which
             // needs to be identical with the first one will be missing when opening
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index abbdb1117585..6e75fd299131 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1537,7 +1537,7 @@ void SdrTextObj::SetVerticalWriting(bool bVertical)
         pOutlinerParaObject = GetOutlinerParaObject();
     }
 
-    if( pOutlinerParaObject && (pOutlinerParaObject->IsVertical() != (bool)bVertical) )
+    if( pOutlinerParaObject && (pOutlinerParaObject->IsVertical() != bVertical) )
     {
         // get item settings
         const SfxItemSet& rSet = GetObjectItemSet();
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 6a287d67eedb..794a4e779e15 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1637,7 +1637,7 @@ OUString SdrPage::GetLayoutName() const
 
 void SdrPage::SetInserted( bool bIns )
 {
-    if( (bool) mbInserted != bIns )
+    if( mbInserted != bIns )
     {
         mbInserted = bIns;
 
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 2164abba3d71..b450544e7ee4 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -1184,7 +1184,7 @@ vcl::Window* SdrPaintView::GetItemBrowser() const
 
 void SdrPaintView::SetAnimationPause( bool bSet )
 {
-    if((bool)mbAnimationPause != bSet)
+    if(mbAnimationPause != bSet)
     {
         mbAnimationPause = bSet;
 
@@ -1271,7 +1271,7 @@ bool SdrPaintView::IsBufferedOutputAllowed() const
 
 void SdrPaintView::SetBufferedOutputAllowed(bool bNew)
 {
-    if(bNew != (bool)mbBufferedOutputAllowed)
+    if(bNew != mbBufferedOutputAllowed)
     {
         mbBufferedOutputAllowed = bNew;
     }
@@ -1284,7 +1284,7 @@ bool SdrPaintView::IsBufferedOverlayAllowed() const
 
 void SdrPaintView::SetBufferedOverlayAllowed(bool bNew)
 {
-    if(bNew != (bool)mbBufferedOverlayAllowed)
+    if(bNew != mbBufferedOverlayAllowed)
     {
         mbBufferedOverlayAllowed = bNew;
     }
@@ -1293,7 +1293,7 @@ void SdrPaintView::SetBufferedOverlayAllowed(bool bNew)
 
 void SdrPaintView::SetPagePaintingAllowed(bool bNew)
 {
-    if(bNew != (bool)mbPagePaintingAllowed)
+    if(bNew != mbPagePaintingAllowed)
     {
         mbPagePaintingAllowed = bNew;
     }
diff --git a/unoidl/source/sourceprovider-scanner.hxx b/unoidl/source/sourceprovider-scanner.hxx
index 522b19a59f12..abc91259a0b3 100644
--- a/unoidl/source/sourceprovider-scanner.hxx
+++ b/unoidl/source/sourceprovider-scanner.hxx
@@ -62,7 +62,7 @@ public:
         rtl::Reference<unoidl::PlainStructTypeEntity> const & theBaseEntity):
         SourceProviderEntityPad(published), baseName(theBaseName),
         baseEntity(theBaseEntity)
-    { assert(theBaseName.isEmpty() != (bool) theBaseEntity.is()); }
+    { assert(theBaseName.isEmpty() != theBaseEntity.is()); }
 
     OUString const baseName;
     rtl::Reference<unoidl::PlainStructTypeEntity> const baseEntity;
@@ -94,7 +94,7 @@ public:
         rtl::Reference<unoidl::ExceptionTypeEntity> const & theBaseEntity):
         SourceProviderEntityPad(published), baseName(theBaseName),
         baseEntity(theBaseEntity)
-    { assert(theBaseName.isEmpty() != (bool) theBaseEntity.is()); }
+    { assert(theBaseName.isEmpty() != theBaseEntity.is()); }
 
     OUString const baseName;
     rtl::Reference<unoidl::ExceptionTypeEntity> const baseEntity;
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 9422bab3b1a2..db8acb198729 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -1448,7 +1448,7 @@ StyleSettings::SetUseFlatBorders( bool bUseFlatBorders )
 bool
 StyleSettings::GetUseFlatBorders() const
 {
-    return (bool) mxData->mnUseFlatBorders;
+    return mxData->mnUseFlatBorders;
 }
 
 void
@@ -1461,7 +1461,7 @@ StyleSettings::SetUseFlatMenus( bool bUseFlatMenus )
 bool
 StyleSettings::GetUseFlatMenus() const
 {
-    return (bool) mxData->mnUseFlatMenus;
+    return mxData->mnUseFlatMenus;
 }
 
 void
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index d597a0e15594..0243de205deb 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -164,7 +164,7 @@ void Splitter::dispose()
 
 void Splitter::SetHorizontal(bool bNew)
 {
-    if(bNew != (bool)mbHorzSplit)
+    if(bNew != mbHorzSplit)
     {
         ImplInitHorVer(bNew);
     }
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 0828f68c3587..fcbe5c0456c6 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2104,7 +2104,7 @@ void X11SalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen )
 {
     if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 )
     {
-        if( mbFullScreen == (bool)bFullScreen )
+        if( mbFullScreen == bFullScreen )
             return;
         if( bFullScreen )
         {
@@ -2169,7 +2169,7 @@ void X11SalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen )
             if( bVisible )
                 Show( true );
         }
-        if( mbFullScreen == (bool)bFullScreen )
+        if( mbFullScreen == bFullScreen )
             return;
 
         pDisplay_->getWMAdaptor()->showFullScreen( this, bFullScreen );
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 866b42e5d85a..f8eeb4c6a15b 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -110,7 +110,7 @@ void lcl_linenumberingHeaderFooter( const uno::Reference<container::XNameContain
             if( !xStyle.is() )
                 return;
             uno::Reference<beans::XPropertySet> xPropertySet( xStyle, uno::UNO_QUERY );
-            xPropertySet->setPropertyValue( getPropertyName( PROP_PARA_LINE_NUMBER_COUNT ), uno::makeAny( ( bool )( nListId >= 0 ) ) );
+            xPropertySet->setPropertyValue( getPropertyName( PROP_PARA_LINE_NUMBER_COUNT ), uno::makeAny( nListId >= 0 ) );
         }
     }
 }
diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx
index 06bf19bb1501..428508b79cbd 100644
--- a/xmloff/source/style/xmlbahdl.cxx
+++ b/xmloff/source/style/xmlbahdl.cxx
@@ -675,7 +675,7 @@ XMLIsTransparentPropHdl::~XMLIsTransparentPropHdl()
 
 bool XMLIsTransparentPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const
 {
-    bool bValue = ( (bool) (rStrImpValue == sTransparent) == bTransPropValue);
+    bool bValue = ( (rStrImpValue == sTransparent) == bTransPropValue);
     rValue <<= bValue;
 
     return true;


More information about the Libreoffice-commits mailing list