From 0d1253c2328106a443d16b6c8e96347de33e2ace Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 24 Jan 2019 09:08:34 +0200 Subject: new loplugin writeonlyvars largely based on the relevant portion of the unusedfields loplugin, but adapted for local vars Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1 Reviewed-on: https://gerrit.libreoffice.org/66835 Tested-by: Jenkins Reviewed-by: Noel Grandin --- dbaccess/source/filter/xml/xmlExport.cxx | 2 -- dbaccess/source/filter/xml/xmlfilter.cxx | 5 ----- dbaccess/source/ui/browser/unodatbr.cxx | 2 -- dbaccess/source/ui/misc/RowSetDrop.cxx | 4 ---- dbaccess/source/ui/misc/TokenWriter.cxx | 2 -- dbaccess/source/ui/relationdesign/RTableConnectionData.cxx | 2 -- 6 files changed, 17 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 1915b6815b91..53363f09d6fd 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -398,8 +398,6 @@ void ODBExport::exportDataSource() // special handlings if ( pProperties->Name == PROPERTY_BOOLEANCOMPARISONMODE ) { - sal_Int32 nValue = 0; - aValue >>= nValue; if ( sValue == "0" ) sValue = "equal-integer"; else if ( sValue == "1" ) diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 2be6e6d7be65..a0fabc0d02d8 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -159,7 +159,6 @@ static ErrCode ReadThroughComponent( try { - bool bEncrypted = false; // open stream (and set parser input) OUString sStreamName = OUString::createFromAscii(pStreamName); if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) ) @@ -179,10 +178,6 @@ static ErrCode ReadThroughComponent( // get input stream xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ ); - - uno::Reference< beans::XPropertySet > xProps( xDocStream, uno::UNO_QUERY_THROW ); - uno::Any aAny = xProps->getPropertyValue("Encrypted"); - aAny >>= bEncrypted; } catch (const packages::WrongPasswordException&) { diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index e4528d487620..d366b3a4618f 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2963,8 +2963,6 @@ void SbaTableQueryBrowser::unloadAndCleanup( bool _bDisposeConnection ) { // get the active connection. We need to dispose it. Reference< XPropertySet > xRowSetProps(getRowSet(),UNO_QUERY); - Reference< XConnection > xConn; - xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION) >>= xConn; #if OSL_DEBUG_LEVEL > 0 { Reference< XComponent > xComp( diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 12964ce0d786..8b596b137839 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -121,8 +121,6 @@ bool ORowSetImportExport::Read() { Reference xProp(m_xResultSet,UNO_QUERY); sal_Int32 nRowCount = 0; - sal_Int32 nCurrentRow = 0; - sal_Int32 nRowFilterIndex = 0; if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_ISROWCOUNTFINAL) ) { bool bFinal = false; @@ -141,8 +139,6 @@ bool ORowSetImportExport::Read() while(m_xResultSet.is() && m_xResultSet->next() && bContinue && nRowCount ) { --nRowCount; - ++nCurrentRow; - ++nRowFilterIndex; bContinue = insertNewRow(); } } diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 029856bb066e..28a316ac7621 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -815,7 +815,6 @@ void OHTMLImportExport::WriteTables() // 2. and now the data Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY); - sal_Int32 j=1; sal_Int32 kk=0; m_xResultSet->beforeFirst(); // set back before the first row while(m_xResultSet->next()) @@ -846,7 +845,6 @@ void OHTMLImportExport::WriteTables() } WriteCell(pFormat[i-1],pColWidth[i-1],nHeight,pHorJustify[i-1],aValue,OOO_STRING_SVTOOLS_HTML_tabledata); } - ++j; TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_tablerow ); } } diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx index 226cf4bb9c19..e07197ff734a 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx @@ -311,8 +311,6 @@ bool ORelationTableConnectionData::Update() OSL_ENSURE(xKey.is(),"Key is not valid!"); if ( xKey.is() ) { - sal_Int32 nType = 0; - xKey->getPropertyValue(PROPERTY_TYPE) >>= nType; OUString sReferencedTable; xKey->getPropertyValue(PROPERTY_REFERENCEDTABLE) >>= sReferencedTable; if ( sReferencedTable == getReferencedTable()->GetTableName() ) -- cgit v1.2.3