[Libreoffice-commits] core.git: 2 commits - basctl/source cppcanvas/source i18npool/source nlpsolver/ThirdParty sc/source sd/source sfx2/source svtools/source svx/source ucb/workben vcl/source vcl/win

Jan Holesovsky kendy at collabora.com
Fri May 9 13:29:13 PDT 2014


 basctl/source/dlged/managelang.cxx                                                 |    6 ++---
 cppcanvas/source/mtfrenderer/implrenderer.cxx                                      |    2 -
 i18npool/source/nativenumber/nativenumbersupplier.cxx                              |    2 -
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalFile.java |    4 +--
 sc/source/core/tool/address.cxx                                                    |    4 +--
 sc/source/core/tool/chgtrack.cxx                                                   |   12 +++++-----
 sd/source/ui/slideshow/slideshowimpl.cxx                                           |    6 ++---
 sfx2/source/appl/newhelp.cxx                                                       |    6 ++---
 sfx2/source/dialog/versdlg.cxx                                                     |    8 +++---
 svtools/source/contnr/fileview.cxx                                                 |    2 -
 svtools/source/contnr/svlbitm.cxx                                                  |    2 -
 svtools/source/contnr/treelistbox.cxx                                              |    2 -
 svx/source/form/formcontroller.cxx                                                 |    2 -
 svx/source/inc/datanavi.hxx                                                        |    2 -
 svx/source/table/cell.cxx                                                          |    2 -
 ucb/workben/ucb/ucbdemo.cxx                                                        |    4 +--
 vcl/source/fontsubset/cff.cxx                                                      |    2 -
 vcl/win/source/gdi/salgdi3.cxx                                                     |    2 -
 18 files changed, 35 insertions(+), 35 deletions(-)

New commits:
commit 261b1ad80aae0dd9aba50190a4cf99011cc18fb9
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri May 9 20:59:53 2014 +0200

    '!= false' is redundant, and confusing - kill it.
    
    Change-Id: I1a52b9ce7b590e8cf274a2daaa1c55cfc1efe48b

diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index 5f0f4b8..175e464 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -209,10 +209,10 @@ IMPL_LINK_NOARG(ManageLanguageDialog, SelectHdl)
     bool bEmpty = ( !nCount ||
                     m_pLanguageLB->GetEntryPos( m_sCreateLangStr ) != LISTBOX_ENTRY_NOTFOUND );
     bool bSelect = ( m_pLanguageLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND );
-    bool bEnable = ( !bEmpty && bSelect != false );
+    bool bEnable = !bEmpty && bSelect;
 
-    m_pDeletePB->Enable( bEnable != false );
-    m_pMakeDefPB->Enable( bEnable != false && nCount > 1 && m_pLanguageLB->GetSelectEntryCount() == 1 );
+    m_pDeletePB->Enable(bEnable);
+    m_pMakeDefPB->Enable(bEnable && nCount > 1 && m_pLanguageLB->GetSelectEntryCount() == 1);
 
     return 1;
 }
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 839aa40..5b8c437 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -93,7 +93,7 @@ namespace
                                                           const cppcanvas::CanvasSharedPtr& rCanvas )
     {
         // set rIsColorSet and check for true at the same time
-        if( (rIsColorSet=pAct->IsSetting()) != false )
+        if (rIsColorSet = pAct->IsSetting())
         {
             ::Color aColor( pAct->GetColor() );
 
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 18d1374..51942ef 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -224,7 +224,7 @@ OUString SAL_CALL AsciiToNative( const OUString& inStr, sal_Int32 startPos, sal_
                     len = 0;
                 }
                 if (i < nCount) {
-                    if ((doDecimal = (!doDecimal && i < nCount-1 && isDecimal(str[i]) && isNumber(str[i+1]))) != false)
+                    if (doDecimal = (!doDecimal && i < nCount-1 && isDecimal(str[i]) && isNumber(str[i+1])))
                         newStr[count] = (DecimalChar[number->number] ? DecimalChar[number->number] : str[i]);
                     else if (i < nCount-1 && isMinus(str[i]) && isNumber(str[i+1]))
                         newStr[count] = (MinusChar[number->number] ? MinusChar[number->number] : str[i]);
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalFile.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalFile.java
index 03390e9..b494d46 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalFile.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalFile.java
@@ -144,11 +144,11 @@ public class GlobalFile {
       StringTokenizer st;
       String s;
       boolean start = false;
-      while(inReader.ready()!=false){
+      while(inReader.ready()){
         st = new StringTokenizer(inReader.readLine());
         over:{
         while(!st.hasMoreTokens()){//Justify blank lines.
-          if(inReader.ready()!=false){
+          if(inReader.ready()){
             st = new StringTokenizer(inReader.readLine());
           }else
             break over;
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 825daae..d1ea155 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -615,7 +615,7 @@ static const sal_Unicode* lcl_r1c1_get_col( const sal_Unicode* p,
         return NULL;
 
     p++;
-    if( (isRelative = (*p == '[') ) != false )
+    if( isRelative = (*p == '[') )
         p++;
     n = sal_Unicode_strtol( p, &pEnd );
     if( NULL == pEnd )
@@ -661,7 +661,7 @@ static inline const sal_Unicode* lcl_r1c1_get_row(
         return NULL;
 
     p++;
-    if( (isRelative = (*p == '[') ) != false )
+    if( isRelative = (*p == '[') )
         p++;
     n = sal_Unicode_strtol( p, &pEnd );
     if( NULL == pEnd )
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index fe280e3..f6def98 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -1018,12 +1018,12 @@ bool ScChangeActionDel::Reject( ScDocument* pDoc )
                 case SC_CAT_DELETE_COLS :
                     if ( !(aRange.aStart.Col() == 0 && aRange.aEnd.Col() == MAXCOL) )
                     {   // Only if not TabDelete
-                        if ( ( bOk = pDoc->CanInsertCol( aRange ) ) != false )
+                        if ( bOk = pDoc->CanInsertCol( aRange ) )
                             bOk = pDoc->InsertCol( aRange );
                     }
                 break;
                 case SC_CAT_DELETE_ROWS :
-                    if ( ( bOk = pDoc->CanInsertRow( aRange ) ) != false )
+                    if ( bOk = pDoc->CanInsertRow( aRange ) )
                         bOk = pDoc->InsertRow( aRange );
                 break;
                 case SC_CAT_DELETE_TABS :
@@ -1031,7 +1031,7 @@ bool ScChangeActionDel::Reject( ScDocument* pDoc )
                     //TODO: Remember table names?
                     OUString aName;
                     pDoc->CreateValidTabName( aName );
-                    if ( ( bOk = pDoc->ValidNewTabName( aName ) ) != false )
+                    if ( bOk = pDoc->ValidNewTabName( aName ) )
                         bOk = pDoc->InsertTab( aRange.aStart.Tab(), aName );
                 }
                 break;
@@ -4224,7 +4224,7 @@ bool ScChangeTrack::Reject(
                     bOk = Reject( itChangeAction->second, NULL, true ); //! Recursion
             }
         }
-        if ( bOk && (bRejected = pAct->Reject( pDoc )) != false )
+        if ( bOk && (bRejected = pAct->Reject( pDoc )) )
         {
             // pRefDoc NULL := Do not save deleted Cells
             AppendDeleteRange( pAct->GetBigRange().MakeRange(), NULL, (short) 0,
@@ -4337,7 +4337,7 @@ bool ScChangeTrack::Reject(
                 bOk = Reject( itChangeAction->second, NULL, true );//! Recursion
             }
         }
-        if ( bOk && (bRejected = pAct->Reject( pDoc )) != false )
+        if ( bOk && (bRejected = pAct->Reject( pDoc )) )
         {
             ScChangeActionMove* pReject = new ScChangeActionMove(
                 pAct->GetBigRange().MakeRange(),
@@ -4361,7 +4361,7 @@ bool ScChangeTrack::Reject(
             aCell.assign(*pDoc, aRange.aStart);
             pReject->SetOldValue(aCell, pDoc, pDoc);
         }
-        if ( (bRejected = pAct->Reject( pDoc )) != false && !bRecursion )
+        if ( (bRejected = pAct->Reject( pDoc )) && !bRecursion )
         {
             ScCellValue aCell;
             aCell.assign(*pDoc, aRange.aStart);
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 8e2f17e..e9dd1f6 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -1056,7 +1056,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
 
             aProperties.push_back(
                 beans::PropertyValue( "ImageAnimationsAllowed" ,
-                    -1, Any( maPresSettings.mbAnimationAllowed != false ),
+                    -1, Any( maPresSettings.mbAnimationAllowed ),
                     beans::PropertyState_DIRECT_VALUE ) );
 
             const bool bZOrderEnabled(
@@ -1068,7 +1068,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
 
             aProperties.push_back(
                 beans::PropertyValue( "ForceManualAdvance" ,
-                    -1, Any( maPresSettings.mbManual != false ),
+                    -1, Any( maPresSettings.mbManual ),
                     beans::PropertyState_DIRECT_VALUE ) );
 
             if( mbUsePen )
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 4bfa3f3..fdc154c 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -2265,9 +2265,9 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg )
             {
                 // create descriptor, set string and find all words
                 Reference < XSearchDescriptor > xSrchDesc = xSearchable->createSearchDescriptor();
-                xSrchDesc->setPropertyValue( "SearchWords", makeAny( pDlg->IsOnlyWholeWords() != false ) );
-                xSrchDesc->setPropertyValue( "SearchCaseSensitive", makeAny( pDlg->IsMarchCase() != false ) );
-                xSrchDesc->setPropertyValue( "SearchBackwards", makeAny( pDlg->IsSearchBackwards() != false ) );
+                xSrchDesc->setPropertyValue( "SearchWords", makeAny(pDlg->IsOnlyWholeWords()) );
+                xSrchDesc->setPropertyValue( "SearchCaseSensitive", makeAny(pDlg->IsMarchCase()) );
+                xSrchDesc->setPropertyValue( "SearchBackwards", makeAny(pDlg->IsSearchBackwards()) );
                 xSrchDesc->setSearchString( sSearchText );
                 Reference< XInterface > xSelection;
                 Reference< XTextRange > xCursor = getCursor();
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index da5f84d..8902006 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -374,14 +374,14 @@ IMPL_LINK_NOARG(SfxVersionDialog, SelectHdl_Impl)
 {
     bool bEnable = ( m_pVersionBox->FirstSelected() != NULL );
     SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
-    m_pDeleteButton->Enable( bEnable!= false && !pObjShell->IsReadOnly() );
-    m_pOpenButton->Enable( bEnable!= false );
-    m_pViewButton->Enable( bEnable!= false );
+    m_pDeleteButton->Enable(bEnable && !pObjShell->IsReadOnly());
+    m_pOpenButton->Enable(bEnable);
+    m_pViewButton->Enable(bEnable);
 
     const SfxPoolItem *pDummy=NULL;
     SfxItemState eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_MERGE, pDummy );
     eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_COMPARE, pDummy );
-    m_pCompareButton->Enable( bEnable!= false && eState >= SFX_ITEM_AVAILABLE );
+    m_pCompareButton->Enable(bEnable && eState >= SFX_ITEM_AVAILABLE);
 
     return 0L;
 }
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index d7ee71b..3e6d1f0 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -545,7 +545,7 @@ inline bool SvtFileView_Impl::EnableNameReplacing( bool bEnable )
 inline void SvtFileView_Impl::EndEditing( bool _bCancel )
 {
     if ( mpView->IsEditingActive() )
-        mpView->EndEditing( _bCancel != false );
+        mpView->EndEditing(_bCancel);
 }
 
 // functions -------------------------------------------------------------
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index f42f86f..f624e75 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -46,7 +46,7 @@ void SvLBoxButtonData::InitData( bool bImagesFromDefault, bool _bRadioBtn, const
     bDataOk = false;
     eState = SV_BUTTON_UNCHECKED;
     pImpl->bDefaultImages = bImagesFromDefault;
-    pImpl->bShowRadioButton = ( _bRadioBtn != false );
+    pImpl->bShowRadioButton = _bRadioBtn;
 
     if ( bImagesFromDefault )
         SetDefaultImages( pCtrl );
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 57553c8..17da0b7 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3836,7 +3836,7 @@ bool SvTreeListBox::IsContextMenuHandlingEnabled( void ) const
 void SvTreeListBox::EnableList( bool _bEnable )
 {
     // call base class method
-    Window::Enable( _bEnable != false );
+    Window::Enable(_bEnable);
     // then paint immediately
     Paint( Rectangle( Point(), GetSizePixel() ) );
 }
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 2f4903d..fd872b4 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -315,7 +315,7 @@ namespace
     {
         bool bInputRequired = true;
         OSL_VERIFY( _rxControlModel->getPropertyValue( FM_PROP_INPUT_REQUIRED ) >>= bInputRequired );
-        return ( bInputRequired != false );
+        return bInputRequired;
     }
 
     void lcl_resetColumnControlInfo( ColumnInfo& _rColInfo )
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index 738593ad..498c6f5 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -630,7 +630,7 @@ namespace svxform
         OUString         GetURL() const { return m_pURLED->GetText(); }
         void             SetURL( const OUString& _rURL ) { m_pURLED->SetText( _rURL );}
         bool             IsLinkInstance() const { return m_pLinkInstanceCB->IsChecked(); }
-        void             SetLinkInstance( bool _bLink ) { m_pLinkInstanceCB->Check( _bLink != false ); }
+        void             SetLinkInstance( bool _bLink ) { m_pLinkInstanceCB->Check(_bLink); }
     };
 
 
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 8e904c2..ad69f65 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -433,7 +433,7 @@ void Cell::SetModel(SdrModel* pNewModel)
 
 void Cell::merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan )
 {
-    if( (mnColSpan != nColumnSpan) || (mnRowSpan != nRowSpan) || (mbMerged != false) )
+    if ((mnColSpan != nColumnSpan) || (mnRowSpan != nRowSpan) || mbMerged)
     {
         mnColSpan = nColumnSpan;
         mnRowSpan = nRowSpan;
diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx
index 0be3ecf..e9a1a18 100644
--- a/ucb/workben/ucb/ucbdemo.cxx
+++ b/ucb/workben/ucb/ucbdemo.cxx
@@ -2118,11 +2118,11 @@ IMPL_LINK( MyWin, ToolBarHandler, ToolBox*, pToolBox )
             break;
 
         case MYWIN_ITEMID_TIMING:
-            m_bTiming = m_pTool->IsItemChecked(MYWIN_ITEMID_TIMING) != false;
+            m_bTiming = m_pTool->IsItemChecked(MYWIN_ITEMID_TIMING);
             break;
 
         case MYWIN_ITEMID_SORT:
-            m_bSort = m_pTool->IsItemChecked(MYWIN_ITEMID_SORT) != false;
+            m_bSort = m_pTool->IsItemChecked(MYWIN_ITEMID_SORT);
             break;
 
         case MYWIN_ITEMID_FETCHSIZE:
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 8dc4c90..2ad874b 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1992,7 +1992,7 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
     nPrivEntryCount += int(mpCffLocal->mfExpFactor != 0.0);
     nPrivEntryCount += int(mpCffLocal->mnLangGroup != 0);
     nPrivEntryCount += int(mpCffLocal->mnLangGroup == 1);
-    nPrivEntryCount += int(mpCffLocal->mbForceBold != false);
+    nPrivEntryCount += int(mpCffLocal->mbForceBold);
 #endif // IGNORE_HINTS
     // emit the privdict header
     pOut += sprintf( pOut,
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index dcc29cb..d2e13a9 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -169,7 +169,7 @@ ImplFontAttrCache::~ImplFontAttrCache()
                 aCacheFile.WriteInt16(rDFA.GetPitch());
                 aCacheFile.WriteInt16(rDFA.GetWidthType());
                 aCacheFile.WriteInt16(rDFA.GetFamilyType());
-                aCacheFile.WriteInt16(rDFA.IsSymbolFont() != false);
+                aCacheFile.WriteInt16(rDFA.IsSymbolFont());
 
                 write_uInt16_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.GetStyleName(), RTL_TEXTENCODING_UTF8);
 
commit dd484af7cfb472a39c9afebc6dad9ea28d1224c4
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri May 9 20:41:28 2014 +0200

    fdo#78267: Fix advancing slides by mouse clicks.
    
    Fixes a regression from b45a12c37d2b671e54404afda5dee1b0947bd3ed.
    
    The confusing logical operation
    
      ! (maPresSettings.mbLockedPages != sal_False)
    
    should translate to
    
      !maPresSettings.mbLockPages
    
    Change-Id: Iaba62ee001dd57194c1a17421d8632330eab1345

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 3f816c0..8e2f17e 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -1051,7 +1051,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
 
             aProperties.push_back(
                 beans::PropertyValue( "AdvanceOnClick" ,
-                    -1, Any( maPresSettings.mbLockedPages ),
+                    -1, Any( !maPresSettings.mbLockedPages ),
                     beans::PropertyState_DIRECT_VALUE ) );
 
             aProperties.push_back(


More information about the Libreoffice-commits mailing list