summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-25 18:56:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-27 10:10:52 +0200
commitf3049f68584811bb897873f35e0c302898af2d31 (patch)
treeb77f8bee3f733b8f2565a64276e33387576a26ac /sc
parent28fc0962b10519ab84654d189d2ad0cca8f84f95 (diff)
loplugin:constantparam
Change-Id: I966dcf87be021520e7cc394338b9c0574bb8afee Reviewed-on: https://gerrit.libreoffice.org/53541 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/postit.hxx9
-rw-r--r--sc/qa/unit/helper/qahelper.cxx4
-rw-r--r--sc/qa/unit/helper/qahelper.hxx2
-rw-r--r--sc/qa/unit/ucalc_formula.cxx2
-rw-r--r--sc/source/core/data/postit.cxx4
-rw-r--r--sc/source/filter/excel/xiescher.cxx3
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx2
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx2
-rw-r--r--sc/source/ui/inc/delcodlg.hxx2
-rw-r--r--sc/source/ui/miscdlgs/delcodlg.cxx8
10 files changed, 11 insertions, 27 deletions
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 46aa4b0745c6..09f8d77a18e4 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -329,12 +329,6 @@ public:
object. The rectangle may be empty, in this case the default
position and size is used.
- @param bAlwaysCreateCaption If sal_True is passed, the caption drawing
- object will be created immediately. If sal_False is passed, the caption
- drawing object will not be created if the note is not visible
- (bShown = sal_False), but the cell note will cache the passed data.
- MUST be set to sal_False outside of import filter implementations!
-
@return Pointer to the new cell note object if insertion was
successful (i.e. the passed cell position was valid), null
otherwise. The Calc document is the owner of the note object.
@@ -342,8 +336,7 @@ public:
static ScPostIt* CreateNoteFromObjectData(
ScDocument& rDoc, const ScAddress& rPos,
std::unique_ptr<SfxItemSet> pItemSet, OutlinerParaObject* pOutlinerObj,
- const tools::Rectangle& rCaptionRect, bool bShown,
- bool bAlwaysCreateCaption );
+ const tools::Rectangle& rCaptionRect, bool bShown );
/** Creates a cell note based on the passed string and inserts it into the
document.
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 3f7c93198312..8aa9cc883568 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -472,12 +472,10 @@ bool checkFormulaPositions(
}
ScTokenArray* compileFormula(
- ScDocument* pDoc, const OUString& rFormula, const ScAddress* pPos,
+ ScDocument* pDoc, const OUString& rFormula,
formula::FormulaGrammar::Grammar eGram )
{
ScAddress aPos(0,0,0);
- if (pPos)
- aPos = *pPos;
ScCompiler aComp(pDoc, aPos, eGram);
return aComp.CompileString(rFormula);
}
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 5f40ba84432a..f8d522e65387 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -140,7 +140,7 @@ SCQAHELPER_DLLPUBLIC bool checkFormulaPositions(
ScDocument& rDoc, SCTAB nTab, SCCOL nCol, const SCROW* pRows, size_t nRowCount);
SCQAHELPER_DLLPUBLIC ScTokenArray* compileFormula(
- ScDocument* pDoc, const OUString& rFormula, const ScAddress* pPos = nullptr,
+ ScDocument* pDoc, const OUString& rFormula,
formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_NATIVE );
SCQAHELPER_DLLPUBLIC bool checkOutput(
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 352cb4ae1d38..0b375db0dd21 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1020,7 +1020,7 @@ void Test::testFormulaCompiler()
{
std::unique_ptr<ScTokenArray> pArray;
{
- pArray.reset(compileFormula(m_pDoc, OUString::createFromAscii(aTests[i].pInput), nullptr, aTests[i].eInputGram));
+ pArray.reset(compileFormula(m_pDoc, OUString::createFromAscii(aTests[i].pInput), aTests[i].eInputGram));
CPPUNIT_ASSERT_MESSAGE("Token array shouldn't be NULL!", pArray.get());
}
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 50d416077d89..7b51b97431bd 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1242,7 +1242,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromCaption(
ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
ScDocument& rDoc, const ScAddress& rPos, std::unique_ptr<SfxItemSet> pItemSet,
OutlinerParaObject* pOutlinerObj, const tools::Rectangle& rCaptionRect,
- bool bShown, bool bAlwaysCreateCaption )
+ bool bShown )
{
OSL_ENSURE( pItemSet && pOutlinerObj, "ScNoteUtil::CreateNoteFromObjectData - item set and outliner object expected" );
ScNoteData aNoteData( bShown );
@@ -1264,7 +1264,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
/* Create the note and insert it into the document. If the note is
visible, the caption object will be created automatically. */
- ScPostIt* pNote = new ScPostIt( rDoc, rPos, aNoteData, bAlwaysCreateCaption, 0/*nPostItId*/ );
+ ScPostIt* pNote = new ScPostIt( rDoc, rPos, aNoteData, /*bAlwaysCreateCaption*/false, 0/*nPostItId*/ );
pNote->AutoStamp();
rDoc.SetNote(rPos, pNote);
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 989c9b693d0f..c5fbac78f43f 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1826,8 +1826,7 @@ void XclImpNoteObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject&
rSdrObj.GetMergedItemSet().Clone(), // new object on heap expected
new OutlinerParaObject( *pOutlinerObj ), // new object on heap expected
rSdrObj.GetLogicRect(),
- ::get_flag( mnNoteFlags, EXC_NOTE_VISIBLE ),
- false );
+ ::get_flag( mnNoteFlags, EXC_NOTE_VISIBLE ) );
}
}
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index f8095c33eabf..c279deb63993 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -910,7 +910,7 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos)
// create cell note with all data from drawing object
pNote = ScNoteUtil::CreateNoteFromObjectData( *pDoc, rPos,
std::move(xItemSet), xOutlinerObj.release(),
- aCaptionRect, mxAnnotationData->mbShown, false );
+ aCaptionRect, mxAnnotationData->mbShown );
}
}
}
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index d1035d97a79a..f8d4b8f0d542 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -704,7 +704,7 @@ VclPtr<AbstractScDataFormDlg> ScAbstractDialogFactory_Impl::CreateScDataFormDlg(
VclPtr<AbstractScDeleteContentsDlg> ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(weld::Window* pParent)
{
- return VclPtr<AbstractScDeleteContentsDlg_Impl>::Create(new ScDeleteContentsDlg(pParent, InsertDeleteFlags::NONE));
+ return VclPtr<AbstractScDeleteContentsDlg_Impl>::Create(new ScDeleteContentsDlg(pParent));
}
VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( vcl::Window* pParent,
diff --git a/sc/source/ui/inc/delcodlg.hxx b/sc/source/ui/inc/delcodlg.hxx
index 00910bcb2cd9..d2f9e9535d8a 100644
--- a/sc/source/ui/inc/delcodlg.hxx
+++ b/sc/source/ui/inc/delcodlg.hxx
@@ -45,7 +45,7 @@ private:
DECL_LINK( DelAllHdl, weld::Button&, void );
public:
- ScDeleteContentsDlg(weld::Window* pParent, InsertDeleteFlags nCheckDefaults );
+ ScDeleteContentsDlg(weld::Window* pParent);
virtual ~ScDeleteContentsDlg() override;
void DisableObjects();
diff --git a/sc/source/ui/miscdlgs/delcodlg.cxx b/sc/source/ui/miscdlgs/delcodlg.cxx
index 19d098994c76..28b1169f22e9 100644
--- a/sc/source/ui/miscdlgs/delcodlg.cxx
+++ b/sc/source/ui/miscdlgs/delcodlg.cxx
@@ -26,7 +26,7 @@ InsertDeleteFlags ScDeleteContentsDlg::nPreviousChecks = (InsertDeleteFlags::D
InsertDeleteFlags::NOTE | InsertDeleteFlags::FORMULA |
InsertDeleteFlags::VALUE);
-ScDeleteContentsDlg::ScDeleteContentsDlg(weld::Window* pParent, InsertDeleteFlags nCheckDefaults)
+ScDeleteContentsDlg::ScDeleteContentsDlg(weld::Window* pParent)
: GenericDialogController(pParent, "modules/scalc/ui/deletecontents.ui", "DeleteContentsDialog")
, m_bObjectsDisabled(false)
, m_xBtnDelAll(m_xBuilder->weld_check_button("deleteall"))
@@ -39,12 +39,6 @@ ScDeleteContentsDlg::ScDeleteContentsDlg(weld::Window* pParent, InsertDeleteFlag
, m_xBtnDelObjects(m_xBuilder->weld_check_button("objects"))
, m_xBtnOk(m_xBuilder->weld_button("ok"))
{
- if ( nCheckDefaults != InsertDeleteFlags::NONE )
- {
- ScDeleteContentsDlg::nPreviousChecks = nCheckDefaults;
- ScDeleteContentsDlg::bPreviousAllCheck = false;
- }
-
m_xBtnDelAll->set_active( ScDeleteContentsDlg::bPreviousAllCheck );
m_xBtnDelStrings->set_active( bool(InsertDeleteFlags::STRING & ScDeleteContentsDlg::nPreviousChecks) );
m_xBtnDelNumbers->set_active( bool(InsertDeleteFlags::VALUE & ScDeleteContentsDlg::nPreviousChecks) );