summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-02-03 10:05:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-03 10:53:01 +0100
commit0528012fd0dc4b93645ef7790b0db9d1cecbae66 (patch)
treee3adb8f0200fc95c06f62205b346244c79ae88ca /sc
parentf612839ed9200a3900ae5c3a2e12beccfa37b11e (diff)
loplugin:constantparam
Change-Id: If2dee122bf07dc179fd8f6e766442ec1891a5f3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87845 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/columnspanset.hxx3
-rw-r--r--sc/source/core/data/bcaslot.cxx2
-rw-r--r--sc/source/core/data/columnspanset.cxx4
-rw-r--r--sc/source/core/data/documen6.cxx2
-rw-r--r--sc/source/core/data/document.cxx4
-rw-r--r--sc/source/core/data/listenercontext.cxx4
-rw-r--r--sc/source/core/data/table3.cxx2
-rw-r--r--sc/source/filter/oox/commentsbuffer.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx9
-rw-r--r--sc/source/ui/docshell/docfuncutil.cxx2
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx2
-rw-r--r--sc/source/ui/inc/docfunc.hxx2
12 files changed, 16 insertions, 22 deletions
diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx
index 99a99ee935c0..b76664c785c6 100644
--- a/sc/inc/columnspanset.hxx
+++ b/sc/inc/columnspanset.hxx
@@ -62,7 +62,6 @@ private:
typedef std::vector<std::unique_ptr<ColumnType>> TableType;
std::vector<std::unique_ptr<TableType>> maTables;
- bool const mbInit;
ColumnType& getColumn(const ScDocument& rDoc, SCTAB nTab, SCCOL nCol);
@@ -84,7 +83,7 @@ public:
virtual void executeSum(SCROW, SCROW, bool, double& ) { return; } ;
};
- ColumnSpanSet(bool bInit);
+ ColumnSpanSet();
ColumnSpanSet(const ColumnSpanSet&) = delete;
const ColumnSpanSet& operator=(const ColumnSpanSet&) = delete;
~ColumnSpanSet();
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index af791ccc55ef..efa1ac103e1e 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -1085,7 +1085,7 @@ void ScBroadcastAreaSlotMachine::InsertBulkGroupArea( ScBroadcastArea* pArea, co
if (it == m_BulkGroupAreas.end() || m_BulkGroupAreas.key_comp()(pArea, it->first))
{
// Insert a new one.
- it = m_BulkGroupAreas.insert(it, std::make_pair(pArea, std::make_unique<sc::ColumnSpanSet>(false)));
+ it = m_BulkGroupAreas.insert(it, std::make_pair(pArea, std::make_unique<sc::ColumnSpanSet>()));
}
sc::ColumnSpanSet *const pSet = it->second.get();
diff --git a/sc/source/core/data/columnspanset.cxx b/sc/source/core/data/columnspanset.cxx
index 5d605dc79b2b..8bdd64a55064 100644
--- a/sc/source/core/data/columnspanset.cxx
+++ b/sc/source/core/data/columnspanset.cxx
@@ -58,7 +58,7 @@ void ColumnSpanSet::Action::startColumn(SCTAB /*nTab*/, SCCOL /*nCol*/) {}
ColumnSpanSet::ColumnAction::~ColumnAction() {}
-ColumnSpanSet::ColumnSpanSet(bool bInit) : mbInit(bInit) {}
+ColumnSpanSet::ColumnSpanSet() {}
ColumnSpanSet::~ColumnSpanSet()
{
@@ -77,7 +77,7 @@ ColumnSpanSet::ColumnType& ColumnSpanSet::getColumn(const ScDocument& rDoc, SCTA
rTab.resize(nCol+1);
if (!rTab[nCol])
- rTab[nCol].reset(new ColumnType(0, rDoc.MaxRow(), mbInit));
+ rTab[nCol].reset(new ColumnType(0, rDoc.MaxRow(), /*bInit*/false));
return *rTab[nCol];
}
diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx
index e6d7a315f7bf..c2f2d2b0c4dd 100644
--- a/sc/source/core/data/documen6.cxx
+++ b/sc/source/core/data/documen6.cxx
@@ -191,7 +191,7 @@ SvtScriptType ScDocument::GetRangeScriptType(
SvtScriptType ScDocument::GetRangeScriptType( const ScRangeList& rRanges )
{
- sc::ColumnSpanSet aSet(false);
+ sc::ColumnSpanSet aSet;
for (size_t i = 0, n = rRanges.size(); i < n; ++i)
{
const ScRange& rRange = rRanges[i];
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 7366d6702a95..44a303c71921 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2880,7 +2880,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
bInsertingFromOtherDoc = true; // No Broadcast/Listener created at Insert
- sc::ColumnSpanSet aBroadcastSpans(false);
+ sc::ColumnSpanSet aBroadcastSpans;
SCCOL nClipStartCol = aClipRange.aStart.Col();
SCROW nClipStartRow = aClipRange.aStart.Row();
@@ -3039,7 +3039,7 @@ void ScDocument::CopyMultiRangeFromClip(
SCROW nRow1 = rDestPos.Row();
ScClipParam& rClipParam = pClipDoc->GetClipParam();
- sc::ColumnSpanSet aBroadcastSpans(false);
+ sc::ColumnSpanSet aBroadcastSpans;
if (!bSkipAttrForEmpty)
{
diff --git a/sc/source/core/data/listenercontext.cxx b/sc/source/core/data/listenercontext.cxx
index c9194eca0d24..e247026a5f7e 100644
--- a/sc/source/core/data/listenercontext.cxx
+++ b/sc/source/core/data/listenercontext.cxx
@@ -36,12 +36,12 @@ ColumnBlockPosition* StartListeningContext::getBlockPosition(SCTAB nTab, SCCOL n
}
EndListeningContext::EndListeningContext(ScDocument& rDoc, ScTokenArray* pOldCode) :
- mrDoc(rDoc), maSet(false), mpPosSet(std::make_shared<ColumnBlockPositionSet>(rDoc)),
+ mrDoc(rDoc), maSet(), mpPosSet(std::make_shared<ColumnBlockPositionSet>(rDoc)),
mpOldCode(pOldCode), maPosDelta(0,0,0) {}
EndListeningContext::EndListeningContext(
ScDocument& rDoc, const std::shared_ptr<ColumnBlockPositionSet>& pSet, ScTokenArray* pOldCode) :
- mrDoc(rDoc), maSet(false), mpPosSet(pSet),
+ mrDoc(rDoc), maSet(), mpPosSet(pSet),
mpOldCode(pOldCode), maPosDelta(0,0,0) {}
void EndListeningContext::setPositionDelta( const ScAddress& rDelta )
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 8f6c588cd6c7..74d286684c04 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1169,7 +1169,7 @@ void ScTable::SortReorderByRowRefUpdate(
SCROW nRow2 = pArray->GetLast();
ScRange aMoveRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab);
- sc::ColumnSpanSet aGrpListenerRanges(false);
+ sc::ColumnSpanSet aGrpListenerRanges;
{
// Get the range of formula group listeners within sorted range (if any).
diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx
index 60737f46ba36..f33284ac3675 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -166,7 +166,7 @@ void Comment::finalizeImport()
rtl::Reference<ScAnnotationsObj> xAnnos = static_cast<ScAnnotationsObj*>(pAnnosSupp->getAnnotations().get());
ScDocShell* pDocShell = xAnnos->GetDocShell();
// non-empty string required by note implementation (real text will be added below)
- ScPostIt* pPostIt = pDocShell->GetDocFunc().ImportNote( maModel.maRange.aStart, OUString( ' ' ), nullptr, nullptr );
+ ScPostIt* pPostIt = pDocShell->GetDocFunc().ImportNote( maModel.maRange.aStart, OUString( ' ' ) );
SdrCaptionObj* pCaption = pPostIt->GetOrCreateCaption( maModel.maRange.aStart );
Reference< XShape > xAnnoShape( pCaption->getUnoShape(), UNO_QUERY_THROW ); // SvxShapeText
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index ae76b44f9551..c9becf98ae4d 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1364,7 +1364,7 @@ void ScDocFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, c
}
}
-ScPostIt* ScDocFunc::ImportNote( const ScAddress& rPos, const OUString& rNoteText, const OUString* pAuthor, const OUString* pDate )
+ScPostIt* ScDocFunc::ImportNote( const ScAddress& rPos, const OUString& rNoteText )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument& rDoc = rDocShell.GetDocument();
@@ -1373,12 +1373,7 @@ ScPostIt* ScDocFunc::ImportNote( const ScAddress& rPos, const OUString& rNoteTex
assert(!pOldNote && "imported data has >1 notes on same cell?");
// create new note
- ScPostIt* pNewNote = nullptr;
- if( (pNewNote = ScNoteUtil::CreateNoteFromString( rDoc, rPos, rNoteText, false, true, /*nNoteId*/0 )) )
- {
- if( pAuthor ) pNewNote->SetAuthor( *pAuthor );
- if( pDate ) pNewNote->SetDate( *pDate );
- }
+ ScPostIt* pNewNote = ScNoteUtil::CreateNoteFromString( rDoc, rPos, rNoteText, false, true, /*nNoteId*/0 );
rDoc.SetStreamValid(rPos.Tab(), false);
diff --git a/sc/source/ui/docshell/docfuncutil.cxx b/sc/source/ui/docshell/docfuncutil.cxx
index 304bd44b01a5..1b780db420a3 100644
--- a/sc/source/ui/docshell/docfuncutil.cxx
+++ b/sc/source/ui/docshell/docfuncutil.cxx
@@ -99,7 +99,7 @@ std::unique_ptr<ScSimpleUndo::DataSpansType> DocFuncUtil::getNonEmptyCellSpans(
SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
std::pair<ScSimpleUndo::DataSpansType::iterator,bool> r =
- pDataSpans->insert(std::make_pair(nTab, std::make_unique<sc::ColumnSpanSet>(false)));
+ pDataSpans->insert(std::make_pair(nTab, std::make_unique<sc::ColumnSpanSet>()));
if (r.second)
{
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index f16f0f70b066..46aaa52e2099 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2904,7 +2904,7 @@ bool ScExternalRefManager::refreshSrcDocument(sal_uInt16 nFileId)
ScDocShell& rDocSh = static_cast<ScDocShell&>(*xDocShell);
ScDocument& rSrcDoc = rDocSh.GetDocument();
- sc::ColumnSpanSet aCachedArea(false);
+ sc::ColumnSpanSet aCachedArea;
maRefCache.getAllCachedDataSpans(rSrcDoc, nFileId, aCachedArea);
// Clear the existing cache, and refill it. Make sure we keep the
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index ca0f03e0318c..e3a8117a5493 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -119,7 +119,7 @@ public:
void SetNoteText( const ScAddress& rPos, const OUString& rNoteText, bool bApi );
void ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, const OUString* pAuthor, const OUString* pDate, bool bApi );
- SC_DLLPUBLIC ScPostIt* ImportNote( const ScAddress& rPos, const OUString& rNoteText, const OUString* pAuthor, const OUString* pDate );
+ SC_DLLPUBLIC ScPostIt* ImportNote( const ScAddress& rPos, const OUString& rNoteText );
bool ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& rPattern,
bool bApi );