[Libreoffice-commits] core.git: compilerplugins/clang include/svtools svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 27 12:55:27 UTC 2018


 compilerplugins/clang/unusedenumconstants.readonly.results |    6 ---
 include/svtools/brwbox.hxx                                 |   10 ------
 svtools/source/brwbox/brwbox1.cxx                          |   21 -------------
 svtools/source/brwbox/brwbox2.cxx                          |   18 -----------
 svtools/source/brwbox/datwin.cxx                           |   15 +++------
 svtools/source/brwbox/datwin.hxx                           |    2 -
 6 files changed, 7 insertions(+), 65 deletions(-)

New commits:
commit 3dba3a29848882ff49d668272e5aa64b4579501c
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Nov 26 11:26:50 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Nov 27 13:54:59 2018 +0100

    remove unused BrowserMode enum values
    
    Change-Id: I46eb4145bd79253c1c20b7a03d82b6873402d9ac
    Reviewed-on: https://gerrit.libreoffice.org/64086
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results b/compilerplugins/clang/unusedenumconstants.readonly.results
index 697a01a18bf6..bd262cd636cc 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -466,12 +466,6 @@ include/svtools/apearcfg.hxx:35
     enum DragMode FullWindow
 include/svtools/apearcfg.hxx:36
     enum DragMode Frame
-include/svtools/brwbox.hxx:69
-    enum BrowserMode NO_SCROLLBACK
-include/svtools/brwbox.hxx:80
-    enum BrowserMode OWN_DATACHANGED
-include/svtools/brwbox.hxx:86
-    enum BrowserMode SMART_HIDECURSOR
 include/svtools/headbar.hxx:186
     enum HeaderBarItemBits RIGHT
 include/svtools/headbar.hxx:187
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index ba09a67050b0..983854a6953a 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -69,7 +69,6 @@ enum class BrowserMode
     HIDECURSOR           = 0x000200,
 
     NO_HSCROLL           = 0x000400,
-    NO_SCROLLBACK        = 0x000800,
 
     AUTO_VSCROLL         = 0x001000,
     AUTO_HSCROLL         = 0x002000,
@@ -80,21 +79,15 @@ enum class BrowserMode
 
     HEADERBAR_NEW        = 0x040000,
     AUTOSIZE_LASTCOL     = 0x080000,
-    OWN_DATACHANGED      = 0x100000,
 
     CURSOR_WO_FOCUS      = 0x200000,
     // Allows a cursor which is shown even if the control does not have the focus. This does not affect other
     // situations which require to temporarily hide the cursor (such as scrolling).
 
-    SMART_HIDECURSOR     = 0x400000,
-    // is an enhanced version of BrowserMode::HIDECURSOR.
-    // When set, BrowserMode::HIDECURSOR is overruled, and the cursor is hidden as long as no selection exists,
-    // but shown otherwise. This does not affect other situations which require to temporarily hide the
-    // cursor (such as scrolling).
 };
 namespace o3tl
 {
-    template<> struct typed_flags<BrowserMode> : is_typed_flags<BrowserMode, 0x7cff3f> {};
+    template<> struct typed_flags<BrowserMode> : is_typed_flags<BrowserMode, 0x2cf73f> {};
 }
 
 #define BROWSER_NONE                      0
@@ -293,7 +286,6 @@ private:
     SVT_DLLPRIVATE void            ColumnInserted( sal_uInt16 nPos );
 
     DECL_DLLPRIVATE_LINK(    ScrollHdl, ScrollBar*, void );
-    DECL_DLLPRIVATE_LINK(    EndScrollHdl, ScrollBar*, void );
     DECL_DLLPRIVATE_LINK(    StartDragHdl, HeaderBar*, void );
 
     SVT_DLLPRIVATE long            GetFrozenWidth() const;
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index b9ae51e904ac..12b9e2c54aef 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -97,7 +97,6 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
 
     aHScroll->SetLineSize(1);
     aHScroll->SetScrollHdl( LINK( this, BrowseBox, ScrollHdl ) );
-    aHScroll->SetEndScrollHdl( LINK( this, BrowseBox, EndScrollHdl ) );
     pDataWin->Show();
 
     SetMode( nMode );
@@ -961,11 +960,6 @@ long BrowseBox::ScrollColumns( long nCols )
 
 long BrowseBox::ScrollRows( long nRows )
 {
-
-    // out of range?
-    if ( pDataWin->bNoScrollBack && nRows < 0 )
-        return 0;
-
     // compute new top row
     long nTmpMin = std::min( static_cast<long>(nTopRow + nRows), static_cast<long>(nRowCount - 1) );
 
@@ -1400,9 +1394,6 @@ bool BrowseBox::GoToRow( long nRow, bool bRowColMove, bool bKeepSelection )
     if ( !bRowColMove && !IsCursorMoveAllowed( nRow, nCurColId ) )
         return false;
 
-    if ( pDataWin->bNoScrollBack && nRow < nTopRow )
-        nRow = nTopRow;
-
     // compute the last visible row
     Size aSz( pDataWin->GetSizePixel() );
     sal_uInt16 nVisibleRows = sal_uInt16( aSz.Height() / GetDataRowHeight() - 1 );
@@ -2114,9 +2105,6 @@ void BrowseBox::SetMode( BrowserMode nMode )
 
     nControlAreaWidth = USHRT_MAX;
 
-    pDataWin->bNoScrollBack =
-            BrowserMode::NO_SCROLLBACK == ( nMode & BrowserMode::NO_SCROLLBACK);
-
     long nOldRowSel = bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel;
     MultiSelection *pOldRowSel = bMultiSelection ? uRow.pSel : nullptr;
 
@@ -2130,11 +2118,7 @@ void BrowseBox::SetMode( BrowserMode nMode )
     // default: do not hide the cursor at all (untaken scrolling and such)
     bHideCursor = TRISTATE_FALSE;
 
-    if ( BrowserMode::SMART_HIDECURSOR == ( nMode & BrowserMode::SMART_HIDECURSOR ) )
-    {   // smart cursor hide overrules hard cursor hide
-        bHideCursor = TRISTATE_INDET;
-    }
-    else if ( BrowserMode::HIDECURSOR == ( nMode & BrowserMode::HIDECURSOR ) )
+    if ( BrowserMode::HIDECURSOR == ( nMode & BrowserMode::HIDECURSOR ) )
     {
         bHideCursor = TRISTATE_TRUE;
     }
@@ -2152,12 +2136,9 @@ void BrowseBox::SetMode( BrowserMode nMode )
     pVScroll->SetLineSize( 1 );
     pVScroll->SetPageSize(1);
     pVScroll->SetScrollHdl( LINK( this, BrowseBox, ScrollHdl ) );
-    pVScroll->SetEndScrollHdl( LINK( this, BrowseBox, EndScrollHdl ) );
 
     pDataWin->bAutoSizeLastCol =
             BrowserMode::AUTOSIZE_LASTCOL == ( nMode & BrowserMode::AUTOSIZE_LASTCOL );
-    pDataWin->bOwnDataChangedHdl =
-            BrowserMode::OWN_DATACHANGED == ( nMode & BrowserMode::OWN_DATACHANGED );
 
     // create a headerbar. what happens, if a headerbar has to be created and
     // there already are columns?
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 7944ab7bb565..e06e3746a55e 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -1271,16 +1271,9 @@ sal_uInt16 BrowseBox::FrozenColCount() const
 
 IMPL_LINK(BrowseBox, ScrollHdl, ScrollBar*, pBar, void)
 {
-
     if ( pBar->GetDelta() == 0 )
         return;
 
-    if ( pBar->GetDelta() < 0 && pDataWin->bNoScrollBack )
-    {
-        UpdateScrollbars();
-        return;
-    }
-
     if ( pBar == aHScroll.get() )
         ScrollColumns( aHScroll->GetDelta() );
     if ( pBar == pVScroll )
@@ -1288,17 +1281,6 @@ IMPL_LINK(BrowseBox, ScrollHdl, ScrollBar*, pBar, void)
 }
 
 
-IMPL_LINK_NOARG(BrowseBox, EndScrollHdl, ScrollBar*, void)
-{
-
-    if ( pDataWin->bNoScrollBack )
-    {
-        EndScroll();
-        return;
-    }
-}
-
-
 IMPL_LINK( BrowseBox, StartDragHdl, HeaderBar*, pBar, void )
 {
     pBar->SetDragSize( pDataWin->GetOutputSizePixel().Height() );
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index d241e1b35913..046a9796506b 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -183,7 +183,6 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
     ,bInDtor( false )
     ,bInPaint( false )
     ,bInCommand( false )
-    ,bNoScrollBack( false )
     ,bNoHScroll( false )
     ,bNoVScroll( false )
     ,bAutoHScroll(false)
@@ -194,7 +193,6 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
     ,bUpdateOnUnlock( false )
     ,bInUpdateScrollbars( false )
     ,bHadRecursion( false )
-    ,bOwnDataChangedHdl( false )
     ,bCallingDropCallback( false )
     ,nUpdateLock( 0 )
     ,nCursorHidden( 0 )
@@ -262,14 +260,11 @@ void BrowserDataWin::DataChanged( const DataChangedEvent& rDCEvt )
     if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
          (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
     {
-        if( !bOwnDataChangedHdl )
-        {
-            InitSettings_Impl(this);
-            Invalidate();
-            InitSettings_Impl(GetParent());
-            GetParent()->Invalidate();
-            GetParent()->Resize();
-        }
+        InitSettings_Impl(this);
+        Invalidate();
+        InitSettings_Impl(GetParent());
+        GetParent()->Invalidate();
+        GetParent()->Resize();
     }
     else
         Control::DataChanged( rDCEvt );
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index ef9a9ec5ab01..1693f1e3a75b 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -103,7 +103,6 @@ public:
     std::vector<tools::Rectangle> aInvalidRegion; // invalidated Rectangles during !UpdateMode
     bool            bInPaint;       // TRUE while in Paint
     bool            bInCommand;     // TRUE while in Command
-    bool            bNoScrollBack;  // only scroll forward
     bool            bNoHScroll;     // no horizontal scrollbar
     bool            bNoVScroll;     // no vertical scrollbar
     bool            bAutoHScroll;   // autohide horizontaler Scrollbar
@@ -114,7 +113,6 @@ public:
     bool            bUpdateOnUnlock;  // Update() while locked
     bool            bInUpdateScrollbars;  // prevents recursions
     bool            bHadRecursion;        // a recursion occurred
-    bool            bOwnDataChangedHdl;   // don't change colors in DataChanged
     bool            bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop currently
     sal_uInt16          nUpdateLock;    // lock count, don't call Control::Update()!
     short           nCursorHidden;  // new counter for DoHide/ShowCursor


More information about the Libreoffice-commits mailing list