summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-28 13:43:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-29 09:38:51 +0200
commit80343351c9444bba7a5ac98f22fddbbecf5abb9f (patch)
tree4341e3ba5903482c45971bac14c74c2caee10045 /sc
parent37f9fdc11c4e95d6a34cb515a454503256a82c63 (diff)
loplugin:constantparam (2)
Change-Id: I528f22876497f87159e3b9453362ebbfb55b7092
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xicontent.cxx12
-rw-r--r--sc/source/filter/inc/formulabase.hxx3
-rw-r--r--sc/source/filter/oox/formulabase.cxx18
-rw-r--r--sc/source/ui/dataprovider/dataprovider.cxx5
-rw-r--r--sc/source/ui/docshell/docsh.cxx3
-rw-r--r--sc/source/ui/inc/dataprovider.hxx2
6 files changed, 18 insertions, 25 deletions
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index ab31d5d4307d..e75c945662d8 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -129,14 +129,12 @@ void lclAppendString32( OUString& rString, XclImpStream& rStrm, bool b16Bit )
lclAppendString32( rString, rStrm, rStrm.ReaduInt32(), b16Bit );
}
-/** Reads 32-bit string length and ignores following character array.
- @param b16Bit true = 16-bit characters, false = 8-bit characters. */
-void lclIgnoreString32( XclImpStream& rStrm, bool b16Bit )
+/** Reads 32-bit string length and ignores following 16-bit character array. */
+void lclIgnoreString32( XclImpStream& rStrm )
{
sal_uInt32 nChars(0);
nChars = rStrm.ReaduInt32();
- if( b16Bit )
- nChars *= 2;
+ nChars *= 2;
rStrm.Ignore( nChars );
}
@@ -262,10 +260,10 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm )
// description (ignore)
if( ::get_flag( nFlags, EXC_HLINK_DESCR ) )
- lclIgnoreString32( rStrm, true );
+ lclIgnoreString32( rStrm );
// target frame (ignore) !! DESCR/FRAME - is this the right order? (never seen them together)
if( ::get_flag( nFlags, EXC_HLINK_FRAME ) )
- lclIgnoreString32( rStrm, true );
+ lclIgnoreString32( rStrm );
// URL fields are zero-terminated - do not let the stream replace them
// in the lclAppendString32() with the '?' character.
diff --git a/sc/source/filter/inc/formulabase.hxx b/sc/source/filter/inc/formulabase.hxx
index 3f359c07e1bf..74e3d8508502 100644
--- a/sc/source/filter/inc/formulabase.hxx
+++ b/sc/source/filter/inc/formulabase.hxx
@@ -297,7 +297,7 @@ private:
class ApiTokenIterator
{
public:
- explicit ApiTokenIterator( const ApiTokenSequence& rTokens, sal_Int32 nSpacesOpCode, bool bSkipSpaces );
+ explicit ApiTokenIterator( const ApiTokenSequence& rTokens, sal_Int32 nSpacesOpCode );
bool is() const { return mpToken != mpTokenEnd; }
const ApiToken* operator->() const { return mpToken; }
@@ -310,7 +310,6 @@ private:
const ApiToken* mpToken; /// Pointer to current token of the token sequence.
const ApiToken* mpTokenEnd; /// Pointer behind last token of the token sequence.
const sal_Int32 mnSpacesOpCode; /// Op-code for whitespace tokens.
- const bool mbSkipSpaces; /// true = Skip whitespace tokens.
};
// List of API op-codes =======================================================
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 476f0deba2cd..edc5615934ce 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -139,11 +139,10 @@ ApiTokenSequence ApiTokenVector::toSequence() const
// token sequence iterator ====================================================
-ApiTokenIterator::ApiTokenIterator( const ApiTokenSequence& rTokens, sal_Int32 nSpacesOpCode, bool bSkipSpaces ) :
+ApiTokenIterator::ApiTokenIterator( const ApiTokenSequence& rTokens, sal_Int32 nSpacesOpCode ) :
mpToken( rTokens.getConstArray() ),
mpTokenEnd( rTokens.getConstArray() + rTokens.getLength() ),
- mnSpacesOpCode( nSpacesOpCode ),
- mbSkipSpaces( bSkipSpaces )
+ mnSpacesOpCode( nSpacesOpCode )
{
skipSpaces();
}
@@ -160,9 +159,8 @@ ApiTokenIterator& ApiTokenIterator::operator++()
void ApiTokenIterator::skipSpaces()
{
- if( mbSkipSpaces )
- while( is() && (mpToken->OpCode == mnSpacesOpCode) )
- ++mpToken;
+ while( is() && (mpToken->OpCode == mnSpacesOpCode) )
+ ++mpToken;
}
// function data ==============================================================
@@ -1593,7 +1591,7 @@ OUString FormulaProcessorBase::generateApiArray( const Matrix< Any >& rMatrix )
Any FormulaProcessorBase::extractReference( const ApiTokenSequence& rTokens ) const
{
- ApiTokenIterator aTokenIt( rTokens, OPCODE_SPACES, true );
+ ApiTokenIterator aTokenIt( rTokens, OPCODE_SPACES );
if( aTokenIt.is() && (aTokenIt->OpCode == OPCODE_PUSH) )
{
Any aRefAny = aTokenIt->Data;
@@ -1622,7 +1620,7 @@ void FormulaProcessorBase::extractCellRangeList( ScRangeList& orRanges,
orRanges.RemoveAll();
TokenToRangeListState eState = STATE_OPEN;
sal_Int32 nParenLevel = 0;
- for( ApiTokenIterator aIt( rTokens, OPCODE_SPACES, true ); aIt.is() && (eState != STATE_ERROR); ++aIt )
+ for( ApiTokenIterator aIt( rTokens, OPCODE_SPACES ); aIt.is() && (eState != STATE_ERROR); ++aIt )
{
sal_Int32 nOpCode = aIt->OpCode;
switch( eState )
@@ -1668,13 +1666,13 @@ void FormulaProcessorBase::extractCellRangeList( ScRangeList& orRanges,
bool FormulaProcessorBase::extractString( OUString& orString, const ApiTokenSequence& rTokens ) const
{
- ApiTokenIterator aTokenIt( rTokens, OPCODE_SPACES, true );
+ ApiTokenIterator aTokenIt( rTokens, OPCODE_SPACES );
return aTokenIt.is() && (aTokenIt->OpCode == OPCODE_PUSH) && (aTokenIt->Data >>= orString) && !(++aTokenIt).is();
}
bool FormulaProcessorBase::extractSpecialTokenInfo( ApiSpecialTokenInfo& orTokenInfo, const ApiTokenSequence& rTokens ) const
{
- ApiTokenIterator aTokenIt( rTokens, OPCODE_SPACES, true );
+ ApiTokenIterator aTokenIt( rTokens, OPCODE_SPACES );
return aTokenIt.is() && (aTokenIt->OpCode == OPCODE_BAD) && (aTokenIt->Data >>= orTokenInfo);
}
diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx
index ade7eeb95f95..353d19d42b76 100644
--- a/sc/source/ui/dataprovider/dataprovider.cxx
+++ b/sc/source/ui/dataprovider/dataprovider.cxx
@@ -125,7 +125,7 @@ void ExternalDataSource::setDBData(const OUString& rDBName)
{
if (!mpDBDataManager)
{
- mpDBDataManager.reset(new ScDBDataManager(rDBName, false, mpDoc));
+ mpDBDataManager.reset(new ScDBDataManager(rDBName, mpDoc));
}
else
{
@@ -246,9 +246,8 @@ void ScDBDataManager::WriteToDoc(ScDocument& rDoc)
pDocShell->PostPaint(aDestRange, PaintPartFlags::All);
}
-ScDBDataManager::ScDBDataManager(const OUString& rDBName, bool /*bAllowResize*/, ScDocument* pDoc):
+ScDBDataManager::ScDBDataManager(const OUString& rDBName, ScDocument* pDoc):
maDBName(rDBName),
- //mbAllowResize(bAllowResize),
mpDoc(pDoc)
{
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 076d52c20afa..63c3f3ac745d 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -3064,8 +3064,7 @@ VclPtr<SfxDocumentInfoDialog> ScDocShell::CreateDocumentInfoDialog( const SfxIte
pDlg->AddFontTabPage();
pDlg->AddTabPage( 42,
ScResId( STR_DOC_STAT ),
- ScDocStatPageCreate,
- nullptr);
+ ScDocStatPageCreate);
}
return pDlg;
}
diff --git a/sc/source/ui/inc/dataprovider.hxx b/sc/source/ui/inc/dataprovider.hxx
index 61d1e112f14f..9f1d0a179e51 100644
--- a/sc/source/ui/inc/dataprovider.hxx
+++ b/sc/source/ui/inc/dataprovider.hxx
@@ -135,7 +135,7 @@ class ScDBDataManager
ScDocument* mpDoc;
public:
- ScDBDataManager(const OUString& rDBName, bool bAllowResize, ScDocument* pDoc);
+ ScDBDataManager(const OUString& rDBName, ScDocument* pDoc);
~ScDBDataManager();
void SetDatabase(const OUString& rDBName);