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

Noel Grandin noel.grandin at collabora.co.uk
Tue Jul 25 12:19:53 UTC 2017


 sc/inc/chgviset.hxx              |    4 ----
 sc/source/core/tool/chgviset.cxx |    2 --
 sc/source/ui/drawfunc/fuins2.cxx |   22 ++--------------------
 sc/source/ui/inc/tabvwsh.hxx     |    5 -----
 sc/source/ui/inc/undobase.hxx    |    1 -
 sc/source/ui/undo/undobase.cxx   |    9 +--------
 sc/source/ui/view/tabvwsh4.cxx   |    8 --------
 sc/source/ui/view/viewutil.cxx   |   14 ++------------
 8 files changed, 5 insertions(+), 60 deletions(-)

New commits:
commit 2c3cac855cf65a75d7e73e4cba10b757d5ab1940
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Jul 21 11:49:48 2017 +0200

    loplugin:unusedfields in sc
    
    The *chart* fields in ScTabViewShell in sc/source/ui/inc/tabvwsh.hxx
    are unused since:
        commit 5021f298418f6efa7bb7b6540113b712599778fe
        Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
        Date:   Mon Jul 28 12:11:08 2014 -0300
        Remove some unused code
    
    The bEveryoneButMe field in ScChangeViewSettings is unused since
        commit 90e8ad7ab779740c7381d26ffe7d08acc3a9ff96
        Author: Noel Grandin <noel at peralex.com>
        Date:   Tue Jul 21 15:39:17 2015 +0200
        loplugin:unusedmethods scripting,sc
    
    Change-Id: Ie9fbdf8f5e9177449316aaeb40ca3bd26df78a95
    Reviewed-on: https://gerrit.libreoffice.org/40264
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/chgviset.hxx b/sc/inc/chgviset.hxx
index 874f0724d6f1..2cd86278231d 100644
--- a/sc/inc/chgviset.hxx
+++ b/sc/inc/chgviset.hxx
@@ -45,7 +45,6 @@ private:
     bool                bIsAuthor;
     bool                bIsComment;
     bool                bIsRange;
-    bool                bEveryoneButMe;
     bool                bShowAccepted;
     bool                bShowRejected;
     bool                mbIsActionRange;
@@ -64,7 +63,6 @@ public:
         , bIsAuthor(false)
         , bIsComment(false)
         , bIsRange(false)
-        , bEveryoneButMe(false)
         , bShowAccepted(false)
         , bShowRejected(false)
         , mbIsActionRange(false)
@@ -106,8 +104,6 @@ public:
 
     bool                IsValidComment(const OUString* pCommentStr) const;
 
-    bool                IsEveryoneButMe() const {return bEveryoneButMe;}
-
     bool                HasRange() const {return bIsRange;}
     void                SetHasRange(bool bFlag) {bIsRange=bFlag;}
 
diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx
index d5f13a122db8..34e6e69ef4b5 100644
--- a/sc/source/core/tool/chgviset.cxx
+++ b/sc/source/core/tool/chgviset.cxx
@@ -45,7 +45,6 @@ ScChangeViewSettings::ScChangeViewSettings( const ScChangeViewSettings& r ):
     bIsAuthor       =r.bIsAuthor;
     bIsComment      =r.bIsComment;
     bIsRange        =r.bIsRange;
-    bEveryoneButMe  =r.bEveryoneButMe;
     bShowAccepted   =r.bShowAccepted;
     bShowRejected   =r.bShowRejected;
     mbIsActionRange = r.mbIsActionRange;
@@ -69,7 +68,6 @@ ScChangeViewSettings& ScChangeViewSettings::operator=( const ScChangeViewSetting
     bIsAuthor       =r.bIsAuthor;
     bIsComment      =r.bIsComment;
     bIsRange        =r.bIsRange;
-    bEveryoneButMe  =r.bEveryoneButMe;
     bShowAccepted   =r.bShowAccepted;
     bShowRejected   =r.bShowRejected;
     mbIsActionRange = r.mbIsActionRange;
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 3409bfa3db43..24f6f40a9f36 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -497,11 +497,6 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
     if( xChartModel.is() )
         xChartModel->lockControllers();
 
-    ScRangeListRef aDummy;
-    tools::Rectangle aMarkDest;
-    SCTAB nMarkTab;
-    bool bDrawRect = pViewShell->GetChartArea( aDummy, aMarkDest, nMarkTab );
-
     // object size
     awt::Size aSz = xObj->getVisualAreaSize( nAspect );
     Size aSize( aSz.Width, aSz.Height );
@@ -509,11 +504,6 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
     MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
 
     bool bSizeCh = false;
-    if (bDrawRect && !aMarkDest.IsEmpty())
-    {
-        aSize = aMarkDest.GetSize();
-        bSizeCh = true;
-    }
     if (aSize.Height() <= 0 || aSize.Width() <= 0)
     {
         aSize.Width() = 5000;
@@ -555,8 +545,6 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
         }
         else
         {
-            if (bDrawRect)
-                nToTable = static_cast<sal_uInt16>(nMarkTab);
             rReq.AppendItem( SfxUInt16Item( FN_PARAM_4, nToTable ) );
         }
 
@@ -597,14 +585,8 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
 
     //  object position
 
-    Point aStart;
-    if ( bDrawRect )
-        aStart = aMarkDest.TopLeft();                       // marked by hand
-    else
-    {
-        // get chart position (from window size and data range)
-        aStart = pViewSh->GetChartInsertPos( aSize, aPositionRange );
-    }
+    // get chart position (from window size and data range)
+    Point aStart = pViewSh->GetChartInsertPos( aSize, aPositionRange );
 
     tools::Rectangle aRect (aStart, aSize);
     SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 5169f2e2db0e..c4888cbd468c 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -156,9 +156,6 @@ private:
     bool                    bInPrepareClose;
     bool                    bInDispose;
 
-    ScRangeListRef          aChartSource;
-    tools::Rectangle               aChartPos;
-    SCTAB                   nChartDestTab;
     sal_uInt16              nCurRefDlgId;
 
     SfxBroadcaster*         pAccessibilityBroadcaster;
@@ -312,8 +309,6 @@ public:
 
     void            FillFieldData( ScHeaderFieldData& rData );
 
-    bool            GetChartArea( ScRangeListRef& rSource, tools::Rectangle& rDest, SCTAB& rTab ) const;
-
     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
 
     ScNavigatorSettings*    GetNavigatorSettings();
diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx
index 57a89337aa01..df35d85191db 100644
--- a/sc/source/ui/inc/undobase.hxx
+++ b/sc/source/ui/inc/undobase.hxx
@@ -110,7 +110,6 @@ public:
 protected:
     ScRangeList     maBlockRanges;
     SdrUndoAction*  mpDrawUndo;
-    ScBlockUndoMode meMode;
 
     void BeginUndo();
     void EndUndo();
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 71b8751f396d..e5b598d6f5f4 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -348,8 +348,7 @@ void ScBlockUndo::ShowBlock()
 ScMultiBlockUndo::ScMultiBlockUndo(
     ScDocShell* pDocSh, const ScRangeList& rRanges) :
     ScSimpleUndo(pDocSh),
-    maBlockRanges(rRanges),
-    meMode(SC_UNDO_SIMPLE)
+    maBlockRanges(rRanges)
 {
     mpDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
 }
@@ -367,9 +366,6 @@ void ScMultiBlockUndo::BeginUndo()
 
 void ScMultiBlockUndo::EndUndo()
 {
-    if (meMode == SC_UNDO_AUTOHEIGHT)
-        AdjustHeight();
-
     EnableDrawAdjust(&pDocShell->GetDocument(), true);
     DoSdrUndoAction(mpDrawUndo, &pDocShell->GetDocument());
 
@@ -379,9 +375,6 @@ void ScMultiBlockUndo::EndUndo()
 
 void ScMultiBlockUndo::EndRedo()
 {
-    if (meMode == SC_UNDO_AUTOHEIGHT)
-        AdjustHeight();
-
     ShowBlock();
     ScSimpleUndo::EndRedo();
 }
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 4401d7cc57c0..cae1ce4496be 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1820,14 +1820,6 @@ void ScTabViewShell::FillFieldData( ScHeaderFieldData& rData )
     // eNumType is known by the dialog
 }
 
-bool ScTabViewShell::GetChartArea( ScRangeListRef& rSource, tools::Rectangle& rDest, SCTAB& rTab ) const
-{
-    rSource = aChartSource;
-    rDest   = aChartPos;
-    rTab    = nChartDestTab;
-    return false;
-}
-
 ScNavigatorSettings* ScTabViewShell::GetNavigatorSettings()
 {
     if( !pNavSettings )
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index c5bca8dec8c2..144176759fb4 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -147,18 +147,8 @@ bool ScViewUtil::IsActionShown( const ScChangeAction& rAction,
     if ( !rSettings.IsShowAccepted() && rAction.IsAccepted() && !rAction.IsRejecting() )
         return false;
 
-    if ( rSettings.HasAuthor() )
-    {
-        if ( rSettings.IsEveryoneButMe() )
-        {
-            // GetUser() at ChangeTrack is the current user
-            ScChangeTrack* pTrack = rDocument.GetChangeTrack();
-            if ( !pTrack || rAction.GetUser() == pTrack->GetUser() )
-                return false;
-        }
-        else if ( rAction.GetUser() != rSettings.GetTheAuthorToShow() )
-            return false;
-    }
+    if ( rSettings.HasAuthor() && rAction.GetUser() != rSettings.GetTheAuthorToShow() )
+        return false;
 
     if ( rSettings.HasComment() )
     {


More information about the Libreoffice-commits mailing list