summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-25 18:20:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-26 08:56:47 +0200
commit979c8c56b7d52fe9a5d4b1fbfdab0adaba04c470 (patch)
treede5942b227fb6f441e1f36878a030a1b13601ba0 /oox
parentc2d139d8fa92e44baf592cd8ce644dc66356e143 (diff)
loplugin:oncevar in oox..sax
Change-Id: I0fee8bcddaeea48335e3be05761d2ad2c45020e2 Reviewed-on: https://gerrit.libreoffice.org/39238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/qa/unit/vba_encryption.cxx2
-rw-r--r--oox/source/core/binarycodec.cxx4
-rw-r--r--oox/source/crypto/Standard2007Engine.cxx3
-rw-r--r--oox/source/drawingml/shape.cxx5
-rw-r--r--oox/source/export/ColorPropertySet.cxx3
-rw-r--r--oox/source/export/chartexport.cxx15
-rw-r--r--oox/source/export/shapes.cxx3
-rw-r--r--oox/source/ole/olehelper.cxx2
8 files changed, 12 insertions, 25 deletions
diff --git a/oox/qa/unit/vba_encryption.cxx b/oox/qa/unit/vba_encryption.cxx
index 37dfeff636f4..60164cb4bc32 100644
--- a/oox/qa/unit/vba_encryption.cxx
+++ b/oox/qa/unit/vba_encryption.cxx
@@ -73,7 +73,7 @@ void TestVbaEncryption::testSimple2()
void TestVbaEncryption::testProjKey1()
{
- OUString aProjectID("{917DED54-440B-4FD1-A5C1-74ACF261E600}");
+ OUString const aProjectID("{917DED54-440B-4FD1-A5C1-74ACF261E600}");
sal_uInt8 nProjKey = VBAEncryption::calculateProjKey(aProjectID);
CPPUNIT_ASSERT_EQUAL((int)0xdf, (int)nProjKey);
}
diff --git a/oox/source/core/binarycodec.cxx b/oox/source/core/binarycodec.cxx
index 72ae862a0f14..84660d6abb54 100644
--- a/oox/source/core/binarycodec.cxx
+++ b/oox/source/core/binarycodec.cxx
@@ -146,8 +146,6 @@ void BinaryCodec_XOR::initKey( const sal_uInt8 pnPassData[ 16 ] )
for (sal_Int32 nIndex = nLen; nIndex < static_cast<sal_Int32>(sizeof(mpnKey)); ++nIndex, ++pnFillChar )
mpnKey[ nIndex ] = *pnFillChar;
- size_t nRotateSize = 2;
-
// use little-endian base key to create key array
sal_uInt8 pnBaseKeyLE[ 2 ];
pnBaseKeyLE[ 0 ] = static_cast< sal_uInt8 >( mnBaseKey );
@@ -156,7 +154,7 @@ void BinaryCodec_XOR::initKey( const sal_uInt8 pnPassData[ 16 ] )
for (sal_Int32 nIndex = 0; nIndex < static_cast<sal_Int32>(sizeof(mpnKey)); ++nIndex, ++pnKeyChar )
{
*pnKeyChar ^= pnBaseKeyLE[ nIndex & 1 ];
- lclRotateLeft( *pnKeyChar, nRotateSize );
+ lclRotateLeft( *pnKeyChar, 2/*nRotateSize*/ );
}
}
diff --git a/oox/source/crypto/Standard2007Engine.cxx b/oox/source/crypto/Standard2007Engine.cxx
index b9c259fa02ac..a11780fddc52 100644
--- a/oox/source/crypto/Standard2007Engine.cxx
+++ b/oox/source/crypto/Standard2007Engine.cxx
@@ -203,8 +203,7 @@ void Standard2007Engine::writeEncryptionInfo(const OUString& password, BinaryXOu
rStream.writeUnicodeArray(lclCspName);
rStream.WriteUInt16(0);
- sal_uInt32 encryptionVerifierSize = static_cast<sal_uInt32>(sizeof(msfilter::EncryptionVerifierAES));
- rStream.writeMemory(&mInfo.verifier, encryptionVerifierSize);
+ rStream.writeMemory(&mInfo.verifier, sizeof(msfilter::EncryptionVerifierAES));
}
void Standard2007Engine::encrypt(BinaryXInputStream& aInputStream,
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 7d04518b5f25..a01fd47075d0 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1197,9 +1197,6 @@ Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase& rFilterBase )
Reference < io::XStream > xStream( new utl::OStreamWrapper( aTempStream ) );
Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() );
- // Rendering format
- OUString sFormat( "SVM" );
-
// Size of the rendering
awt::Size aActualSize = mxShape->getSize();
Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MapUnit::MapCM ) );
@@ -1221,7 +1218,7 @@ Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase& rFilterBase )
aDescriptor[ 0 ].Name = "OutputStream";
aDescriptor[ 0 ].Value <<= xOutputStream;
aDescriptor[ 1 ].Name = "FilterName";
- aDescriptor[ 1 ].Value <<= sFormat;
+ aDescriptor[ 1 ].Value <<= OUString("SVM"); // Rendering format
aDescriptor[ 2 ].Name = "FilterData";
aDescriptor[ 2 ].Value <<= aFilterData;
diff --git a/oox/source/export/ColorPropertySet.cxx b/oox/source/export/ColorPropertySet.cxx
index 768763bf91d4..ec25b10c3c49 100644
--- a/oox/source/export/ColorPropertySet.cxx
+++ b/oox/source/export/ColorPropertySet.cxx
@@ -120,8 +120,7 @@ uno::Any SAL_CALL ColorPropertySet::getPropertyValue( const OUString& aPropertyN
{
if( aPropertyName == "FillStyle" && m_bIsFillColor )
{
- css::drawing::FillStyle aFillStyle = css::drawing::FillStyle_SOLID;
- return uno::makeAny(aFillStyle);
+ return uno::makeAny(css::drawing::FillStyle_SOLID);
}
else if (aPropertyName == m_aColorPropName)
return uno::makeAny( m_nColor );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index d893cc678cb8..2d2d5fdd3536 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -781,8 +781,7 @@ void ChartExport::exportExternalData( const Reference< css::chart::XChartDocumen
// Converting absolute path to relative path.
if( externalDataPath[ 0 ] != '.' && externalDataPath[ 1 ] != '.')
{
- sal_Int32 nStartPos = 0;
- sal_Int32 nSepPos = externalDataPath.indexOf( '/', nStartPos );
+ sal_Int32 nSepPos = externalDataPath.indexOf( '/', 0 );
if( nSepPos > 0)
{
relationPath = relationPath.copy( nSepPos, ::std::max< sal_Int32 >( externalDataPath.getLength(), 0 ) - nSepPos );
@@ -1630,9 +1629,8 @@ void ChartExport::exportDoughnutChart( const Reference< chart2::XChartType >& xC
// firstSliceAng
exportFirstSliceAng( );
//FIXME: holeSize
- sal_Int32 nHoleSize = 50;
pFS->singleElement( FSNS( XML_c, XML_holeSize ),
- XML_val, I32S( nHoleSize ),
+ XML_val, I32S( 50 ),
FSEND );
pFS->endElement( FSNS( XML_c, XML_doughnutChart ) );
@@ -1876,9 +1874,8 @@ void ChartExport::exportUpDownBars( const Reference< chart2::XChartType >& xChar
pFS->startElement( FSNS( XML_c, XML_upDownBars ),
FSEND );
// TODO: gapWidth
- sal_Int32 nGapWidth = 150;
pFS->singleElement( FSNS( XML_c, XML_gapWidth ),
- XML_val, I32S( nGapWidth ),
+ XML_val, I32S( 150 ),
FSEND );
Reference< beans::XPropertySet > xChartPropSet = xChartPropProvider->getUpBar();
@@ -2626,9 +2623,8 @@ void ChartExport::_exportAxis(
if( bLogarithmic )
{
// default value is 10?
- sal_Int32 nLogBase = 10;
pFS->singleElement( FSNS( XML_c, XML_logBase ),
- XML_val, I32S( nLogBase ),
+ XML_val, I32S( 10 ),
FSEND );
}
}
@@ -2871,9 +2867,8 @@ void ChartExport::_exportAxis(
}
// FIXME: seems not support? lblOffset
- sal_Int32 nLblOffset = 100;
pFS->singleElement( FSNS( XML_c, XML_lblOffset ),
- XML_val, I32S( nLblOffset ),
+ XML_val, I32S( 100 ),
FSEND );
}
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 4775b1bfb901..ff909e7bc625 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -970,9 +970,8 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV );
if( nAdjustmentValuesIndex != -1 )
{
- sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
WritePresetShape( sPresetShape, eShapeType, bPredefinedHandlesUsed,
- nAdjustmentsWhichNeedsToBeConverted, aGeometrySeq[ nAdjustmentValuesIndex ] );
+ 0/*nAdjustmentsWhichNeedsToBeConverted*/, aGeometrySeq[ nAdjustmentValuesIndex ] );
}
else
WritePresetShape( sPresetShape );
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index 285942923cc6..5c1fce46d5f9 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -172,7 +172,7 @@ classIdToGUIDCNamePairMap::classIdToGUIDCNamePairMap()
{ AX_GUID_SCROLLBAR, "ScrollBar"},
}
};
- int length = SAL_N_ELEMENTS( initialCntrlData );
+ int const length = SAL_N_ELEMENTS( initialCntrlData );
IdCntrlData* pData = initialCntrlData;
for ( int index = 0; index < length; ++index, ++pData )
mnIdToGUIDCNamePairMap[ pData->nId ] = pData->aData;