summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-09-29 12:43:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-09-30 06:57:26 +0000
commit4d87443bf59c3242d58b56cc1583d73213ae1f2f (patch)
treec1f74fc569506299100b5063f14c09e46035a943 /sc
parent8e812b87ff7f8c5bf2c6f8858646c55effd2eea3 (diff)
loplugin:constantparam
Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c Reviewed-on: https://gerrit.libreoffice.org/29321 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/clipcontext.hxx5
-rw-r--r--sc/inc/table.hxx2
-rw-r--r--sc/source/core/data/clipcontext.cxx9
-rw-r--r--sc/source/core/data/column.cxx2
-rw-r--r--sc/source/core/data/documen3.cxx2
-rw-r--r--sc/source/core/data/document.cxx4
-rw-r--r--sc/source/core/data/table3.cxx8
-rw-r--r--sc/source/filter/inc/biffinputstream.hxx28
-rw-r--r--sc/source/filter/inc/richstring.hxx5
-rw-r--r--sc/source/filter/oox/biffinputstream.cxx22
-rw-r--r--sc/source/filter/oox/pivotcachebuffer.cxx4
-rw-r--r--sc/source/filter/oox/richstring.cxx20
-rw-r--r--sc/source/ui/app/transobj.cxx6
-rw-r--r--sc/source/ui/inc/transobj.hxx2
14 files changed, 36 insertions, 83 deletions
diff --git a/sc/inc/clipcontext.hxx b/sc/inc/clipcontext.hxx
index 9951c053ff7e..c1f33839e8f5 100644
--- a/sc/inc/clipcontext.hxx
+++ b/sc/inc/clipcontext.hxx
@@ -133,15 +133,12 @@ public:
class CopyToClipContext : public ClipContextBase
{
bool mbKeepScenarioFlags:1;
- bool mbCloneNotes:1;
public:
- CopyToClipContext() = delete;
- CopyToClipContext(ScDocument& rDoc, bool bKeepScenarioFlags, bool bCloneNotes);
+ CopyToClipContext(ScDocument& rDoc, bool bKeepScenarioFlags);
virtual ~CopyToClipContext() override;
bool isKeepScenarioFlags() const;
- bool isCloneNotes() const;
};
class CopyToDocContext : public ClipContextBase
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 419d8bde3f23..e4e14329cdbe 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -844,7 +844,7 @@ public:
const ScSortParam& rSortParam, bool bKeepQuery, bool bUpdateRefs,
ScProgress* pProgress, sc::ReorderParam* pUndo );
- void Reorder( const sc::ReorderParam& rParam, ScProgress* pProgress );
+ void Reorder( const sc::ReorderParam& rParam );
bool ValidQuery(
SCROW nRow, const ScQueryParam& rQueryParam, ScRefCellValue* pCell = nullptr,
diff --git a/sc/source/core/data/clipcontext.cxx b/sc/source/core/data/clipcontext.cxx
index 16084be70c6d..8b0ce0df315b 100644
--- a/sc/source/core/data/clipcontext.cxx
+++ b/sc/source/core/data/clipcontext.cxx
@@ -328,8 +328,8 @@ bool CopyFromClipContext::isDateCell( const ScColumn& rCol, SCROW nRow ) const
}
CopyToClipContext::CopyToClipContext(
- ScDocument& rDoc, bool bKeepScenarioFlags, bool bCloneNotes) :
- ClipContextBase(rDoc), mbKeepScenarioFlags(bKeepScenarioFlags), mbCloneNotes(bCloneNotes) {}
+ ScDocument& rDoc, bool bKeepScenarioFlags) :
+ ClipContextBase(rDoc), mbKeepScenarioFlags(bKeepScenarioFlags) {}
CopyToClipContext::~CopyToClipContext() {}
@@ -338,11 +338,6 @@ bool CopyToClipContext::isKeepScenarioFlags() const
return mbKeepScenarioFlags;
}
-bool CopyToClipContext::isCloneNotes() const
-{
- return mbCloneNotes;
-}
-
CopyToDocContext::CopyToDocContext(ScDocument& rDoc) :
ClipContextBase(rDoc), mbStartListening(true) {}
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 95959b9386c4..ea92124982c5 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1027,7 +1027,7 @@ void ScColumn::CopyToClip(
rCxt.isKeepScenarioFlags() ? (ScMF::All & ~ScMF::Scenario) : ScMF::All );
{
- CopyToClipHandler aFunc(*this, rColumn, rCxt.getBlockPosition(rColumn.nTab, rColumn.nCol), rCxt.isCloneNotes());
+ CopyToClipHandler aFunc(*this, rColumn, rCxt.getBlockPosition(rColumn.nTab, rColumn.nCol), true/*CloneNotes*/);
sc::ParseBlock(maCells.begin(), maCells, aFunc, nRow1, nRow2);
}
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 5aa0fcf2e115..eab54acab123 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1408,7 +1408,7 @@ void ScDocument::Reorder( const sc::ReorderParam& rParam )
bool bOldEnableIdle = IsIdleEnabled();
EnableIdle(false);
- pTab->Reorder(rParam, nullptr);
+ pTab->Reorder(rParam);
EnableIdle(bOldEnableIdle);
}
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 9462a54e9bbf..415c3e647d51 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2183,7 +2183,7 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam,
pClipDoc->ResetClip(this, pMarks);
- sc::CopyToClipContext aCxt(*pClipDoc, bKeepScenarioFlags, true/*bCloneNoteCaptions*/);
+ sc::CopyToClipContext aCxt(*pClipDoc, bKeepScenarioFlags);
CopyRangeNamesToClip(pClipDoc, aClipRange, pMarks);
for (SCTAB i = 0; i < nEndTab; ++i)
@@ -2285,7 +2285,7 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
rClipParam.maRanges.Append(ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0));
pClipDoc->ResetClip( this, nTab );
- sc::CopyToClipContext aCxt(*pClipDoc, false, true);
+ sc::CopyToClipContext aCxt(*pClipDoc, false);
if (nTab < static_cast<SCTAB>(maTabs.size()) && nTab < static_cast<SCTAB>(pClipDoc->maTabs.size()))
if (maTabs[nTab] && pClipDoc->maTabs[nTab])
maTabs[nTab]->CopyToClip(aCxt, nCol1, nRow1, nCol2, nRow2, pClipDoc->maTabs[nTab]);
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 158686e9fbcf..8cec68efb1b3 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1752,7 +1752,7 @@ void ScTable::Sort(
DestroySortCollator();
}
-void ScTable::Reorder( const sc::ReorderParam& rParam, ScProgress* pProgress )
+void ScTable::Reorder( const sc::ReorderParam& rParam )
{
if (rParam.maOrderIndices.empty())
return;
@@ -1767,10 +1767,10 @@ void ScTable::Reorder( const sc::ReorderParam& rParam, ScProgress* pProgress )
pArray->ReorderByRow(rParam.maOrderIndices);
if (pArray->IsUpdateRefs())
SortReorderByRowRefUpdate(
- pArray.get(), rParam.maSortRange.aStart.Col(), rParam.maSortRange.aEnd.Col(), pProgress);
+ pArray.get(), rParam.maSortRange.aStart.Col(), rParam.maSortRange.aEnd.Col(), nullptr);
else
SortReorderByRow(
- pArray.get(), rParam.maSortRange.aStart.Col(), rParam.maSortRange.aEnd.Col(), pProgress);
+ pArray.get(), rParam.maSortRange.aStart.Col(), rParam.maSortRange.aEnd.Col(), nullptr);
}
else
{
@@ -1778,7 +1778,7 @@ void ScTable::Reorder( const sc::ReorderParam& rParam, ScProgress* pProgress )
pArray->SetOrderIndices(rParam.maOrderIndices);
SortReorderByColumn(
pArray.get(), rParam.maSortRange.aStart.Row(), rParam.maSortRange.aEnd.Row(),
- rParam.mbPattern, pProgress);
+ rParam.mbPattern, nullptr);
}
}
diff --git a/sc/source/filter/inc/biffinputstream.hxx b/sc/source/filter/inc/biffinputstream.hxx
index 76ae3a82eec5..cf620d1dccd9 100644
--- a/sc/source/filter/inc/biffinputstream.hxx
+++ b/sc/source/filter/inc/biffinputstream.hxx
@@ -128,12 +128,9 @@ public:
@param rInStream
The base input stream. Must be seekable. Will be sought to its
start position.
-
- @param bContLookup Automatic CONTINUE lookup on/off.
*/
explicit BiffInputStream(
- BinaryInputStream& rInStream,
- bool bContLookup = true );
+ BinaryInputStream& rInStream );
// record control ---------------------------------------------------------
@@ -222,26 +219,11 @@ public:
// byte strings -----------------------------------------------------------
- /** Reads 8/16 bit string length and character array, and returns the string.
- @param b16BitLen
- True = Read 16-bit string length field before the character array.
- False = Read 8-bit string length field before the character array.
- @param bAllowNulChars
- True = NUL characters are inserted into the imported string.
- False = NUL characters are replaced by question marks (default).
- */
- OString readByteString( bool b16BitLen, bool bAllowNulChars );
-
- /** Reads 8/16 bit string length and character array, and returns a Unicode string.
- @param b16BitLen
- True = Read 16-bit string length field before the character array.
- False = Read 8-bit string length field before the character array.
+ /** Reads 16 bit string length and character array, and returns a Unicode string.
+ NUL characters are replaced by question marks (default).
@param eTextEnc The text encoding used to create the Unicode string.
- @param bAllowNulChars
- True = NUL characters are inserted into the imported string.
- False = NUL characters are replaced by question marks (default).
*/
- OUString readByteStringUC( bool b16BitLen, rtl_TextEncoding eTextEnc, bool bAllowNulChars = false );
+ OUString readByteStringUC( rtl_TextEncoding eTextEnc );
private:
/** Initializes all members after base stream has been sought to new record. */
@@ -277,8 +259,6 @@ private:
sal_Int64 mnCurrRecSize; /// Helper for record size and position.
sal_Int64 mnComplRecSize; /// Size of complete record data (with CONTINUEs).
bool mbHasComplRec; /// True = mnComplRecSize is valid.
-
- bool mbCont; /// True = automatic CONTINUE lookup enabled.
};
} // namespace xls
diff --git a/sc/source/filter/inc/richstring.hxx b/sc/source/filter/inc/richstring.hxx
index 5ec2bfdbe9d7..1582b4c2fa6f 100644
--- a/sc/source/filter/inc/richstring.hxx
+++ b/sc/source/filter/inc/richstring.hxx
@@ -58,12 +58,11 @@ public:
/** Converts the portion and replaces or appends to the passed XText. */
void convert(
const css::uno::Reference< css::text::XText >& rxText,
- const oox::xls::Font* pFont, bool bReplace );
+ bool bReplace );
void convert( ScEditEngineDefaulter& rEE, ESelection& rSelection, const oox::xls::Font* pFont );
void writeFontProperties(
- const css::uno::Reference< css::text::XText >& rxText,
- const oox::xls::Font* pFont ) const;
+ const css::uno::Reference< css::text::XText >& rxText ) const;
private:
OUString maText; /// Portion text.
diff --git a/sc/source/filter/oox/biffinputstream.cxx b/sc/source/filter/oox/biffinputstream.cxx
index 6b54834fe2a5..7d9e8a2784cd 100644
--- a/sc/source/filter/oox/biffinputstream.cxx
+++ b/sc/source/filter/oox/biffinputstream.cxx
@@ -151,7 +151,7 @@ void BiffInputRecordBuffer::updateDecoded()
} // namespace prv
-BiffInputStream::BiffInputStream( BinaryInputStream& rInStream, bool bContLookup ) :
+BiffInputStream::BiffInputStream( BinaryInputStream& rInStream ) :
BinaryStreamBase( true ),
maRecBuffer( rInStream ),
mnRecHandle( -1 ),
@@ -159,8 +159,7 @@ BiffInputStream::BiffInputStream( BinaryInputStream& rInStream, bool bContLookup
mnAltContId( BIFF_ID_UNKNOWN ),
mnCurrRecSize( 0 ),
mnComplRecSize( 0 ),
- mbHasComplRec( false ),
- mbCont( bContLookup )
+ mbHasComplRec( false )
{
mbEof = true; // EOF will be true if stream is not inside a record
}
@@ -182,7 +181,7 @@ bool BiffInputStream::startNextRecord()
// ignore record, if identifier and size are zero
bIsZeroRec = (maRecBuffer.getRecId() == 0) && (maRecBuffer.getRecSize() == 0);
}
- while( bValidRec && ((mbCont && isContinueId( maRecBuffer.getRecId() )) || bIsZeroRec) );
+ while( bValidRec && (isContinueId( maRecBuffer.getRecId()) || bIsZeroRec) );
// setup other class members
setupRecord();
@@ -318,15 +317,10 @@ void BiffInputStream::skip( sal_Int32 nBytes, size_t nAtomSize )
// byte strings ---------------------------------------------------------------
-OString BiffInputStream::readByteString( bool b16BitLen, bool bAllowNulChars )
+OUString BiffInputStream::readByteStringUC( rtl_TextEncoding eTextEnc )
{
- sal_Int32 nStrLen = b16BitLen ? readuInt16() : readuInt8();
- return readCharArray( nStrLen, bAllowNulChars );
-}
-
-OUString BiffInputStream::readByteStringUC( bool b16BitLen, rtl_TextEncoding eTextEnc, bool bAllowNulChars )
-{
- return OStringToOUString( readByteString( b16BitLen, bAllowNulChars ), eTextEnc );
+ sal_Int32 nStrLen = readuInt16();
+ return readCharArrayUC( nStrLen, eTextEnc );
}
// private --------------------------------------------------------------------
@@ -338,7 +332,7 @@ void BiffInputStream::setupRecord()
mnRecId = maRecBuffer.getRecId();
mnAltContId = BIFF_ID_UNKNOWN;
mnCurrRecSize = mnComplRecSize = maRecBuffer.getRecSize();
- mbHasComplRec = !mbCont;
+ mbHasComplRec = false;
mbEof = !isInRecord();
// enable decoder in new record
enableDecoder();
@@ -371,7 +365,7 @@ bool BiffInputStream::isContinueId( sal_uInt16 nRecId ) const
bool BiffInputStream::jumpToNextContinue()
{
- mbEof = mbEof || !mbCont || !isContinueId( maRecBuffer.getNextRecId() ) || !maRecBuffer.startNextRecord();
+ mbEof = mbEof || !isContinueId( maRecBuffer.getNextRecId() ) || !maRecBuffer.startNextRecord();
if( !mbEof )
mnCurrRecSize += maRecBuffer.getRecSize();
return !mbEof;
diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx
index 467b02d8edc2..a9e59cefcd83 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -235,7 +235,7 @@ void PivotCacheItem::readIndex( SequenceInputStream& rStrm )
void PivotCacheItem::readString( BiffInputStream& rStrm, const WorkbookHelper& rHelper )
{
- maValue <<= rStrm.readByteStringUC( true, rHelper.getTextEncoding() );
+ maValue <<= rStrm.readByteStringUC( rHelper.getTextEncoding() );
mnType = XML_s;
}
@@ -634,7 +634,7 @@ void PivotCacheField::importPCDField( BiffInputStream& rStrm )
maFieldGroupModel.mnBaseField = rStrm.readuInt16();
rStrm.skip( 2 ); // number of unique items (either shared or group)
rStrm >> nGroupItems >> nBaseItems >> nSharedItems;
- maFieldModel.maName = rStrm.readByteStringUC( true, getTextEncoding() );
+ maFieldModel.maName = rStrm.readByteStringUC( getTextEncoding() );
maFieldModel.mbServerField = getFlag( nFlags, BIFF_PCDFIELD_SERVERFIELD );
maFieldModel.mbUniqueList = !getFlag( nFlags, BIFF_PCDFIELD_NOUNIQUEITEMS );
diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx
index da88e98d7941..4573e743b840 100644
--- a/sc/source/filter/oox/richstring.cxx
+++ b/sc/source/filter/oox/richstring.cxx
@@ -80,7 +80,7 @@ void RichStringPortion::finalizeImport()
mxFont = getStyles().getFont( mnFontId );
}
-void RichStringPortion::convert( const Reference< XText >& rxText, const oox::xls::Font* pFont, bool bReplace )
+void RichStringPortion::convert( const Reference< XText >& rxText, bool bReplace )
{
if ( mbConverted )
return;
@@ -100,15 +100,6 @@ void RichStringPortion::convert( const Reference< XText >& rxText, const oox::xl
PropertySet aPropSet( xRange );
mxFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
}
-
- /* Some font attributes cannot be set to cell formatting in Calc but
- require to use rich formatting, e.g. font escapement. But do not
- use the passed font if this portion has its own font. */
- else if( lclNeedsRichTextFormat( pFont ) )
- {
- PropertySet aPropSet( xRange );
- pFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
- }
}
mbConverted = true;
@@ -149,15 +140,12 @@ void RichStringPortion::convert( ScEditEngineDefaulter& rEE, ESelection& rSelect
rEE.QuickSetAttribs( aItemSet, rSelection );
}
-void RichStringPortion::writeFontProperties( const Reference<XText>& rxText, const oox::xls::Font* pFont ) const
+void RichStringPortion::writeFontProperties( const Reference<XText>& rxText ) const
{
PropertySet aPropSet(rxText);
if (mxFont.get())
mxFont->writeToPropertySet(aPropSet, FONT_PROPTYPE_TEXT);
-
- if (lclNeedsRichTextFormat(pFont))
- pFont->writeToPropertySet(aPropSet, FONT_PROPTYPE_TEXT);
}
void FontPortionModel::read( SequenceInputStream& rStrm )
@@ -390,13 +378,13 @@ void RichString::convert( const Reference< XText >& rxText, bool bReplaceOld ) c
// It's much faster this way.
RichStringPortion& rPtn = *maTextPortions.front();
rxText->setString(rPtn.getText());
- rPtn.writeFontProperties(rxText, nullptr);
+ rPtn.writeFontProperties(rxText);
return;
}
for( PortionVector::const_iterator aIt = maTextPortions.begin(), aEnd = maTextPortions.end(); aIt != aEnd; ++aIt )
{
- (*aIt)->convert( rxText, nullptr, bReplaceOld );
+ (*aIt)->convert( rxText, bReplaceOld );
bReplaceOld = false; // do not replace first portion text with following portions
}
}
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 50f50536b33e..59d285f27dbb 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -96,7 +96,7 @@ void ScTransferObj::GetAreaSize( ScDocument* pDoc, SCTAB nTab1, SCTAB nTab2, SCR
}
void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPrintFactor,
- const ScRange& rBlock, bool bMetaFile )
+ const ScRange& rBlock )
{
if (!pDoc)
return;
@@ -111,7 +111,7 @@ void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPr
aViewData.SetScreen( rBlock.aStart.Col(), rBlock.aStart.Row(),
rBlock.aEnd.Col(), rBlock.aEnd.Row() );
- ScPrintFunc::DrawToDev( pDoc, pDev, nPrintFactor, aBound, &aViewData, bMetaFile );
+ ScPrintFunc::DrawToDev( pDoc, pDev, nPrintFactor, aBound, &aViewData, false/*bMetaFile*/ );
}
ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDescriptor& rDesc ) :
@@ -350,7 +350,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
ScopedVclPtrInstance< VirtualDevice > pVirtDev;
pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) );
- PaintToDev( pVirtDev, pDoc, 1.0, aBlock, false );
+ PaintToDev( pVirtDev, pDoc, 1.0, aBlock );
pVirtDev->SetMapMode( MapMode( MAP_PIXEL ) );
Bitmap aBmp = pVirtDev->GetBitmap( Point(), pVirtDev->GetOutputSize() );
diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx
index 45c7d49ac737..350a11f51b51 100644
--- a/sc/source/ui/inc/transobj.hxx
+++ b/sc/source/ui/inc/transobj.hxx
@@ -66,7 +66,7 @@ private:
ScDocument* pDestDoc,
SCCOL nSubX=0, SCROW nSubY=0 );
static void PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPrintFactor,
- const ScRange& rBlock, bool bMetaFile );
+ const ScRange& rBlock );
static void GetAreaSize( ScDocument* pDoc, SCTAB nTab1, SCTAB nTab2, SCROW& nRow, SCCOL& nCol );
public: