diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-20 12:29:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-20 15:09:55 +0200 |
commit | 4f75a9310156de50e0c9ffd8d5bed9ee34651e50 (patch) | |
tree | 5d65cd3798fb6b70ed13a7a8ab44ac20d184e682 | |
parent | 85f08e3e34bea01456eaf8989ac4f77d3900d5c5 (diff) |
loplugin:unusedfields in tools
Change-Id: I4e26c4750f6ff6c246a25507cfed1a0b4e3c6b81
Reviewed-on: https://gerrit.libreoffice.org/40225
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | compilerplugins/clang/unusedfields.readonly.results | 2 | ||||
-rw-r--r-- | include/tools/multisel.hxx | 1 | ||||
-rw-r--r-- | tools/source/memtools/multisel.cxx | 29 |
3 files changed, 4 insertions, 28 deletions
diff --git a/compilerplugins/clang/unusedfields.readonly.results b/compilerplugins/clang/unusedfields.readonly.results index 4dbd91675443..9f621908c89c 100644 --- a/compilerplugins/clang/unusedfields.readonly.results +++ b/compilerplugins/clang/unusedfields.readonly.results @@ -688,8 +688,6 @@ include/test/sheet/xnamedranges.hxx:38 apitest::XNamedRanges xSheet css::uno::Reference<css::sheet::XSpreadsheet> include/tools/inetmime.hxx:66 INetContentTypeParameter m_bConverted _Bool -include/tools/multisel.hxx:43 - MultiSelection bSelectNew _Bool include/vcl/bitmap.hxx:175 BmpFilterParam::(anonymous) mnSepiaPercent sal_uInt16 include/vcl/bitmap.hxx:176 diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx index 4671cfd9d2f0..17c95a93421f 100644 --- a/include/tools/multisel.hxx +++ b/include/tools/multisel.hxx @@ -40,7 +40,6 @@ private: sal_uIntPtr nSelCount; // number of selected indexes bool bInverseCur;// inverse cursor bool bCurValid; // are nCurIndex and nCurSubSel valid - bool bSelectNew; // auto-select newly inserted indexes TOOLS_DLLPRIVATE void ImplClear(); TOOLS_DLLPRIVATE size_t ImplFindSubSelection( long nIndex ) const; diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx index 903b1ff7a901..e6f6c0af4e84 100644 --- a/tools/source/memtools/multisel.cxx +++ b/tools/source/memtools/multisel.cxx @@ -67,8 +67,7 @@ MultiSelection::MultiSelection(): nCurIndex(0), nSelCount(0), bInverseCur(false), - bCurValid(false), - bSelectNew(false) + bCurValid(false) { } @@ -83,8 +82,7 @@ void MultiSelection::Reset() MultiSelection::MultiSelection( const MultiSelection& rOrig ) : aTotRange(rOrig.aTotRange), nSelCount(rOrig.nSelCount), - bCurValid(rOrig.bCurValid), - bSelectNew(false) + bCurValid(rOrig.bCurValid) { if ( bCurValid ) { @@ -110,8 +108,7 @@ MultiSelection::MultiSelection( const Range& rRange ): nCurIndex(0), nSelCount(0), bInverseCur(false), - bCurValid(false), - bSelectNew(false) + bCurValid(false) { } @@ -344,8 +341,7 @@ void MultiSelection::Insert( long nIndex, long nCount ) // did we need to shift the sub selections? if ( nSubSelPos < aSels.size() ) { // did we insert an unselected into an existing sub selection? - if ( !bSelectNew - && aSels[ nSubSelPos ]->Min() != nIndex + if ( aSels[ nSubSelPos ]->Min() != nIndex && aSels[ nSubSelPos ]->IsInside(nIndex) ) { // split the sub selection if ( nSubSelPos < aSels.size() ) { @@ -359,21 +355,6 @@ void MultiSelection::Insert( long nIndex, long nCount ) aSels[ nSubSelPos ]->Min() = nIndex; } - // did we append an selected to an existing sub selection? - else if ( bSelectNew - && nSubSelPos > 0 - && aSels[ nSubSelPos ]->Max() == nIndex-1 - ) // expand the previous sub selection - aSels[ nSubSelPos-1 ]->Max() += nCount; - - // did we insert an selected into an existing sub selection? - else if ( bSelectNew - && aSels[ nSubSelPos ]->Min() == nIndex - ) { // expand the sub selection - aSels[ nSubSelPos ]->Max() += nCount; - ++nSubSelPos; - } - // shift the sub selections behind the inserting position for ( size_t nPos = nSubSelPos; nPos < aSels.size(); ++nPos ) { @@ -384,8 +365,6 @@ void MultiSelection::Insert( long nIndex, long nCount ) bCurValid = false; aTotRange.Max() += nCount; - if ( bSelectNew ) - nSelCount += nCount; } void MultiSelection::Remove( long nIndex ) |