diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-15 11:27:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-16 08:45:17 +0200 |
commit | 98c4cd372bf0e9d4b5b129405f5af4562d8a0f64 (patch) | |
tree | f3aae749f01d0453a227b922a6ad3217171700d7 /filter | |
parent | 666901bc82fab69f9a80b564f97b5456d0ef684e (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/flash/swfexporter.cxx | 16 | ||||
-rw-r--r-- | filter/source/flash/swfexporter.hxx | 30 | ||||
-rw-r--r-- | filter/source/graphic/GraphicExportDialog.cxx | 5 | ||||
-rw-r--r-- | filter/source/graphic/GraphicExportDialog.hxx | 1 | ||||
-rw-r--r-- | filter/source/graphic/GraphicExportFilter.cxx | 14 | ||||
-rw-r--r-- | filter/source/graphic/GraphicExportFilter.hxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/ipcx/ipcx.cxx | 3 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 10 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 3 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.hxx | 1 | ||||
-rw-r--r-- | filter/source/svg/svgexport.cxx | 4 | ||||
-rw-r--r-- | filter/source/svg/svgfilter.hxx | 8 | ||||
-rw-r--r-- | filter/source/t602/t602filter.cxx | 17 | ||||
-rw-r--r-- | filter/source/t602/t602filter.hxx | 2 |
14 files changed, 11 insertions, 105 deletions
diff --git a/filter/source/flash/swfexporter.cxx b/filter/source/flash/swfexporter.cxx index 34d7d10bb9f9..3ec5942e0372 100644 --- a/filter/source/flash/swfexporter.cxx +++ b/filter/source/flash/swfexporter.cxx @@ -577,22 +577,6 @@ void FlashExporter::exportShape( const Reference< XShape >& xShape, bool bMaster pShapeInfo->mnWidth = aBoundRect.Width; pShapeInfo->mnHeight = aBoundRect.Height; - if( mbPresentation ) - { - xPropSet->getPropertyValue( "Bookmark" ) >>= pShapeInfo->maBookmark; - xPropSet->getPropertyValue( "DimColor" ) >>= pShapeInfo->mnDimColor; - xPropSet->getPropertyValue( "DimHide" ) >>= pShapeInfo->mbDimHide; - xPropSet->getPropertyValue( "DimPrevious" ) >>= pShapeInfo->mbDimPrev; - xPropSet->getPropertyValue( "Effect" ) >>= pShapeInfo->meEffect; - xPropSet->getPropertyValue( "PlayFull" ) >>= pShapeInfo->mbPlayFull; - xPropSet->getPropertyValue( "PresentationOrder" ) >>= pShapeInfo->mnPresOrder; - xPropSet->getPropertyValue( "Sound" ) >>= pShapeInfo->maSoundURL; - xPropSet->getPropertyValue( "SoundOn" ) >>= pShapeInfo->mbSoundOn; - xPropSet->getPropertyValue( "Speed" ) >>= pShapeInfo->meEffectSpeed; - xPropSet->getPropertyValue( "TextEffect" ) >>= pShapeInfo->meTextEffect; - xPropSet->getPropertyValue( "TransparentColor" ) >>= pShapeInfo->mnBlueScreenColor; - } - GDIMetaFile aMtf; Reference< XComponent > xComponent( xShape, UNO_QUERY ); diff --git a/filter/source/flash/swfexporter.hxx b/filter/source/flash/swfexporter.hxx index 117077a08b83..d76e56f024ae 100644 --- a/filter/source/flash/swfexporter.hxx +++ b/filter/source/flash/swfexporter.hxx @@ -64,36 +64,8 @@ public: sal_Int32 mnWidth; sal_Int32 mnHeight; - css::presentation::AnimationEffect meEffect; - css::presentation::AnimationEffect meTextEffect; - css::presentation::AnimationSpeed meEffectSpeed; - - sal_Int32 mnPresOrder; - - OUString maBookmark; - - sal_Int32 mnDimColor; - bool mbDimHide; - bool mbDimPrev; - - bool mbSoundOn; - bool mbPlayFull; - OUString maSoundURL; - - sal_Int32 mnBlueScreenColor; - ShapeInfo() : - mnID(0), mnX(0), mnY(0), mnWidth(0), mnHeight(0), - meEffect( css::presentation::AnimationEffect_NONE ), - meTextEffect( css::presentation::AnimationEffect_NONE ), - meEffectSpeed( css::presentation::AnimationSpeed_MEDIUM ), - mnPresOrder( 0 ), - mnDimColor( 0 ), - mbDimHide( false ), - mbDimPrev( false ), - mbSoundOn( false ), - mbPlayFull( false ), - mnBlueScreenColor( 0 ) {} + mnID(0), mnX(0), mnY(0), mnWidth(0), mnHeight(0) {} }; diff --git a/filter/source/graphic/GraphicExportDialog.cxx b/filter/source/graphic/GraphicExportDialog.cxx index a4318dbc65c6..b3b82ca98762 100644 --- a/filter/source/graphic/GraphicExportDialog.cxx +++ b/filter/source/graphic/GraphicExportDialog.cxx @@ -38,7 +38,6 @@ using namespace css::lang; GraphicExportDialog::GraphicExportDialog( const Reference< XComponentContext >& ) : meFieldUnit(FUNIT_NONE) - , mbExportSelection( false ) { } @@ -86,10 +85,6 @@ void GraphicExportDialog::setPropertyValues( const Sequence<PropertyValue>& aPro { maMediaDescriptor[ i ].Value >>= maFilterDataSequence; } - else if ( maMediaDescriptor[ i ].Name == "SelectionOnly" ) - { - maMediaDescriptor[ i ].Value >>= mbExportSelection; - } } } diff --git a/filter/source/graphic/GraphicExportDialog.hxx b/filter/source/graphic/GraphicExportDialog.hxx index 54e7117c8cce..bad51f9ae1ee 100644 --- a/filter/source/graphic/GraphicExportDialog.hxx +++ b/filter/source/graphic/GraphicExportDialog.hxx @@ -48,7 +48,6 @@ class GraphicExportDialog : public cppu::WeakImplHelper OUString maDialogTitle; FieldUnit meFieldUnit; - bool mbExportSelection; public: diff --git a/filter/source/graphic/GraphicExportFilter.cxx b/filter/source/graphic/GraphicExportFilter.cxx index b161e0b5cd84..65f70ba18a06 100644 --- a/filter/source/graphic/GraphicExportFilter.cxx +++ b/filter/source/graphic/GraphicExportFilter.cxx @@ -24,8 +24,7 @@ #include <svtools/DocumentToGraphicRenderer.hxx> GraphicExportFilter::GraphicExportFilter( const Reference<XComponentContext>& ) - : mExportSelection(false) - , mTargetWidth(0) + : mTargetWidth(0) , mTargetHeight(0) {} @@ -53,17 +52,6 @@ void GraphicExportFilter::gatherProperties( const Sequence<PropertyValue>& rProp { aProperty.Value >>= mFilterDataSequence; } - else if ( aProperty.Name == "SelectionOnly" ) - { - aProperty.Value >>= mExportSelection; - } - else if ( aProperty.Name == "URL" ) - { - if( !( aProperty.Value >>= mTargetUrl ) ) - { - aProperty.Value >>= mTargetUrl.Complete; - } - } else if ( aProperty.Name == "OutputStream" ) { aProperty.Value >>= mxOutputStream; diff --git a/filter/source/graphic/GraphicExportFilter.hxx b/filter/source/graphic/GraphicExportFilter.hxx index 7c7d95c4431b..6c3d7b8a8304 100644 --- a/filter/source/graphic/GraphicExportFilter.hxx +++ b/filter/source/graphic/GraphicExportFilter.hxx @@ -45,9 +45,7 @@ class GraphicExportFilter : void gatherProperties( const Sequence<PropertyValue>& rDescriptor ); - bool mExportSelection; OUString mFilterExtension; - util::URL mTargetUrl; Sequence<PropertyValue> mFilterDataSequence; diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx index 6698b5e69601..fed075ed131b 100644 --- a/filter/source/graphicfilter/ipcx/ipcx.cxx +++ b/filter/source/graphicfilter/ipcx/ipcx.cxx @@ -38,7 +38,6 @@ private: sal_uLong nBitsPerPlanePix; // bits per plane per pixel sal_uLong nPlanes; // no of planes sal_uLong nBytesPerPlaneLin; // bytes per plane line - sal_uInt16 nPaletteInfo; sal_uLong nWidth, nHeight; // dimension in pixel sal_uInt16 nResX, nResY; // resolution in pixel per inch or 0,0 @@ -67,7 +66,6 @@ PCXReader::PCXReader(SvStream &rStream) , nBitsPerPlanePix(0) , nPlanes(0) , nBytesPerPlaneLin(0) - , nPaletteInfo(0) , nWidth(0) , nHeight(0) , nResX(0) @@ -178,6 +176,7 @@ void PCXReader::ImplReadHeader() m_rPCX.ReadUChar( nbyte ); nPlanes = (sal_uLong)nbyte; sal_uInt16 nushort(0); m_rPCX.ReadUInt16( nushort ); nBytesPerPlaneLin = (sal_uLong)nushort; + sal_uInt16 nPaletteInfo; m_rPCX.ReadUInt16( nPaletteInfo ); m_rPCX.SeekRel( 58 ); diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 52b5df44ff81..4dd1519bd74f 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -390,7 +390,8 @@ DffPropertyReader::~DffPropertyReader() SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rRule ) { - rIn.ReadUInt32( rRule.nRuleId ) + sal_uInt32 nRuleId; + rIn.ReadUInt32( nRuleId ) .ReadUInt32( rRule.nShapeA ) .ReadUInt32( rRule.nShapeB ) .ReadUInt32( rRule.nShapeC ) @@ -5594,7 +5595,6 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, // files may yield to this being uninitialized maBaseURL( rBaseURL ), mnCurMaxShapeId(0), - mnDrawingsSaved(0), mnIdClusters(0), rStCtrl( rStCtrl_ ), pStData( pStData_ ), @@ -5639,7 +5639,6 @@ SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const OUString& rBaseURL ) nGroupShapeFlags(0), maBaseURL( rBaseURL ), mnCurMaxShapeId(0), - mnDrawingsSaved(0), mnIdClusters(0), rStCtrl( rStCtrl_ ), pStData( nullptr ), @@ -5720,7 +5719,7 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL ) rStCtrl.ReadUInt32( mnCurMaxShapeId ) .ReadUInt32( mnIdClusters ) .ReadUInt32( nDummy ) - .ReadUInt32( mnDrawingsSaved ); + .ReadUInt32( nDummy ); // nDrawingsSaved if ( mnIdClusters-- > 2 ) { @@ -5735,8 +5734,9 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL ) maFidcls.resize(mnIdClusters); for (sal_uInt32 i = 0; i < mnIdClusters; ++i) { + sal_uInt32 cspidCur; ///< number of SPIDs used so far rStCtrl.ReadUInt32( maFidcls[ i ].dgid ) - .ReadUInt32( maFidcls[ i ].cspidCur ); + .ReadUInt32( cspidCur ); } } } diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 4dc6a9dca0cc..2c4849fd9928 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -95,7 +95,6 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc, mnPDFTypeSelection ( 0 ), mbExportNotes ( true ), mbExportPlaceholders ( false ), - mbViewPDF ( true ), mbUseReferenceXObject ( false ), mbExportNotesPages ( false ), mbExportOnlyNotesPages ( false ), @@ -457,8 +456,6 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& rFilterData[ nData ].Value >>= mnPDFTypeSelection; else if ( rFilterData[ nData ].Name == "ExportNotes" ) rFilterData[ nData ].Value >>= mbExportNotes; - else if ( rFilterData[ nData ].Name == "ViewPDFAfterExport" ) - rFilterData[ nData ].Value >>= mbViewPDF; else if ( rFilterData[ nData ].Name == "ExportNotesPages" ) rFilterData[ nData ].Value >>= mbExportNotesPages; else if ( rFilterData[ nData ].Name == "ExportOnlyNotesPages" ) diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx index 4051cd88ff21..723742a4bb26 100644 --- a/filter/source/pdf/pdfexport.hxx +++ b/filter/source/pdf/pdfexport.hxx @@ -45,7 +45,6 @@ private: sal_Int32 mnPDFTypeSelection; bool mbExportNotes; bool mbExportPlaceholders; - bool mbViewPDF; bool mbUseReferenceXObject; bool mbExportNotesPages; bool mbExportOnlyNotesPages; diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 0687c2a3b73d..d61bb6873cdc 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1373,10 +1373,6 @@ void SVGFilter::implGetPagePropSet( const Reference< XDrawPage > & rxPage ) implSafeGetPagePropSet( "IsDateTimeFixed", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldFixed; implSafeGetPagePropSet( "DateTimeFormat", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.nDateTimeFormat; - implSafeGetPagePropSet( "Number", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.nPageNumber; - implSafeGetPagePropSet( "DateTimeText", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sDateTimeText; - implSafeGetPagePropSet( "FooterText", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sFooterText; - implSafeGetPagePropSet( "HeaderText", xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.sHeaderText; if( mVisiblePagePropSet.bIsPageNumberFieldVisible ) { diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index 4d724240f08e..cb1e9dd049cb 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -147,13 +147,9 @@ struct PagePropertySet bool bIsDateTimeFieldVisible; bool bIsFooterFieldVisible; bool bIsHeaderFieldVisible; - sal_Int32 nPageNumberingType; + sal_Int32 nPageNumberingType; bool bIsDateTimeFieldFixed; - sal_Int16 nPageNumber; - sal_Int32 nDateTimeFormat; - OUString sDateTimeText; - OUString sFooterText; - OUString sHeaderText; + sal_Int32 nDateTimeFormat; }; struct HashReferenceXInterface diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index 45ebedc2d900..fdd0e88b93ff 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -191,23 +191,8 @@ void SAL_CALL T602ImportFilter::setTargetDocument( const Reference< css::lang::X } // XInitialization -void SAL_CALL T602ImportFilter::initialize( const Sequence< Any >& aArguments ) +void SAL_CALL T602ImportFilter::initialize( const Sequence< Any >& /*aArguments*/ ) { - Sequence < PropertyValue > aAnySeq; - sal_Int32 nLength = aArguments.getLength(); - if ( nLength && ( aArguments[0] >>= aAnySeq ) ) - { - const PropertyValue * pValue = aAnySeq.getConstArray(); - nLength = aAnySeq.getLength(); - for ( sal_Int32 i = 0 ; i < nLength; i++) - { - if ( pValue[i].Name == "Type" ) - { - pValue[i].Value >>= msFilterName; - break; - } - } - } } // Other functions diff --git a/filter/source/t602/t602filter.hxx b/filter/source/t602/t602filter.hxx index 385b1b5d0d97..62d0ffe08dab 100644 --- a/filter/source/t602/t602filter.hxx +++ b/filter/source/t602/t602filter.hxx @@ -126,12 +126,10 @@ class T602ImportFilter : public cppu::WeakImplHelper < > { private: -// css::uno::Reference<css::io::XInputStream> xInputStream; css::uno::Reference<css::xml::sax::XDocumentHandler> mxHandler; css::uno::Reference< css::lang::XMultiServiceFactory > mxMSF; css::uno::Reference< css::lang::XComponent > mxDoc; css::uno::Reference < css::io::XInputStream > mxInputStream; - OUString msFilterName; SvXMLAttributeList *mpAttrList; |