sc/inc/address.hxx | 8 ++++---- sc/qa/unit/ucalc_formula.cxx | 4 ---- sc/source/core/data/column2.cxx | 10 +++------- sc/source/core/data/conditio.cxx | 1 - sc/source/core/data/documen5.cxx | 1 - sc/source/core/tool/address.cxx | 1 - sc/source/ui/miscdlgs/acredlin.cxx | 2 -- sc/source/ui/miscdlgs/highred.cxx | 2 -- sc/source/ui/namedlg/namedlg.cxx | 2 -- sc/source/ui/vba/vbanames.cxx | 3 +-- sc/source/ui/view/printfun.cxx | 1 - sw/inc/index.hxx | 4 ++-- sw/inc/pam.hxx | 4 ++-- sw/inc/ring.hxx | 4 ++-- sw/qa/core/uwriter.cxx | 1 - sw/source/core/access/accpara.cxx | 2 -- sw/source/core/doc/doc.cxx | 9 +++------ sw/source/core/doc/docredln.cxx | 1 - sw/source/core/frmedt/fecopy.cxx | 3 --- sw/source/core/unocore/unoftn.cxx | 1 - 20 files changed, 17 insertions(+), 47 deletions(-)
New commits: commit 9e06c1b69c8d13c93c94428218c84c437422463e Author: Noel Grandin <[email protected]> Date: Tue Apr 11 12:21:28 2017 +0200 add SAL_WARN_UNUSED to sw::Ring and friends Change-Id: Ic90e4357089c1f487dd5738f9c14862ce95d611d Reviewed-on: https://gerrit.libreoffice.org/36408 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index fecfa983b6b9..84320219cd07 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -34,7 +34,7 @@ class IMark; } /// Marks a character position inside a document model node. -class SW_DLLPUBLIC SwIndex +class SAL_WARN_UNUSED SW_DLLPUBLIC SwIndex { private: friend class SwIndexReg; @@ -107,7 +107,7 @@ public: SW_DLLPUBLIC std::ostream& operator <<(std::ostream& s, const SwIndex& index); -class SwIndexReg +class SAL_WARN_UNUSED SwIndexReg { friend class SwIndex; friend bool sw_PosOk(const SwPosition & aPos); diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index 2fe0e6acb310..380cc878ed72 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -46,7 +46,7 @@ namespace utl { } /// Marks a position in the document model. -struct SW_DLLPUBLIC SwPosition +struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition { SwNodeIndex nNode; SwIndex nContent; @@ -147,7 +147,7 @@ SW_DLLPUBLIC bool GoInContentSkipHidden( SwPaM&, SwMoveFnCollection const &); SW_DLLPUBLIC bool GoInContentCellsSkipHidden( SwPaM&, SwMoveFnCollection const &); /// PaM is Point and Mark: a selection of the document model. -class SW_DLLPUBLIC SwPaM : public sw::Ring<SwPaM> +class SAL_WARN_UNUSED SW_DLLPUBLIC SwPaM : public sw::Ring<SwPaM> { SwPosition m_Bound1; SwPosition m_Bound2; diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx index ad9cce5c796f..a03db4c68cee 100644 --- a/sw/inc/ring.hxx +++ b/sw/inc/ring.hxx @@ -36,7 +36,7 @@ namespace sw * @example sw/qa/core/uwriter.cxx */ template <typename value_type> - class Ring + class SAL_WARN_UNUSED Ring { public: typedef typename std::add_const<value_type>::type const_value_type; @@ -148,7 +148,7 @@ namespace sw * helper class that provides Svalue_typeL-style container iteration to the ring */ template <typename value_type> - class RingContainer final + class SAL_WARN_UNUSED RingContainer final { private: /** the item in the ring where iteration starts */ diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index e0df520be313..7f2d5fb63540 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -1067,7 +1067,6 @@ void SwDocTest::randomTest() for( int i = 0; i < 2000; i++ ) { - SwPaM aPam(m_pDoc->GetNodes()); SwCursor aCrs(getRandomPosition(m_pDoc, i/20), nullptr); aCrs.SetMark(); diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 5ec175e4fb9a..722e2bb6a6fb 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1416,8 +1416,6 @@ OUString SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex) OUString strTypeName; SwFieldMgr aMgr; SwTextField* pTextField = nullptr; - SwTextNode* pTextNd = const_cast<SwTextNode*>( GetTextNode() ); - SwIndex fldIndex( pTextNd, nIndex ); sal_Int32 nFieldIndex = GetPortionData().GetFieldIndex(nIndex); if (nFieldIndex >= 0) { diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 2a2684862b29..06fc61b466fb 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1487,12 +1487,9 @@ bool SwDoc::HasInvisibleContent() const for( sal_uLong n = GetNodes().Count()-1; n; --n) { SwTextNode* pTextNd = GetNodes()[ n ]->GetTextNode(); - if ( pTextNd ) - { - SwPaM aPam(*pTextNd, 0, *pTextNd, pTextNd->GetText().getLength()); - if( pTextNd->HasHiddenCharAttribute( true ) || ( pTextNd->HasHiddenCharAttribute( false ) ) ) - return true; - } + if ( pTextNd && + ( pTextNd->HasHiddenCharAttribute( true ) || pTextNd->HasHiddenCharAttribute( false ) ) ) + return true; } for(auto pSectFormat : GetSections()) diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 314e4c84ef27..0ccc138ce105 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1431,7 +1431,6 @@ void SwRangeRedline::DelCopyOfSection(size_t nMyPos) } } - SwPosition aEnd( *pEnd ); *GetPoint() = *pEnd; *GetMark() = *pEnd; DeleteMark(); diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 2cf915eb5c29..444f4de516b3 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1045,9 +1045,6 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) // ** // ** Update SwDoc::Append, if you change the following code ** // ** - - SwPosition aInsertPosition( rInsPos ); - { SwNodeIndex aIndexBefore(rInsPos.nNode); diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index e248ae8d1190..92d77dde84d6 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -360,7 +360,6 @@ SwXFootnote::getAnchor() SwTextFootnote const*const pTextFootnote = rFormat.GetTextFootnote(); SwPaM aPam( pTextFootnote->GetTextNode(), pTextFootnote->GetStart() ); - SwPosition aMark( *aPam.Start() ); aPam.SetMark(); ++aPam.GetMark()->nContent; const uno::Reference< text::XTextRange > xRet = commit 4b57c28302def4dd56b2dc8ffb73f21b688a6534 Author: Noel Grandin <[email protected]> Date: Tue Apr 11 11:46:10 2017 +0200 tag ScAddress and friends with SAL_WARN_UNUSED Change-Id: I4ed6b1e8b4225a87fbcb863a47c84e30228b5352 Reviewed-on: https://gerrit.libreoffice.org/36407 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 8a7512678bd2..f2ac3595b6c7 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -180,7 +180,7 @@ inline void applyStartToEndFlags(ScRefFlags &target) } // ScAddress -class ScAddress +class SAL_WARN_UNUSED ScAddress { private: SCROW nRow; @@ -459,7 +459,7 @@ inline bool ValidAddress( const ScAddress& rAddress ) } // ScRange -class ScRange +class SAL_WARN_UNUSED ScRange { public: ScAddress aStart; @@ -720,7 +720,7 @@ inline bool ValidRange( const ScRange& rRange ) } // ScRangePair -class ScRangePair +class SAL_WARN_UNUSED ScRangePair { private: ScRange aRange[2]; @@ -756,7 +756,7 @@ inline ScRangePair& ScRangePair::operator= ( const ScRangePair& rRange ) } // ScRefAddress -class ScRefAddress +class SAL_WARN_UNUSED ScRefAddress { private: ScAddress aAdr; diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 5336107f0bb2..045e6976b9d8 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -5108,10 +5108,6 @@ void Test::testFuncINDIRECT2() CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (2, "baz")); - ScAddress aStart; - ScAddress aEnd; - ScAddress aRef; - m_pDoc->SetValue(0,0,0, 10.0); m_pDoc->SetValue(0,1,0, 10.0); m_pDoc->SetValue(0,2,0, 10.0); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 58206e30dda5..c73dbdbd73d6 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -2222,15 +2222,13 @@ class FillMatrixHandler size_t mnMatCol; size_t mnTopRow; - SCCOL mnCol; - SCTAB mnTab; ScDocument* mpDoc; svl::SharedStringPool& mrPool; svl::SharedStringPool* mpPool; // if matrix is not in the same document public: - FillMatrixHandler(ScMatrix& rMat, size_t nMatCol, size_t nTopRow, SCCOL nCol, SCTAB nTab, ScDocument* pDoc, svl::SharedStringPool* pPool) : - mrMat(rMat), mnMatCol(nMatCol), mnTopRow(nTopRow), mnCol(nCol), mnTab(nTab), + FillMatrixHandler(ScMatrix& rMat, size_t nMatCol, size_t nTopRow, ScDocument* pDoc, svl::SharedStringPool* pPool) : + mrMat(rMat), mnMatCol(nMatCol), mnTopRow(nTopRow), mpDoc(pDoc), mrPool(pDoc->GetSharedStringPool()), mpPool(pPool) {} void operator() (const sc::CellStoreType::value_type& node, size_t nOffset, size_t nDataSize) @@ -2320,8 +2318,6 @@ public: double fVal; if (rCell.GetErrorOrValue(nErr, fVal)) { - ScAddress aAdr(mnCol, nThisRow, mnTab); - if (nErr != FormulaError::NONE) fVal = CreateDoubleError(nErr); @@ -2370,7 +2366,7 @@ public: void ScColumn::FillMatrix( ScMatrix& rMat, size_t nMatCol, SCROW nRow1, SCROW nRow2, svl::SharedStringPool* pPool ) const { - FillMatrixHandler aFunc(rMat, nMatCol, nRow1, nCol, nTab, pDocument, pPool); + FillMatrixHandler aFunc(rMat, nMatCol, nRow1, pDocument, pPool); sc::ParseBlock(maCells.begin(), maCells, aFunc, nRow1, nRow2); } diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index a2b2f1886b60..ea0762295e87 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1375,7 +1375,6 @@ ScTokenArray* ScConditionEntry::CreateFlatCopiedTokenArray( sal_uInt16 nIndex ) { assert(nIndex <= 1); ScTokenArray* pRet = nullptr; - ScAddress aAddr; if ( nIndex==0 ) { diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index 09a4162da72c..31eaf827911f 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -123,7 +123,6 @@ void ScDocument::UpdateAllCharts() SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); OSL_ENSURE(pPage,"Page ?"); - ScRange aRange; SdrObjListIter aIter( *pPage, SdrIterMode::DeepNoGroups ); SdrObject* pObject = aIter.Next(); while (pObject) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index ad82b72a2218..72b1862f221d 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1146,7 +1146,6 @@ static ScRefFlags lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDo OUString aTab; bool bExtDoc = false; bool bExtDocInherited = false; - const ScAddress aCurPos(rAddr); // Lets see if this is a reference to something in an external file. A // document name is always quoted and has a trailing #. diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 5130dc0411cc..20f6f5286c11 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -200,8 +200,6 @@ void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData) void ScAcceptChgDlg::Init() { - ScRange aRange; - OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" ); ScChangeTrack* pChanges=pDoc->GetChangeTrack(); diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index a08f8e9eb489..25f9224f1e33 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -78,8 +78,6 @@ void ScHighlightChgDlg::dispose() void ScHighlightChgDlg::Init() { - ScRange aRange; - OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" ); ScChangeTrack* pChanges=pDoc->GetChangeTrack(); diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index c6162534bc6f..2aac5a9a3ae9 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -122,8 +122,6 @@ void ScNameDlg::dispose() void ScNameDlg::Init() { - ScRange aRange; - OSL_ENSURE( mpViewData && mpDoc, "ViewData or Document not found!" ); //init UI diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx index c366521f81e0..4717fcf6611f 100644 --- a/sc/source/ui/vba/vbanames.cxx +++ b/sc/source/ui/vba/vbanames.cxx @@ -198,8 +198,7 @@ ScVbaNames::Add( const css::uno::Any& Name , uno::Reference< sheet::XCellRangeAddressable > thisRangeAdd( aAny, ::uno::UNO_QUERY_THROW); table::CellRangeAddress aAddr = thisRangeAdd->getRangeAddress(); - ScAddress aPos( static_cast< SCCOL >( aAddr.StartColumn ) , static_cast< SCROW >( aAddr.StartRow ) , static_cast< SCTAB >(aAddr.Sheet ) ); - uno::Any aAny2 ; + uno::Any aAny2; if ( mxNames.is() ) { sal_Int32 nUnoType = 0; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 082ca8400712..6c99a32a6605 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -476,7 +476,6 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr long nDevSizeY = aRect.Bottom()-aRect.Top()+1; tools::Rectangle aLines; - ScRange aRange( nX1,nY1,nTab, nX2,nY2,nTab ); long nTwipsSizeX = 0; for (SCCOL i=nX1; i<=nX2; i++) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
