diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-29 12:43:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-30 06:57:26 +0000 |
commit | 4d87443bf59c3242d58b56cc1583d73213ae1f2f (patch) | |
tree | c1f74fc569506299100b5063f14c09e46035a943 /oox | |
parent | 8e812b87ff7f8c5bf2c6f8858646c55effd2eea3 (diff) |
loplugin:constantparam
Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c
Reviewed-on: https://gerrit.libreoffice.org/29321
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 5 | ||||
-rw-r--r-- | oox/source/helper/binaryinputstream.cxx | 6 | ||||
-rw-r--r-- | oox/source/ole/axcontrol.cxx | 4 | ||||
-rw-r--r-- | oox/source/ole/vbaexport.cxx | 21 | ||||
-rw-r--r-- | oox/source/ole/vbaproject.cxx | 6 | ||||
-rw-r--r-- | oox/source/ppt/pptshape.cxx | 5 | ||||
-rw-r--r-- | oox/source/ppt/slidepersist.cxx | 2 |
7 files changed, 22 insertions, 27 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 55e429178e1b..3fbe3515bd1b 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -321,14 +321,13 @@ void Shape::addChildren( ::oox::core::XmlFilterBase& rFilterBase, const Theme* pTheme, const Reference< XShapes >& rxShapes, basegfx::B2DHomMatrix& aTransformation, - const awt::Rectangle* pShapeRect, - ShapeIdMap* pShapeMap ) + const awt::Rectangle* pShapeRect ) { addChildren(rFilterBase, *this, pTheme, rxShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), - pShapeMap, aTransformation); + nullptr, aTransformation); } struct ActionLockGuard diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx index 65de093af611..e3f300a604df 100644 --- a/oox/source/helper/binaryinputstream.cxx +++ b/oox/source/helper/binaryinputstream.cxx @@ -95,12 +95,12 @@ OUString BinaryInputStream::readUnicodeArray( sal_Int32 nChars, bool bAllowNulCh return aStringBuffer.makeStringAndClear(); } -OUString BinaryInputStream::readCompressedUnicodeArray( sal_Int32 nChars, bool bCompressed, bool bAllowNulChars ) +OUString BinaryInputStream::readCompressedUnicodeArray( sal_Int32 nChars, bool bCompressed ) { return bCompressed ? // ISO-8859-1 maps all byte values 0xHH to the same Unicode code point U+00HH - readCharArrayUC( nChars, RTL_TEXTENCODING_ISO_8859_1, bAllowNulChars ) : - readUnicodeArray( nChars, bAllowNulChars ); + readCharArrayUC( nChars, RTL_TEXTENCODING_ISO_8859_1 ) : + readUnicodeArray( nChars ); } void BinaryInputStream::copyToStream( BinaryOutputStream& rOutStrm ) diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 92a9aa1c6851..69ab00395709 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -2674,8 +2674,8 @@ void EmbeddedControl::convertFromProperties( const Reference< XControlModel >& r } EmbeddedForm::EmbeddedForm( const Reference< XModel >& rxDocModel, - const Reference< XDrawPage >& rxDrawPage, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : - maControlConv( rxDocModel, rGraphicHelper, bDefaultColorBgr ), + const Reference< XDrawPage >& rxDrawPage, const GraphicHelper& rGraphicHelper ) : + maControlConv( rxDocModel, rGraphicHelper, true/*bDefaultColorBgr*/ ), mxModelFactory( rxDocModel, UNO_QUERY ), mxFormsSupp( rxDrawPage, UNO_QUERY ) { diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx index 7272757754a8..dec660eccd96 100644 --- a/oox/source/ole/vbaexport.cxx +++ b/oox/source/ole/vbaexport.cxx @@ -395,7 +395,7 @@ void VBACompression::write() // section 2.4.3 #if VBA_ENCRYPTION -VBAEncryption::VBAEncryption(const sal_uInt8* pData, const sal_uInt16 length, SvStream& rEncryptedData, sal_uInt8* pSeed, sal_uInt8 nProjKey) +VBAEncryption::VBAEncryption(const sal_uInt8* pData, const sal_uInt16 length, SvStream& rEncryptedData, sal_uInt8 nProjKey) :mpData(pData) ,mnLength(length) ,mrEncryptedData(rEncryptedData) @@ -404,16 +404,13 @@ VBAEncryption::VBAEncryption(const sal_uInt8* pData, const sal_uInt16 length, Sv ,mnEncryptedByte2(0) ,mnProjKey(nProjKey) ,mnIgnoredLength(0) - ,mnSeed(pSeed ? *pSeed : 0x00) + ,mnSeed(0x00) ,mnVersionEnc(0) { - if (!pSeed) - { - std::random_device rd; - std::mt19937 gen(rd()); - std::uniform_int_distribution<> dis(0, 255); - mnSeed = dis(gen); - } + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(0, 255); + mnSeed = dis(gen); } void VBAEncryption::writeSeed() @@ -915,7 +912,7 @@ void exportPROJECTStream(SvStream& rStrm, const css::uno::Reference<css::contain aProtectedStream.WriteUInt32(0x00000000); const sal_uInt8* pData = static_cast<const sal_uInt8*>(aProtectedStream.GetData()); sal_uInt8 nProjKey = VBAEncryption::calculateProjKey(aProjectID); - VBAEncryption aProtectionState(pData, 4, rStrm, nullptr, nProjKey); + VBAEncryption aProtectionState(pData, 4, rStrm, nProjKey); aProtectionState.write(); exportString(rStrm, "\"\r\n"); #else @@ -928,7 +925,7 @@ void exportPROJECTStream(SvStream& rStrm, const css::uno::Reference<css::contain aProtectedStream.Seek(0); aProtectedStream.WriteUInt8(0x00); pData = static_cast<const sal_uInt8*>(aProtectedStream.GetData()); - VBAEncryption aProjectPassword(pData, 1, rStrm, nullptr, nProjKey); + VBAEncryption aProjectPassword(pData, 1, rStrm, nProjKey); aProjectPassword.write(); exportString(rStrm, "\"\r\n"); #else @@ -941,7 +938,7 @@ void exportPROJECTStream(SvStream& rStrm, const css::uno::Reference<css::contain aProtectedStream.Seek(0); aProtectedStream.WriteUInt8(0xFF); pData = static_cast<const sal_uInt8*>(aProtectedStream.GetData()); - VBAEncryption aVisibilityState(pData, 1, rStrm, nullptr, nProjKey); + VBAEncryption aVisibilityState(pData, 1, rStrm, nProjKey); aVisibilityState.write(); exportString(rStrm, "\"\r\n\r\n"); #else diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index 0642a8a5324e..54711172fa98 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -174,7 +174,7 @@ void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper { // load the code modules and forms if( isImportVba() ) - importVba( rVbaPrjStrg, rGraphicHelper, true/*bDefaultColorBgr*/ ); + importVba( rVbaPrjStrg, rGraphicHelper ); // copy entire storage into model if( isExportVba() ) copyStorage( rVbaPrjStrg ); @@ -249,10 +249,10 @@ Reference< XNameContainer > const & VbaProject::createDialogLibrary() return mxDialogLib; } -void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) +void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGraphicHelper ) { readVbaModules( rVbaPrjStrg ); - importModulesAndForms(rVbaPrjStrg, rGraphicHelper, bDefaultColorBgr ); + importModulesAndForms(rVbaPrjStrg, rGraphicHelper ); } void VbaProject::readVbaModules( StorageBase& rVbaPrjStrg ) diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index a1600c259665..71f6428ff596 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -114,7 +114,6 @@ void PPTShape::addShape( const oox::drawingml::Theme* pTheme, const Reference< XShapes >& rxShapes, basegfx::B2DHomMatrix& aTransformation, - const awt::Rectangle* pShapeRect, ::oox::drawingml::ShapeIdMap* pShapeMap ) { SAL_INFO("oox.ppt","add shape id: " << msId << " location: " << ((meShapeLocation == Master) ? "master" : ((meShapeLocation == Slide) ? "slide" : ((meShapeLocation == Layout) ? "layout" : "other"))) << " subtype: " << mnSubType << " service: " << msServiceName); @@ -333,7 +332,7 @@ void PPTShape::addShape( } else setMasterTextListStyle( aMasterTextListStyle ); - Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText, mpPlaceholder.get() != nullptr, aTransformation, getFillProperties() ) ); + Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, nullptr, bClearText, mpPlaceholder.get() != nullptr, aTransformation, getFillProperties() ) ); if (!rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && ((sal_Int32)mnSubType == XML_title)) { try @@ -369,7 +368,7 @@ void PPTShape::addShape( // if this is a group shape, we have to add also each child shape Reference<XShapes> xShapes(xShape, UNO_QUERY); if (xShapes.is()) - addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap, aTransformation ); + addChildren( rFilterBase, *this, pTheme, xShapes, awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap, aTransformation ); } } catch (const Exception&) diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 37ff18324420..ec7932548824 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -145,7 +145,7 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) PPTShape* pPPTShape = dynamic_cast< PPTShape* >( (*aChildIter).get() ); basegfx::B2DHomMatrix aTransformation; if ( pPPTShape ) - pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, nullptr, &getShapeMap() ); + pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, &getShapeMap() ); else (*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), nullptr, &getShapeMap() ); } |