compilerplugins/clang/unusedenumconstants.readonly.results |    4 ---
 sc/source/filter/lotus/lotread.cxx                         |    4 ---
 sc/source/filter/oox/formulabase.cxx                       |   13 ++++------
 sc/source/ui/inc/undobase.hxx                              |    6 ----
 sc/source/ui/undo/undobase.cxx                             |   16 +++----------
 sc/source/ui/undo/undoblk.cxx                              |    8 +++---
 sc/source/ui/undo/undotab.cxx                              |    2 -
 7 files changed, 16 insertions(+), 37 deletions(-)

New commits:
commit f326c3c01c3f2dd1ed244bded68d096cd680ad18
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Nov 22 15:40:22 2018 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Nov 24 19:05:07 2018 +0100

    remove unused FuncFlags::BIFFIMPORTONLY,STATE::S_WK1
    
    Change-Id: I94d88f871bfc78a066f6fd583b7fb7a7305944c8
    Reviewed-on: https://gerrit.libreoffice.org/63943
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results 
b/compilerplugins/clang/unusedenumconstants.readonly.results
index 0ad6cb92a0c2..88093da091b3 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -1178,8 +1178,6 @@ sc/source/filter/inc/unitconverter.hxx:44
     enum oox::xls::Unit UNIT_REFDEVY
 sc/source/filter/lotus/lotread.cxx:41
     enum STATE S_WK1
-sc/source/filter/oox/formulabase.cxx:63
-    enum FuncFlags BIFFIMPORTONLY
 sc/source/ui/inc/viewdata.hxx:43
     enum ScSplitMode SC_SPLIT_MODE_MAX_ENUM
 sc/source/ui/inc/viewdata.hxx:45
diff --git a/sc/source/filter/lotus/lotread.cxx 
b/sc/source/filter/lotus/lotread.cxx
index 5be4db478cfc..155e265a6f4b 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -38,7 +38,6 @@ ErrCode ImportLotus::parse()
     enum STATE
     {
         S_START,        // analyse first BOF
-        S_WK1,          // in WK1-Stream
         S_WK3,          // in WK3-Section
         S_WK4,
         S_FM3,
@@ -107,9 +106,6 @@ ErrCode ImportLotus::parse()
             }
             break;
 
-            case S_WK1:                                 // S_WK1
-            break;
-
             case S_WK3:                                 // S_WK3
             case S_WK4:                                 // S_WK4
             switch( nOp )
diff --git a/sc/source/filter/oox/formulabase.cxx 
b/sc/source/filter/oox/formulabase.cxx
index 4a11eef0ff87..7872a03529d1 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -60,13 +60,12 @@ enum class FuncFlags : sal_uInt16 {
     MACROCALL_NEW     = MACROCALL | MACROCALL_FN, /** New Excel functions not
                                                       defined in OOXML, _xlfn. 
prefix in all formats. OOXML name
                                                       must exist. */
-    BIFFIMPORTONLY    = 0x0800,   /// Only used in BIFF binary import filter.
     BIFFEXPORTONLY    = 0x1000,   /// Only used in BIFF binary export filter.
     INTERNAL          = 0x2000,   /// Function is internal in Calc.
     EUROTOOL          = 0x4000,   /// function of euro tool lib, 
FUNCLIB_EUROTOOL
 };
 namespace o3tl {
-    template<> struct typed_flags<FuncFlags> : is_typed_flags<FuncFlags, 
0x7fff> {};
+    template<> struct typed_flags<FuncFlags> : is_typed_flags<FuncFlags, 
0x77ff> {};
 }
 
 namespace oox {
@@ -191,13 +190,13 @@ struct FunctionData
 bool FunctionData::isSupported(bool bImportFilter) const
 {
     /*  For import filters: the FuncFlags::EXPORTONLY, 
FuncFlags::BIFFEXPORTONLY
-                            and FuncFlags::BIFFIMPORTONLY flag must not be set.
-        For export filters: the FuncFlags::IMPORTONLY, 
FuncFlags::BIFFIMPORTONLY
-                            and FuncFlags::BIFFEXPORTONLY flag must not be 
set. */
+                            must not be set.
+        For export filters: the FuncFlags::IMPORTONLY, 
FuncFlags::BIFFEXPORTONLY
+                            must not be set. */
     if (bImportFilter)
-        return !(mnFlags & ( FuncFlags::EXPORTONLY | FuncFlags::BIFFEXPORTONLY 
| FuncFlags::BIFFIMPORTONLY));
+        return !(mnFlags & ( FuncFlags::EXPORTONLY | 
FuncFlags::BIFFEXPORTONLY));
     else
-        return !(mnFlags & ( FuncFlags::IMPORTONLY | FuncFlags::BIFFIMPORTONLY 
| FuncFlags::BIFFEXPORTONLY));
+        return !(mnFlags & ( FuncFlags::IMPORTONLY | 
FuncFlags::BIFFEXPORTONLY));
 }
 
 const sal_uInt16 NOID = SAL_MAX_UINT16;     /// No BIFF function identifier 
available.
commit 1ab34cdb4a8bf255ba6a0eb96b2a30c7be5e451b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Nov 22 15:37:23 2018 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Nov 24 19:04:55 2018 +0100

    remove ScMoveUndoMode enum
    
    we only use one value
    
    Change-Id: I7a0f3760615111adcd8b925234f53fafa46a0bd7
    Reviewed-on: https://gerrit.libreoffice.org/63942
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results 
b/compilerplugins/clang/unusedenumconstants.readonly.results
index 8b78a97df024..0ad6cb92a0c2 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -1180,8 +1180,6 @@ sc/source/filter/lotus/lotread.cxx:41
     enum STATE S_WK1
 sc/source/filter/oox/formulabase.cxx:63
     enum FuncFlags BIFFIMPORTONLY
-sc/source/ui/inc/undobase.hxx:135
-    enum ScMoveUndoMode SC_UNDO_REFFIRST
 sc/source/ui/inc/viewdata.hxx:43
     enum ScSplitMode SC_SPLIT_MODE_MAX_ENUM
 sc/source/ui/inc/viewdata.hxx:45
diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx
index fea28529fd7d..903b63ec51f3 100644
--- a/sc/source/ui/inc/undobase.hxx
+++ b/sc/source/ui/inc/undobase.hxx
@@ -132,21 +132,17 @@ public:
     void            EndRedo();
 };
 
-enum ScMoveUndoMode { SC_UNDO_REFFIRST, SC_UNDO_REFLAST };
-
 class ScMoveUndo: public ScSimpleUndo               // with references
 {
 public:
                     ScMoveUndo( ScDocShell* pDocSh,
-                                ScDocumentUniquePtr pRefDoc, 
std::unique_ptr<ScRefUndoData> pRefData,
-                                ScMoveUndoMode eRefMode );
+                                ScDocumentUniquePtr pRefDoc, 
std::unique_ptr<ScRefUndoData> pRefData );
     virtual         ~ScMoveUndo() override;
 
 protected:
     std::unique_ptr<SdrUndoAction>  pDrawUndo;
     ScDocumentUniquePtr             pRefUndoDoc;
     std::unique_ptr<ScRefUndoData>  pRefUndoData;
-    ScMoveUndoMode const  eMode;
 
     void            BeginUndo();
     void            EndUndo();
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index feb652e8a6c2..a14410e399bb 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -407,12 +407,10 @@ void ScMultiBlockUndo::ShowBlock()
     }
 }
 
-ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocumentUniquePtr pRefDoc, 
std::unique_ptr<ScRefUndoData> pRefData,
-                                                ScMoveUndoMode eRefMode ) :
+ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocumentUniquePtr pRefDoc, 
std::unique_ptr<ScRefUndoData> pRefData ) :
     ScSimpleUndo( pDocSh ),
     pRefUndoDoc( std::move(pRefDoc) ),
-    pRefUndoData( std::move(pRefData) ),
-    eMode( eRefMode )
+    pRefUndoData( std::move(pRefData) )
 {
     ScDocument& rDoc = pDocShell->GetDocument();
     if (pRefUndoData)
@@ -433,10 +431,7 @@ void ScMoveUndo::UndoRef()
     ScRange aRange(0,0,0, MAXCOL,MAXROW,pRefUndoDoc->GetTableCount()-1);
     pRefUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::FORMULA, false, 
rDoc, nullptr, false);
     if (pRefUndoData)
-        pRefUndoData->DoUndo( &rDoc, (eMode == SC_UNDO_REFFIRST) );
-        // HACK: ScDragDropUndo is the only one with REFFIRST.
-        // If not, results possibly in a too frequent adjustment
-        // of ChartRefs. Not that pretty, but not too bad either..
+        pRefUndoData->DoUndo( &rDoc, false );
 }
 
 void ScMoveUndo::BeginUndo()
@@ -444,16 +439,13 @@ void ScMoveUndo::BeginUndo()
     ScSimpleUndo::BeginUndo();
 
     EnableDrawAdjust( &pDocShell->GetDocument(), false );
-
-    if (pRefUndoDoc && eMode == SC_UNDO_REFFIRST)
-        UndoRef();
 }
 
 void ScMoveUndo::EndUndo()
 {
     DoSdrUndoAction( pDrawUndo.get(), &pDocShell->GetDocument() );     // must 
also be called when pointer is null
 
-    if (pRefUndoDoc && eMode == SC_UNDO_REFLAST)
+    if (pRefUndoDoc)
         UndoRef();
 
     EnableDrawAdjust( &pDocShell->GetDocument(), true );
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 4e982824e2ea..e2862e5b3294 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -73,7 +73,7 @@ ScUndoInsertCells::ScUndoInsertCells( ScDocShell* 
pNewDocShell,
                                 SCTAB nNewCount, std::unique_ptr<SCTAB[]> 
pNewTabs, std::unique_ptr<SCTAB[]> pNewScenarios,
                                 InsCellCmd eNewCmd, ScDocumentUniquePtr 
pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData,
                                 bool bNewPartOfPaste ) :
-    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), 
SC_UNDO_REFLAST ),
+    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) ),
     aEffRange( rRange ),
     nCount( nNewCount ),
     pTabs( std::move(pNewTabs) ),
@@ -341,7 +341,7 @@ ScUndoDeleteCells::ScUndoDeleteCells( ScDocShell* 
pNewDocShell,
                                 const ScRange& rRange,
                                 SCTAB nNewCount, std::unique_ptr<SCTAB[]> 
pNewTabs, std::unique_ptr<SCTAB[]> pNewScenarios,
                                 DelCellCmd eNewCmd, ScDocumentUniquePtr 
pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData ) :
-    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), 
SC_UNDO_REFLAST ),
+    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) ),
     aEffRange( rRange ),
     nCount( nNewCount ),
     pTabs( std::move(pNewTabs) ),
@@ -626,7 +626,7 @@ ScUndoDeleteMulti::ScUndoDeleteMulti(
     bool bNewRows, bool bNeedsRefresh, SCTAB nNewTab,
     const std::vector<sc::ColRowSpan>& rSpans,
     ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData 
) :
-    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), 
SC_UNDO_REFLAST ),
+    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) ),
     mbRows(bNewRows),
     mbRefresh(bNeedsRefresh),
     nTab( nNewTab ),
@@ -1172,7 +1172,7 @@ bool ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) 
const
 ScUndoDragDrop::ScUndoDragDrop( ScDocShell* pNewDocShell,
                     const ScRange& rRange, const ScAddress& aNewDestPos, bool 
bNewCut,
                     ScDocumentUniquePtr pUndoDocument, bool bScenario ) :
-    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), nullptr, 
SC_UNDO_REFLAST ),
+    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), nullptr ),
     mnPaintExtFlags( 0 ),
     aSrcRange( rRange ),
     bCut( bNewCut ),
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index aff057b84354..24e784feea75 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -247,7 +247,7 @@ bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& 
rTarget) const
 
 ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell, const 
vector<SCTAB> &aTab,
                                     ScDocumentUniquePtr pUndoDocument, 
std::unique_ptr<ScRefUndoData> pRefData ) :
-    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData), 
SC_UNDO_REFLAST )
+    ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) )
 {
     theTabs.insert(theTabs.end(), aTab.begin(), aTab.end() );
     SetChangeTrack();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to