[Libreoffice-commits] core.git: include/svl include/svtools svl/source svtools/source sw/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Oct 31 06:35:25 UTC 2017


 include/svl/urihelper.hxx                  |    1 
 include/svl/zformat.hxx                    |    4 -
 include/svtools/parhtml.hxx                |    7 +--
 include/svtools/rtfout.hxx                 |    3 -
 svl/source/misc/urihelper.cxx              |    3 -
 svl/source/numbers/zforlist.cxx            |    2 
 svl/source/numbers/zformat.cxx             |   14 ------
 svtools/source/brwbox/datwin.cxx           |   10 +---
 svtools/source/brwbox/datwin.hxx           |    3 -
 svtools/source/svhtml/htmlsupp.cxx         |   67 ++++++++++++-----------------
 svtools/source/svrtf/rtfout.cxx            |    4 -
 svtools/source/table/tablecontrol_impl.cxx |   12 ++---
 sw/source/filter/html/htmlbas.cxx          |    2 
 13 files changed, 51 insertions(+), 81 deletions(-)

New commits:
commit 7fed35ff43d6e8c1e838c6fe582edd308692bab0
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Oct 30 11:49:29 2017 +0200

    loplugin:constantparam in svl,svtools
    
    Change-Id: I0d7c1dff2646e483c866f547224c60838b221c4b
    Reviewed-on: https://gerrit.libreoffice.org/44083
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svl/urihelper.hxx b/include/svl/urihelper.hxx
index 487dc92a137c..fd4039e5da8f 100644
--- a/include/svl/urihelper.hxx
+++ b/include/svl/urihelper.hxx
@@ -57,7 +57,6 @@ SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
                                     INetURLObject::EncodeMechanism eEncodeMechanism = INetURLObject::EncodeMechanism::WasEncoded,
                                     INetURLObject::DecodeMechanism eDecodeMechanism = INetURLObject::DecodeMechanism::ToIUri,
                                     rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
-                                    bool bRelativeNonURIs = false,
                                     FSysStyle eStyle = FSysStyle::Detect);
 
 SVL_DLLPUBLIC void SetMaybeFileHdl(Link<OUString *, bool> const & rTheMaybeFileHdl);
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 9f6305e807b3..3148e89df8a3 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -356,9 +356,7 @@ public:
     bool HasNewCurrency() const;
 
     // strip [$-yyy] from all [$xxx-yyy] leaving only xxx's,
-    // if bQuoteSymbol==true the xxx will become "xxx"
-    static OUString StripNewCurrencyDelimiters( const OUString& rStr,
-                                                bool bQuoteSymbol );
+    static OUString StripNewCurrencyDelimiters( const OUString& rStr );
 
     // If a new SYMBOLTYPE_CURRENCY is contained if the format is of type
     // css::util::NumberFormat::CURRENCY, and if so the symbol xxx and the extension nnn
diff --git a/include/svtools/parhtml.hxx b/include/svtools/parhtml.hxx
index e8a94f896f1f..4e6725139239 100644
--- a/include/svtools/parhtml.hxx
+++ b/include/svtools/parhtml.hxx
@@ -254,10 +254,9 @@ public:
     void ParseScriptOptions( OUString& rLangString, const OUString&, HTMLScriptLanguage& rLang,
                              OUString& rSrc, OUString& rLibrary, OUString& rModule );
 
-    // remove a comment around the content of <SCRIPT> or <STYLE>
-    // In case of 'bFull', the whole line behind a "<!--" might
-    // be deleted (for JavaScript)
-    static void RemoveSGMLComment( OUString &rString, bool bFull );
+    // Remove a comment around the content of <SCRIPT> or <STYLE>.
+    // The whole line behind a "<!--" might be deleted (for JavaScript).
+    static void RemoveSGMLComment( OUString &rString );
 
     static bool InternalImgToPrivateURL( OUString& rURL );
     static rtl_TextEncoding GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader );
diff --git a/include/svtools/rtfout.hxx b/include/svtools/rtfout.hxx
index 508414d9a5a5..d163abf33f87 100644
--- a/include/svtools/rtfout.hxx
+++ b/include/svtools/rtfout.hxx
@@ -34,8 +34,7 @@ namespace RTFOutFuncs {
 
 SVT_DLLPUBLIC SvStream& Out_String(
     SvStream&, const rtl::OUString&,
-    rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-    bool bWriteHelpFile = false );
+    rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
 
 }
 
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 6da98476fa06..fc5e6322ec02 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -60,7 +60,6 @@ OUString URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
                                  INetURLObject::EncodeMechanism eEncodeMechanism,
                                  INetURLObject::DecodeMechanism eDecodeMechanism,
                                  rtl_TextEncoding eCharset,
-                                 bool bRelativeNonURIs,
                                  FSysStyle eStyle)
 {
     // Backwards compatibility:
@@ -78,7 +77,7 @@ OUString URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
                                                  bIgnoreFragment,
                                                  eEncodeMechanism,
                                                  eCharset,
-                                                 bRelativeNonURIs,
+                                                 false/*bRelativeNonURIs*/,
                                                  eStyle);
         if (bCheckFileExists
             && !bWasAbsolute
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index f4c236827a01..24331b1dbea3 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1852,7 +1852,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const css::i18n::NumberForma
             rCode.Index != NF_CURRENCY_1000DEC2_CCC )
     {   // strip surrounding [$...] on automatic currency
         if ( aCodeStr.indexOf( "[$" ) >= 0)
-            aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr, false );
+            aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr );
         else
         {
             if (LocaleDataWrapper::areChecksEnabled() &&
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 34121edce041..0a9036193016 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1899,8 +1899,7 @@ bool SvNumberformat::GetNewCurrencySymbol( OUString& rSymbol,
 }
 
 // static
-OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr,
-                                                     bool bQuoteSymbol )
+OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr )
 {
     OUString aTmp;
     sal_Int32 nStartPos, nPos, nLen;
@@ -1947,16 +1946,7 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr,
             {
                 nPos = nDash;
             }
-            if ( !bQuoteSymbol || rStr[ nStartPos ] == '"' )
-            {
-                aTmp += rStr.copy( nStartPos, nPos - nStartPos );
-            }
-            else
-            {
-                aTmp += "\"";
-                aTmp += rStr.copy( nStartPos, nPos - nStartPos );
-                aTmp += "\"";
-            }
+            aTmp += rStr.copy( nStartPos, nPos - nStartPos );
             nStartPos = nClose + 1;
         }
     }
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
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 17dfb5138a8f..c38ff3a47638 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -106,7 +106,7 @@ void SwHTMLParser::EndScript()
     // Create a Basic module for javascript and StarBasic.
 
         // The Basic does still not remove SGML comments
-        RemoveSGMLComment( m_aScriptSource, true );
+        RemoveSGMLComment( m_aScriptSource );
 
         // get library name
         OUString aLibName;


More information about the Libreoffice-commits mailing list