[Libreoffice-commits] core.git: compilerplugins/clang sc/qa sc/source sd/qa sd/source sw/qa
Noel Grandin
noel.grandin at collabora.co.uk
Wed Aug 30 09:02:41 UTC 2017
compilerplugins/clang/constparams.cxx | 3 ++-
sc/qa/unit/filters-test.cxx | 6 +++---
sc/qa/unit/helper/qahelper.cxx | 6 +++---
sc/qa/unit/helper/qahelper.hxx | 6 +++---
sc/qa/unit/helper/shared_test_impl.hxx | 6 +++---
sc/qa/unit/subsequent_export-test.cxx | 10 +++++-----
sc/qa/unit/subsequent_filters-test.cxx | 10 +++++-----
sc/qa/unit/tiledrendering/tiledrendering.cxx | 2 +-
sc/qa/unit/ucalc.cxx | 2 +-
sc/source/ui/miscdlgs/datatableview.cxx | 4 ++--
sd/qa/unit/HtmlExportTest.cxx | 2 +-
sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 2 +-
sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx | 2 +-
sw/qa/core/Test-BigPtrArray.cxx | 2 +-
sw/qa/core/test_ToxTextGenerator.cxx | 2 +-
sw/qa/core/uwriter.cxx | 2 +-
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 2 +-
17 files changed, 35 insertions(+), 34 deletions(-)
New commits:
commit 008199ee75ed4edc250270628f6e6cb1677dbbc9
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Aug 29 16:08:30 2017 +0200
loplugin:constparam in various
Change-Id: I6821a3946f2e8fabf26558a84370c16ac8827fed
Reviewed-on: https://gerrit.libreoffice.org/41721
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx
index a281d8635900..bac52a422618 100644
--- a/compilerplugins/clang/constparams.cxx
+++ b/compilerplugins/clang/constparams.cxx
@@ -46,6 +46,7 @@ public:
|| startswith(fn, WORKDIR "/YaccTarget/unoidl/source/sourceprovider-parser.cxx")
// some weird calling through a function pointer
|| startswith(fn, SRCDIR "/svtools/source/table/defaultinputhandler.cxx")
+ || startswith(fn, SRCDIR "/sdext/source/pdfimport/test/pdfunzip.cxx")
// windows only
|| startswith(fn, SRCDIR "/basic/source/sbx/sbxdec.cxx")
|| startswith(fn, SRCDIR "/sfx2/source/doc/syspath.cxx")
@@ -493,7 +494,7 @@ bool ConstParams::isPointerOrReferenceToConst(const QualType& qt) {
return false;
}
-loplugin::Plugin::Registration< ConstParams > X("constparams", false);
+loplugin::Plugin::Registration< ConstParams > X("constparams", true);
}
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 2b926251affb..3b93603c16eb 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -159,7 +159,7 @@ void ScFiltersTest::testCVEs()
namespace {
-void testRangeNameImpl(ScDocument& rDoc)
+void testRangeNameImpl(const ScDocument& rDoc)
{
//check one range data per sheet and one global more detailed
//add some more checks here
@@ -434,7 +434,7 @@ void ScFiltersTest::testSheetNamesXLSX()
xDocSh->DoClose();
}
-void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle& aRect, ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ )
+void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle& aRect, const ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ )
{
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
CPPUNIT_ASSERT_MESSAGE("No drawing layer.", pDrawLayer);
@@ -548,7 +548,7 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape()
}
}
-void testEnhancedProtectionImpl( ScDocument& rDoc )
+void testEnhancedProtectionImpl( const ScDocument& rDoc )
{
const ScTableProtection* pProt = rDoc.GetTabProtection(0);
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 668b388f55a1..0bd525c3c20f 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -118,7 +118,7 @@ void loadFile(const OUString& aFileName, std::string& aContent)
aContent = aOStream.str();
}
-void testFile(OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat)
+void testFile(const OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat)
{
csv_handler aHandler(&rDoc, nTab, aStringFormat);
orcus::csv::parser_config aConfig;
@@ -143,7 +143,7 @@ void testFile(OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStr
}
}
-void testCondFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab)
+void testCondFile(const OUString& aFileName, ScDocument* pDoc, SCTAB nTab)
{
conditional_format_handler aHandler(pDoc, nTab);
orcus::csv::parser_config aConfig;
@@ -486,7 +486,7 @@ ScTokenArray* compileFormula(
}
bool checkOutput(
- ScDocument* pDoc, const ScRange& aOutRange,
+ const ScDocument* pDoc, const ScRange& aOutRange,
const std::vector<std::vector<const char*>>& aCheck, const char* pCaption )
{
bool bResult = true;
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 3d2a62f0d9bc..b677f014d47e 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -121,10 +121,10 @@ SCQAHELPER_DLLPUBLIC std::ostream& operator<<(std::ostream& rStrm, const OpCode&
SCQAHELPER_DLLPUBLIC void loadFile(const OUString& aFileName, std::string& aContent);
-SCQAHELPER_DLLPUBLIC void testFile(OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat = StringType::StringValue);
+SCQAHELPER_DLLPUBLIC void testFile(const OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat = StringType::StringValue);
//need own handler because conditional formatting strings must be generated
-SCQAHELPER_DLLPUBLIC void testCondFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab);
+SCQAHELPER_DLLPUBLIC void testCondFile(const OUString& aFileName, ScDocument* pDoc, SCTAB nTab);
SCQAHELPER_DLLPUBLIC const SdrOle2Obj* getSingleChartObject(ScDocument& rDoc, sal_uInt16 nPage);
@@ -143,7 +143,7 @@ SCQAHELPER_DLLPUBLIC ScTokenArray* compileFormula(
formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_NATIVE );
SCQAHELPER_DLLPUBLIC bool checkOutput(
- ScDocument* pDoc, const ScRange& aOutRange,
+ const ScDocument* pDoc, const ScRange& aOutRange,
const std::vector<std::vector<const char*>>& aCheck, const char* pCaption );
template<size_t Size>
diff --git a/sc/qa/unit/helper/shared_test_impl.hxx b/sc/qa/unit/helper/shared_test_impl.hxx
index 00bc6c65a2dd..b997a8a28ce4 100644
--- a/sc/qa/unit/helper/shared_test_impl.hxx
+++ b/sc/qa/unit/helper/shared_test_impl.hxx
@@ -51,7 +51,7 @@ DataBarData aData[] = {
{ ScRange(1,9,0,1,12,0), COLORSCALE_AUTO, COLORSCALE_AUTO, databar::MIDDLE }
};
-void testDataBar_Impl(ScDocument& rDoc)
+void testDataBar_Impl(const ScDocument& rDoc)
{
ScConditionalFormatList* pList = rDoc.GetCondFormList(0);
CPPUNIT_ASSERT(pList);
@@ -88,7 +88,7 @@ ColorScale2EntryData aData2Entry[] = {
{ ScRange(5,2,0,5,5,0), COLORSCALE_VALUE, COLORSCALE_FORMULA }
};
-void testColorScale2Entry_Impl(ScDocument& rDoc)
+void testColorScale2Entry_Impl(const ScDocument& rDoc)
{
const ScConditionalFormatList* pList = rDoc.GetCondFormList(0);
CPPUNIT_ASSERT(pList);
@@ -127,7 +127,7 @@ ColorScale3EntryData aData3Entry[] = {
{ ScRange(5,1,1,5,6,1), COLORSCALE_VALUE, COLORSCALE_VALUE, COLORSCALE_FORMULA }
};
-void testColorScale3Entry_Impl(ScDocument& rDoc)
+void testColorScale3Entry_Impl(const ScDocument& rDoc)
{
ScConditionalFormatList* pList = rDoc.GetCondFormList(1);
CPPUNIT_ASSERT(pList);
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index c07f28af1f26..60e870412c5b 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -2388,7 +2388,7 @@ void ScExportTest::testTrackChangesSimpleXLSX()
return aExpected == aActual;
}
- bool check( ScDocument& rDoc )
+ bool check( const ScDocument& rDoc )
{
CheckItem aChecks[] =
{
@@ -2578,7 +2578,7 @@ void ScExportTest::testSheetTabColorsXLSX()
{
struct
{
- bool checkContent( ScDocument& rDoc )
+ bool checkContent( const ScDocument& rDoc )
{
std::vector<OUString> aTabNames = rDoc.GetAllTableNames();
@@ -2737,7 +2737,7 @@ void ScExportTest::testSharedFormulaExportXLSX()
{
struct
{
- bool checkContent( ScDocument& rDoc )
+ bool checkContent( const ScDocument& rDoc )
{
SCTAB nTabCount = rDoc.GetTableCount();
if (nTabCount != 2)
@@ -2832,7 +2832,7 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
{
struct
{
- bool checkContent( ScDocument& rDoc )
+ bool checkContent( const ScDocument& rDoc )
{
{
// B2:B7 should show A,B,....,F.
@@ -2982,7 +2982,7 @@ void ScExportTest::testRelativePathsODS()
namespace {
-void testSheetProtection_Impl(ScDocument& rDoc)
+void testSheetProtection_Impl(const ScDocument& rDoc)
{
CPPUNIT_ASSERT(rDoc.IsTabProtected(0));
ScTableProtection* pTabProtection = rDoc.GetTabProtection(0);
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 43c0664e5245..91f9b962a74f 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -401,7 +401,7 @@ bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL,
namespace {
-void testRangeNameImpl(ScDocument& rDoc)
+void testRangeNameImpl(const ScDocument& rDoc)
{
//check one range data per sheet and one global more detailed
//add some more checks here
@@ -2687,7 +2687,7 @@ void ScFiltersTest::testCondFormatThemeColor2XLSX()
namespace {
-void checkDatabarPositiveColor(ScConditionalFormat* pFormat, const Color& rColor)
+void checkDatabarPositiveColor(const ScConditionalFormat* pFormat, const Color& rColor)
{
CPPUNIT_ASSERT(pFormat);
const ScFormatEntry* pEntry = pFormat->GetEntry(0);
@@ -2741,7 +2741,7 @@ void ScFiltersTest::testCondFormatThemeColor3XLSX()
namespace {
-void testComplexIconSetsXLSX_Impl(ScDocument& rDoc, SCCOL nCol, ScIconSetType eType)
+void testComplexIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, ScIconSetType eType)
{
ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 0);
CPPUNIT_ASSERT(pFormat);
@@ -2753,7 +2753,7 @@ void testComplexIconSetsXLSX_Impl(ScDocument& rDoc, SCCOL nCol, ScIconSetType eT
CPPUNIT_ASSERT_EQUAL(eType, pIconSet->GetIconSetData()->eIconSetType);
}
-void testCustomIconSetsXLSX_Impl(ScDocument& rDoc, SCCOL nCol, SCROW nRow, ScIconSetType eType, sal_Int32 nIndex)
+void testCustomIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, SCROW nRow, ScIconSetType eType, sal_Int32 nIndex)
{
ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 1);
CPPUNIT_ASSERT(pFormat);
@@ -3869,7 +3869,7 @@ void ScFiltersTest::testAutofilterXLSX()
namespace {
-void checkValidationFormula(const ScAddress& rPos, ScDocument& rDoc, const OUString& rExpectedFormula)
+void checkValidationFormula(const ScAddress& rPos, const ScDocument& rDoc, const OUString& rExpectedFormula)
{
const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(rDoc.GetAttr(rPos, ATTR_VALIDDATA) );
CPPUNIT_ASSERT(pItem);
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 3d7aba5d1b26..fd9c71197ded 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -686,7 +686,7 @@ void ScTiledRenderingTest::testUndoShells()
comphelper::LibreOfficeKit::setActive(false);
}
-bool lcl_hasEditView(ScViewData& rViewData)
+bool lcl_hasEditView(const ScViewData& rViewData)
{
bool bResult = false;
for (unsigned int i=0; i<4; i++)
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 41b6c32038d4..f0ea8169412b 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -299,7 +299,7 @@ void Test::testSharedStringPoolUndoDoc()
{
struct
{
- bool check( ScDocument& rSrcDoc, ScDocument& rCopyDoc )
+ bool check( const ScDocument& rSrcDoc, ScDocument& rCopyDoc )
{
// Copy A1:A4 to the undo document.
for (SCROW i = 0; i <= 4; ++i)
diff --git a/sc/source/ui/miscdlgs/datatableview.cxx b/sc/source/ui/miscdlgs/datatableview.cxx
index 2d8c65267180..d149713ca347 100644
--- a/sc/source/ui/miscdlgs/datatableview.cxx
+++ b/sc/source/ui/miscdlgs/datatableview.cxx
@@ -174,7 +174,7 @@ void ScDataTableView::MouseButtonDown(const MouseEvent& rMEvt)
namespace {
-SCCOL findColFromPos(sal_uInt16 nPixelPos, ScDocument* pDoc, SCCOL nStartCol = 0)
+SCCOL findColFromPos(sal_uInt16 nPixelPos, const ScDocument* pDoc, SCCOL nStartCol = 0)
{
nPixelPos -= nRowHeaderWidth;
sal_uInt32 nPixelLength = 0;
@@ -194,7 +194,7 @@ SCCOL findColFromPos(sal_uInt16 nPixelPos, ScDocument* pDoc, SCCOL nStartCol = 0
return -1;
}
-SCROW findRowFromPos(sal_uInt16 nPixelPos, ScDocument* pDoc, SCROW nStartRow = 0)
+SCROW findRowFromPos(sal_uInt16 nPixelPos, const ScDocument* pDoc, SCROW nStartRow = 0)
{
nPixelPos -= nColHeaderHeight;
sal_uInt32 nPixelLength = 0;
diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx
index 70407bc60ec6..343461f493bd 100644
--- a/sd/qa/unit/HtmlExportTest.cxx
+++ b/sd/qa/unit/HtmlExportTest.cxx
@@ -17,7 +17,7 @@ using namespace css;
class SdHTMLFilterTest : public SdModelTestBase, public XmlTestTools, public HtmlTestTools
{
private:
- htmlDocPtr exportAndParseHtml(sd::DrawDocShellRef& xDocShRef)
+ htmlDocPtr exportAndParseHtml(sd::DrawDocShellRef const & xDocShRef)
{
FileFormat* pFormat = getFormat(HTML);
OUString aExt = "." + OUString::createFromAscii(pFormat->pName);
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 9cf3a557e4a0..cd32300cef74 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -851,7 +851,7 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
}
}
-void SlotManager::RenameSlide(SfxRequest& rRequest)
+void SlotManager::RenameSlide(const SfxRequest& rRequest)
{
View* pDrView = &mrSlideSorter.GetView();
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
index 1ca42fcd6cb6..9c8b950c8391 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
@@ -81,7 +81,7 @@ private:
/** The implementation is a copy of the code for SID_RENAMEPAGE in
drviews2.cxx.
*/
- void RenameSlide( SfxRequest& rRequest );
+ void RenameSlide( const SfxRequest& rRequest );
DECL_LINK(RenameSlideHdl, AbstractSvxNameDialog&, bool);
bool RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const OUString& rName);
diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx
index 263adae27501..aaa8a911d00e 100644
--- a/sw/qa/core/Test-BigPtrArray.cxx
+++ b/sw/qa/core/Test-BigPtrArray.cxx
@@ -75,7 +75,7 @@ namespace /* private */
return true;
}
- void releaseBigPtrArrayContent(BigPtrArray& bparr)
+ void releaseBigPtrArrayContent(BigPtrArray const & bparr)
{
for (sal_uLong i = 0; i < bparr.Count(); i++)
delete bparr[i];
diff --git a/sw/qa/core/test_ToxTextGenerator.cxx b/sw/qa/core/test_ToxTextGenerator.cxx
index 9df7b50d1a21..0803d21be61d 100644
--- a/sw/qa/core/test_ToxTextGenerator.cxx
+++ b/sw/qa/core/test_ToxTextGenerator.cxx
@@ -115,7 +115,7 @@ public:
class ToxTextGeneratorWithMockedChapterField : public ToxTextGenerator {
public:
- explicit ToxTextGeneratorWithMockedChapterField(SwForm &form)
+ explicit ToxTextGeneratorWithMockedChapterField(SwForm const &form)
: ToxTextGenerator(form, std::make_shared<MockedToxTabStopTokenHandler>()),
mChapterFieldType(), mChapterField(&mChapterFieldType) {}
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index e3bddb2d887d..d619d94282a0 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -1451,7 +1451,7 @@ void SwDocTest::testTableAutoFormats()
}
static OUString
-translitTest(SwDoc & rDoc, SwPaM & rPaM, TransliterationFlags const nType)
+translitTest(SwDoc & rDoc, const SwPaM & rPaM, TransliterationFlags const nType)
{
utl::TransliterationWrapper aTrans(
::comphelper::getProcessComponentContext(), nType);
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 1f93b06fa34f..30bb7462b725 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -623,7 +623,7 @@ DECLARE_OOXMLIMPORT_TEST(testGroupshapeSdt, "groupshape-sdt.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(20), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xShape->getText()), 1), "CharKerning"));
}
-void lcl_countTextFrames(css::uno::Reference< lang::XComponent >& xComponent,
+void lcl_countTextFrames(const css::uno::Reference< lang::XComponent >& xComponent,
sal_Int32 nExpected )
{
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(xComponent, uno::UNO_QUERY);
More information about the Libreoffice-commits
mailing list