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

Noel Grandin noel at peralex.com
Mon Oct 26 08:20:19 UTC 2015


 sc/inc/global.hxx                      |   89 ++++++++-------------------
 sc/inc/scabstdlg.hxx                   |    4 -
 sc/qa/unit/copy_paste_test.cxx         |    2 
 sc/qa/unit/subsequent_filters-test.cxx |    4 -
 sc/qa/unit/ucalc.cxx                   |   74 +++++++++++-----------
 sc/qa/unit/ucalc_formula.cxx           |    2 
 sc/qa/unit/ucalc_sharedformula.cxx     |    2 
 sc/source/core/data/clipcontext.cxx    |   14 ++--
 sc/source/core/data/column.cxx         |   52 +++++++--------
 sc/source/core/data/column3.cxx        |   52 +++++++--------
 sc/source/core/data/column4.cxx        |   18 ++---
 sc/source/core/data/documen2.cxx       |    6 -
 sc/source/core/data/documen3.cxx       |    2 
 sc/source/core/data/document.cxx       |   62 +++++++++---------
 sc/source/core/data/document10.cxx     |    4 -
 sc/source/core/data/dpobject.cxx       |    2 
 sc/source/core/data/dpoutput.cxx       |    4 -
 sc/source/core/data/table2.cxx         |   34 +++++-----
 sc/source/core/data/table4.cxx         |   10 +--
 sc/source/core/data/table6.cxx         |    2 
 sc/source/core/tool/chgtrack.cxx       |    4 -
 sc/source/ui/app/transobj.cxx          |    4 -
 sc/source/ui/attrdlg/scdlgfact.hxx     |    4 -
 sc/source/ui/docshell/arealink.cxx     |   12 +--
 sc/source/ui/docshell/dbdocfun.cxx     |   32 ++++-----
 sc/source/ui/docshell/dbdocimp.cxx     |   24 +++----
 sc/source/ui/docshell/docfunc.cxx      |   74 +++++++++++-----------
 sc/source/ui/docshell/docfuncutil.cxx  |   16 ++--
 sc/source/ui/docshell/docsh5.cxx       |   18 ++---
 sc/source/ui/docshell/impex.cxx        |   12 +--
 sc/source/ui/docshell/olinefun.cxx     |   28 ++++----
 sc/source/ui/docshell/tablink.cxx      |    4 -
 sc/source/ui/inc/delcodlg.hxx          |    2 
 sc/source/ui/inc/docfuncutil.hxx       |    2 
 sc/source/ui/inc/inscodlg.hxx          |    2 
 sc/source/ui/inc/viewfunc.hxx          |    2 
 sc/source/ui/miscdlgs/delcodlg.cxx     |   40 ++++++------
 sc/source/ui/miscdlgs/inscodlg.cxx     |   44 ++++++-------
 sc/source/ui/undo/undobase.cxx         |    2 
 sc/source/ui/undo/undoblk.cxx          |   69 ++++++++++-----------
 sc/source/ui/undo/undoblk2.cxx         |    4 -
 sc/source/ui/undo/undoblk3.cxx         |   84 ++++++++++++-------------
 sc/source/ui/undo/undodat.cxx          |  108 ++++++++++++++++-----------------
 sc/source/ui/undo/undotab.cxx          |    6 -
 sc/source/ui/unoobj/cellsuno.cxx       |   26 +++----
 sc/source/ui/unoobj/docuno.cxx         |    2 
 sc/source/ui/unoobj/funcuno.cxx        |    6 -
 sc/source/ui/vba/excelvbahelper.cxx    |    2 
 sc/source/ui/vba/vbahelper.cxx         |    2 
 sc/source/ui/vba/vbarange.cxx          |   16 ++--
 sc/source/ui/view/cellsh1.cxx          |  108 ++++++++++++++++-----------------
 sc/source/ui/view/cellsh3.cxx          |    2 
 sc/source/ui/view/cliputil.cxx         |    6 -
 sc/source/ui/view/dbfunc3.cxx          |   18 ++---
 sc/source/ui/view/gridwin.cxx          |    6 -
 sc/source/ui/view/viewfun2.cxx         |   10 +--
 sc/source/ui/view/viewfun3.cxx         |   90 +++++++++++++--------------
 sc/source/ui/view/viewfun4.cxx         |   12 +--
 sc/source/ui/view/viewfun5.cxx         |    8 +-
 sc/source/ui/view/viewfunc.cxx         |   24 +++----
 60 files changed, 670 insertions(+), 704 deletions(-)

New commits:
commit eaa34b4e29478770c4707d56aa102491bc8e058a
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Oct 26 10:19:25 2015 +0200

    convert InsertDeleteFlags to use o3tl::typed_flags
    
    Change-Id: I3f6a97195d3364b2a0964f62f11e9c0de9493d64

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 8ecfedf..c61b209 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -135,72 +135,37 @@ const ScBreakType BREAK_NONE   = 0;
 const ScBreakType BREAK_PAGE   = 1;
 const ScBreakType BREAK_MANUAL = 2;
 
-// insert/delete flags - typesafe bitfield
-struct InsertDeleteFlags final {
-private:
-    sal_uInt16 v;
-    // hidden so that it doesn't accidentally get called in constructor initialiser lists
-    explicit InsertDeleteFlags(sal_uInt16 _v) : v(_v) {}
-public:
-    static InsertDeleteFlags fromInt(sal_uInt16 v) { return InsertDeleteFlags(v); }
-    operator bool() const { return v != 0; }
-    sal_uInt16 val() const { return v; }
-    bool operator ==(const InsertDeleteFlags& other) const { return v == other.v; }
-    bool operator !=(const InsertDeleteFlags& other) const { return v != other.v; }
-private:
-    // disallow implicit conversion to int
-    operator int() const { return v; }
-};
-// make combining these type-safe
-inline InsertDeleteFlags operator| (const InsertDeleteFlags& lhs, const InsertDeleteFlags& rhs)
-{
-    return InsertDeleteFlags::fromInt(lhs.val() | rhs.val());
-}
-inline InsertDeleteFlags operator& (const InsertDeleteFlags& lhs, const InsertDeleteFlags& rhs)
-{
-    return InsertDeleteFlags::fromInt(lhs.val() & rhs.val());
-}
-inline InsertDeleteFlags& operator|= (InsertDeleteFlags& lhs, const InsertDeleteFlags& rhs)
+enum class InsertDeleteFlags : sal_uInt16
 {
-    lhs = InsertDeleteFlags::fromInt(lhs.val() | rhs.val());
-    return lhs;
-}
-inline InsertDeleteFlags& operator&= (InsertDeleteFlags& lhs, const InsertDeleteFlags& rhs)
-{
-    lhs = InsertDeleteFlags::fromInt(lhs.val() & rhs.val());
-    return lhs;
-}
-
-const InsertDeleteFlags IDF_NONE      = InsertDeleteFlags::fromInt(0x0000);
-const InsertDeleteFlags IDF_VALUE     = InsertDeleteFlags::fromInt(0x0001);   /// Numeric values (and numeric results if IDF_FORMULA is not set).
-const InsertDeleteFlags IDF_DATETIME  = InsertDeleteFlags::fromInt(0x0002);   /// Dates, times, datetime values.
-const InsertDeleteFlags IDF_STRING    = InsertDeleteFlags::fromInt(0x0004);   /// Strings (and string results if IDF_FORMULA is not set).
-const InsertDeleteFlags IDF_NOTE      = InsertDeleteFlags::fromInt(0x0008);   /// Cell notes.
-const InsertDeleteFlags IDF_FORMULA   = InsertDeleteFlags::fromInt(0x0010);   /// Formula cells.
-const InsertDeleteFlags IDF_HARDATTR  = InsertDeleteFlags::fromInt(0x0020);   /// Hard cell attributes.
-const InsertDeleteFlags IDF_STYLES    = InsertDeleteFlags::fromInt(0x0040);   /// Cell styles.
-const InsertDeleteFlags IDF_OBJECTS   = InsertDeleteFlags::fromInt(0x0080);   /// Drawing objects.
-const InsertDeleteFlags IDF_EDITATTR  = InsertDeleteFlags::fromInt(0x0100);   /// Rich-text attributes.
-const InsertDeleteFlags IDF_OUTLINE   = InsertDeleteFlags::fromInt(0x0800);   /// Sheet / outlining (grouping) information
-const InsertDeleteFlags IDF_NOCAPTIONS  = InsertDeleteFlags::fromInt(0x0200);   /// Internal use only (undo etc.): do not copy/delete caption objects of cell notes.
-const InsertDeleteFlags IDF_ADDNOTES    = InsertDeleteFlags::fromInt(0x0400);   /// Internal use only (copy from clip): do not delete existing cell contents when pasting notes.
-const InsertDeleteFlags IDF_SPECIAL_BOOLEAN  = InsertDeleteFlags::fromInt(0x1000);
-const InsertDeleteFlags IDF_FORGETCAPTIONS = InsertDeleteFlags::fromInt(0x2000); /// Internal use only (d&d undo): do not delete caption objects of cell notes.
-const InsertDeleteFlags IDF_ATTRIB     = IDF_HARDATTR | IDF_STYLES;
-const InsertDeleteFlags IDF_CONTENTS   = IDF_VALUE | IDF_DATETIME | IDF_STRING | IDF_NOTE | IDF_FORMULA | IDF_OUTLINE;
-const InsertDeleteFlags IDF_ALL        = IDF_CONTENTS | IDF_ATTRIB | IDF_OBJECTS;
-const InsertDeleteFlags IDF_ALL_USED_BITS = IDF_ALL | IDF_EDITATTR | IDF_NOCAPTIONS | IDF_ADDNOTES | IDF_SPECIAL_BOOLEAN | IDF_FORGETCAPTIONS;
-
-inline InsertDeleteFlags operator~ (const InsertDeleteFlags& rhs)
+    NONE             = 0x0000,
+    VALUE            = 0x0001,   /// Numeric values (and numeric results if InsertDeleteFlags::FORMULA is not set).
+    DATETIME         = 0x0002,   /// Dates, times, datetime values.
+    STRING           = 0x0004,   /// Strings (and string results if InsertDeleteFlags::FORMULA is not set).
+    NOTE             = 0x0008,   /// Cell notes.
+    FORMULA          = 0x0010,   /// Formula cells.
+    HARDATTR         = 0x0020,   /// Hard cell attributes.
+    STYLES           = 0x0040,   /// Cell styles.
+    OBJECTS          = 0x0080,   /// Drawing objects.
+    EDITATTR         = 0x0100,   /// Rich-text attributes.
+    OUTLINE          = 0x0800,   /// Sheet / outlining (grouping) information
+    NOCAPTIONS       = 0x0200,   /// Internal use only (undo etc.): do not copy/delete caption objects of cell notes.
+    ADDNOTES         = 0x0400,   /// Internal use only (copy from clip): do not delete existing cell contents when pasting notes.
+    SPECIAL_BOOLEAN  = 0x1000,
+    FORGETCAPTIONS   = 0x2000,   /// Internal use only (d&d undo): do not delete caption objects of cell notes.
+    ATTRIB           = HARDATTR | STYLES,
+    CONTENTS         = VALUE | DATETIME | STRING | NOTE | FORMULA | OUTLINE,
+    ALL              = CONTENTS | ATTRIB | OBJECTS,
+    ALL_USED_BITS    = ALL | EDITATTR | NOCAPTIONS | ADDNOTES | SPECIAL_BOOLEAN | FORGETCAPTIONS,
+    /// Copy flags for auto/series fill functions: do not touch notes and drawing objects.
+    AUTOFILL         = ALL & ~(NOTE | OBJECTS)
+};
+namespace o3tl
 {
-    return IDF_ALL_USED_BITS & InsertDeleteFlags::fromInt(~rhs.val());
+    template<> struct typed_flags<InsertDeleteFlags> : is_typed_flags<InsertDeleteFlags, 0x3fff> {};
 }
+// This doesn't work at the moment, perhaps when we have constexpr we can modify InsertDeleteFlags to make it work.
+//static_assert((InsertDeleteFlags::ATTRIB & InsertDeleteFlags::CONTENTS) == InsertDeleteFlags::NONE, "these must match");
 
-// This doesnt work at the moment, perhaps when we have constexpr we can modify InsertDeleteFlags to make it work.
-//static_assert((IDF_ATTRIB & IDF_CONTENTS) == IDF_NONE, "these must match");
-
-/// Copy flags for auto/series fill functions: do not touch notes and drawing objects.
-const InsertDeleteFlags IDF_AUTOFILL   = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS);
 
 enum class ScPasteFunc {
     NONE, ADD, SUB, MUL, DIV
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 1fd7e12..82c866e 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -361,7 +361,7 @@ public:
         ScTabViewShell* pTabViewShell) = 0;
 
     virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(vcl::Window* pParent,
-                                                                    InsertDeleteFlags nCheckDefaults = IDF_NONE) = 0;
+                                                                    InsertDeleteFlags nCheckDefaults = InsertDeleteFlags::NONE) = 0;
     virtual AbstractScFillSeriesDlg * CreateScFillSeriesDlg( vcl::Window*        pParent,
                                                             ScDocument& rDocument,
                                                             FillDir     eFillDir,
@@ -381,7 +381,7 @@ public:
                                                              bool bDisallowCellMove = false ) = 0;
 
     virtual AbstractScInsertContentsDlg * CreateScInsertContentsDlg( vcl::Window*        pParent,
-                                                                    InsertDeleteFlags nCheckDefaults = IDF_NONE,
+                                                                    InsertDeleteFlags nCheckDefaults = InsertDeleteFlags::NONE,
                                                                     const OUString* pStrTitle = NULL ) = 0;
 
     virtual AbstractScInsertTableDlg * CreateScInsertTableDlg(vcl::Window* pParent, ScViewData& rViewData,
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index 1cd559b..9d933a3 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -116,7 +116,7 @@ void ScCopyPasteTest::testCopyPasteXLS()
     CPPUNIT_ASSERT(pViewShell != NULL);
 
     // 6. Paste
-    pViewShell->GetViewData().GetView()->PasteFromClip(IDF_ALL, &aClipDoc);
+    pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc);
 
     xDocSh->DoClose();
 }
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index d88a1cc..d362b2d5 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -719,7 +719,7 @@ void ScFiltersTest::testFormulaDepDeleteContentsODS()
     ScMarkData aMark;
     aMark.SetMarkArea(aRange);
     aMark.MarkToMulti();
-    bool bGood = rFunc.DeleteContents(aMark, IDF_ALL, true, true);
+    bool bGood = rFunc.DeleteContents(aMark, InsertDeleteFlags::ALL, true, true);
     CPPUNIT_ASSERT(bGood);
     CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(3,1,0)));
     CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(3,2,0)));
@@ -2623,7 +2623,7 @@ void ScFiltersTest::testOptimalHeightReset()
     ScRange aDelRange(0,0,0,0,0,0);
     ScMarkData aMark;
     aMark.SetMarkArea(aDelRange);
-    bool bRet = rFunc.DeleteContents( aMark, IDF_ALL, false, true );
+    bool bRet = rFunc.DeleteContents( aMark, InsertDeleteFlags::ALL, false, true );
     CPPUNIT_ASSERT_MESSAGE("DeleteContents failed", bRet);
 
     // get the new height of A1
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index f473903..0ef8cdc 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -269,7 +269,7 @@ void Test::testPerf()
 
         ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
         pUndoDoc->InitUndo(m_pDoc, 0, 0);
-        m_pDoc->CopyToDocument(ScRange(aPos), IDF_CONTENTS, false, pUndoDoc, &aMark);
+        m_pDoc->CopyToDocument(ScRange(aPos), InsertDeleteFlags::CONTENTS, false, pUndoDoc, &aMark);
 
         // Paste it to A2:A100000, and measure its duration.
         ScRange aPasteRange(0,1,0,0,99999,0);
@@ -277,17 +277,17 @@ void Test::testPerf()
 
         {
             MeasureTimeSwitch aTime(diff);
-            m_pDoc->CopyFromClip(aPasteRange, aMark, IDF_CONTENTS, pUndoDoc, &aClipDoc);
+            m_pDoc->CopyFromClip(aPasteRange, aMark, InsertDeleteFlags::CONTENTS, pUndoDoc, &aClipDoc);
         }
         PERF_ASSERT(diff, scale, 1500.0, "Pasting a single cell to A2:A100000");
 
         ScDocument* pRedoDoc = new ScDocument(SCDOCMODE_UNDO);
         pRedoDoc->InitUndo(m_pDoc, 0, 0);
-        m_pDoc->CopyToDocument(aPasteRange, IDF_CONTENTS, false, pRedoDoc, &aMark);
+        m_pDoc->CopyToDocument(aPasteRange, InsertDeleteFlags::CONTENTS, false, pRedoDoc, &aMark);
 
         // Create an undo object for this.
         ScRefUndoData* pRefUndoData = new ScRefUndoData(m_pDoc);
-        ScUndoPaste aUndo(&getDocShell(), aPasteRange, aMark, pUndoDoc, pRedoDoc, IDF_CONTENTS, pRefUndoData);
+        ScUndoPaste aUndo(&getDocShell(), aPasteRange, aMark, pUndoDoc, pRedoDoc, InsertDeleteFlags::CONTENTS, pRefUndoData);
 
         // Make sure it did what it's supposed to do.
         CPPUNIT_ASSERT_EQUAL(m_pDoc->GetString(aPos), m_pDoc->GetString(aPasteRange.aStart));
@@ -340,7 +340,7 @@ void Test::testPerf()
 
         ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
         pUndoDoc->InitUndo(m_pDoc, 0, 0);
-        m_pDoc->CopyToDocument(aSrcRange, IDF_CONTENTS, false, pUndoDoc, &aMark);
+        m_pDoc->CopyToDocument(aSrcRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc, &aMark);
 
         // Paste it to A3:A100001, and measure its duration.
         ScRange aPasteRange(0,2,0,0,100000,0);
@@ -348,17 +348,17 @@ void Test::testPerf()
 
         {
             MeasureTimeSwitch aTime(diff);
-            m_pDoc->CopyFromClip(aPasteRange, aMark, IDF_CONTENTS, pUndoDoc, &aClipDoc);
+            m_pDoc->CopyFromClip(aPasteRange, aMark, InsertDeleteFlags::CONTENTS, pUndoDoc, &aClipDoc);
         }
         PERF_ASSERT(diff, scale, 1000.0, "Pasting A1:A2 to A3:A100001");
 
         ScDocument* pRedoDoc = new ScDocument(SCDOCMODE_UNDO);
         pRedoDoc->InitUndo(m_pDoc, 0, 0);
-        m_pDoc->CopyToDocument(aPasteRange, IDF_CONTENTS, false, pRedoDoc, &aMark);
+        m_pDoc->CopyToDocument(aPasteRange, InsertDeleteFlags::CONTENTS, false, pRedoDoc, &aMark);
 
         // Create an undo object for this.
         ScRefUndoData* pRefUndoData = new ScRefUndoData(m_pDoc);
-        ScUndoPaste aUndo(&getDocShell(), aPasteRange, aMark, pUndoDoc, pRedoDoc, IDF_CONTENTS, pRefUndoData);
+        ScUndoPaste aUndo(&getDocShell(), aPasteRange, aMark, pUndoDoc, pRedoDoc, InsertDeleteFlags::CONTENTS, pRefUndoData);
 
         // Make sure it did what it's supposed to do.
         CPPUNIT_ASSERT_EQUAL(m_pDoc->GetString(aPos), m_pDoc->GetString(aPasteRange.aStart));
@@ -417,7 +417,7 @@ void Test::testPerf()
 
         ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
         pUndoDoc->InitUndo(m_pDoc, 0, 0);
-        m_pDoc->CopyToDocument(aSrcRange, IDF_CONTENTS, false, pUndoDoc, &aMark);
+        m_pDoc->CopyToDocument(aSrcRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc, &aMark);
 
         // Paste it to A3:A50001, and measure its duration.
         ScRange aPasteRange(0,2,0,0,50000,0);
@@ -425,17 +425,17 @@ void Test::testPerf()
 
         {
             MeasureTimeSwitch aTime(diff);
-            m_pDoc->CopyFromClip(aPasteRange, aMark, IDF_CONTENTS, pUndoDoc, &aClipDoc);
+            m_pDoc->CopyFromClip(aPasteRange, aMark, InsertDeleteFlags::CONTENTS, pUndoDoc, &aClipDoc);
         }
         PERF_ASSERT(diff, scale, 2000.0, "Pasting");
 
         ScDocument* pRedoDoc = new ScDocument(SCDOCMODE_UNDO);
         pRedoDoc->InitUndo(m_pDoc, 0, 0);
-        m_pDoc->CopyToDocument(aPasteRange, IDF_CONTENTS, false, pRedoDoc, &aMark);
+        m_pDoc->CopyToDocument(aPasteRange, InsertDeleteFlags::CONTENTS, false, pRedoDoc, &aMark);
 
         // Create an undo object for this.
         ScRefUndoData* pRefUndoData = new ScRefUndoData(m_pDoc);
-        ScUndoPaste aUndo(&getDocShell(), aPasteRange, aMark, pUndoDoc, pRedoDoc, IDF_CONTENTS, pRefUndoData);
+        ScUndoPaste aUndo(&getDocShell(), aPasteRange, aMark, pUndoDoc, pRedoDoc, InsertDeleteFlags::CONTENTS, pRefUndoData);
 
         // Make sure it did what it's supposed to do.
         CPPUNIT_ASSERT_EQUAL(CELLTYPE_FORMULA, m_pDoc->GetCellType(aPasteRange.aStart));
@@ -3259,7 +3259,7 @@ void Test::testCopyPaste()
     std::unique_ptr<ScUndoPaste> pUndo(createUndoPaste(getDocShell(), aRange, pUndoDoc));
     ScMarkData aMark;
     aMark.SetMarkArea(aRange);
-    m_pDoc->CopyFromClip(aRange, aMark, IDF_ALL, NULL, &aClipDoc);
+    m_pDoc->CopyFromClip(aRange, aMark, InsertDeleteFlags::ALL, NULL, &aClipDoc);
 
     //check values after copying
     OUString aString;
@@ -3342,7 +3342,7 @@ void Test::testCopyPasteAsLink()
     ScMarkData aMark;
     aMark.SetMarkArea(aRange);
     // Paste range as link.
-    m_pDoc->CopyFromClip(aRange, aMark, IDF_CONTENTS, NULL, &aClipDoc, true, true);
+    m_pDoc->CopyFromClip(aRange, aMark, InsertDeleteFlags::CONTENTS, NULL, &aClipDoc, true, true);
 
     // Check pasted content to make sure they reference the correct cells.
     ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,1,1));
@@ -3393,13 +3393,13 @@ void Test::testCopyPasteTranspose()
 
     ::std::unique_ptr<ScDocument> pTransClip;
     pTransClip.reset(new ScDocument(SCDOCMODE_CLIP));
-    aNewClipDoc.TransposeClip(pTransClip.get(), IDF_ALL, false);
+    aNewClipDoc.TransposeClip(pTransClip.get(), InsertDeleteFlags::ALL, false);
     ScDocument* pTransposedClip = pTransClip.release();
 
     ScRange aDestRange = ScRange(3,1,1,3,3,1);//target: Sheet2.D2:D4
     ScMarkData aMark;
     aMark.SetMarkArea(aDestRange);
-    m_pDoc->CopyFromClip(aDestRange, aMark, IDF_ALL, NULL, pTransposedClip);
+    m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, NULL, pTransposedClip);
 
     //check cell content after transposed copy/paste
     OUString aString = m_pDoc->GetString(3, 3, 1);
@@ -3464,7 +3464,7 @@ void Test::testCopyPasteMultiRange()
     m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark);
 
     // Paste to D9:E11, and make sure it won't crash (rhbz#1080196).
-    m_pDoc->CopyMultiRangeFromClip(ScAddress(3,8,0), aMark, IDF_CONTENTS, &aClipDoc);
+    m_pDoc->CopyMultiRangeFromClip(ScAddress(3,8,0), aMark, InsertDeleteFlags::CONTENTS, &aClipDoc);
     CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(3,8,0)));
     CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(4,8,0)));
     CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(3,9,0)));
@@ -3608,20 +3608,20 @@ void Test::testCopyPasteSkipEmpty()
     // Create undo document.
     ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
     pUndoDoc->InitUndo(m_pDoc, 0, 0);
-    m_pDoc->CopyToDocument(aDestRange, IDF_ALL, false, pUndoDoc, &aMark);
+    m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, pUndoDoc, &aMark);
 
     // Paste clipboard content onto A1:A5 but skip empty cells.
     bool bSkipEmpty = true;
-    m_pDoc->CopyFromClip(aDestRange, aMark, IDF_ALL, pUndoDoc, &aClipDoc, true, false, false, bSkipEmpty);
+    m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, pUndoDoc, &aClipDoc, true, false, false, bSkipEmpty);
 
     // Create redo document.
     ScDocument* pRedoDoc = new ScDocument(SCDOCMODE_UNDO);
     pRedoDoc->InitUndo(m_pDoc, 0, 0);
-    m_pDoc->CopyToDocument(aDestRange, IDF_ALL, false, pRedoDoc, &aMark);
+    m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, pRedoDoc, &aMark);
 
     // Create an undo object for this.
     ScRefUndoData* pRefUndoData = new ScRefUndoData(m_pDoc);
-    ScUndoPaste aUndo(&getDocShell(), aDestRange, aMark, pUndoDoc, pRedoDoc, IDF_ALL, pRefUndoData);
+    ScUndoPaste aUndo(&getDocShell(), aDestRange, aMark, pUndoDoc, pRedoDoc, InsertDeleteFlags::ALL, pRefUndoData);
 
     // Check the content after the paste.
     {
@@ -3686,7 +3686,7 @@ void Test::testCopyPasteSkipEmpty2()
     ScRange aDestRange(0,2,0,2,2,0);
     ScMarkData aMark;
     aMark.SetMarkArea(aDestRange);
-    m_pDoc->CopyFromClip(aDestRange, aMark, IDF_ALL, NULL, &aClipDoc, false, false, true, true);
+    m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, NULL, &aClipDoc, false, false, true, true);
 
     CPPUNIT_ASSERT_EQUAL(OUString("A"), m_pDoc->GetString(ScAddress(0,2,0)));
     CPPUNIT_ASSERT_MESSAGE("B3 should be empty.", m_pDoc->GetCellType(ScAddress(1,2,0)) == CELLTYPE_NONE);
@@ -3737,11 +3737,11 @@ void Test::testCopyPasteSkipEmptyConditionalFormatting()
     // Create undo document.
     ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
     pUndoDoc->InitUndo(m_pDoc, 0, 0);
-    m_pDoc->CopyToDocument(aDestRange, IDF_CONTENTS, false, pUndoDoc, &aMark);
+    m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc, &aMark);
 
     // Paste clipboard content onto A1:A5 but skip empty cells.
     bool bSkipEmpty = true;
-    m_pDoc->CopyFromClip(aDestRange, aMark, IDF_CONTENTS, pUndoDoc, &aClipDoc, true, false, false, bSkipEmpty);
+    m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::CONTENTS, pUndoDoc, &aClipDoc, true, false, false, bSkipEmpty);
 
     ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
     CPPUNIT_ASSERT_EQUAL(size_t(2), pList->size());
@@ -3790,7 +3790,7 @@ void Test::testCutPasteRefUndo()
     pUndoDoc->InitUndo(m_pDoc, 0, 0);
 
     // Do the pasting of 12 into C2.  This should update A2 to reference C2.
-    m_pDoc->CopyFromClip(ScAddress(2,1,0), aMark, IDF_CONTENTS, pUndoDoc, &aClipDoc);
+    m_pDoc->CopyFromClip(ScAddress(2,1,0), aMark, InsertDeleteFlags::CONTENTS, pUndoDoc, &aClipDoc);
     CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(0,1,0));
 
     if (!checkFormula(*m_pDoc, ScAddress(0,1,0), "C2"))
@@ -3800,7 +3800,7 @@ void Test::testCutPasteRefUndo()
     if (!checkFormula(*pUndoDoc, ScAddress(0,1,0), "B2"))
         CPPUNIT_FAIL("A2 in the undo document should be referencing B2.");
 
-    ScUndoPaste aUndo(&getDocShell(), ScRange(ScAddress(2,1,0)), aMark, pUndoDoc, NULL, IDF_CONTENTS, NULL, false, NULL);
+    ScUndoPaste aUndo(&getDocShell(), ScRange(ScAddress(2,1,0)), aMark, pUndoDoc, NULL, InsertDeleteFlags::CONTENTS, NULL, false, NULL);
     aUndo.Undo();
 
     // Now A2 should be referencing B2 once again.
@@ -3876,14 +3876,14 @@ void Test::testUndoCut()
     // Set up an undo object for cutting A1:A3.
     ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
     pUndoDoc->InitUndo(m_pDoc, 0 ,0);
-    m_pDoc->CopyToDocument(aRange, IDF_ALL, false, pUndoDoc);
+    m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL, false, pUndoDoc);
     CPPUNIT_ASSERT_EQUAL(  1.0, pUndoDoc->GetValue(ScAddress(0,0,0)));
     CPPUNIT_ASSERT_EQUAL( 10.0, pUndoDoc->GetValue(ScAddress(0,1,0)));
     CPPUNIT_ASSERT_EQUAL(100.0, pUndoDoc->GetValue(ScAddress(0,2,0)));
     ScUndoCut aUndo(&getDocShell(), aRange, aRange.aEnd, aMark, pUndoDoc);
 
     // "Cut" the selection.
-    m_pDoc->DeleteSelection(IDF_ALL, aMark);
+    m_pDoc->DeleteSelection(InsertDeleteFlags::ALL, aMark);
     CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(0,3,0)); // The SUM should be zero after the "cut".
 
     // Undo it, and check the result.
@@ -3986,7 +3986,7 @@ void Test::testCopyPasteRelativeFormula()
     m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark);
 
     // Paste it to B1:B2.
-    InsertDeleteFlags nFlags = IDF_ALL;
+    InsertDeleteFlags nFlags = InsertDeleteFlags::ALL;
     ScRange aDestRange(1,0,0,1,1,0);
     aMark.SetMarkArea(aDestRange);
     m_pDoc->CopyFromClip(aDestRange, aMark, nFlags, NULL, &aClipDoc);
@@ -4069,7 +4069,7 @@ void Test::testCopyPasteRepeatOneFormula()
     m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark);
 
     // Paste it to C2:C10.
-    InsertDeleteFlags nFlags = IDF_CONTENTS;
+    InsertDeleteFlags nFlags = InsertDeleteFlags::CONTENTS;
     ScRange aDestRange(2,1,0,2,9,0);
     aMark.SetMarkArea(aDestRange);
     m_pDoc->CopyFromClip(aDestRange, aMark, nFlags, NULL, &aClipDoc);
@@ -4719,7 +4719,7 @@ void Test::testCopyPasteFormulasExternalDoc()
     ScDocument* pClipDoc = new ScDocument(SCDOCMODE_CLIP);
     m_pDoc->CopyToClip(aClipParam, pClipDoc, &aMark);
 
-    InsertDeleteFlags nFlags = IDF_ALL;
+    InsertDeleteFlags nFlags = InsertDeleteFlags::ALL;
     aRange = ScRange(1,1,1,1,6,1);
     ScMarkData aMarkData2;
     aMarkData2.SetMarkArea(aRange);
@@ -5223,7 +5223,7 @@ void Test::testNoteCopyPaste()
 
     // Paste to B6:B8 but only cell notes.
     ScRange aDestRange(1,5,0,1,7,0);
-    m_pDoc->CopyFromClip(aDestRange, aMark, IDF_NOTE, NULL, &aClipDoc);
+    m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::NOTE, NULL, &aClipDoc);
 
     // Make sure the notes are there.
     pNote = m_pDoc->GetNote(ScAddress(1,5,0));
@@ -6214,8 +6214,8 @@ void Test::testDeleteContents()
 
     std::unique_ptr<ScDocument> pUndoDoc(new ScDocument(SCDOCMODE_UNDO));
     pUndoDoc->InitUndo(m_pDoc, 0, 0);
-    m_pDoc->CopyToDocument(aRange, IDF_CONTENTS, false, pUndoDoc.get(), &aMark);
-    ScUndoDeleteContents aUndo(&getDocShell(), aMark, aRange, std::move(pUndoDoc), false, IDF_CONTENTS, true);
+    m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc.get(), &aMark);
+    ScUndoDeleteContents aUndo(&getDocShell(), aMark, aRange, std::move(pUndoDoc), false, InsertDeleteFlags::CONTENTS, true);
 
     clearRange(m_pDoc, aRange);
     CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(3,15,0))); // formula
@@ -6822,7 +6822,7 @@ void Test::clearRange(ScDocument* pDoc, const ScRange& rRange)
     aMarkData.SetMarkArea(rRange);
     pDoc->DeleteArea(
         rRange.aStart.Col(), rRange.aStart.Row(),
-        rRange.aEnd.Col(), rRange.aEnd.Row(), aMarkData, IDF_CONTENTS);
+        rRange.aEnd.Col(), rRange.aEnd.Row(), aMarkData, InsertDeleteFlags::CONTENTS);
 }
 
 void Test::clearSheet(ScDocument* pDoc, SCTAB nTab)
@@ -6843,7 +6843,7 @@ void Test::pasteFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocu
 {
     ScMarkData aMark;
     aMark.SetMarkArea(rDestRange);
-    pDestDoc->CopyFromClip(rDestRange, aMark, IDF_ALL, NULL, pClipDoc);
+    pDestDoc->CopyFromClip(rDestRange, aMark, InsertDeleteFlags::ALL, NULL, pClipDoc);
 }
 
 ScUndoPaste* Test::createUndoPaste(ScDocShell& rDocSh, const ScRange& rRange, ScDocument* pUndoDoc)
@@ -6854,7 +6854,7 @@ ScUndoPaste* Test::createUndoPaste(ScDocShell& rDocSh, const ScRange& rRange, Sc
     ScRefUndoData* pRefUndoData = new ScRefUndoData(&rDoc);
 
     return new ScUndoPaste(
-        &rDocSh, rRange, aMarkData, pUndoDoc, NULL, IDF_ALL, pRefUndoData, false);
+        &rDocSh, rRange, aMarkData, pUndoDoc, NULL, InsertDeleteFlags::ALL, pRefUndoData, false);
 }
 
 void Test::setExpandRefs(bool bExpand)
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 1e0c06b..a8e9100 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -2214,7 +2214,7 @@ void Test::testFormulaRefUpdateDeleteContent()
     ScDocFunc& rFunc = getDocShell().GetDocFunc();
     ScMarkData aMark;
     aMark.SetMarkArea(ScAddress(1,1,0));
-    rFunc.DeleteContents(aMark, IDF_CONTENTS, true, true);
+    rFunc.DeleteContents(aMark, InsertDeleteFlags::CONTENTS, true, true);
 
     CPPUNIT_ASSERT_MESSAGE("B2 should be empty.", m_pDoc->GetCellType(ScAddress(1,1,0)) == CELLTYPE_NONE);
     CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(2,1,0)));
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index 3c1a0e3..63cc3b1 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -1317,7 +1317,7 @@ void Test::testSharedFormulasCopyPaste()
     ScRange aRange(1,0,0,1,9,0); // B1:B10
     ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
     pUndoDoc->InitUndo(m_pDoc, 0, 0, true, true);
-    m_pDoc->CopyToDocument(aRange, IDF_CONTENTS, false, pUndoDoc);
+    m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc);
     std::unique_ptr<ScUndoPaste> pUndo(createUndoPaste(getDocShell(), aRange, pUndoDoc));
 
     // First, make sure the formula cells are shared in the undo document.
diff --git a/sc/source/core/data/clipcontext.cxx b/sc/source/core/data/clipcontext.cxx
index 4bdb0e7..25479d5 100644
--- a/sc/source/core/data/clipcontext.cxx
+++ b/sc/source/core/data/clipcontext.cxx
@@ -39,10 +39,10 @@ CopyFromClipContext::CopyFromClipContext(ScDocument& rDoc,
     mnTabStart(-1), mnTabEnd(-1),
     mrDestDoc(rDoc),
     mpRefUndoDoc(pRefUndoDoc), mpClipDoc(pClipDoc),
-    mnInsertFlag(nInsertFlag), mnDeleteFlag(IDF_NONE),
+    mnInsertFlag(nInsertFlag), mnDeleteFlag(InsertDeleteFlags::NONE),
     mpCondFormatList(NULL),
     mbAsLink(bAsLink), mbSkipAttrForEmptyCells(bSkipAttrForEmptyCells),
-    mbCloneNotes (mnInsertFlag & (IDF_NOTE|IDF_ADDNOTES)),
+    mbCloneNotes (mnInsertFlag & (InsertDeleteFlags::NOTE|InsertDeleteFlags::ADDNOTES)),
     mbTableProtected(false)
 {
 }
@@ -160,11 +160,11 @@ void CopyFromClipContext::setSingleCell( const ScAddress& rSrcPos, const ScColum
     // Check the paste flag to see whether we want to paste this cell.  If the
     // flag says we don't want to paste this cell, we'll return with true.
     InsertDeleteFlags nFlags = getInsertFlag();
-    bool bNumeric  = (nFlags & IDF_VALUE) != IDF_NONE;
-    bool bDateTime = (nFlags & IDF_DATETIME) != IDF_NONE;
-    bool bString   = (nFlags & IDF_STRING) != IDF_NONE;
-    bool bBoolean  = (nFlags & IDF_SPECIAL_BOOLEAN) != IDF_NONE;
-    bool bFormula  = (nFlags & IDF_FORMULA) != IDF_NONE;
+    bool bNumeric  = (nFlags & InsertDeleteFlags::VALUE) != InsertDeleteFlags::NONE;
+    bool bDateTime = (nFlags & InsertDeleteFlags::DATETIME) != InsertDeleteFlags::NONE;
+    bool bString   = (nFlags & InsertDeleteFlags::STRING) != InsertDeleteFlags::NONE;
+    bool bBoolean  = (nFlags & InsertDeleteFlags::SPECIAL_BOOLEAN) != InsertDeleteFlags::NONE;
+    bool bFormula  = (nFlags & InsertDeleteFlags::FORMULA) != InsertDeleteFlags::NONE;
 
     switch (rSrcCell.meType)
     {
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 33e0a3b..7bb8d77 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1226,9 +1226,9 @@ bool canCopyValue(const ScDocument& rDoc, const ScAddress& rPos, InsertDeleteFla
     sal_uInt32 nNumIndex = static_cast<const SfxUInt32Item*>(rDoc.GetAttr(rPos, ATTR_VALUE_FORMAT))->GetValue();
     short nType = rDoc.GetFormatTable()->GetType(nNumIndex);
     if ((nType == css::util::NumberFormat::DATE) || (nType == css::util::NumberFormat::TIME) || (nType == css::util::NumberFormat::DATETIME))
-        return ((nFlags & IDF_DATETIME) != IDF_NONE);
+        return ((nFlags & InsertDeleteFlags::DATETIME) != InsertDeleteFlags::NONE);
 
-    return (nFlags & IDF_VALUE) != IDF_NONE;
+    return (nFlags & InsertDeleteFlags::VALUE) != InsertDeleteFlags::NONE;
 }
 
 class CopyAsLinkHandler
@@ -1310,9 +1310,9 @@ public:
     {
         size_t nRow = aNode.position + nOffset;
 
-        if (mnCopyFlags & (IDF_NOTE|IDF_ADDNOTES))
+        if (mnCopyFlags & (InsertDeleteFlags::NOTE|InsertDeleteFlags::ADDNOTES))
         {
-            bool bCloneCaption = (mnCopyFlags & IDF_NOCAPTIONS) == IDF_NONE;
+            bool bCloneCaption = (mnCopyFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE;
             duplicateNotes(nRow, nDataSize, bCloneCaption );
         }
 
@@ -1320,7 +1320,7 @@ public:
         {
             case sc::element_type_numeric:
             {
-                if ((mnCopyFlags & (IDF_DATETIME|IDF_VALUE)) == IDF_NONE)
+                if ((mnCopyFlags & (InsertDeleteFlags::DATETIME|InsertDeleteFlags::VALUE)) == InsertDeleteFlags::NONE)
                     return;
 
                 sc::numeric_block::const_iterator it = sc::numeric_block::begin(*aNode.data);
@@ -1342,7 +1342,7 @@ public:
             case sc::element_type_string:
             case sc::element_type_edittext:
             {
-                if (!(mnCopyFlags & IDF_STRING))
+                if (!(mnCopyFlags & InsertDeleteFlags::STRING))
                     return;
 
                 createRefBlock(aNode, nOffset, nDataSize);
@@ -1350,7 +1350,7 @@ public:
             break;
             case sc::element_type_formula:
             {
-                if (!(mnCopyFlags & IDF_FORMULA))
+                if (!(mnCopyFlags & InsertDeleteFlags::FORMULA))
                     return;
 
                 createRefBlock(aNode, nOffset, nDataSize);
@@ -1390,11 +1390,11 @@ class CopyByCloneHandler
     {
         ScAddress aDestPos(mrDestCol.GetCol(), nRow, mrDestCol.GetTab());
 
-        bool bCloneValue          = (mnCopyFlags & IDF_VALUE) != IDF_NONE;
-        bool bCloneDateTime       = (mnCopyFlags & IDF_DATETIME) != IDF_NONE;
-        bool bCloneString         = (mnCopyFlags & IDF_STRING) != IDF_NONE;
-        bool bCloneSpecialBoolean = (mnCopyFlags & IDF_SPECIAL_BOOLEAN) != IDF_NONE;
-        bool bCloneFormula        = (mnCopyFlags & IDF_FORMULA) != IDF_NONE;
+        bool bCloneValue          = (mnCopyFlags & InsertDeleteFlags::VALUE) != InsertDeleteFlags::NONE;
+        bool bCloneDateTime       = (mnCopyFlags & InsertDeleteFlags::DATETIME) != InsertDeleteFlags::NONE;
+        bool bCloneString         = (mnCopyFlags & InsertDeleteFlags::STRING) != InsertDeleteFlags::NONE;
+        bool bCloneSpecialBoolean = (mnCopyFlags & InsertDeleteFlags::SPECIAL_BOOLEAN) != InsertDeleteFlags::NONE;
+        bool bCloneFormula        = (mnCopyFlags & InsertDeleteFlags::FORMULA) != InsertDeleteFlags::NONE;
 
         bool bForceFormula = false;
 
@@ -1512,9 +1512,9 @@ public:
     {
         size_t nRow = aNode.position + nOffset;
 
-        if (mnCopyFlags & (IDF_NOTE|IDF_ADDNOTES))
+        if (mnCopyFlags & (InsertDeleteFlags::NOTE|InsertDeleteFlags::ADDNOTES))
         {
-            bool bCloneCaption = (mnCopyFlags & IDF_NOCAPTIONS) == IDF_NONE;
+            bool bCloneCaption = (mnCopyFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE;
             duplicateNotes(nRow, nDataSize, bCloneCaption );
         }
 
@@ -1522,7 +1522,7 @@ public:
         {
             case sc::element_type_numeric:
             {
-                if ((mnCopyFlags & (IDF_DATETIME|IDF_VALUE)) == IDF_NONE)
+                if ((mnCopyFlags & (InsertDeleteFlags::DATETIME|InsertDeleteFlags::VALUE)) == InsertDeleteFlags::NONE)
                     return;
 
                 sc::numeric_block::const_iterator it = sc::numeric_block::begin(*aNode.data);
@@ -1543,7 +1543,7 @@ public:
             break;
             case sc::element_type_string:
             {
-                if (!(mnCopyFlags & IDF_STRING))
+                if (!(mnCopyFlags & InsertDeleteFlags::STRING))
                     return;
 
                 sc::string_block::const_iterator it = sc::string_block::begin(*aNode.data);
@@ -1583,7 +1583,7 @@ public:
             break;
             case sc::element_type_edittext:
             {
-                if (!(mnCopyFlags & IDF_STRING))
+                if (!(mnCopyFlags & InsertDeleteFlags::STRING))
                     return;
 
                 sc::edittext_block::const_iterator it = sc::edittext_block::begin(*aNode.data);
@@ -1647,9 +1647,9 @@ void ScColumn::CopyToColumn(
         return;
     }
 
-    if ( (nFlags & IDF_ATTRIB) != IDF_NONE )
+    if ( (nFlags & InsertDeleteFlags::ATTRIB) != InsertDeleteFlags::NONE )
     {
-        if ( (nFlags & IDF_STYLES) != IDF_STYLES )
+        if ( (nFlags & InsertDeleteFlags::STYLES) != InsertDeleteFlags::STYLES )
         {   // keep the StyleSheets in the target document
             // e.g. DIF and RTF Clipboard-Import
             for ( SCROW nRow = nRow1; nRow <= nRow2; nRow++ )
@@ -1666,7 +1666,7 @@ void ScColumn::CopyToColumn(
             pAttrArray->CopyArea( nRow1, nRow2, 0, *rColumn.pAttrArray);
     }
 
-    if ((nFlags & IDF_CONTENTS) != IDF_NONE)
+    if ((nFlags & InsertDeleteFlags::CONTENTS) != InsertDeleteFlags::NONE)
     {
         if (bAsLink)
         {
@@ -1696,12 +1696,12 @@ void ScColumn::UndoToColumn(
     ScColumn& rColumn, const ScMarkData* pMarkData ) const
 {
     if (nRow1 > 0)
-        CopyToColumn(rCxt, 0, nRow1-1, IDF_FORMULA, false, rColumn);
+        CopyToColumn(rCxt, 0, nRow1-1, InsertDeleteFlags::FORMULA, false, rColumn);
 
     CopyToColumn(rCxt, nRow1, nRow2, nFlags, bMarked, rColumn, pMarkData);      //TODO: bMarked ????
 
     if (nRow2 < MAXROW)
-        CopyToColumn(rCxt, nRow2+1, MAXROW, IDF_FORMULA, false, rColumn);
+        CopyToColumn(rCxt, nRow2+1, MAXROW, InsertDeleteFlags::FORMULA, false, rColumn);
 }
 
 void ScColumn::CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const
@@ -1738,10 +1738,10 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol )
     {
         if ( static_cast<const ScMergeFlagAttr&>(pPattern->GetItem( ATTR_MERGE_FLAG )).IsScenario() )
         {
-            DeleteArea( nStart, nEnd, IDF_CONTENTS );
+            DeleteArea( nStart, nEnd, InsertDeleteFlags::CONTENTS );
             sc::CopyToDocContext aCxt(*pDocument);
             ((ScColumn&)rSrcCol).
-                CopyToColumn(aCxt, nStart, nEnd, IDF_CONTENTS, false, *this);
+                CopyToColumn(aCxt, nStart, nEnd, InsertDeleteFlags::CONTENTS, false, *this);
 
             //  UpdateUsed not needed, already done in TestCopyScenario (obsolete comment ?)
 
@@ -1769,9 +1769,9 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
     {
         if ( static_cast<const ScMergeFlagAttr&>(pPattern->GetItem( ATTR_MERGE_FLAG )).IsScenario() )
         {
-            rDestCol.DeleteArea( nStart, nEnd, IDF_CONTENTS );
+            rDestCol.DeleteArea( nStart, nEnd, InsertDeleteFlags::CONTENTS );
             sc::CopyToDocContext aCxt(*rDestCol.pDocument);
-            CopyToColumn(aCxt, nStart, nEnd, IDF_CONTENTS, false, rDestCol);
+            CopyToColumn(aCxt, nStart, nEnd, InsertDeleteFlags::CONTENTS, false, rDestCol);
 
             //  UpdateUsed not needed, is already done in TestCopyScenario (obsolete comment ?)
 
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index c4d2e4e..065f0d5 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -545,9 +545,9 @@ class DeleteAreaHandler
 public:
     DeleteAreaHandler(ScDocument& rDoc, InsertDeleteFlags nDelFlag) :
         mrDoc(rDoc),
-        mbNumeric(nDelFlag & IDF_VALUE),
-        mbString(nDelFlag & IDF_STRING),
-        mbFormula(nDelFlag & IDF_FORMULA) {}
+        mbNumeric(nDelFlag & InsertDeleteFlags::VALUE),
+        mbString(nDelFlag & InsertDeleteFlags::STRING),
+        mbFormula(nDelFlag & InsertDeleteFlags::FORMULA) {}
 
     void operator() (const sc::CellStoreType::value_type& node, size_t nOffset, size_t nDataSize)
     {
@@ -659,10 +659,10 @@ void ScColumn::DeleteArea(
     SCROW nStartRow, SCROW nEndRow, InsertDeleteFlags nDelFlag, bool bBroadcast,
     sc::ColumnSpanSet* pBroadcastSpans )
 {
-    InsertDeleteFlags nContMask = IDF_CONTENTS;
-    // IDF_NOCAPTIONS needs to be passed too, if IDF_NOTE is set
-    if( nDelFlag & IDF_NOTE )
-        nContMask |= IDF_NOCAPTIONS;
+    InsertDeleteFlags nContMask = InsertDeleteFlags::CONTENTS;
+    // InsertDeleteFlags::NOCAPTIONS needs to be passed too, if InsertDeleteFlags::NOTE is set
+    if( nDelFlag & InsertDeleteFlags::NOTE )
+        nContMask |= InsertDeleteFlags::NOCAPTIONS;
     InsertDeleteFlags nContFlag = nDelFlag & nContMask;
 
     sc::SingleColumnSpanSet aDeletedRows;
@@ -670,7 +670,7 @@ void ScColumn::DeleteArea(
     sc::ColumnBlockPosition aBlockPos;
     InitBlockPosition(aBlockPos);
 
-    if (!IsEmptyData() && nContFlag)
+    if (!IsEmptyData() && nContFlag != InsertDeleteFlags::NONE)
     {
         DeleteCells(aBlockPos, nStartRow, nEndRow, nDelFlag, aDeletedRows);
         if (pBroadcastSpans)
@@ -683,22 +683,22 @@ void ScColumn::DeleteArea(
         }
     }
 
-    if (nDelFlag & IDF_NOTE)
+    if (nDelFlag & InsertDeleteFlags::NOTE)
     {
-        bool bForgetCaptionOwnership = ((nDelFlag & IDF_FORGETCAPTIONS) != IDF_NONE);
+        bool bForgetCaptionOwnership = ((nDelFlag & InsertDeleteFlags::FORGETCAPTIONS) != InsertDeleteFlags::NONE);
         DeleteCellNotes(aBlockPos, nStartRow, nEndRow, bForgetCaptionOwnership);
     }
 
-    if ( nDelFlag & IDF_EDITATTR )
+    if ( nDelFlag & InsertDeleteFlags::EDITATTR )
     {
-        OSL_ENSURE( nContFlag == IDF_NONE, "DeleteArea: Wrong Flags" );
+        OSL_ENSURE( nContFlag == InsertDeleteFlags::NONE, "DeleteArea: Wrong Flags" );
         RemoveEditAttribs( nStartRow, nEndRow );
     }
 
     // Delete attributes just now
-    if ((nDelFlag & IDF_ATTRIB) == IDF_ATTRIB)
+    if ((nDelFlag & InsertDeleteFlags::ATTRIB) == InsertDeleteFlags::ATTRIB)
         pAttrArray->DeleteArea( nStartRow, nEndRow );
-    else if ((nDelFlag & IDF_HARDATTR) == IDF_HARDATTR)
+    else if ((nDelFlag & InsertDeleteFlags::HARDATTR) == InsertDeleteFlags::HARDATTR)
         pAttrArray->DeleteHardAttr( nStartRow, nEndRow );
 
     if (bBroadcast)
@@ -818,17 +818,17 @@ public:
         {
             if (bCopyCellNotes && !mrCxt.isSkipAttrForEmptyCells())
             {
-                bool bCloneCaption = (nFlags & IDF_NOCAPTIONS) == IDF_NONE;
+                bool bCloneCaption = (nFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE;
                 duplicateNotes(nSrcRow1, nDataSize, bCloneCaption );
             }
             return;
         }
 
-        bool bNumeric = (nFlags & IDF_VALUE) != IDF_NONE;
-        bool bDateTime = (nFlags & IDF_DATETIME) != IDF_NONE;
-        bool bString   = (nFlags & IDF_STRING) != IDF_NONE;
-        bool bBoolean  = (nFlags & IDF_SPECIAL_BOOLEAN) != IDF_NONE;
-        bool bFormula  = (nFlags & IDF_FORMULA) != IDF_NONE;
+        bool bNumeric = (nFlags & InsertDeleteFlags::VALUE) != InsertDeleteFlags::NONE;
+        bool bDateTime = (nFlags & InsertDeleteFlags::DATETIME) != InsertDeleteFlags::NONE;
+        bool bString   = (nFlags & InsertDeleteFlags::STRING) != InsertDeleteFlags::NONE;
+        bool bBoolean  = (nFlags & InsertDeleteFlags::SPECIAL_BOOLEAN) != InsertDeleteFlags::NONE;
+        bool bFormula  = (nFlags & InsertDeleteFlags::FORMULA) != InsertDeleteFlags::NONE;
 
         bool bAsLink = mrCxt.isAsLink();
 
@@ -1001,7 +1001,7 @@ public:
         }
         if (bCopyCellNotes)
         {
-            bool bCloneCaption = (nFlags & IDF_NOCAPTIONS) == IDF_NONE;
+            bool bCloneCaption = (nFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE;
             duplicateNotes(nSrcRow1, nDataSize, bCloneCaption );
         }
     }
@@ -1040,7 +1040,7 @@ public:
 void ScColumn::CopyFromClip(
     sc::CopyFromClipContext& rCxt, SCROW nRow1, SCROW nRow2, long nDy, ScColumn& rColumn )
 {
-    if ((rCxt.getInsertFlag() & IDF_ATTRIB) != IDF_NONE)
+    if ((rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB) != InsertDeleteFlags::NONE)
     {
         if (rCxt.isSkipAttrForEmptyCells())
         {
@@ -1055,13 +1055,13 @@ void ScColumn::CopyFromClip(
         else
             rColumn.pAttrArray->CopyAreaSafe( nRow1, nRow2, nDy, *pAttrArray );
     }
-    if ((rCxt.getInsertFlag() & IDF_CONTENTS) == IDF_NONE)
+    if ((rCxt.getInsertFlag() & InsertDeleteFlags::CONTENTS) == InsertDeleteFlags::NONE)
         return;
 
-    if (rCxt.isAsLink() && rCxt.getInsertFlag() == IDF_ALL)
+    if (rCxt.isAsLink() && rCxt.getInsertFlag() == InsertDeleteFlags::ALL)
     {
         // We also reference empty cells for "ALL"
-        // IDF_ALL must always contain more flags when compared to "Insert contents" as
+        // InsertDeleteFlags::ALL must always contain more flags when compared to "Insert contents" as
         // contents can be selected one by one!
 
         ScAddress aDestPos( nCol, 0, nTab ); // Adapt Row
@@ -2353,7 +2353,7 @@ void ScColumn::RemoveProtected( SCROW nStartRow, SCROW nEndRow )
     {
         const ScProtectionAttr* pAttr = static_cast<const ScProtectionAttr*>(&pPattern->GetItem(ATTR_PROTECTION));
         if ( pAttr->GetHideCell() )
-            DeleteArea( nTop, nBottom, IDF_CONTENTS );
+            DeleteArea( nTop, nBottom, InsertDeleteFlags::CONTENTS );
         else if ( pAttr->GetHideFormula() )
         {
             // Replace all formula cells between nTop and nBottom with raw value cells.
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index bd7c60b..b374d52 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -104,21 +104,21 @@ void ScColumn::DeleteBeforeCopyFromClip(
         SCROW nRow1 = it->mnRow1;
         SCROW nRow2 = it->mnRow2;
 
-        if (nDelFlag & IDF_CONTENTS)
+        if (nDelFlag & InsertDeleteFlags::CONTENTS)
         {
             sc::SingleColumnSpanSet aDeletedRows;
             DeleteCells(aBlockPos, nRow1, nRow2, nDelFlag, aDeletedRows);
             rBroadcastSpans.set(nTab, nCol, aDeletedRows, true);
         }
 
-        if (nDelFlag & IDF_NOTE)
+        if (nDelFlag & InsertDeleteFlags::NOTE)
             DeleteCellNotes(aBlockPos, nRow1, nRow2, false);
 
-        if (nDelFlag & IDF_EDITATTR)
+        if (nDelFlag & InsertDeleteFlags::EDITATTR)
             RemoveEditAttribs(nRow1, nRow2);
 
         // Delete attributes just now
-        if (nDelFlag & IDF_ATTRIB)
+        if (nDelFlag & InsertDeleteFlags::ATTRIB)
         {
             pAttrArray->DeleteArea(nRow1, nRow2);
 
@@ -133,7 +133,7 @@ void ScColumn::DeleteBeforeCopyFromClip(
             if (pCondList)
                 pCondList->DeleteArea(nCol, nRow1, nCol, nRow2);
         }
-        else if ((nDelFlag & IDF_HARDATTR) == IDF_HARDATTR)
+        else if ((nDelFlag & InsertDeleteFlags::HARDATTR) == InsertDeleteFlags::HARDATTR)
             pAttrArray->DeleteHardAttr(nRow1, nRow2);
     }
 }
@@ -154,7 +154,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
 
     InsertDeleteFlags nFlags = rCxt.getInsertFlag();
 
-    if ((nFlags & IDF_ATTRIB) != IDF_NONE)
+    if ((nFlags & InsertDeleteFlags::ATTRIB) != InsertDeleteFlags::NONE)
     {
         if (!rCxt.isSkipAttrForEmptyCells() || rSrcCell.meType != CELLTYPE_NONE)
         {
@@ -164,7 +164,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
         }
     }
 
-    if ((nFlags & IDF_CONTENTS) != IDF_NONE)
+    if ((nFlags & InsertDeleteFlags::CONTENTS) != InsertDeleteFlags::NONE)
     {
         std::vector<sc::CellTextAttr> aTextAttrs(nDestSize, rSrcAttr);
 
@@ -225,7 +225,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
     }
 
     const ScPostIt* pNote = rCxt.getSingleCellNote(nColOffset);
-    if (pNote && (nFlags & (IDF_NOTE | IDF_ADDNOTES)) != IDF_NONE)
+    if (pNote && (nFlags & (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES)) != InsertDeleteFlags::NONE)
     {
         // Duplicate the cell note over the whole pasted range.
 
@@ -236,7 +236,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
         aNotes.reserve(nDestSize);
         for (size_t i = 0; i < nDestSize; ++i)
         {
-            bool bCloneCaption = (nFlags & IDF_NOCAPTIONS) == IDF_NONE;
+            bool bCloneCaption = (nFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE;
             aNotes.push_back(pNote->Clone(rSrcPos, *pDocument, aDestPos, bCloneCaption));
             aDestPos.IncRow();
         }
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index dbf9686..5774c33 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -886,7 +886,7 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
     {
         SetNoListening( true );     // noch nicht bei CopyToTable/Insert
         sc::CopyToDocContext aCopyDocCxt(*this);
-        maTabs[nOldPos]->CopyToTable(aCopyDocCxt, 0, 0, MAXCOL, MAXROW, IDF_ALL, (pOnlyMarked != NULL),
+        maTabs[nOldPos]->CopyToTable(aCopyDocCxt, 0, 0, MAXCOL, MAXROW, InsertDeleteFlags::ALL, (pOnlyMarked != NULL),
                                         maTabs[nNewPos], pOnlyMarked );
         maTabs[nNewPos]->SetTabBgColor(maTabs[nOldPos]->GetTabBgColor());
 
@@ -965,7 +965,7 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
     {
         if (ValidTab(nDestPos) && nDestPos < static_cast<SCTAB>(maTabs.size()) && maTabs[nDestPos])
         {
-            maTabs[nDestPos]->DeleteArea( 0,0, MAXCOL,MAXROW, IDF_ALL );
+            maTabs[nDestPos]->DeleteArea( 0,0, MAXCOL,MAXROW, InsertDeleteFlags::ALL );
         }
         else
             bValid = false;
@@ -991,7 +991,7 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
             {   // scope for bulk broadcast
                 ScBulkBroadcast aBulkBroadcast( pBASM);
                 pSrcDoc->maTabs[nSrcPos]->CopyToTable(aCxt, 0, 0, MAXCOL, MAXROW,
-                        ( bResultsOnly ? IDF_ALL & ~IDF_FORMULA : IDF_ALL),
+                        ( bResultsOnly ? InsertDeleteFlags::ALL & ~InsertDeleteFlags::FORMULA : InsertDeleteFlags::ALL),
                         false, maTabs[nDestPos] );
             }
         }
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index e9b2f55..e939264 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1988,7 +1988,7 @@ void ScDocument::DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
         ApplyFlagsTab( nStartCol+1, nStartRow+1, nEndCol, nEndRow, nTab, SC_MF_HOR | SC_MF_VER );
 
     // Remove all covered notes (removed captions are collected by drawing undo if active)
-    InsertDeleteFlags nDelFlag = IDF_NOTE | (bDeleteCaptions ? IDF_NONE : IDF_NOCAPTIONS);
+    InsertDeleteFlags nDelFlag = InsertDeleteFlags::NOTE | (bDeleteCaptions ? InsertDeleteFlags::NONE : InsertDeleteFlags::NOCAPTIONS);
     if( nStartCol < nEndCol )
         DeleteAreaTab( nStartCol + 1, nStartRow, nEndCol, nStartRow, nTab, nDelFlag );
     if( nStartRow < nEndRow )
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 53f5b30..9786c2a 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1747,7 +1747,7 @@ bool ScDocument::CanFitBlock( const ScRange& rOld, const ScRange& rNew )
 void ScDocument::FitBlock( const ScRange& rOld, const ScRange& rNew, bool bClear )
 {
     if (bClear)
-        DeleteAreaTab( rOld, IDF_ALL );
+        DeleteAreaTab( rOld, InsertDeleteFlags::ALL );
 
     bool bInsCol,bDelCol,bInsRow,bDelRow;
     ScRange aColRange,aRowRange;
@@ -1787,7 +1787,7 @@ void ScDocument::DeleteArea(
 
     std::vector<ScAddress> aGroupPos;
     // Destroy and reconstruct listeners only if content is affected.
-    bool bDelContent = ((nDelFlag & ~IDF_CONTENTS) != nDelFlag);
+    bool bDelContent = ((nDelFlag & ~InsertDeleteFlags::CONTENTS) != nDelFlag);
     if (bDelContent)
     {
         // Record the positions of top and/or bottom formula groups that intersect
@@ -1985,7 +1985,7 @@ void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
         sc::AutoCalcSwitch aACSwitch(*pDestDoc, false); // avoid multiple calculations
 
         if (nTab1 > 0)
-            CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, false, pDestDoc, pMarks );
+            CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, InsertDeleteFlags::FORMULA, false, pDestDoc, pMarks );
 
         sc::CopyToDocContext aCxt(*pDestDoc);
         OSL_ASSERT( nTab2 < static_cast<SCTAB>(maTabs.size()) && nTab2 < static_cast<SCTAB>(pDestDoc->maTabs.size()));
@@ -1997,7 +1997,7 @@ void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
         }
 
         if (nTab2 < MAXTAB)
-            CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, false, pDestDoc, pMarks );
+            CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, InsertDeleteFlags::FORMULA, false, pDestDoc, pMarks );
     }
 }
 
@@ -2045,7 +2045,7 @@ void ScDocument::UndoToDocument(const ScRange& rRange,
 
     sc::CopyToDocContext aCxt(*pDestDoc);
     if (nTab1 > 0)
-        CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, false, pDestDoc, pMarks );
+        CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, InsertDeleteFlags::FORMULA, false, pDestDoc, pMarks );
 
     SCTAB nMinSizeBothTabs = static_cast<SCTAB>(std::min(maTabs.size(), pDestDoc->maTabs.size()));
     for (SCTAB i = nTab1; i <= nTab2 && i < nMinSizeBothTabs; i++)
@@ -2057,7 +2057,7 @@ void ScDocument::UndoToDocument(const ScRange& rRange,
     }
 
     if (nTab2 < static_cast<SCTAB>(maTabs.size()))
-        CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,maTabs.size(), IDF_FORMULA, false, pDestDoc, pMarks );
+        CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,maTabs.size(), InsertDeleteFlags::FORMULA, false, pDestDoc, pMarks );
 }
 
 // bUseRangeForVBA added for VBA api support to allow content of a specified
@@ -2268,7 +2268,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, InsertDeleteFlags nFlags
                                             aClipRange.aEnd.Col(), aClipRange.aEnd.Row(),
                                             pTransClip->maTabs[i], nFlags, bAsLink );
 
-                if ( pDrawLayer && ( nFlags & IDF_OBJECTS ) )
+                if ( pDrawLayer && ( nFlags & InsertDeleteFlags::OBJECTS ) )
                 {
                     //  Drawing objects are copied to the new area without transposing.
                     //  CopyFromClip is used to adjust the objects to the transposed block's
@@ -2466,7 +2466,7 @@ void ScDocument::StartListeningFromClip( SCCOL nCol1, SCROW nRow1,
                                         SCCOL nCol2, SCROW nRow2,
                                         const ScMarkData& rMark, InsertDeleteFlags nInsFlag )
 {
-    if (nInsFlag & IDF_CONTENTS)
+    if (nInsFlag & InsertDeleteFlags::CONTENTS)
     {
         std::shared_ptr<sc::ColumnBlockPositionSet> pSet(
             new sc::ColumnBlockPositionSet(*this));
@@ -2486,7 +2486,7 @@ void ScDocument::SetDirtyFromClip(
     SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark,
     InsertDeleteFlags nInsFlag, sc::ColumnSpanSet& rBroadcastSpans )
 {
-    if (nInsFlag & IDF_CONTENTS)
+    if (nInsFlag & InsertDeleteFlags::CONTENTS)
     {
         SCTAB nMax = static_cast<SCTAB>(maTabs.size());
         ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
@@ -2520,7 +2520,7 @@ void ScDocument::CopyBlockFromClip(
             maTabs[i]->CopyFromClip(
                 rCxt, nCol1, nRow1, nCol2, nRow2, nDx, nDy, rClipTabs[nClipTab]);
 
-            if (rCxt.getClipDoc()->pDrawLayer && (rCxt.getInsertFlag() & IDF_OBJECTS))
+            if (rCxt.getClipDoc()->pDrawLayer && (rCxt.getInsertFlag() & InsertDeleteFlags::OBJECTS))
             {
                 //  also copy drawing objects
 
@@ -2544,7 +2544,7 @@ void ScDocument::CopyBlockFromClip(
             nClipTab = (nClipTab+1) % (static_cast<SCTAB>(rClipTabs.size()));
         }
     }
-    if (rCxt.getInsertFlag() & IDF_CONTENTS)
+    if (rCxt.getInsertFlag() & InsertDeleteFlags::CONTENTS)
     {
         nClipTab = 0;
         for (SCTAB i = rCxt.getTabStart(); i <= nTabEnd && i < static_cast<SCTAB>(maTabs.size()); i++)
@@ -2726,18 +2726,18 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
     /*  Decide which contents to delete before copying. Delete all
         contents if nInsFlag contains any real content flag.
         #i102056# Notes are pasted from clipboard in a second pass,
-        together with the special flag IDF_ADDNOTES that states to not
+        together with the special flag InsertDeleteFlags::ADDNOTES that states to not
         overwrite/delete existing cells but to insert the notes into
         these cells. In this case, just delete old notes from the
         destination area. */
-    InsertDeleteFlags nDelFlag = IDF_NONE;
-    if ( (nInsFlag & (IDF_CONTENTS | IDF_ADDNOTES)) == (IDF_NOTE | IDF_ADDNOTES) )
-        nDelFlag |= IDF_NOTE;
-    else if ( nInsFlag & IDF_CONTENTS )
-        nDelFlag |= IDF_CONTENTS;
+    InsertDeleteFlags nDelFlag = InsertDeleteFlags::NONE;
+    if ( (nInsFlag & (InsertDeleteFlags::CONTENTS | InsertDeleteFlags::ADDNOTES)) == (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) )
+        nDelFlag |= InsertDeleteFlags::NOTE;
+    else if ( nInsFlag & InsertDeleteFlags::CONTENTS )
+        nDelFlag |= InsertDeleteFlags::CONTENTS;
 
-    if (nInsFlag & IDF_ATTRIB)
-        nDelFlag |= IDF_ATTRIB;
+    if (nInsFlag & InsertDeleteFlags::ATTRIB)
+        nDelFlag |= InsertDeleteFlags::ATTRIB;
 
     sc::CopyFromClipContext aCxt(*this, pRefUndoDoc, pClipDoc, nInsFlag, bAsLink, bSkipAttrForEmpty);
     std::pair<SCTAB,SCTAB> aTabRanges = getMarkedTableRange(maTabs, rMark);
@@ -2788,7 +2788,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
             nR2 = nRow2;
 
         const SCCOLROW nThreshold = 8192;
-        bool bPreallocatePattern = ((nInsFlag & IDF_ATTRIB) && (nRow2 - nRow1 > nThreshold));
+        bool bPreallocatePattern = ((nInsFlag & InsertDeleteFlags::ATTRIB) && (nRow2 - nRow1 > nThreshold));
         std::vector< SCTAB > vTables;
 
         if (bPreallocatePattern)
@@ -2918,7 +2918,7 @@ void ScDocument::CopyMultiRangeFromClip(
     if (!bSkipAttrForEmpty)
     {
         // Do the deletion first.
-        InsertDeleteFlags nDelFlag = IDF_CONTENTS;
+        InsertDeleteFlags nDelFlag = InsertDeleteFlags::CONTENTS;
         SCCOL nColSize = rClipParam.getPasteColSize();
         SCROW nRowSize = rClipParam.getPasteRowSize();
 
@@ -3107,8 +3107,8 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
                                 bool bSkipEmpty, bool bAsLink )
 {
     InsertDeleteFlags nDelFlags = nFlags;
-    if (nDelFlags & IDF_CONTENTS)
-        nDelFlags |= IDF_CONTENTS;          // Either all contents or delete nothing!
+    if (nDelFlags & InsertDeleteFlags::CONTENTS)
+        nDelFlags |= InsertDeleteFlags::CONTENTS;          // Either all contents or delete nothing!
 
     SCTAB nSrcTab = rSrcArea.aStart.Tab();
 
@@ -3119,7 +3119,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
         SCCOL nEndCol = rSrcArea.aEnd.Col();
         SCROW nEndRow = rSrcArea.aEnd.Row();
         std::unique_ptr<ScDocument> pMixDoc;
-        bool bDoMix = ( bSkipEmpty || nFunction != ScPasteFunc::NONE ) && ( nFlags & IDF_CONTENTS );
+        bool bDoMix = ( bSkipEmpty || nFunction != ScPasteFunc::NONE ) && ( nFlags & InsertDeleteFlags::CONTENTS );
 
         bool bOldAutoCalc = GetAutoCalc();
         SetAutoCalc( false );                   // avoid multiple calculations
@@ -3146,7 +3146,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
                     // context used for copying content to the temporary mix document.
                     sc::CopyToDocContext aMixCxt(*pMixDoc);
                     maTabs[i]->CopyToTable(aMixCxt, nStartCol,nStartRow, nEndCol,nEndRow,
-                                            IDF_CONTENTS, false, pMixDoc->maTabs[i] );
+                                            InsertDeleteFlags::CONTENTS, false, pMixDoc->maTabs[i] );
                 }
                 maTabs[i]->DeleteArea( nStartCol,nStartRow, nEndCol,nEndRow, nDelFlags);
                 maTabs[nSrcTab]->CopyToTable(aCxt, nStartCol,nStartRow, nEndCol,nEndRow,
@@ -3170,13 +3170,13 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
                                 bool bSkipEmpty, bool bAsLink )
 {
     InsertDeleteFlags nDelFlags = nFlags;
-    if (nDelFlags & IDF_CONTENTS)
-        nDelFlags |= IDF_CONTENTS;          // Either all contents or delete nothing!
+    if (nDelFlags & InsertDeleteFlags::CONTENTS)
+        nDelFlags |= InsertDeleteFlags::CONTENTS;          // Either all contents or delete nothing!
 
     if (ValidTab(nSrcTab) && nSrcTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nSrcTab])
     {
         std::unique_ptr<ScDocument> pMixDoc;
-        bool bDoMix = ( bSkipEmpty || nFunction != ScPasteFunc::NONE ) && ( nFlags & IDF_CONTENTS );
+        bool bDoMix = ( bSkipEmpty || nFunction != ScPasteFunc::NONE ) && ( nFlags & InsertDeleteFlags::CONTENTS );
 
         bool bOldAutoCalc = GetAutoCalc();
         SetAutoCalc( false );                   // avoid multiple calculations
@@ -3208,7 +3208,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
 
                     sc::CopyToDocContext aMixCxt(*pMixDoc);
                     maTabs[i]->CopyToTable(aMixCxt, nStartCol,nStartRow, nEndCol,nEndRow,
-                                            IDF_CONTENTS, true, pMixDoc->maTabs[i], &rMark );
+                                            InsertDeleteFlags::CONTENTS, true, pMixDoc->maTabs[i], &rMark );
                 }
 
                 maTabs[i]->DeleteSelection( nDelFlags, rMark );
@@ -5663,7 +5663,7 @@ void ScDocument::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData&
 
     std::vector<ScAddress> aGroupPos;
     // Destroy and reconstruct listeners only if content is affected.
-    bool bDelContent = ((nDelFlag & ~IDF_CONTENTS) != nDelFlag);
+    bool bDelContent = ((nDelFlag & ~InsertDeleteFlags::CONTENTS) != nDelFlag);
     if (bDelContent)
     {
         // Record the positions of top and/or bottom formula groups that
@@ -5703,7 +5703,7 @@ void ScDocument::DeleteSelectionTab(
 
         std::vector<ScAddress> aGroupPos;
         // Destroy and reconstruct listeners only if content is affected.
-        bool bDelContent = ((nDelFlag & ~IDF_CONTENTS) != nDelFlag);
+        bool bDelContent = ((nDelFlag & ~InsertDeleteFlags::CONTENTS) != nDelFlag);
         if (bDelContent)
         {
             // Record the positions of top and/or bottom formula groups that
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index dd3572c..d520a0f 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -103,7 +103,7 @@ bool ScDocument::CopyOneCellFromClip(
         const ScPatternAttr* pAttr = pClipDoc->GetPattern(aSrcPos);
         rCxt.setSingleCellPattern(nColOffset, pAttr);
 
-        if ((rCxt.getInsertFlag() & (IDF_NOTE | IDF_ADDNOTES)) != IDF_NONE)
+        if ((rCxt.getInsertFlag() & (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES)) != InsertDeleteFlags::NONE)
             rCxt.setSingleCellNote(nColOffset, pClipDoc->GetNote(aSrcPos));
 
         ScColumn& rSrcCol = pSrcTab->aCol[aSrcPos.Col()];
@@ -118,7 +118,7 @@ bool ScDocument::CopyOneCellFromClip(
     for (SCTAB i = rCxt.getTabStart(); i <= nTabEnd && i < static_cast<SCTAB>(maTabs.size()); ++i)
     {
         maTabs[i]->CopyOneCellFromClip(rCxt, nCol1, nRow1, nCol2, nRow2);
-        if (rCxt.getInsertFlag() & IDF_ATTRIB)
+        if (rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB)
             for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
             {
                 maTabs[i]->CopyConditionalFormat(nCol1, nRow, nCol2, nRow, nCol1 - aClipRange.aStart.Col(),
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 316a878..0ba7b27 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -909,7 +909,7 @@ void ScDPObject::Output( const ScAddress& rPos )
     //  clear old output area
     pDoc->DeleteAreaTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(),
                          aOutRange.aEnd.Col(),   aOutRange.aEnd.Row(),
-                         aOutRange.aStart.Tab(), IDF_ALL );
+                         aOutRange.aStart.Tab(), InsertDeleteFlags::ALL );
     pDoc->RemoveFlagsTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(),
                           aOutRange.aEnd.Col(),   aOutRange.aEnd.Row(),
                           aOutRange.aStart.Tab(), SC_MF_AUTO );
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index a2c13f8..a277ab5 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -978,8 +978,8 @@ void ScDPOutput::Output()
 
     //  clear whole (new) output area
     // when modifying table, clear old area !
-    //TODO: include IDF_OBJECTS ???
-    pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, IDF_ALL );
+    //TODO: include InsertDeleteFlags::OBJECTS ???
+    pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, InsertDeleteFlags::ALL );
 
     if ( bDoFilter )
         lcl_DoFilterButton( pDoc, aStartPos.Col(), aStartPos.Row(), nTab );
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index b4f143e..38208ec 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -334,7 +334,7 @@ void ScTable::InsertCol(
         sc::CopyToDocContext aCxt(*pDocument);
         for (SCSIZE i=0; i<nSize; i++)
         {
-            aCol[nStartCol-1].CopyToColumn(aCxt, nStartRow, nEndRow, IDF_ATTRIB,
+            aCol[nStartCol-1].CopyToColumn(aCxt, nStartRow, nEndRow, InsertDeleteFlags::ATTRIB,
                                                 false, aCol[nStartCol+i] );
             aCol[nStartCol+i].RemoveFlags( nStartRow, nEndRow,
                                                 SC_MF_HOR | SC_MF_VER | SC_MF_AUTO );
@@ -394,7 +394,7 @@ void ScTable::DeleteCol(
     }
 
     for (SCSIZE i = 0; i < nSize; i++)
-        aCol[nStartCol + i].DeleteArea(nStartRow, nEndRow, IDF_ALL, false);
+        aCol[nStartCol + i].DeleteArea(nStartRow, nEndRow, InsertDeleteFlags::ALL, false);
 
     if ((nStartRow == 0) && (nEndRow == MAXROW))
     {
@@ -436,14 +436,14 @@ void ScTable::DeleteArea(
 
             // Do not set protected cell in a protected table
 
-        if ( IsProtected() && (nDelFlag & IDF_ATTRIB) )
+        if ( IsProtected() && (nDelFlag & InsertDeleteFlags::ATTRIB) )
         {
             ScPatternAttr aPattern(pDocument->GetPool());
             aPattern.GetItemSet().Put( ScProtectionAttr( false ) );
             ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern );
         }
 
-        if( nDelFlag & IDF_ATTRIB )
+        if( nDelFlag & InsertDeleteFlags::ATTRIB )
             mpCondFormatList->DeleteArea( nCol1, nRow1, nCol2, nRow2 );
     }
 
@@ -468,13 +468,13 @@ void ScTable::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rMa
     {
         ScRange* pRange = aRangeList[i];
 
-        if((nDelFlag & IDF_ATTRIB) && pRange && pRange->aStart.Tab() == nTab)
+        if((nDelFlag & InsertDeleteFlags::ATTRIB) && pRange && pRange->aStart.Tab() == nTab)
             mpCondFormatList->DeleteArea( pRange->aStart.Col(), pRange->aStart.Row(), pRange->aEnd.Col(), pRange->aEnd.Row() );
     }
 
         // Do not set protected cell in a protected sheet
 
-    if ( IsProtected() && (nDelFlag & IDF_ATTRIB) )
+    if ( IsProtected() && (nDelFlag & InsertDeleteFlags::ATTRIB) )
     {
         ScDocumentPool* pPool = pDocument->GetPool();
         SfxItemSet aSet( *pPool, ATTR_PATTERN_START, ATTR_PATTERN_END );
@@ -659,7 +659,7 @@ void ScTable::CopyFromClip(
         for ( SCCOL i = nCol1; i <= nCol2; i++)
             aCol[i].CopyFromClip(rCxt, nRow1, nRow2, nDy, pTable->aCol[i - nDx]); // notes are handles at column level
 
-        if (rCxt.getInsertFlag() & IDF_ATTRIB)
+        if (rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB)
         {
             // make sure that there are no old references to the cond formats
             sal_uInt16 nWhichArray[2];
@@ -669,7 +669,7 @@ void ScTable::CopyFromClip(
                 aCol[i].ClearItems(nRow1, nRow2, nWhichArray);
         }
 
-        if ((rCxt.getInsertFlag() & IDF_ATTRIB) != IDF_NONE)
+        if ((rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB) != InsertDeleteFlags::NONE)
         {
             if (nRow1==0 && nRow2==MAXROW && pColWidth && pTable->pColWidth)
                 for (SCCOL i=nCol1; i<=nCol2; i++)
@@ -690,7 +690,7 @@ void ScTable::CopyFromClip(
             }
 
             // Do not set protected cell in a protected sheet
-            if (IsProtected() && (rCxt.getInsertFlag() & IDF_ATTRIB))
+            if (IsProtected() && (rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB))
             {
                 ScPatternAttr aPattern(pDocument->GetPool());
                 aPattern.GetItemSet().Put( ScProtectionAttr( false ) );
@@ -831,9 +831,9 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     for (SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
     {
         SCROW nRow;
-        if ( bAsLink && nFlags == IDF_ALL )
+        if ( bAsLink && nFlags == InsertDeleteFlags::ALL )
         {
-            //  with IDF_ALL, also create links (formulas) for empty cells
+            //  with InsertDeleteFlags::ALL, also create links (formulas) for empty cells
 
             for ( nRow=nRow1; nRow<=nRow2; nRow++ )
             {
@@ -1080,7 +1080,7 @@ void ScTable::CopyToTable(
     if (!ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2))
         return;
 
-    if (nFlags)
+    if (nFlags != InsertDeleteFlags::NONE)
         for (SCCOL i = nCol1; i <= nCol2; i++)
             aCol[i].CopyToColumn(rCxt, nRow1, nRow2, nFlags, bMarked,
                                 pDestTab->aCol[i], pMarkData, bAsLink);
@@ -1088,7 +1088,7 @@ void ScTable::CopyToTable(
     if (!bColRowFlags)      // Column widths/Row heights/Flags
         return;
 
-    if(pDestTab->pDocument->IsUndo() && (nFlags & IDF_ATTRIB))
+    if(pDestTab->pDocument->IsUndo() && (nFlags & InsertDeleteFlags::ATTRIB))
     {
         pDestTab->mpCondFormatList.reset(new ScConditionalFormatList(pDestTab->pDocument, *mpCondFormatList));
     }
@@ -1182,13 +1182,13 @@ void ScTable::CopyToTable(
     if (bFlagChange)
         pDestTab->InvalidatePageBreaks();
 
-    if(nFlags & IDF_ATTRIB)
+    if(nFlags & InsertDeleteFlags::ATTRIB)
     {
         pDestTab->mpCondFormatList->DeleteArea(nCol1, nRow1, nCol2, nRow2);
         pDestTab->CopyConditionalFormat(nCol1, nRow1, nCol2, nRow2, 0, 0, this);
     }
 
-    if(nFlags & IDF_OUTLINE) // also only when bColRowFlags
+    if(nFlags & InsertDeleteFlags::OUTLINE) // also only when bColRowFlags
         pDestTab->SetOutlineTable( pOutlineTable );
 }
 
@@ -1206,10 +1206,10 @@ void ScTable::UndoToTable(
             if ( i >= nCol1 && i <= nCol2 )
                 aCol[i].UndoToColumn(rCxt, nRow1, nRow2, nFlags, bMarked, pDestTab->aCol[i], pMarkData);
             else
-                aCol[i].CopyToColumn(rCxt, 0, MAXROW, IDF_FORMULA, false, pDestTab->aCol[i]);
+                aCol[i].CopyToColumn(rCxt, 0, MAXROW, InsertDeleteFlags::FORMULA, false, pDestTab->aCol[i]);
         }
 
-        if (nFlags & IDF_ATTRIB)
+        if (nFlags & InsertDeleteFlags::ATTRIB)
             pDestTab->mpCondFormatList.reset(new ScConditionalFormatList(pDestTab->pDocument, *mpCondFormatList));
 
         if (bWidth||bHeight)
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index ee1a29a..b8f3a95 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -545,9 +545,9 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     if (!bHasFiltered)
     {
         if (bVertical)
-            DeleteArea(nCol1, static_cast<SCROW>(nIMin), nCol2, static_cast<SCROW>(nIMax), IDF_AUTOFILL);
+            DeleteArea(nCol1, static_cast<SCROW>(nIMin), nCol2, static_cast<SCROW>(nIMax), InsertDeleteFlags::AUTOFILL);
         else
-            DeleteArea(static_cast<SCCOL>(nIMin), nRow1, static_cast<SCCOL>(nIMax), nRow2, IDF_AUTOFILL);
+            DeleteArea(static_cast<SCCOL>(nIMin), nRow1, static_cast<SCCOL>(nIMax), nRow2, InsertDeleteFlags::AUTOFILL);
     }
 
     sal_uLong nProgress = 0;
@@ -632,7 +632,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
 
                 if ( bHasFiltered )
                     DeleteArea(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow),
-                            static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), IDF_AUTOFILL);
+                            static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), InsertDeleteFlags::AUTOFILL);
 
                 if ( pSrcPattern != aCol[nCol].GetPattern( static_cast<SCROW>(nRow) ) )
                 {
@@ -1175,7 +1175,7 @@ void ScTable::FillFormulaVertical(
     if (aSpans.empty())
         return;
 
-    aCol[nCol].DeleteRanges(aSpans, IDF_VALUE | IDF_DATETIME | IDF_STRING | IDF_FORMULA | IDF_OUTLINE, false);
+    aCol[nCol].DeleteRanges(aSpans, InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME | InsertDeleteFlags::STRING | InsertDeleteFlags::FORMULA | InsertDeleteFlags::OUTLINE, false);
     aCol[nCol].CloneFormulaCell(rSrcCell, sc::CellTextAttr(), aSpans, NULL);
 
     std::shared_ptr<sc::ColumnBlockPositionSet> pSet(new sc::ColumnBlockPositionSet(*pDocument));
@@ -1528,7 +1528,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     SCCOLROW nIMin = nIStart;
     SCCOLROW nIMax = nIEnd;
     PutInOrder(nIMin,nIMax);
-    InsertDeleteFlags nDel = bAttribs ? IDF_AUTOFILL : (IDF_AUTOFILL & IDF_CONTENTS);
+    InsertDeleteFlags nDel = bAttribs ? InsertDeleteFlags::AUTOFILL : (InsertDeleteFlags::AUTOFILL & InsertDeleteFlags::CONTENTS);
 
     bool bIsFiltered = IsDataFiltered(aFillRange);
     if (!bIsFiltered)
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 859b1b1..4fb4216 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -686,7 +686,7 @@ bool ScTable::ReplaceAllStyle(
         {
             if (pUndoDoc)
                 pDocument->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab,
-                                            IDF_ATTRIB, true, pUndoDoc, &rMark );
+                                            InsertDeleteFlags::ATTRIB, true, pUndoDoc, &rMark );
             ApplySelectionStyle( *pReplaceStyle, rMark );
         }
         else
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 381e0ab..53129011 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -1247,8 +1247,8 @@ bool ScChangeActionMove::Reject( ScDocument* pDoc )
 
     pTrack->LookUpContents( aToRange, pDoc, 0, 0, 0 );  // Contents to be moved
 
-    pDoc->DeleteAreaTab( aToRange, IDF_ALL );
-    pDoc->DeleteAreaTab( aFrmRange, IDF_ALL );
+    pDoc->DeleteAreaTab( aToRange, InsertDeleteFlags::ALL );
+    pDoc->DeleteAreaTab( aFrmRange, InsertDeleteFlags::ALL );
     // Adjust formula in the Document
     sc::RefUpdateContext aCxt(*pDoc);
     aCxt.meMode = URM_MOVE;
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 017d68b..1154c66 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -498,7 +498,7 @@ void ScTransferObj::DragFinished( sal_Int8 nDropAction )
             ScMarkData aMarkData = GetSourceMarkData();
             //  external drag&drop doesn't copy objects, so they also aren't deleted:
             //  bApi=TRUE, don't show error messages from drag&drop
-            pSourceSh->GetDocFunc().DeleteContents( aMarkData, IDF_ALL & ~IDF_OBJECTS, true, true );
+            pSourceSh->GetDocFunc().DeleteContents( aMarkData, InsertDeleteFlags::ALL & ~InsertDeleteFlags::OBJECTS, true, true );
         }
     }
 
@@ -646,7 +646,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
         bool bWasCut = pDoc->IsCutMode();
         if (!bWasCut)
             pDoc->SetClipArea( aDestRange, true );          // Cut
-        rDestDoc.CopyFromClip( aDestRange, aDestMark, IDF_ALL, NULL, pDoc, false );
+        rDestDoc.CopyFromClip( aDestRange, aDestMark, InsertDeleteFlags::ALL, NULL, pDoc, false );
         pDoc->SetClipArea( aDestRange, bWasCut );
 
         StripRefs( pDoc, nStartX,nStartY, nEndX,nEndY, &rDestDoc );
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 5932e94..491514e 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -426,7 +426,7 @@ public:
         ScTabViewShell* pTabViewShell) override;
 
     virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(vcl::Window* pParent,
-                                                                    InsertDeleteFlags nCheckDefaults = IDF_NONE) override;
+                                                                    InsertDeleteFlags nCheckDefaults = InsertDeleteFlags::NONE) override;
 
     virtual AbstractScFillSeriesDlg * CreateScFillSeriesDlg( vcl::Window*        pParent,
                                                             ScDocument&     rDocument,
@@ -446,7 +446,7 @@ public:
                                                              bool bDisallowCellMove = false ) override;
 
     virtual AbstractScInsertContentsDlg * CreateScInsertContentsDlg( vcl::Window*        pParent,
-                                                                    InsertDeleteFlags nCheckDefaults = IDF_NONE,
+                                                                    InsertDeleteFlags nCheckDefaults = InsertDeleteFlags::NONE,
                                                                     const OUString* pStrTitle = NULL ) override;
 
     virtual AbstractScInsertTableDlg * CreateScInsertTableDlg(vcl::Window* pParent, ScViewData& rViewData,
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 016cd79..314181a 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -334,16 +334,16 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
                 {
                     pUndoDoc->InitUndo( &rDoc, 0, rDoc.GetTableCount()-1 );
                     rDoc.CopyToDocument( 0,0,0,MAXCOL,MAXROW,MAXTAB,
-                                            IDF_FORMULA, false, pUndoDoc );     // alle Formeln
+                                            InsertDeleteFlags::FORMULA, false, pUndoDoc );     // alle Formeln
                 }
                 else
                     pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab );             // nur Zieltabelle
-                rDoc.CopyToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
+                rDoc.CopyToDocument( aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pUndoDoc );
             }
             else        // ohne Einfuegen
             {
                 pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab );             // nur Zieltabelle
-                rDoc.CopyToDocument( aMaxRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
+                rDoc.CopyToDocument( aMaxRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pUndoDoc );
             }
         }
 
@@ -353,7 +353,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
         if (bDoInsert)
             rDoc.FitBlock( aOldRange, aNewRange );         // incl. loeschen
         else
-            rDoc.DeleteAreaTab( aMaxRange, IDF_ALL & ~IDF_NOTE );
+            rDoc.DeleteAreaTab( aMaxRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE );
 
         //  Daten kopieren
 
@@ -392,7 +392,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
                     ScMarkData aDestMark;
                     aDestMark.SelectOneTable( nDestTab );
                     aDestMark.SetMarkArea( aNewTokenRange );
-                    rDoc.CopyFromClip( aNewTokenRange, aDestMark, IDF_ALL, NULL, &aClipDoc, false );
+                    rDoc.CopyFromClip( aNewTokenRange, aDestMark, InsertDeleteFlags::ALL, NULL, &aClipDoc, false );
                     aNewTokenRange.aStart.SetRow( aNewTokenRange.aEnd.Row() + 2 );
                 }
             }
@@ -409,7 +409,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
         {
             ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
             pRedoDoc->InitUndo( &rDoc, nDestTab, nDestTab );
-            rDoc.CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
+            rDoc.CopyToDocument( aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pRedoDoc );
 
             pImpl->m_pDocSh->GetUndoManager()->AddUndoAction(
                 new ScUndoUpdateAreaLink( pImpl->m_pDocSh,
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 2d762ea..9b26bad 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -363,19 +363,19 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
                     pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
                     rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0,
                             nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab,
-                            IDF_NONE, false, pUndoDoc );
+                            InsertDeleteFlags::NONE, false, pUndoDoc );
                     rDoc.CopyToDocument( 0, static_cast<SCROW>(nOutStartRow),
                             nTab, MAXCOL, static_cast<SCROW>(nOutEndRow), nTab,
-                            IDF_NONE, false, pUndoDoc );
+                            InsertDeleteFlags::NONE, false, pUndoDoc );
                 }
                 else
                     pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
 
                 //  Datenbereich sichern - incl. Filter-Ergebnis
-                rDoc.CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, false, pUndoDoc );
+                rDoc.CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, InsertDeleteFlags::ALL, false, pUndoDoc );
 
                 //  alle Formeln wegen Referenzen
-                rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, false, pUndoDoc );
+                rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, InsertDeleteFlags::FORMULA, false, pUndoDoc );
 
                 //  DB- und andere Bereiche
                 ScRangeName* pDocRange = rDoc.GetRangeName();
@@ -737,12 +737,12 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
             pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab, false, true );
             rDoc.CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
                                     aLocalParam.nCol2, aLocalParam.nRow2, nDestTab,
-                                    IDF_ALL, false, pUndoDoc );
+                                    InsertDeleteFlags::ALL, false, pUndoDoc );
             //  Attribute sichern, falls beim Filtern mitkopiert
 
             if (pDestData)
             {
-                rDoc.CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
+                rDoc.CopyToDocument( aOldDest, InsertDeleteFlags::ALL, false, pUndoDoc );
                 pOld = &aOldDest;
             }
         }
@@ -750,7 +750,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
         {
             pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
             rDoc.CopyToDocument( 0, rQueryParam.nRow1, nTab, MAXCOL, rQueryParam.nRow2, nTab,
-                                        IDF_NONE, false, pUndoDoc );
+                                        InsertDeleteFlags::NONE, false, pUndoDoc );
         }
 
         ScDBCollection* pDocDB = rDoc.GetDBCollection();
@@ -778,13 +778,13 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
 
             pAttribDoc = new ScDocument( SCDOCMODE_UNDO );
             pAttribDoc->InitUndo( &rDoc, nDestTab, nDestTab, false, true );
-            rDoc.CopyToDocument( aAttribRange, IDF_ATTRIB, false, pAttribDoc );
+            rDoc.CopyToDocument( aAttribRange, InsertDeleteFlags::ATTRIB, false, pAttribDoc );
         }
 
         if ( bDoSize )
             rDoc.FitBlock( aOldDest, aDestTotal );
         else
-            rDoc.DeleteAreaTab(aOldDest, IDF_ALL);         // einfach loeschen
+            rDoc.DeleteAreaTab(aOldDest, InsertDeleteFlags::ALL);         // einfach loeschen
     }
 
     //  Filtern am Dokument ausfuehren
@@ -838,7 +838,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
             {
                 ScRange aHdrRange = aAttribRange;
                 aHdrRange.aEnd.SetRow( aHdrRange.aStart.Row() );
-                pAttribDoc->CopyToDocument( aHdrRange, IDF_ATTRIB, false, &rDoc );
+                pAttribDoc->CopyToDocument( aHdrRange, InsertDeleteFlags::ATTRIB, false, &rDoc );
             }
 
             //  Daten
@@ -1026,19 +1026,19 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
                 pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow );
 
                 pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
-                rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
-                rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
+                rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, pUndoDoc );
+                rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, pUndoDoc );
             }
             else
                 pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, bOldFilter );
 
             //  Datenbereich sichern - incl. Filter-Ergebnis
             rDoc.CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab,
-                                    IDF_ALL, false, pUndoDoc );
+                                    InsertDeleteFlags::ALL, false, pUndoDoc );
 
             //  alle Formeln wegen Referenzen
             rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
-                                        IDF_FORMULA, false, pUndoDoc );
+                                        InsertDeleteFlags::FORMULA, false, pUndoDoc );
 
             //  DB- und andere Bereiche
             ScRangeName* pDocRange = rDoc.GetRangeName();
@@ -1161,7 +1161,7 @@ void createUndoDoc(std::unique_ptr<ScDocument>& pUndoDoc, ScDocument* pDoc, cons
     SCTAB nTab = rRange.aStart.Tab();
     pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO));
     pUndoDoc->InitUndo(pDoc, nTab, nTab);
-    pDoc->CopyToDocument(rRange, IDF_ALL, false, pUndoDoc.get());
+    pDoc->CopyToDocument(rRange, InsertDeleteFlags::ALL, false, pUndoDoc.get());
 }
 
 bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNewOut, bool bApi)
@@ -1340,7 +1340,7 @@ bool ScDBDocFunc::RemovePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
 
     rDoc.DeleteAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
                          aRange.aEnd.Col(),   aRange.aEnd.Row(),
-                         nTab, IDF_ALL );
+                         nTab, InsertDeleteFlags::ALL );
     rDoc.RemoveFlagsTab( aRange.aStart.Col(), aRange.aStart.Row(),
                           aRange.aEnd.Col(),   aRange.aEnd.Row(),
                           nTab, SC_MF_AUTO );
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index bb48cd0..b168270 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -449,10 +449,10 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
 
             SCCOL nMinEndCol = std::min( rParam.nCol2, nEndCol );    // not too much
             nMinEndCol = sal::static_int_cast<SCCOL>( nMinEndCol + nFormulaCols );  // only if column count unchanged
-            pImportDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, nTab, IDF_ATTRIB );
+            pImportDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, nTab, InsertDeleteFlags::ATTRIB );
             rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
                                     nMinEndCol, rParam.nRow1, nTab,
-                                    IDF_ATTRIB, false, pImportDoc );
+                                    InsertDeleteFlags::ATTRIB, false, pImportDoc );
 
             SCROW nDataStartRow = rParam.nRow1+1;
             for (SCCOL nCopyCol=rParam.nCol1; nCopyCol<=nMinEndCol; nCopyCol++)
@@ -498,7 +498,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
         if (bRecord)
         {
             // do not touch notes (ScUndoImportData does not support drawing undo)
-            InsertDeleteFlags nCopyFlags = IDF_ALL & ~IDF_NOTE;
+            InsertDeleteFlags nCopyFlags = InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE;
 
             //  nFormulaCols is set only if column count is unchanged
             rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
@@ -523,7 +523,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
 
             ScRange aDelRange( rParam.nCol1, rParam.nRow1, nTab,
                                 rParam.nCol2, rParam.nRow2, nTab );
-            rDoc.DeleteAreaTab( aDelRange, IDF_ALL & ~IDF_NOTE );  // ohne die Formeln
+            rDoc.DeleteAreaTab( aDelRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE );  // ohne die Formeln
 
             ScRange aOld( rParam.nCol1, rParam.nRow1, nTab,
                             rParam.nCol2+nFormulaCols, rParam.nRow2, nTab );
@@ -533,10 +533,10 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
         }
         else if ( nEndCol < rParam.nCol2 )      // DeleteArea calls PutInOrder
             rDoc.DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
-                                aNewMark, IDF_CONTENTS & ~IDF_NOTE );
+                                aNewMark, InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE );
 
         //  CopyToDocument doesn't remove contents
-        rDoc.DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, IDF_CONTENTS & ~IDF_NOTE );
+        rDoc.DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE );
 
         //  remove each column from ImportDoc after copying to reduce memory usage
         bool bOldAutoCalc = rDoc.GetAutoCalc();
@@ -544,8 +544,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
         for (SCCOL nCopyCol = rParam.nCol1; nCopyCol <= nEndCol; nCopyCol++)
         {
             pImportDoc->CopyToDocument( nCopyCol, rParam.nRow1, nTab, nCopyCol, nEndRow, nTab,
-                                        IDF_ALL, false, &rDoc );
-            pImportDoc->DeleteAreaTab( nCopyCol, rParam.nRow1, nCopyCol, nEndRow, nTab, IDF_CONTENTS );
+                                        InsertDeleteFlags::ALL, false, &rDoc );
+            pImportDoc->DeleteAreaTab( nCopyCol, rParam.nRow1, nCopyCol, nEndRow, nTab, InsertDeleteFlags::CONTENTS );
         }
         rDoc.SetAutoCalc( bOldAutoCalc );
 
@@ -554,7 +554,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
             if (bKeepFormat)            // formats for formulas
                 pImportDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
                                             nEndCol+nFormulaCols, nEndRow, nTab,
-                                            IDF_ATTRIB, false, &rDoc );
+                                            InsertDeleteFlags::ATTRIB, false, &rDoc );
             // fill formulas
             ScMarkData aMark;
             aMark.SelectOneTable(nTab);
@@ -574,10 +574,10 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
         {
             if ( rParam.nCol2 > nEndCol )
                 rDoc.DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
-                                    aNewMark, IDF_CONTENTS );
+                                    aNewMark, InsertDeleteFlags::CONTENTS );
             if ( rParam.nRow2 > nEndRow )
                 rDoc.DeleteArea( rParam.nCol1, nEndRow+1, rParam.nCol2, rParam.nRow2,
-                                    aNewMark, IDF_CONTENTS );
+                                    aNewMark, InsertDeleteFlags::CONTENTS );
         }
 
         if( !bAddrInsert )      // update database range
@@ -598,7 +598,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
             if (nFormulaCols > 0)                   // include filled formulas for redo
                 rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
                                         nEndCol+nFormulaCols, nEndRow, nTab,
-                                        IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
+                                        InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pRedoDoc );
 
             ScDBData* pRedoDBData = pDBData ? new ScDBData( *pDBData ) : NULL;
 
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 86422ae..9815276 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -591,10 +591,10 @@ bool ScDocFunc::DeleteContents(
         bMulti = false;
 
     // no objects on protected tabs
-    bool bObjects = (nFlags & IDF_OBJECTS) && !sc::DocFuncUtil::hasProtectedTab(rDoc, rMark);
+    bool bObjects = (nFlags & InsertDeleteFlags::OBJECTS) && !sc::DocFuncUtil::hasProtectedTab(rDoc, rMark);
 
     sal_uInt16 nExtFlags = 0;       // extra flags are needed only if attributes are deleted
-    if ( nFlags & IDF_ATTRIB )
+    if ( nFlags & InsertDeleteFlags::ATTRIB )
         rDocShell.UpdatePaintExt( nExtFlags, aMarkRange );
 
     //  Reihenfolge:
@@ -603,7 +603,7 @@ bool ScDocFunc::DeleteContents(
     //  3) Inhalte fuer Undo kopieren und Undo-Aktion anlegen
     //  4) Inhalte loeschen
 
-    bool bDrawUndo = bObjects || (nFlags & IDF_NOTE);
+    bool bDrawUndo = bObjects || (nFlags & InsertDeleteFlags::NOTE);
     if (bRecord && bDrawUndo)
         rDoc.BeginDrawUndo();
 
@@ -665,10 +665,10 @@ bool ScDocFunc::DeleteCell(
     }
 
     // no objects on protected tabs
-    bool bObjects = (nFlags & IDF_OBJECTS) && !sc::DocFuncUtil::hasProtectedTab(rDoc, rMark);
+    bool bObjects = (nFlags & InsertDeleteFlags::OBJECTS) && !sc::DocFuncUtil::hasProtectedTab(rDoc, rMark);
 
     sal_uInt16 nExtFlags = 0;       // extra flags are needed only if attributes are deleted
-    if (nFlags & IDF_ATTRIB)
+    if (nFlags & InsertDeleteFlags::ATTRIB)
         rDocShell.UpdatePaintExt(nExtFlags, rPos);
 
     //  order op opeeration:
@@ -678,7 +678,7 @@ bool ScDocFunc::DeleteCell(
     //  4) delete contents
     //  5) add undo-action
 
-    bool bDrawUndo = bObjects || (nFlags & IDF_NOTE);     // needed for shown notes
+    bool bDrawUndo = bObjects || (nFlags & InsertDeleteFlags::NOTE);     // needed for shown notes
     if (bDrawUndo && bRecord)
         rDoc.BeginDrawUndo();
 
@@ -752,7 +752,7 @@ bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
         ScRange aCopyRange = aMarkRange;
         aCopyRange.aStart.SetTab(0);
         aCopyRange.aEnd.SetTab(nTabCount-1);
-        rDoc.CopyToDocument( aCopyRange, IDF_CONTENTS, true, pUndoDoc, &aMultiMark );
+        rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::CONTENTS, true, pUndoDoc, &aMultiMark );
 
         rDocShell.GetUndoManager()->AddUndoAction(
             new ScUndoTransliterate( &rDocShell, aMultiMark, pUndoDoc, nType ) );
@@ -1356,7 +1356,7 @@ bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& r
     {
         ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
         pUndoDoc->InitUndo( &rDoc, aMultiRange.aStart.Tab(), aMultiRange.aEnd.Tab() );
-        rDoc.CopyToDocument( aMultiRange, IDF_ATTRIB, bMulti, pUndoDoc, &rMark );
+        rDoc.CopyToDocument( aMultiRange, InsertDeleteFlags::ATTRIB, bMulti, pUndoDoc, &rMark );
 
         rDocShell.GetUndoManager()->AddUndoAction(
             new ScUndoSelectionAttr(
@@ -1431,7 +1431,7 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName,
         ScRange aCopyRange = aMultiRange;
         aCopyRange.aStart.SetTab(0);
         aCopyRange.aEnd.SetTab(nTabCount-1);
-        rDoc.CopyToDocument( aCopyRange, IDF_ATTRIB, bMulti, pUndoDoc, &rMark );
+        rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, bMulti, pUndoDoc, &rMark );
 
         rDocShell.GetUndoManager()->AddUndoAction(
             new ScUndoSelectionStyle(
@@ -2351,7 +2351,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
                 nScenarioCount ++;
 
             rDoc.CopyToDocument( nUndoStartCol, nUndoStartRow, *itr, nUndoEndCol, nUndoEndRow, *itr+nScenarioCount,
-                IDF_ALL | IDF_NOCAPTIONS, false, pUndoDoc );
+                InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, pUndoDoc );
         }
 
         pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
@@ -2405,13 +2405,13 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
     {
         itr = aFullMark.begin(), itrEnd = aFullMark.end();
         for (; itr != itrEnd && *itr < nTabCount; ++itr)
-            pRefUndoDoc->DeleteAreaTab(nUndoStartCol,nUndoStartRow,nUndoEndCol,nUndoEndRow, *itr, IDF_ALL);
+            pRefUndoDoc->DeleteAreaTab(nUndoStartCol,nUndoStartRow,nUndoEndCol,nUndoEndRow, *itr, InsertDeleteFlags::ALL);
 
             //  alle Tabellen anlegen, damit Formeln kopiert werden koennen:
         pUndoDoc->AddUndoTab( 0, nTabCount-1 );
 
             //  kopieren mit bColRowFlags=false (#54194#)
-        pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,IDF_FORMULA,false,pUndoDoc,NULL,false);
+        pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,InsertDeleteFlags::FORMULA,false,pUndoDoc,NULL,false);
         delete pRefUndoDoc;
 
         SCTAB* pTabs      = new SCTAB[nSelCount];
@@ -2698,7 +2698,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
     {
         bool bWholeCols = ( nStartRow == 0 && nEndRow == MAXROW );
         bool bWholeRows = ( nStartCol == 0 && nEndCol == MAXCOL );
-        InsertDeleteFlags nUndoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
+        InsertDeleteFlags nUndoFlags = (InsertDeleteFlags::ALL & ~InsertDeleteFlags::OBJECTS) | InsertDeleteFlags::NOCAPTIONS;
 
         pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
         pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab, bWholeCols, bWholeRows );
@@ -2723,7 +2723,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
         ScMarkData aDelMark;    // only for tables
         for (nTab=nStartTab; nTab<=nEndTab; nTab++)
         {
-            rDoc.DeleteAreaTab( nStartCol,nStartRow, nOldEndCol,nOldEndRow, nTab, IDF_ALL );
+            rDoc.DeleteAreaTab( nStartCol,nStartRow, nOldEndCol,nOldEndRow, nTab, InsertDeleteFlags::ALL );
             aDelMark.SelectTable( nTab, true );
         }
         rDoc.DeleteObjectsInArea( nStartCol,nStartRow, nOldEndCol,nOldEndRow, aDelMark );
@@ -2735,7 +2735,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
                                     nUndoEndCol,nUndoEndRow,nDestEndTab,
                                     HASATTR_MERGED | HASATTR_OVERLAPPED ))
             {
-                rDoc.CopyFromClip( rSource, aSourceMark, IDF_ALL, NULL, pClipDoc );
+                rDoc.CopyFromClip( rSource, aSourceMark, InsertDeleteFlags::ALL, NULL, pClipDoc );
                 for (nTab=nStartTab; nTab<=nEndTab; nTab++)
                 {
                     SCCOL nTmpEndCol = nEndCol;
@@ -2766,7 +2766,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
         function ScDocument::UpdateReference() is called which calls
         ScDrawLayer::MoveCells() which may move away inserted objects to wrong
         positions (e.g. if source and destination range overlaps).*/
-    rDoc.CopyFromClip( aPasteDest, aDestMark, IDF_ALL & ~(IDF_OBJECTS),
+    rDoc.CopyFromClip( aPasteDest, aDestMark, InsertDeleteFlags::ALL & ~(InsertDeleteFlags::OBJECTS),
                         NULL, pClipDoc, true, false, bIncludeFiltered );
 
     // skipped rows and merged cells don't mix
@@ -2781,7 +2781,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
         and row heights. There are no cell notes or drawing objects, if the
         clipdoc does not contain a drawing layer.*/
     if ( pClipDoc->GetDrawLayer() )
-        rDoc.CopyFromClip( aPasteDest, aDestMark, IDF_OBJECTS,
+        rDoc.CopyFromClip( aPasteDest, aDestMark, InsertDeleteFlags::OBJECTS,
                            NULL, pClipDoc, true, false, bIncludeFiltered );
 
     if (bRecord)
@@ -3057,7 +3057,7 @@ bool ScDocFunc::DeleteTable( SCTAB nTab, bool bRecord, bool /* bApi */ )
         pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );     // nur nTab mit Flags
         pUndoDoc->AddUndoTab( 0, nCount-1 );                    // alle Tabs fuer Referenzen
 
-        rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pUndoDoc );
+        rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::ALL,false, pUndoDoc );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list