diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-30 11:49:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-31 07:34:41 +0100 |
commit | 7fed35ff43d6e8c1e838c6fe582edd308692bab0 (patch) | |
tree | 57bc40dd19c70c36e5f3c9256e4a7b65af7926cc /svtools | |
parent | 4cfcf965b5c95b1ba7dd454e9dda954e8315b8a9 (diff) |
loplugin:constantparam in svl,svtools
Change-Id: I0d7c1dff2646e483c866f547224c60838b221c4b
Reviewed-on: https://gerrit.libreoffice.org/44083
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/datwin.cxx | 10 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.hxx | 3 | ||||
-rw-r--r-- | svtools/source/svhtml/htmlsupp.cxx | 67 | ||||
-rw-r--r-- | svtools/source/svrtf/rtfout.cxx | 4 | ||||
-rw-r--r-- | svtools/source/table/tablecontrol_impl.cxx | 12 |
5 files changed, 41 insertions, 55 deletions
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index 1fa89d1ca296..2378e91ed4f5 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -239,16 +239,12 @@ void BrowserDataWin::LeaveUpdateLock() } } -void InitSettings_Impl(vcl::Window* pWin, bool bFont, bool bForeground) +void InitSettings_Impl(vcl::Window* pWin) { const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings(); - if (bFont) - pWin->ApplyControlFont(*pWin, rStyleSettings.GetFieldFont()); - - if (bFont || bForeground) - pWin->ApplyControlForeground(*pWin, rStyleSettings.GetWindowTextColor()); - + pWin->ApplyControlFont(*pWin, rStyleSettings.GetFieldFont()); + pWin->ApplyControlForeground(*pWin, rStyleSettings.GetWindowTextColor()); pWin->ApplyControlBackground(*pWin, rStyleSettings.GetWindowColor()); } diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx index c89b45457c5e..81366e31548e 100644 --- a/svtools/source/brwbox/datwin.hxx +++ b/svtools/source/brwbox/datwin.hxx @@ -190,8 +190,7 @@ public: }; -void InitSettings_Impl( vcl::Window *pWin, - bool bFont = true, bool bForeground = true ); +void InitSettings_Impl( vcl::Window *pWin ); #endif diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx index 8b5998648712..619cc6009e0d 100644 --- a/svtools/source/svhtml/htmlsupp.cxx +++ b/svtools/source/svhtml/htmlsupp.cxx @@ -78,7 +78,7 @@ void HTMLParser::ParseScriptOptions( OUString& rLangString, const OUString& rBas } } -void HTMLParser::RemoveSGMLComment( OUString &rString, bool bFull ) +void HTMLParser::RemoveSGMLComment( OUString &rString ) { sal_Unicode c = 0; while( !rString.isEmpty() && @@ -94,20 +94,16 @@ void HTMLParser::RemoveSGMLComment( OUString &rString, bool bFull ) // remove SGML comments if( rString.startsWith( "<!--" ) ) { - sal_Int32 nPos = 3; - if( bFull ) - { - // the whole line - nPos = 4; - while( nPos < rString.getLength() && - ( ( c = rString[nPos] ) != '\r' && c != '\n' ) ) - ++nPos; - if( c == '\r' && nPos+1 < rString.getLength() && - '\n' == rString[nPos+1] ) - ++nPos; - else if( c != '\n' ) - nPos = 3; - } + // the whole line + sal_Int32 nPos = 4; + while( nPos < rString.getLength() && + ( ( c = rString[nPos] ) != '\r' && c != '\n' ) ) + ++nPos; + if( c == '\r' && nPos+1 < rString.getLength() && + '\n' == rString[nPos+1] ) + ++nPos; + else if( c != '\n' ) + nPos = 3; ++nPos; rString = rString.copy( nPos ); } @@ -115,33 +111,30 @@ void HTMLParser::RemoveSGMLComment( OUString &rString, bool bFull ) if( rString.endsWith("-->") ) { rString = rString.copy( 0, rString.getLength()-3 ); - if( bFull ) + // "//" or "'", maybe preceding CR/LF + rString = comphelper::string::stripEnd(rString, ' '); + sal_Int32 nDel = 0, nLen = rString.getLength(); + if( nLen >= 2 && + rString.endsWith("//") ) { - // "//" or "'", maybe preceding CR/LF - rString = comphelper::string::stripEnd(rString, ' '); - sal_Int32 nDel = 0, nLen = rString.getLength(); - if( nLen >= 2 && - rString.endsWith("//") ) - { - nDel = 2; - } - else if( nLen && '\'' == rString[nLen-1] ) - { - nDel = 1; - } - if( nDel && nLen >= nDel+1 ) + nDel = 2; + } + else if( nLen && '\'' == rString[nLen-1] ) + { + nDel = 1; + } + if( nDel && nLen >= nDel+1 ) + { + c = rString[nLen-(nDel+1)]; + if( '\r'==c || '\n'==c ) { - c = rString[nLen-(nDel+1)]; - if( '\r'==c || '\n'==c ) - { + nDel++; + if( '\n'==c && nLen >= nDel+1 && + '\r'==rString[nLen-(nDel+1)] ) nDel++; - if( '\n'==c && nLen >= nDel+1 && - '\r'==rString[nLen-(nDel+1)] ) - nDel++; - } } - rString = rString.copy( 0, nLen-nDel ); } + rString = rString.copy( 0, nLen-nDel ); } } diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx index 1df25dc47d3a..0b9ba46eb426 100644 --- a/svtools/source/svrtf/rtfout.cxx +++ b/svtools/source/svrtf/rtfout.cxx @@ -182,11 +182,11 @@ SvStream& Out_Char(SvStream& rStream, sal_Unicode c, } SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const OUString& rStr, - rtl_TextEncoding eDestEnc, bool bWriteHelpFile) + rtl_TextEncoding eDestEnc) { int nUCMode = 1; for (sal_Int32 n = 0; n < rStr.getLength(); ++n) - Out_Char(rStream, rStr[n], &nUCMode, eDestEnc, bWriteHelpFile); + Out_Char(rStream, rStr[n], &nUCMode, eDestEnc, false/*bWriteHelpFile*/); if (nUCMode != 1) rStream.WriteCharPtr( "\\uc1" ).WriteCharPtr( " " ); // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored.; return rStream; diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index dd15c46b492b..b16677314e92 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -596,12 +596,12 @@ namespace svt { namespace table } - void lcl_setButtonRepeat( vcl::Window& _rWindow, sal_uLong _nDelay ) + void lcl_setButtonRepeat( vcl::Window& _rWindow ) { AllSettings aSettings = _rWindow.GetSettings(); MouseSettings aMouseSettings = aSettings.GetMouseSettings(); - aMouseSettings.SetButtonRepeat( _nDelay ); + aMouseSettings.SetButtonRepeat( 0 ); aSettings.SetMouseSettings( aMouseSettings ); _rWindow.SetSettings( aSettings, true ); @@ -610,7 +610,7 @@ namespace svt { namespace table bool lcl_updateScrollbar( vcl::Window& _rParent, VclPtr<ScrollBar>& _rpBar, bool const i_needBar, long _nVisibleUnits, - long _nPosition, long _nLineSize, long _nRange, + long _nPosition, long _nRange, bool _bHorizontal, const Link<ScrollBar*,void>& _rScrollHandler ) { // do we currently have the scrollbar? @@ -632,7 +632,7 @@ namespace svt { namespace table ); _rpBar->SetScrollHdl( _rScrollHandler ); // get some speed into the scrolling .... - lcl_setButtonRepeat( *_rpBar, 0 ); + lcl_setButtonRepeat( *_rpBar ); } if ( _rpBar ) @@ -640,7 +640,7 @@ namespace svt { namespace table _rpBar->SetRange( Range( 0, _nRange ) ); _rpBar->SetVisibleSize( _nVisibleUnits ); _rpBar->SetPageSize( _nVisibleUnits ); - _rpBar->SetLineSize( _nLineSize ); + _rpBar->SetLineSize( 1 ); _rpBar->SetThumbPos( _nPosition ); _rpBar->Show(); } @@ -1086,7 +1086,6 @@ namespace svt { namespace table lcl_getRowsFittingInto( i_dataCellPlayground.GetHeight(), m_nRowHeightPixel, false ), // visible units m_nTopRow, // current position - 1, // line size m_nRowCount, // range false, // vertical LINK( this, TableControl_Impl, OnScroll ) // scroll handler @@ -1111,7 +1110,6 @@ namespace svt { namespace table lcl_getColumnsVisibleWithin( i_dataCellPlayground, m_nLeftColumn, *this, false ), // visible units m_nLeftColumn, // current position - 1, // line size m_nColumnCount, // range true, // horizontal LINK( this, TableControl_Impl, OnScroll ) // scroll handler |