[Libreoffice-commits] core.git: sc/inc sc/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Apr 19 06:39:18 UTC 2018


 sc/inc/global.hxx                  |    3 ---
 sc/source/core/data/stlpool.cxx    |    2 +-
 sc/source/ui/miscdlgs/delcodlg.cxx |   21 +++++++--------------
 sc/source/ui/miscdlgs/inscodlg.cxx |   21 +++++++--------------
 4 files changed, 15 insertions(+), 32 deletions(-)

New commits:
commit 8c9c1b852ce0ebc6bd19437e9e583ef4226cf685
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Apr 18 14:12:06 2018 +0200

    drop IS_SET macro
    
    Change-Id: I876462e3f436b1540bb1a7ef92f184fa1c0be0e8
    Reviewed-on: https://gerrit.libreoffice.org/53102
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 93521c4d0b8e..fdb1e5e37467 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -276,9 +276,6 @@ namespace o3tl
 #define DELETEZ(pPtr) { delete pPtr; pPtr = 0; }
 #endif
 
-                                    // is bit set in set?
-#define IS_SET(bit,set)(((set)&(bit))==(bit))
-
 enum CellType
     {
         CELLTYPE_NONE,
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index 586ecbad9276..51cad3874aa2 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -120,7 +120,7 @@ void ScStyleSheetPool::Remove( SfxStyleSheetBase* pStyle )
 {
     if ( pStyle )
     {
-        OSL_ENSURE( IS_SET( SfxStyleSearchBits::UserDefined, pStyle->GetMask() ),
+        OSL_ENSURE( SfxStyleSearchBits::UserDefined & pStyle->GetMask(),
                     "SfxStyleSearchBits::UserDefined not set!" );
 
         static_cast<ScDocumentPool&>(rPool).StyleDeleted(static_cast<ScStyleSheet*>(pStyle));
diff --git a/sc/source/ui/miscdlgs/delcodlg.cxx b/sc/source/ui/miscdlgs/delcodlg.cxx
index f4c8ea972e6a..36b9e3f4062b 100644
--- a/sc/source/ui/miscdlgs/delcodlg.cxx
+++ b/sc/source/ui/miscdlgs/delcodlg.cxx
@@ -46,20 +46,13 @@ ScDeleteContentsDlg::ScDeleteContentsDlg(weld::Window* pParent, InsertDeleteFlag
     }
 
     m_xBtnDelAll->set_active( ScDeleteContentsDlg::bPreviousAllCheck );
-    m_xBtnDelStrings->set_active( IS_SET( InsertDeleteFlags::STRING,
-                                   ScDeleteContentsDlg::nPreviousChecks ) );
-    m_xBtnDelNumbers->set_active( IS_SET( InsertDeleteFlags::VALUE,
-                                   ScDeleteContentsDlg::nPreviousChecks ) );
-    m_xBtnDelDateTime->set_active( IS_SET( InsertDeleteFlags::DATETIME,
-                                   ScDeleteContentsDlg::nPreviousChecks ) );
-    m_xBtnDelFormulas->set_active( IS_SET( InsertDeleteFlags::FORMULA,
-                                   ScDeleteContentsDlg::nPreviousChecks ) );
-    m_xBtnDelNotes->set_active( IS_SET( InsertDeleteFlags::NOTE,
-                                   ScDeleteContentsDlg::nPreviousChecks ) );
-    m_xBtnDelAttrs->set_active( IS_SET( InsertDeleteFlags::ATTRIB,
-                                   ScDeleteContentsDlg::nPreviousChecks ) );
-    m_xBtnDelObjects->set_active( IS_SET( InsertDeleteFlags::OBJECTS,
-                                   ScDeleteContentsDlg::nPreviousChecks ) );
+    m_xBtnDelStrings->set_active( bool(InsertDeleteFlags::STRING & ScDeleteContentsDlg::nPreviousChecks) );
+    m_xBtnDelNumbers->set_active( bool(InsertDeleteFlags::VALUE & ScDeleteContentsDlg::nPreviousChecks) );
+    m_xBtnDelDateTime->set_active( bool(InsertDeleteFlags::DATETIME & ScDeleteContentsDlg::nPreviousChecks) );
+    m_xBtnDelFormulas->set_active( bool(InsertDeleteFlags::FORMULA & ScDeleteContentsDlg::nPreviousChecks) );
+    m_xBtnDelNotes->set_active( bool(InsertDeleteFlags::NOTE & ScDeleteContentsDlg::nPreviousChecks) );
+    m_xBtnDelAttrs->set_active( bool(InsertDeleteFlags::ATTRIB & ScDeleteContentsDlg::nPreviousChecks) );
+    m_xBtnDelObjects->set_active( bool(InsertDeleteFlags::OBJECTS & ScDeleteContentsDlg::nPreviousChecks) );
 
     DisableChecks( m_xBtnDelAll->get_active() );
 
diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index 4a3fbeef67e5..1c8c62c79608 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -76,20 +76,13 @@ ScInsertContentsDlg::ScInsertContentsDlg( vcl::Window*       pParent,
     }
 
     mpBtnInsAll->Check     ( ScInsertContentsDlg::bPreviousAllCheck );
-    mpBtnInsStrings->Check ( IS_SET( InsertDeleteFlags::STRING,
-                                   ScInsertContentsDlg::nPreviousChecks ) );
-    mpBtnInsNumbers->Check ( IS_SET( InsertDeleteFlags::VALUE,
-                                   ScInsertContentsDlg::nPreviousChecks ) );
-    mpBtnInsDateTime->Check( IS_SET( InsertDeleteFlags::DATETIME,
-                                   ScInsertContentsDlg::nPreviousChecks ) );
-    mpBtnInsFormulas->Check( IS_SET( InsertDeleteFlags::FORMULA,
-                                   ScInsertContentsDlg::nPreviousChecks ) );
-    mpBtnInsNotes->Check   ( IS_SET( InsertDeleteFlags::NOTE,
-                                   ScInsertContentsDlg::nPreviousChecks ) );
-    mpBtnInsAttrs->Check   ( IS_SET( InsertDeleteFlags::ATTRIB,
-                                   ScInsertContentsDlg::nPreviousChecks ) );
-    mpBtnInsObjects->Check ( IS_SET( InsertDeleteFlags::OBJECTS,
-                                   ScInsertContentsDlg::nPreviousChecks ) );
+    mpBtnInsStrings->Check ( bool(InsertDeleteFlags::STRING & ScInsertContentsDlg::nPreviousChecks) );
+    mpBtnInsNumbers->Check ( bool(InsertDeleteFlags::VALUE & ScInsertContentsDlg::nPreviousChecks) );
+    mpBtnInsDateTime->Check( bool(InsertDeleteFlags::DATETIME & ScInsertContentsDlg::nPreviousChecks) );
+    mpBtnInsFormulas->Check( bool(InsertDeleteFlags::FORMULA & ScInsertContentsDlg::nPreviousChecks) );
+    mpBtnInsNotes->Check   ( bool(InsertDeleteFlags::NOTE & ScInsertContentsDlg::nPreviousChecks) );
+    mpBtnInsAttrs->Check   ( bool(InsertDeleteFlags::ATTRIB & ScInsertContentsDlg::nPreviousChecks) );
+    mpBtnInsObjects->Check ( bool(InsertDeleteFlags::OBJECTS & ScInsertContentsDlg::nPreviousChecks) );
 
     switch( ScInsertContentsDlg::nPreviousFormulaChecks )
     {


More information about the Libreoffice-commits mailing list