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

Noel Grandin noelgrandin at gmail.com
Tue Sep 22 11:47:45 PDT 2015


 sc/inc/column.hxx                   |    6 +--
 sc/inc/document.hxx                 |    6 +--
 sc/inc/global.hxx                   |    9 +----
 sc/inc/scabstdlg.hxx                |    2 -
 sc/inc/table.hxx                    |    4 +-
 sc/qa/unit/ucalc.cxx                |    4 +-
 sc/source/core/data/column3.cxx     |   55 +++++++++++++++++++-----------------
 sc/source/core/data/document.cxx    |   10 +++---
 sc/source/core/data/table2.cxx      |    4 +-
 sc/source/ui/attrdlg/scdlgfact.cxx  |    2 -
 sc/source/ui/attrdlg/scdlgfact.hxx  |    2 -
 sc/source/ui/inc/inscodlg.hxx       |    6 +--
 sc/source/ui/inc/undoblk.hxx        |    8 ++---
 sc/source/ui/inc/viewfunc.hxx       |   12 +++----
 sc/source/ui/miscdlgs/inscodlg.cxx  |   32 ++++++++++----------
 sc/source/ui/undo/undoblk3.cxx      |    2 -
 sc/source/ui/vba/excelvbahelper.cxx |    2 -
 sc/source/ui/vba/excelvbahelper.hxx |    2 -
 sc/source/ui/vba/vbarange.cxx       |   18 +++++------
 sc/source/ui/view/cellsh1.cxx       |    8 ++---
 sc/source/ui/view/cliputil.cxx      |    2 -
 sc/source/ui/view/viewfun2.cxx      |    4 +-
 sc/source/ui/view/viewfun3.cxx      |   26 ++++++++---------
 sc/source/ui/view/viewfun5.cxx      |    4 +-
 24 files changed, 116 insertions(+), 114 deletions(-)

New commits:
commit ad1386300562779606d958ea8289916cb9cbb8f8
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sun Sep 20 17:15:15 2015 +0200

    convert SC_PASTE constants to scoped enum
    
    Change-Id: I2c1b2cd5a89b3124a2e452800bf397e100cc885b
    Reviewed-on: https://gerrit.libreoffice.org/18734
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 978b3713..6d41bab 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -280,10 +280,10 @@ public:
 
                 //  Selection (?) of this document
     void MixMarked(
-        sc::MixDocContext& rCxt, const ScMarkData& rMark, sal_uInt16 nFunction,
+        sc::MixDocContext& rCxt, const ScMarkData& rMark, ScPasteFunc nFunction,
         bool bSkipEmpty, const ScColumn& rSrcCol );
     void MixData(
-        sc::MixDocContext& rCxt, SCROW nRow1, SCROW nRow2, sal_uInt16 nFunction, bool bSkipEmpty,
+        sc::MixDocContext& rCxt, SCROW nRow1, SCROW nRow2, ScPasteFunc nFunction, bool bSkipEmpty,
         const ScColumn& rSrcCol );
 
     ScAttrIterator* CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const;
@@ -301,7 +301,7 @@ public:
 
     void        CopyScenarioFrom( const ScColumn& rSrcCol );
     void        CopyScenarioTo( ScColumn& rDestCol ) const;
-    bool    TestCopyScenarioTo( const ScColumn& rDestCol ) const;
+    bool       TestCopyScenarioTo( const ScColumn& rDestCol ) const;
     void        MarkScenarioIn( ScMarkData& rDestMark ) const;
 
     void        CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 2f275a8..92fbdfc 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1345,14 +1345,14 @@ public:
     ScClipParam&    GetClipParam();
     void            SetClipParam(const ScClipParam& rParam);
 
-    void            MixDocument( const ScRange& rRange, sal_uInt16 nFunction, bool bSkipEmpty,
+    void            MixDocument( const ScRange& rRange, ScPasteFunc nFunction, bool bSkipEmpty,
                                     ScDocument* pSrcDoc );
 
     void            FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
-                                InsertDeleteFlags nFlags, sal_uInt16 nFunction,
+                                InsertDeleteFlags nFlags, ScPasteFunc nFunction,
                                 bool bSkipEmpty, bool bAsLink );
     void            FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
-                                InsertDeleteFlags nFlags, sal_uInt16 nFunction,
+                                InsertDeleteFlags nFlags, ScPasteFunc nFunction,
                                 bool bSkipEmpty, bool bAsLink );
 
     void            TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nType );
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 2af2c8d6..d738b60 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -201,12 +201,9 @@ inline InsertDeleteFlags operator~ (const InsertDeleteFlags& rhs)
 /// Copy flags for auto/series fill functions: do not touch notes and drawing objects.
 const InsertDeleteFlags IDF_AUTOFILL   = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS);
 
-#define PASTE_NOFUNC        0
-#define PASTE_ADD           1
-#define PASTE_SUB           2
-#define PASTE_MUL           3
-#define PASTE_DIV           4
-
+enum class ScPasteFunc {
+    NONE, ADD, SUB, MUL, DIV
+};
                                         // bits for HasAttr
 #define HASATTR_LINES           1
 #define HASATTR_MERGED          2
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index aab5be0..1fd7e12 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -159,7 +159,7 @@ class AbstractScInsertContentsDlg : public VclAbstractDialog
 {
 public:
     virtual InsertDeleteFlags GetInsContentsCmdBits() const = 0;
-    virtual sal_uInt16  GetFormulaCmdBits() const = 0 ;
+    virtual ScPasteFunc   GetFormulaCmdBits() const = 0 ;
     virtual bool        IsSkipEmptyCells() const = 0;
     virtual bool        IsLink() const = 0;
     virtual void        SetFillMode( bool bSet ) = 0;
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index ed832f1..45ed469 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -457,12 +457,12 @@ public:
 
                 // mark of this document
     void MixMarked(
-        sc::MixDocContext& rCxt, const ScMarkData& rMark, sal_uInt16 nFunction,
+        sc::MixDocContext& rCxt, const ScMarkData& rMark, ScPasteFunc nFunction,
         bool bSkipEmpty, const ScTable* pSrcTab );
 
     void MixData(
         sc::MixDocContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-        sal_uInt16 nFunction, bool bSkipEmpty, const ScTable* pSrcTab );
+        ScPasteFunc nFunction, bool bSkipEmpty, const ScTable* pSrcTab );
 
     void        CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
                             SCCOL nDestCol, SCROW nDestRow, SCTAB nDestTab );
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 3299dd9..b5264db 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -6518,7 +6518,7 @@ void Test::testMixData()
 
     // Paste A1:B1 to A2:B2 and perform addition.
     pasteFromClip(m_pDoc, ScRange(0,1,0,1,1,0), &aClipDoc);
-    m_pDoc->MixDocument(ScRange(0,1,0,1,1,0), PASTE_ADD, false, &aMixDoc);
+    m_pDoc->MixDocument(ScRange(0,1,0,1,1,0), ScPasteFunc::ADD, false, &aMixDoc);
 
     CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(0,1,0)); // A2
     CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(1,1,0)); // B2
@@ -6544,7 +6544,7 @@ void Test::testMixData()
     CPPUNIT_ASSERT_EQUAL(m_pDoc->GetValue(ScAddress(1,1,0)), aMixDoc.GetValue(ScAddress(1,1,0)));
 
     pasteFromClip(m_pDoc, ScRange(1,0,0,1,1,0), &aClipDoc);
-    m_pDoc->MixDocument(ScRange(1,0,0,1,1,0), PASTE_SUB, false, &aMixDoc);
+    m_pDoc->MixDocument(ScRange(1,0,0,1,1,0), ScPasteFunc::SUB, false, &aMixDoc);
 
     CPPUNIT_ASSERT_EQUAL( -3.0, m_pDoc->GetValue(ScAddress(1,0,0))); // 12 - 15
     CPPUNIT_ASSERT_EQUAL(-16.0, m_pDoc->GetValue(ScAddress(1,1,0))); //  0 - 16
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 138b0f5..c4d2e4e 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1110,7 +1110,7 @@ void ScColumn::CopyFromClip(
 }
 
 void ScColumn::MixMarked(
-    sc::MixDocContext& rCxt, const ScMarkData& rMark, sal_uInt16 nFunction,
+    sc::MixDocContext& rCxt, const ScMarkData& rMark, ScPasteFunc nFunction,
     bool bSkipEmpty, const ScColumn& rSrcCol )
 {
     SCROW nRow1, nRow2;
@@ -1126,24 +1126,25 @@ void ScColumn::MixMarked(
 namespace {
 
 // Result in rVal1
-bool lcl_DoFunction( double& rVal1, double nVal2, sal_uInt16 nFunction )
+bool lcl_DoFunction( double& rVal1, double nVal2, ScPasteFunc nFunction )
 {
     bool bOk = false;
     switch (nFunction)
     {
-        case PASTE_ADD:
+        case ScPasteFunc::ADD:
             bOk = SubTotal::SafePlus( rVal1, nVal2 );
             break;
-        case PASTE_SUB:
+        case ScPasteFunc::SUB:
             nVal2 = -nVal2;     // FIXME: Can we do this always without error?
             bOk = SubTotal::SafePlus( rVal1, nVal2 );
             break;
-        case PASTE_MUL:
+        case ScPasteFunc::MUL:
             bOk = SubTotal::SafeMult( rVal1, nVal2 );
             break;
-        case PASTE_DIV:
+        case ScPasteFunc::DIV:
             bOk = SubTotal::SafeDiv( rVal1, nVal2 );
             break;
+        default: break;
     }
     return bOk;
 }
@@ -1175,7 +1176,7 @@ class MixDataHandler
     sc::CellStoreType::iterator miNewCellsPos;
 
     size_t mnRowOffset;
-    sal_uInt16 mnFunction;
+    ScPasteFunc mnFunction;
 
     bool mbSkipEmpty;
 
@@ -1201,7 +1202,7 @@ public:
         sc::ColumnBlockPosition& rBlockPos,
         ScColumn& rDestColumn,
         SCROW nRow1, SCROW nRow2,
-        sal_uInt16 nFunction, bool bSkipEmpty) :
+        ScPasteFunc nFunction, bool bSkipEmpty) :
         mrDestColumn(rDestColumn),
         mrBlockPos(rBlockPos),
         maNewCells(nRow2 - nRow1 + 1),
@@ -1241,10 +1242,11 @@ public:
                 OpCode eOp = ocAdd;
                 switch (mnFunction)
                 {
-                    case PASTE_ADD: eOp = ocAdd; break;
-                    case PASTE_SUB: eOp = ocSub; break;
-                    case PASTE_MUL: eOp = ocMul; break;
-                    case PASTE_DIV: eOp = ocDiv; break;
+                    case ScPasteFunc::ADD: eOp = ocAdd; break;
+                    case ScPasteFunc::SUB: eOp = ocSub; break;
+                    case ScPasteFunc::MUL: eOp = ocMul; break;
+                    case ScPasteFunc::DIV: eOp = ocDiv; break;
+                    default: break;
                 }
                 aArr.AddOpCode(eOp); // Function
 
@@ -1298,10 +1300,11 @@ public:
                 OpCode eOp = ocAdd;
                 switch (mnFunction)
                 {
-                    case PASTE_ADD: eOp = ocAdd; break;
-                    case PASTE_SUB: eOp = ocSub; break;
-                    case PASTE_MUL: eOp = ocMul; break;
-                    case PASTE_DIV: eOp = ocDiv; break;
+                    case ScPasteFunc::ADD: eOp = ocAdd; break;
+                    case ScPasteFunc::SUB: eOp = ocSub; break;
+                    case ScPasteFunc::MUL: eOp = ocMul; break;
+                    case ScPasteFunc::DIV: eOp = ocDiv; break;
+                    default: break;
                 }
                 aArr.AddOpCode(eOp); // Function
 
@@ -1326,10 +1329,11 @@ public:
                 OpCode eOp = ocAdd;
                 switch (mnFunction)
                 {
-                    case PASTE_ADD: eOp = ocAdd; break;
-                    case PASTE_SUB: eOp = ocSub; break;
-                    case PASTE_MUL: eOp = ocMul; break;
-                    case PASTE_DIV: eOp = ocDiv; break;
+                    case ScPasteFunc::ADD: eOp = ocAdd; break;
+                    case ScPasteFunc::SUB: eOp = ocSub; break;
+                    case ScPasteFunc::MUL: eOp = ocMul; break;
+                    case ScPasteFunc::DIV: eOp = ocDiv; break;
+                    default: break;
                 }
                 aArr.AddOpCode(eOp); // Function
 
@@ -1407,10 +1411,11 @@ public:
                     OpCode eOp = ocAdd;
                     switch (mnFunction)
                     {
-                        case PASTE_ADD: eOp = ocAdd; break;
-                        case PASTE_SUB: eOp = ocSub; break;
-                        case PASTE_MUL: eOp = ocMul; break;
-                        case PASTE_DIV: eOp = ocDiv; break;
+                        case ScPasteFunc::ADD: eOp = ocAdd; break;
+                        case ScPasteFunc::SUB: eOp = ocSub; break;
+                        case ScPasteFunc::MUL: eOp = ocMul; break;
+                        case ScPasteFunc::DIV: eOp = ocDiv; break;
+                        default: break;
                     }
 
                     aArr.AddOpCode(eOp); // Function
@@ -1523,7 +1528,7 @@ public:
 }
 
 void ScColumn::MixData(
-    sc::MixDocContext& rCxt, SCROW nRow1, SCROW nRow2, sal_uInt16 nFunction,
+    sc::MixDocContext& rCxt, SCROW nRow1, SCROW nRow2, ScPasteFunc nFunction,
     bool bSkipEmpty, const ScColumn& rSrcCol )
 {
     // destination (this column) block position.
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index a362a24..68d9959 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3082,7 +3082,7 @@ bool ScDocument::HasClipFilteredRows()
     return false;
 }
 
-void ScDocument::MixDocument( const ScRange& rRange, sal_uInt16 nFunction, bool bSkipEmpty,
+void ScDocument::MixDocument( const ScRange& rRange, ScPasteFunc nFunction, bool bSkipEmpty,
                                     ScDocument* pSrcDoc )
 {
     SCTAB nTab1 = rRange.aStart.Tab();
@@ -3103,7 +3103,7 @@ void ScDocument::MixDocument( const ScRange& rRange, sal_uInt16 nFunction, bool
 }
 
 void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
-                                InsertDeleteFlags nFlags, sal_uInt16 nFunction,
+                                InsertDeleteFlags nFlags, ScPasteFunc nFunction,
                                 bool bSkipEmpty, bool bAsLink )
 {
     InsertDeleteFlags nDelFlags = nFlags;
@@ -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 ) && ( nFlags & IDF_CONTENTS );
+        bool bDoMix = ( bSkipEmpty || nFunction != ScPasteFunc::NONE ) && ( nFlags & IDF_CONTENTS );
 
         bool bOldAutoCalc = GetAutoCalc();
         SetAutoCalc( false );                   // avoid multiple calculations
@@ -3166,7 +3166,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
 }
 
 void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
-                                InsertDeleteFlags nFlags, sal_uInt16 nFunction,
+                                InsertDeleteFlags nFlags, ScPasteFunc nFunction,
                                 bool bSkipEmpty, bool bAsLink )
 {
     InsertDeleteFlags nDelFlags = nFlags;
@@ -3176,7 +3176,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
     if (ValidTab(nSrcTab) && nSrcTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nSrcTab])
     {
         std::unique_ptr<ScDocument> pMixDoc;
-        bool bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS );
+        bool bDoMix = ( bSkipEmpty || nFunction != ScPasteFunc::NONE ) && ( nFlags & IDF_CONTENTS );
 
         bool bOldAutoCalc = GetAutoCalc();
         SetAutoCalc( false );                   // avoid multiple calculations
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 3b9c02a..1b6a5bc 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -705,7 +705,7 @@ void ScTable::CopyFromClip(
 
 void ScTable::MixData(
     sc::MixDocContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-    sal_uInt16 nFunction, bool bSkipEmpty, const ScTable* pSrcTab )
+    ScPasteFunc nFunction, bool bSkipEmpty, const ScTable* pSrcTab )
 {
     for (SCCOL i=nCol1; i<=nCol2; i++)
         aCol[i].MixData(rCxt, nRow1, nRow2, nFunction, bSkipEmpty, pSrcTab->aCol[i]);
@@ -713,7 +713,7 @@ void ScTable::MixData(
 
 // Selection form this document
 void ScTable::MixMarked(
-    sc::MixDocContext& rCxt, const ScMarkData& rMark, sal_uInt16 nFunction,
+    sc::MixDocContext& rCxt, const ScMarkData& rMark, ScPasteFunc nFunction,
     bool bSkipEmpty, const ScTable* pSrcTab )
 {
     for (SCCOL i=0; i<=MAXCOL; i++)
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 53f7363..9fd856a 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -302,7 +302,7 @@ InsertDeleteFlags AbstractScInsertContentsDlg_Impl::GetInsContentsCmdBits() cons
     return pDlg->GetInsContentsCmdBits();
 }
 
-sal_uInt16  AbstractScInsertContentsDlg_Impl::GetFormulaCmdBits() const
+ScPasteFunc  AbstractScInsertContentsDlg_Impl::GetFormulaCmdBits() const
 {
     return pDlg->GetFormulaCmdBits();
 }
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 647c8d5..aa3cad4 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -209,7 +209,7 @@ class AbstractScInsertContentsDlg_Impl : public AbstractScInsertContentsDlg
 {
     DECL_ABSTDLG_BASE(AbstractScInsertContentsDlg_Impl, ScInsertContentsDlg)
     virtual InsertDeleteFlags GetInsContentsCmdBits() const SAL_OVERRIDE;
-    virtual sal_uInt16  GetFormulaCmdBits() const SAL_OVERRIDE;
+    virtual ScPasteFunc   GetFormulaCmdBits() const SAL_OVERRIDE;
     virtual bool        IsSkipEmptyCells() const SAL_OVERRIDE;
     virtual bool        IsLink() const SAL_OVERRIDE;
     virtual void        SetFillMode( bool bSet ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/inscodlg.hxx b/sc/source/ui/inc/inscodlg.hxx
index 4c68cb0..a36994d 100644
--- a/sc/source/ui/inc/inscodlg.hxx
+++ b/sc/source/ui/inc/inscodlg.hxx
@@ -37,7 +37,7 @@ public:
     virtual void dispose() SAL_OVERRIDE;
 
     InsertDeleteFlags GetInsContentsCmdBits() const;
-    sal_uInt16      GetFormulaCmdBits() const;
+    ScPasteFunc       GetFormulaCmdBits() const;
     bool            IsSkipEmptyCells() const;
     bool            IsTranspose() const;
     bool            IsLink() const;
@@ -84,7 +84,7 @@ private:
     bool              bUsedShortCut;
 
     InsertDeleteFlags nShortCutInsContentsCmdBits;
-    sal_uInt16        nShortCutFormulaCmdBits;
+    ScPasteFunc       nShortCutFormulaCmdBits;
     bool              bShortCutSkipEmptyCells;
     bool              bShortCutTranspose;
     bool              bShortCutIsLink;
@@ -93,7 +93,7 @@ private:
     static bool         bPreviousAllCheck;
     static InsertDeleteFlags nPreviousChecks;
     static sal_uInt16   nPreviousChecks2;
-    static sal_uInt16   nPreviousFormulaChecks;
+    static ScPasteFunc  nPreviousFormulaChecks;
     static sal_uInt16   nPreviousMoveMode;          // enum InsCellCmd
 
     void DisableChecks( bool bInsAllChecked = true );
diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx
index 53111f4..4013805 100644
--- a/sc/source/ui/inc/undoblk.hxx
+++ b/sc/source/ui/inc/undoblk.hxx
@@ -163,14 +163,14 @@ private:
 
 struct ScUndoPasteOptions
 {
-    sal_uInt16 nFunction;
+    ScPasteFunc  nFunction;
     bool       bSkipEmpty;
     bool       bTranspose;
     bool       bAsLink;
     InsCellCmd eMoveMode;
 
     ScUndoPasteOptions() :
-        nFunction( PASTE_NOFUNC ),
+        nFunction( ScPasteFunc::NONE ),
         bSkipEmpty( false ),
         bTranspose( false ),
         bAsLink( false ),
@@ -293,7 +293,7 @@ public:
                                      SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
                                      SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
                                      ScDocument* pNewUndoDoc, bool bNewMulti, SCTAB nSrc,
-                                     InsertDeleteFlags nFlg, sal_uInt16 nFunc, bool bSkip, bool bLink );
+                                     InsertDeleteFlags nFlg, ScPasteFunc nFunc, bool bSkip, bool bLink );
     virtual         ~ScUndoFillTable();
 
     virtual void    Undo() SAL_OVERRIDE;
@@ -310,7 +310,7 @@ private:
     sal_uLong       nStartChangeAction;
     sal_uLong       nEndChangeAction;
     InsertDeleteFlags nFlags;
-    sal_uInt16      nFunction;
+    ScPasteFunc       nFunction;
     SCTAB           nSrcTab;
     bool            bMulti;         // Multi selection
     bool            bSkipEmpty;
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 7b28d0a..cbd8a39 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -105,13 +105,13 @@ public:
                                             bool bApi = false, bool bIncludeObjects = false, bool bStopEdit = true, bool bUseRangeForVBA = true );
     ScTransferObj*              CopyToTransferable();
     SC_DLLPUBLIC bool           PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
-                                    sal_uInt16 nFunction = PASTE_NOFUNC, bool bSkipEmpty = false,
+                                    ScPasteFunc nFunction = ScPasteFunc::NONE, bool bSkipEmpty = false,
                                     bool bTranspose = false, bool bAsLink = false,
                                     InsCellCmd eMoveMode = INS_NONE,
                                     InsertDeleteFlags nUndoExtraFlags = IDF_NONE,
                                     bool bAllowDialogs = false );
 
-    void                        FillTab( InsertDeleteFlags nFlags, sal_uInt16 nFunction, bool bSkipEmpty, bool bAsLink );
+    void                        FillTab( InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bAsLink );
 
     SC_DLLPUBLIC void           PasteFromSystem();
     SC_DLLPUBLIC bool           PasteFromSystem( SotClipboardFormatId nFormatId, bool bApi = false );
@@ -119,8 +119,8 @@ public:
                                                        ::com::sun::star::datatransfer::XTransferable >& rxTransferable );
 
     void            PasteDraw();
-    void PasteDraw( const Point& rLogicPos, SdrModel* pModel, bool bGroup,
-                    const OUString& rSrcShellID, const OUString& rDestShellID );
+    void            PasteDraw( const Point& rLogicPos, SdrModel* pModel, bool bGroup,
+                        const OUString& rSrcShellID, const OUString& rDestShellID );
 
     bool            PasteOnDrawObjectLinked(
                         const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable,
@@ -341,11 +341,11 @@ private:
                                 const ::com::sun::star::uno::Reference<
                                         ::com::sun::star::datatransfer::XTransferable >& rxTransferable );
 
-    bool             PasteMultiRangesFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction,
+    bool             PasteMultiRangesFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScPasteFunc nFunction,
                                    bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs,
                                    InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags );
 
-    bool             PasteFromClipToMultiRanges( InsertDeleteFlags nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction,
+    bool             PasteFromClipToMultiRanges( InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScPasteFunc nFunction,
                                      bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs,
                                      InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags );
 
diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index 9a7922a..e68c159 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -25,7 +25,7 @@
 
 bool       ScInsertContentsDlg::bPreviousAllCheck = false;
 InsertDeleteFlags ScInsertContentsDlg::nPreviousChecks   = (IDF_VALUE | IDF_DATETIME | IDF_STRING);
-sal_uInt16 ScInsertContentsDlg::nPreviousFormulaChecks = PASTE_NOFUNC;
+ScPasteFunc  ScInsertContentsDlg::nPreviousFormulaChecks = ScPasteFunc::NONE;
 sal_uInt16 ScInsertContentsDlg::nPreviousChecks2 = 0;
 sal_uInt16 ScInsertContentsDlg::nPreviousMoveMode = INS_NONE;   // enum InsCellCmd
 
@@ -41,7 +41,7 @@ ScInsertContentsDlg::ScInsertContentsDlg( vcl::Window*       pParent,
     bMoveRightDisabled( false ),
     bUsedShortCut   ( false ),
     nShortCutInsContentsCmdBits( IDF_NONE ),
-    nShortCutFormulaCmdBits(0),
+    nShortCutFormulaCmdBits(ScPasteFunc::NONE),
     bShortCutSkipEmptyCells(false),
     bShortCutTranspose(false),
     bShortCutIsLink(false),
@@ -98,11 +98,11 @@ ScInsertContentsDlg::ScInsertContentsDlg( vcl::Window*       pParent,
 
     switch( ScInsertContentsDlg::nPreviousFormulaChecks )
     {
-        case PASTE_NOFUNC: mpRbNoOp->Check(); break;
-        case PASTE_ADD:    mpRbAdd->Check(); break;
-        case PASTE_SUB:    mpRbSub->Check(); break;
-        case PASTE_MUL:    mpRbMul->Check(); break;
-        case PASTE_DIV:    mpRbDiv->Check(); break;
+        case ScPasteFunc::NONE: mpRbNoOp->Check(); break;
+        case ScPasteFunc::ADD:    mpRbAdd->Check(); break;
+        case ScPasteFunc::SUB:    mpRbSub->Check(); break;
+        case ScPasteFunc::MUL:    mpRbMul->Check(); break;
+        case ScPasteFunc::DIV:    mpRbDiv->Check(); break;
     }
 
     switch( ScInsertContentsDlg::nPreviousMoveMode )
@@ -312,7 +312,7 @@ IMPL_LINK_TYPED( ScInsertContentsDlg, ShortCutHdl, Button*, pBtn, void )
     {
         bUsedShortCut = true;
         nShortCutInsContentsCmdBits = IDF_STRING | IDF_VALUE | IDF_DATETIME;
-        nShortCutFormulaCmdBits = PASTE_NOFUNC;
+        nShortCutFormulaCmdBits = ScPasteFunc::NONE;
         bShortCutSkipEmptyCells = false;
         bShortCutTranspose = false;
         bShortCutIsLink = false;
@@ -323,7 +323,7 @@ IMPL_LINK_TYPED( ScInsertContentsDlg, ShortCutHdl, Button*, pBtn, void )
     {
         bUsedShortCut = true;
         nShortCutInsContentsCmdBits = IDF_STRING | IDF_VALUE | IDF_DATETIME | IDF_ATTRIB;
-        nShortCutFormulaCmdBits = PASTE_NOFUNC;
+        nShortCutFormulaCmdBits = ScPasteFunc::NONE;
         bShortCutSkipEmptyCells = false;
         bShortCutTranspose = false;
         bShortCutIsLink = false;
@@ -334,7 +334,7 @@ IMPL_LINK_TYPED( ScInsertContentsDlg, ShortCutHdl, Button*, pBtn, void )
     {
         bUsedShortCut = true;
         nShortCutInsContentsCmdBits = IDF_ALL;
-        nShortCutFormulaCmdBits = PASTE_NOFUNC;
+        nShortCutFormulaCmdBits = ScPasteFunc::NONE;
         bShortCutSkipEmptyCells = false;
         bShortCutTranspose = true;
         bShortCutIsLink = false;
@@ -403,17 +403,17 @@ void ScInsertContentsDlg::dispose()
     ModalDialog::dispose();
 }
 
-sal_uInt16  ScInsertContentsDlg::GetFormulaCmdBits() const
+ScPasteFunc  ScInsertContentsDlg::GetFormulaCmdBits() const
 {
-    ScInsertContentsDlg::nPreviousFormulaChecks = PASTE_NOFUNC;
+    ScInsertContentsDlg::nPreviousFormulaChecks = ScPasteFunc::NONE;
     if(mpRbAdd->IsChecked())
-        ScInsertContentsDlg::nPreviousFormulaChecks = PASTE_ADD;
+        ScInsertContentsDlg::nPreviousFormulaChecks = ScPasteFunc::ADD;
     else if(mpRbSub->IsChecked())
-        ScInsertContentsDlg::nPreviousFormulaChecks = PASTE_SUB;
+        ScInsertContentsDlg::nPreviousFormulaChecks = ScPasteFunc::SUB;
     else if(mpRbMul->IsChecked())
-        ScInsertContentsDlg::nPreviousFormulaChecks = PASTE_MUL;
+        ScInsertContentsDlg::nPreviousFormulaChecks = ScPasteFunc::MUL;
     else if(mpRbDiv->IsChecked())
-        ScInsertContentsDlg::nPreviousFormulaChecks = PASTE_DIV;
+        ScInsertContentsDlg::nPreviousFormulaChecks = ScPasteFunc::DIV;
     if (bUsedShortCut)
         return nShortCutFormulaCmdBits;
     return ScInsertContentsDlg::nPreviousFormulaChecks;
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index b5cc16c..762797d 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -224,7 +224,7 @@ ScUndoFillTable::ScUndoFillTable( ScDocShell* pNewDocShell,
                 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
                 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
                 ScDocument* pNewUndoDoc, bool bNewMulti, SCTAB nSrc,
-                InsertDeleteFlags nFlg, sal_uInt16 nFunc, bool bSkip, bool bLink )
+                InsertDeleteFlags nFlg, ScPasteFunc nFunc, bool bSkip, bool bLink )
     :   ScSimpleUndo( pNewDocShell ),
         aRange      ( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ),
         aMarkData   ( rMark ),
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index c42b9cd..a8feafb 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -186,7 +186,7 @@ implnCut( const uno::Reference< frame::XModel>& xModel )
     }
 }
 
-void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, InsertDeleteFlags nFlags, sal_uInt16 nFunction, bool bSkipEmpty, bool bTranspose)
+void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bTranspose)
 {
     PasteCellsWarningReseter resetWarningBox;
     InsCellCmd eMoveMode = INS_NONE;
diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx
index 82ac810..a0b66de 100644
--- a/sc/source/ui/vba/excelvbahelper.hxx
+++ b/sc/source/ui/vba/excelvbahelper.hxx
@@ -41,7 +41,7 @@ void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_I
 void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
 void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
 void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
-void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, InsertDeleteFlags nFlags, sal_uInt16 nFunction, bool bSkipEmpty, bool bTranspose);
+void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bTranspose);
 ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
 ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
 ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 913de30..29596bc 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -2823,27 +2823,27 @@ static InsertDeleteFlags getPasteFlags (sal_Int32 Paste)
     return nFlags;
 }
 
-static sal_uInt16
+static ScPasteFunc
 getPasteFormulaBits( sal_Int32 Operation)
 {
-    sal_uInt16 nFormulaBits = PASTE_NOFUNC ;
+    ScPasteFunc nFormulaBits = ScPasteFunc::NONE;
     switch (Operation)
     {
     case excel::XlPasteSpecialOperation::xlPasteSpecialOperationAdd:
-        nFormulaBits = PASTE_ADD;break;
+        nFormulaBits = ScPasteFunc::ADD; break;
     case excel::XlPasteSpecialOperation::xlPasteSpecialOperationSubtract:
-        nFormulaBits = PASTE_SUB;break;
+        nFormulaBits = ScPasteFunc::SUB;break;
     case excel::XlPasteSpecialOperation::xlPasteSpecialOperationMultiply:
-        nFormulaBits = PASTE_MUL;break;
+        nFormulaBits = ScPasteFunc::MUL;break;
     case excel::XlPasteSpecialOperation::xlPasteSpecialOperationDivide:
-        nFormulaBits = PASTE_DIV;break;
+        nFormulaBits = ScPasteFunc::DIV;break;
 
     case excel::XlPasteSpecialOperation::xlPasteSpecialOperationNone:
     default:
-        nFormulaBits = PASTE_NOFUNC; break;
+        nFormulaBits = ScPasteFunc::NONE; break;
     }
 
-return nFormulaBits;
+    return nFormulaBits;
 }
 void SAL_CALL
 ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, const uno::Any& SkipBlanks, const uno::Any& Transpose ) throw (::com::sun::star::uno::RuntimeException, std::exception)
@@ -2875,7 +2875,7 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons
         Transpose >>= bTranspose;
 
     InsertDeleteFlags nFlags = getPasteFlags(nPaste);
-    sal_uInt16 nFormulaBits = getPasteFormulaBits(nOperation);
+    ScPasteFunc nFormulaBits = getPasteFormulaBits(nOperation);
     excel::implnPasteSpecial(pShell->GetModel(), nFlags,nFormulaBits,bSkipBlanks,bTranspose);
 }
 
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index b0484f9..106bc5c 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -444,7 +444,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
         case FID_FILL_TAB:
             {
                 InsertDeleteFlags nFlags = IDF_NONE;
-                sal_uInt16 nFunction = PASTE_NOFUNC;
+                ScPasteFunc nFunction = ScPasteFunc::NONE;
                 bool bSkipEmpty = false;
                 bool bAsLink    = false;
 
@@ -1316,7 +1316,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
         case FID_INS_CELL_CONTENTS:
             {
                 InsertDeleteFlags nFlags = IDF_NONE;
-                sal_uInt16 nFunction = PASTE_NOFUNC;
+                ScPasteFunc nFunction = ScPasteFunc::NONE;
                 InsCellCmd eMoveMode = INS_NONE;
 
                 vcl::Window* pWin = GetViewData()->GetActiveWin();
@@ -1365,7 +1365,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                         SFX_REQUEST_ARG( rReq, pLinkItem, SfxBoolItem, FN_PARAM_4, false );
                         SFX_REQUEST_ARG( rReq, pMoveItem, SfxInt16Item, FN_PARAM_5, false );
                         if ( pFuncItem )
-                            nFunction = pFuncItem->GetValue();
+                            nFunction = static_cast<ScPasteFunc>(pFuncItem->GetValue());
                         if ( pSkipItem )
                             bSkipEmpty = pSkipItem->GetValue();
                         if ( pTransposeItem )
@@ -1498,7 +1498,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                             rReq.AppendItem( SfxBoolItem( FN_PARAM_2, bSkipEmpty ) );
                             rReq.AppendItem( SfxBoolItem( FN_PARAM_3, bTranspose ) );
                             rReq.AppendItem( SfxBoolItem( FN_PARAM_4, bAsLink ) );
-                            rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, nFunction ) );
+                            rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, static_cast<sal_uInt16>(nFunction) ) );
                             rReq.AppendItem( SfxInt16Item( FN_PARAM_5, (sal_Int16) eMoveMode ) );
                             rReq.Done();
                         }
diff --git a/sc/source/ui/view/cliputil.cxx b/sc/source/ui/view/cliputil.cxx
index 8b08840..a1e52ff 100644
--- a/sc/source/ui/view/cliputil.cxx
+++ b/sc/source/ui/view/cliputil.cxx
@@ -65,7 +65,7 @@ void ScClipUtil::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTab
                 nFlags &= ~IDF_FORMULA;
 
             pTabViewShell->PasteFromClip( nFlags, pClipDoc,
-                    PASTE_NOFUNC, false, false, false, INS_NONE, IDF_NONE,
+                    ScPasteFunc::NONE, false, false, false, INS_NONE, IDF_NONE,
                     bShowDialog );      // allow warning dialog
         }
     }
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 466eec0..0c57a93 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -791,7 +791,7 @@ void ScViewFunc::EnterBlock( const OUString& rString, const EditTextObject* pDat
 
     pInsDoc->SetClipArea( ScRange(aPos) );
     // insert Block, with Undo etc.
-    if ( PasteFromClip( IDF_CONTENTS, pInsDoc.get(), PASTE_NOFUNC, false, false,
+    if ( PasteFromClip( IDF_CONTENTS, pInsDoc.get(), ScPasteFunc::NONE, false, false,
             false, INS_NONE, IDF_ATTRIB ) )
     {
         const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>( pInsDoc->GetAttr(
@@ -1418,7 +1418,7 @@ void ScViewFunc::CopyAutoSpellData( FillDir eDir, SCCOL nStartCol, SCROW nStartR
 
 }
 
-void ScViewFunc::FillTab( InsertDeleteFlags nFlags, sal_uInt16 nFunction, bool bSkipEmpty, bool bAsLink )
+void ScViewFunc::FillTab( InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bAsLink )
 {
     //! allow source sheet to be protected
     ScEditableTester aTester( this );
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 1ffe6ca..8e17d82 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -463,7 +463,7 @@ void ScViewFunc::PasteFromSystem()
         // keep a reference in case the clipboard is changed during PasteFromClip
         uno::Reference<datatransfer::XTransferable> aOwnClipRef( pOwnClip );
         PasteFromClip( IDF_ALL, pOwnClip->GetDocument(),
-                        PASTE_NOFUNC, false, false, false, INS_NONE, IDF_NONE,
+                        ScPasteFunc::NONE, false, false, false, INS_NONE, IDF_NONE,
                         true );     // allow warning dialog
     }
     else if (pDrawClip)
@@ -605,7 +605,7 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran
     if (pOwnClip)
     {
         PasteFromClip( IDF_ALL, pOwnClip->GetDocument(),
-                        PASTE_NOFUNC, false, false, false, INS_NONE, IDF_NONE,
+                        ScPasteFunc::NONE, false, false, false, INS_NONE, IDF_NONE,
                         true );     // allow warning dialog
     }
     else if (pDrawClip)
@@ -700,7 +700,7 @@ bool ScViewFunc::PasteFromSystem( SotClipboardFormatId nFormatId, bool bApi )
         // keep a reference in case the clipboard is changed during PasteFromClip
         uno::Reference<datatransfer::XTransferable> aOwnClipRef( pOwnClip );
         PasteFromClip( IDF_ALL, pOwnClip->GetDocument(),
-                        PASTE_NOFUNC, false, false, false, INS_NONE, IDF_NONE,
+                        ScPasteFunc::NONE, false, false, false, INS_NONE, IDF_NONE,
                         !bApi );        // allow warning dialog
     }
     else
@@ -843,7 +843,7 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument
 }
 
 bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
-                                sal_uInt16 nFunction, bool bSkipEmpty,
+                                ScPasteFunc nFunction, bool bSkipEmpty,
                                 bool bTranspose, bool bAsLink,
                                 InsCellCmd eMoveMode, InsertDeleteFlags nUndoExtraFlags,
                                 bool bAllowDialogs )
@@ -1120,7 +1120,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
     {
         bool bAskIfNotEmpty = bAllowDialogs &&
                                 ( nFlags & IDF_CONTENTS ) &&
-                                nFunction == PASTE_NOFUNC &&
+                                nFunction == ScPasteFunc::NONE &&
                                 SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
         if ( bAskIfNotEmpty )
         {
@@ -1247,7 +1247,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
         //  save original data in case of calculation
 
     std::unique_ptr<ScDocument> pMixDoc;
-    if (nFunction)
+    if (nFunction != ScPasteFunc::NONE)
     {
         bSkipEmpty = false;
         if ( nFlags & IDF_CONTENTS )
@@ -1431,7 +1431,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
 }
 
 bool ScViewFunc::PasteMultiRangesFromClip(
-    InsertDeleteFlags nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction,
+    InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScPasteFunc nFunction,
     bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs,
     InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags)
 {
@@ -1488,7 +1488,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
 
     bool bAskIfNotEmpty =
         bAllowDialogs && (nFlags & IDF_CONTENTS) &&
-        nFunction == PASTE_NOFUNC && SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
+        nFunction == ScPasteFunc::NONE && SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
 
     if (bAskIfNotEmpty)
     {
@@ -1517,7 +1517,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
     }
 
     ::std::unique_ptr<ScDocument> pMixDoc;
-    if ( bSkipEmpty || nFunction )
+    if ( bSkipEmpty || nFunction != ScPasteFunc::NONE)
     {
         if ( nFlags & IDF_CONTENTS )
         {
@@ -1589,7 +1589,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
 }
 
 bool ScViewFunc::PasteFromClipToMultiRanges(
-    InsertDeleteFlags nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction,
+    InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScPasteFunc nFunction,
     bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs,
     InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags )
 {
@@ -1646,7 +1646,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
 
     bool bAskIfNotEmpty =
         bAllowDialogs && (nFlags & IDF_CONTENTS) &&
-        nFunction == PASTE_NOFUNC && SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
+        nFunction == ScPasteFunc::NONE && SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
 
     if (bAskIfNotEmpty)
     {
@@ -1667,7 +1667,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
     }
 
     std::unique_ptr<ScDocument> pMixDoc;
-    if (bSkipEmpty || nFunction)
+    if (bSkipEmpty || nFunction != ScPasteFunc::NONE)
     {
         if (nFlags & IDF_CONTENTS)
         {
@@ -1900,7 +1900,7 @@ bool ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPos, b
 
     //  Paste
 
-    PasteFromClip( IDF_ALL, pClipDoc.get(), PASTE_NOFUNC, false, false, true );       // as a link
+    PasteFromClip( IDF_ALL, pClipDoc.get(), ScPasteFunc::NONE, false, false, true );       // as a link
 
     return true;
 }
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index edd2dd6..4b1c0c0 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -158,7 +158,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
                     SetCursor( nPosX, nPosY );
                     Unmark();
                     PasteFromClip( IDF_ALL, pClipDoc.get(),
-                                    PASTE_NOFUNC, false, false, false, INS_NONE, IDF_NONE,
+                                    ScPasteFunc::NONE, false, false, false, INS_NONE, IDF_NONE,
                                     bAllowDialogs );
                     bRet = true;
                 }
@@ -579,7 +579,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
 
                 pInsDoc->SetClipArea( aSource );
                 PasteFromClip( IDF_ALL, pInsDoc,
-                                PASTE_NOFUNC, false, false, false, INS_NONE, IDF_NONE,
+                                ScPasteFunc::NONE, false, false, false, INS_NONE, IDF_NONE,
                                 bAllowDialogs );
                 delete pInsDoc;
 


More information about the Libreoffice-commits mailing list