diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-02 16:39:41 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-03 08:11:02 +0200 |
commit | 2b7215e6fa12cd947bdbbe195909642a850cfd69 (patch) | |
tree | dadafac588440a970fe5de3106388f6f8276b775 /oox | |
parent | fecfd9c4987229c7fb335c6c6ba847e2ec30d40d (diff) |
loplugin:unuseddefaultparams in oox
Change-Id: If05662102e161d3dd56bbb6ed3964e63ba853cf9
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/drawingml/graphicproperties.hxx | 3 | ||||
-rw-r--r-- | oox/inc/drawingml/textcharacterproperties.hxx | 3 | ||||
-rw-r--r-- | oox/source/core/fastparser.cxx | 4 | ||||
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 6 | ||||
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 4 | ||||
-rw-r--r-- | oox/source/helper/binaryinputstream.cxx | 6 | ||||
-rw-r--r-- | oox/source/helper/binaryoutputstream.cxx | 7 | ||||
-rw-r--r-- | oox/source/helper/containerhelper.cxx | 26 | ||||
-rw-r--r-- | oox/source/ole/axbinarywriter.cxx | 19 | ||||
-rw-r--r-- | oox/source/ole/vbaproject.cxx | 4 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 4 |
12 files changed, 34 insertions, 56 deletions
diff --git a/oox/inc/drawingml/graphicproperties.hxx b/oox/inc/drawingml/graphicproperties.hxx index a834681e5331..e8f7222e1281 100644 --- a/oox/inc/drawingml/graphicproperties.hxx +++ b/oox/inc/drawingml/graphicproperties.hxx @@ -44,8 +44,7 @@ struct GraphicProperties /** Writes the properties to the passed property map. */ void pushToPropMap( PropertyMap& rPropMap, - const GraphicHelper& rGraphicHelper, - sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const; + const GraphicHelper& rGraphicHelper ) const; }; } // namespace drawingml diff --git a/oox/inc/drawingml/textcharacterproperties.hxx b/oox/inc/drawingml/textcharacterproperties.hxx index 1720bee0bc69..8f84e8ab0f99 100644 --- a/oox/inc/drawingml/textcharacterproperties.hxx +++ b/oox/inc/drawingml/textcharacterproperties.hxx @@ -77,8 +77,7 @@ struct TextCharacterProperties /** Writes the properties to the passed property set. */ void pushToPropSet( PropertySet& rPropSet, - const ::oox::core::XmlFilterBase& rFilter, - bool bUseOptional = false ) const; + const ::oox::core::XmlFilterBase& rFilter ) const; }; diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx index 5465577842ed..6410a42901b6 100644 --- a/oox/source/core/fastparser.cxx +++ b/oox/source/core/fastparser.cxx @@ -126,9 +126,9 @@ void FastParser::parseStream( const Reference< XInputStream >& rxInStream, const parseStream( aInputSource, bCloseStream ); } -void FastParser::parseStream( StorageBase& rStorage, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException ) +void FastParser::parseStream( StorageBase& rStorage, const OUString& rStreamName ) throw( SAXException, IOException, RuntimeException ) { - parseStream( rStorage.openInputStream( rStreamName ), rStreamName, bCloseStream ); + parseStream( rStorage.openInputStream( rStreamName ), rStreamName ); } } // namespace core diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 062a600981c6..5551dc06ccf8 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -481,11 +481,11 @@ OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal } // namespace -OUString XmlFilterBase::addRelation( const OUString& rType, const OUString& rTarget, bool bExternal ) +OUString XmlFilterBase::addRelation( const OUString& rType, const OUString& rTarget ) { Reference< XRelationshipAccess > xRelations( getStorage()->getXStorage(), UNO_QUERY ); if( xRelations.is() ) - return lclAddRelation( xRelations, mnRelId ++, rType, rTarget, bExternal ); + return lclAddRelation( xRelations, mnRelId ++, rType, rTarget, false/*bExternal*/ ); return OUString(); } diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index a667bc5a4b19..e8a6001933c7 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -690,7 +690,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, } } -void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr ) const +void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelper& rGraphicHelper ) const { sal_Int16 nBrightness = getLimitedValue< sal_Int16, sal_Int32 >( maBlipProps.moBrightness.get( 0 ) / PER_PERCENT, -100, 100 ); sal_Int16 nContrast = getLimitedValue< sal_Int16, sal_Int32 >( maBlipProps.moContrast.get( 0 ) / PER_PERCENT, -100, 100 ); @@ -705,8 +705,8 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe if( maBlipProps.mxGraphic.is() ) { // created transformed graphic - Reference< XGraphic > xGraphic = lclCheckAndApplyDuotoneTransform( maBlipProps, maBlipProps.mxGraphic, rGraphicHelper, nPhClr ); - xGraphic = lclCheckAndApplyChangeColorTransform( maBlipProps, xGraphic, rGraphicHelper, nPhClr ); + Reference< XGraphic > xGraphic = lclCheckAndApplyDuotoneTransform( maBlipProps, maBlipProps.mxGraphic, rGraphicHelper, API_RGB_TRANSPARENT ); + xGraphic = lclCheckAndApplyChangeColorTransform( maBlipProps, xGraphic, rGraphicHelper, API_RGB_TRANSPARENT ); if (eColorMode == ColorMode_STANDARD && nBrightness == 70 && nContrast == -70) // map MSO 'washout' to our Watermark colormode diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index d7a848d99ef1..acf337ee1a8b 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -182,10 +182,10 @@ void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVe rPropSet.setAnyProperty(PROP_CharInteropGrabBag, makeAny(aGrabBag)); } -void TextCharacterProperties::pushToPropSet( PropertySet& rPropSet, const XmlFilterBase& rFilter, bool bUseOptional ) const +void TextCharacterProperties::pushToPropSet( PropertySet& rPropSet, const XmlFilterBase& rFilter ) const { PropertyMap aPropMap; - pushToPropMap( aPropMap, rFilter, bUseOptional ); + pushToPropMap( aPropMap, rFilter ); rPropSet.setProperties( aPropMap ); pushToGrabBag(rPropSet, maTextEffectsProperties); } diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx index a8e06835a6ae..7f35f6d3e280 100644 --- a/oox/source/helper/binaryinputstream.cxx +++ b/oox/source/helper/binaryinputstream.cxx @@ -102,17 +102,17 @@ OUString BinaryInputStream::readCompressedUnicodeArray( sal_Int32 nChars, bool b readUnicodeArray( nChars, bAllowNulChars ); } -void BinaryInputStream::copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes, sal_Int32 nAtomSize ) +void BinaryInputStream::copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes ) { if( nBytes > 0 ) { // make buffer size a multiple of the passed atom size - sal_Int32 nBufferSize = getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, (INPUTSTREAM_BUFFERSIZE / nAtomSize) * nAtomSize ); + sal_Int32 nBufferSize = getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, INPUTSTREAM_BUFFERSIZE ); StreamDataSequence aBuffer( nBufferSize ); while( nBytes > 0 ) { sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, nBufferSize ); - sal_Int32 nBytesRead = readData( aBuffer, nReadSize, nAtomSize ); + sal_Int32 nBytesRead = readData( aBuffer, nReadSize ); rOutStrm.writeData( aBuffer ); if( nReadSize == nBytesRead ) nBytes -= nReadSize; diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx index c5b8daf48e67..c35f15bc1834 100644 --- a/oox/source/helper/binaryoutputstream.cxx +++ b/oox/source/helper/binaryoutputstream.cxx @@ -123,14 +123,13 @@ BinaryOutputStream::writeUnicodeArray( const OUString& rString, bool bAllowNulCh #endif } -void -BinaryOutputStream::writeCompressedUnicodeArray( const OUString& rString, bool bCompressed, bool bAllowNulChars ) +void BinaryOutputStream::writeCompressedUnicodeArray( const OUString& rString, bool bCompressed ) { if ( bCompressed ) // ISO-8859-1 maps all byte values 0xHH to the same Unicode code point U+00HH - writeCharArrayUC( rString, RTL_TEXTENCODING_ISO_8859_1, bAllowNulChars ); + writeCharArrayUC( rString, RTL_TEXTENCODING_ISO_8859_1 ); else - writeUnicodeArray( rString, bAllowNulChars ); + writeUnicodeArray( rString ); } SequenceOutputStream::SequenceOutputStream( StreamDataSequence& rData ) : diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx index 4a9d72317074..2f8b3d5851b6 100644 --- a/oox/source/helper/containerhelper.cxx +++ b/oox/source/helper/containerhelper.cxx @@ -77,12 +77,12 @@ void ValueRangeSet::insert( const ValueRange& rRange ) OUString ContainerHelper::getUnusedName( const Reference< XNameAccess >& rxNameAccess, const OUString& rSuggestedName, - sal_Unicode cSeparator, sal_Int32 nFirstIndexToAppend ) + sal_Unicode cSeparator ) { OSL_ENSURE( rxNameAccess.is(), "ContainerHelper::getUnusedName - missing XNameAccess interface" ); OUString aNewName = rSuggestedName; - sal_Int32 nIndex = nFirstIndexToAppend; + sal_Int32 nIndex = -1; while( rxNameAccess->hasByName( aNewName ) ) aNewName = OUStringBuffer( rSuggestedName ).append( cSeparator ).append( nIndex++ ).makeStringAndClear(); return aNewName; @@ -90,13 +90,13 @@ OUString ContainerHelper::getUnusedName( bool ContainerHelper::insertByName( const Reference< XNameContainer >& rxNameContainer, - const OUString& rName, const Any& rObject, bool bReplaceOldExisting ) + const OUString& rName, const Any& rObject ) { OSL_ENSURE( rxNameContainer.is(), "ContainerHelper::insertByName - missing XNameContainer interface" ); bool bRet = false; try { - if( bReplaceOldExisting && rxNameContainer->hasByName( rName ) ) + if( rxNameContainer->hasByName( rName ) ) rxNameContainer->replaceByName( rName, rObject ); else rxNameContainer->insertByName( rName, rObject ); @@ -112,29 +112,13 @@ bool ContainerHelper::insertByName( OUString ContainerHelper::insertByUnusedName( const Reference< XNameContainer >& rxNameContainer, const OUString& rSuggestedName, sal_Unicode cSeparator, - const Any& rObject, bool bRenameOldExisting ) + const Any& rObject ) { OSL_ENSURE( rxNameContainer.is(), "ContainerHelper::insertByUnusedName - missing XNameContainer interface" ); // find an unused name OUString aNewName = getUnusedName( rxNameContainer, rSuggestedName, cSeparator ); - // rename existing object - if( bRenameOldExisting && rxNameContainer->hasByName( rSuggestedName ) ) - { - try - { - Any aOldObject = rxNameContainer->getByName( rSuggestedName ); - rxNameContainer->removeByName( rSuggestedName ); - rxNameContainer->insertByName( aNewName, aOldObject ); - aNewName = rSuggestedName; - } - catch( Exception& ) - { - OSL_FAIL( "ContainerHelper::insertByUnusedName - cannot rename old object" ); - } - } - // insert the new object and return its resulting name insertByName( rxNameContainer, aNewName, rObject ); return aNewName; diff --git a/oox/source/ole/axbinarywriter.cxx b/oox/source/ole/axbinarywriter.cxx index 26247e509c2c..ae731480db48 100644 --- a/oox/source/ole/axbinarywriter.cxx +++ b/oox/source/ole/axbinarywriter.cxx @@ -67,7 +67,7 @@ void AxAlignedOutputStream::writeMemory( const void* opMem, sal_Int32 nBytes, si mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos; } -void AxAlignedOutputStream::pad( sal_Int32 nBytes, size_t nAtomSize ) +void AxAlignedOutputStream::pad( sal_Int32 nBytes ) { //PRESUMABLY we need to pad with 0's here as appropriate css::uno::Sequence< sal_Int8 > aData( nBytes ); @@ -75,7 +75,7 @@ void AxAlignedOutputStream::pad( sal_Int32 nBytes, size_t nAtomSize ) // set to 0(s), easier to not get fooled by 0's when looking at // binary content...... memset( static_cast<void*>( aData.getArray() ), 0, nBytes ); - mpOutStrm->writeData( aData, nAtomSize ); + mpOutStrm->writeData( aData ); mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos; } @@ -130,10 +130,10 @@ AxBinaryPropertyWriter::AxBinaryPropertyWriter( BinaryOutputStream& rOutStrm, bo mnNextProp = 1; } -void AxBinaryPropertyWriter::writeBoolProperty( bool orbValue, bool bReverse ) +void AxBinaryPropertyWriter::writeBoolProperty( bool orbValue ) { // orbValue == bReverse false then we want to set the bit, e.g. don't skip - startNextProperty( orbValue == bReverse ); + startNextProperty( !orbValue ); } void AxBinaryPropertyWriter::writePairProperty( AxPairData& orPairData ) @@ -142,13 +142,10 @@ void AxBinaryPropertyWriter::writePairProperty( AxPairData& orPairData ) maLargeProps.push_back( ComplexPropVector::value_type( new PairProperty( orPairData ) ) ); } -void AxBinaryPropertyWriter::writeStringProperty( OUString& orValue, bool bCompressed ) +void AxBinaryPropertyWriter::writeStringProperty( OUString& orValue ) { sal_uInt32 nSize = orValue.getLength(); - if ( bCompressed ) - setFlag( nSize, AX_STRING_COMPRESSED ); - else - nSize *= 2; + setFlag( nSize, AX_STRING_COMPRESSED ); maOutStrm.writeAligned< sal_uInt32 >( nSize ); maLargeProps.push_back( ComplexPropVector::value_type( new StringProperty( orValue, nSize ) ) ); startNextProperty(); @@ -187,9 +184,9 @@ void AxBinaryPropertyWriter::finalizeExport() maOutStrm.seek( nPos ); } -bool AxBinaryPropertyWriter::ensureValid( bool bCondition ) +bool AxBinaryPropertyWriter::ensureValid() { - mbValid = mbValid && bCondition && !maOutStrm.isEof(); + mbValid = mbValid && !maOutStrm.isEof(); return mbValid; } diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index 607bec8282f5..4d2b28c1b8d3 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -167,13 +167,13 @@ bool VbaProject::importVbaProject( StorageBase& rVbaPrjStrg ) return hasModules() || hasDialogs(); } -void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) +void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper& rGraphicHelper ) { if( rVbaPrjStrg.isStorage() ) { // load the code modules and forms if( isImportVba() ) - importVba( rVbaPrjStrg, rGraphicHelper, bDefaultColorBgr ); + importVba( rVbaPrjStrg, rGraphicHelper, true/*bDefaultColorBgr*/ ); // copy entire storage into model if( isExportVba() ) copyStorage( rVbaPrjStrg ); diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index ae717edad93d..c8d5476d304e 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -424,13 +424,13 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS return xShape; } -void ShapeBase::convertFormatting( const Reference< XShape >& rxShape, const ShapeParentAnchor* pParentAnchor ) const +void ShapeBase::convertFormatting( const Reference< XShape >& rxShape ) const { if( rxShape.is() ) { /* Calculate shape rectangle. Applications may do something special according to some imported shape client data (e.g. Excel cell anchor). */ - awt::Rectangle aShapeRect = calcShapeRectangle( pParentAnchor ); + awt::Rectangle aShapeRect = calcShapeRectangle( nullptr ); // convert the shape, if the calculated rectangle is not empty if( (aShapeRect.Width > 0) || (aShapeRect.Height > 0) ) |