From 98c4cd372bf0e9d4b5b129405f5af4562d8a0f64 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 15 May 2017 11:27:44 +0200 Subject: loplugin:unusedfields improve write-only analysis by whitelisting a couple of methods we know only write to their parameters Change-Id: Id7aef9c03c23d10c27707b21eb9a0db4a6c2757c Reviewed-on: https://gerrit.libreoffice.org/37647 Tested-by: Jenkins Reviewed-by: Noel Grandin --- starmath/source/mathtype.cxx | 7 ++++++- starmath/source/mathtype.hxx | 15 --------------- 2 files changed, 6 insertions(+), 16 deletions(-) (limited to 'starmath') diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 7411912b7fa4..4a4f84a4dacf 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -565,6 +565,10 @@ bool MathType::Parse(SotStorage *pStor) EQNOLEFILEHDR aHdr; aHdr.Read(pS); + sal_uInt8 nProdVersion; + sal_uInt8 nProdSubVersion; + sal_uInt8 nPlatform; + sal_uInt8 nProduct; pS->ReadUChar( nVersion ); pS->ReadUChar( nPlatform ); pS->ReadUChar( nProduct ); @@ -2640,6 +2644,7 @@ void MathType::HandleOperator(SmNode *pNode,int nLevel) bool MathType::HandlePile(int &rSetAlign, int nLevel, sal_uInt8 nSelector, sal_uInt8 nVariation) { + sal_uInt8 nVAlign; pS->ReadUChar( nHAlign ); pS->ReadUChar( nVAlign ); @@ -2660,7 +2665,7 @@ bool MathType::HandlePile(int &rSetAlign, int nLevel, sal_uInt8 nSelector, sal_u bool MathType::HandleMatrix(int nLevel, sal_uInt8 nSelector, sal_uInt8 nVariation) { - sal_uInt8 nH_just,nV_just,nRows,nCols; + sal_uInt8 nH_just,nV_just,nRows,nCols,nVAlign; pS->ReadUChar( nVAlign ); pS->ReadUChar( nH_just ); pS->ReadUChar( nV_just ); diff --git a/starmath/source/mathtype.hxx b/starmath/source/mathtype.hxx index 2e617a155339..2fd259fd81f7 100644 --- a/starmath/source/mathtype.hxx +++ b/starmath/source/mathtype.hxx @@ -55,15 +55,10 @@ class MathType public: explicit MathType(OUString &rIn) : nVersion(0) - , nPlatform(0) - , nProduct(0) - , nProdVersion(0) - , nProdSubVersion(0) , pS(nullptr) , rRet(rIn) , pTree(nullptr) , nHAlign(0) - , nVAlign(0) , nPendingAttributes(0) , nInsertion(0) , nLSize(0) @@ -81,15 +76,10 @@ public: MathType(OUString &rIn,SmNode *pIn) : nVersion(0) - , nPlatform(0) - , nProduct(0) - , nProdVersion(0) - , nProdSubVersion(0) , pS(nullptr) , rRet(rIn) , pTree(pIn) , nHAlign(2) - , nVAlign(0) , nPendingAttributes(0) , nInsertion(0) , nLSize(0) @@ -111,10 +101,6 @@ public: private: /*Ver 2 Header*/ sal_uInt8 nVersion; - sal_uInt8 nPlatform; - sal_uInt8 nProduct; - sal_uInt8 nProdVersion; - sal_uInt8 nProdSubVersion; SotStorageStream *pS; @@ -164,7 +150,6 @@ private: SmNode *pTree; sal_uInt8 nHAlign; - sal_uInt8 nVAlign; int nPendingAttributes; sal_uLong nInsertion; -- cgit