Kaydet (Commit) 2b7215e6 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unuseddefaultparams in oox

Change-Id: If05662102e161d3dd56bbb6ed3964e63ba853cf9
üst fecfd9c4
......@@ -71,7 +71,7 @@ public:
/** Parses a stream from the passed storage with the specified name.
@param bCloseStream True = closes the stream after parsing. */
void parseStream( StorageBase& rStorage, const OUString& rStreamName, bool bCloseStream = false )
void parseStream( StorageBase& rStorage, const OUString& rStreamName )
throw( css::xml::sax::SAXException, css::io::IOException, css::uno::RuntimeException );
css::uno::Reference< css::xml::sax::XFastTokenHandler >
......
......@@ -146,7 +146,7 @@ public:
@return Added relation Id.
*/
OUString addRelation( const OUString& rType, const OUString& rTarget, bool bExternal = false );
OUString addRelation( const OUString& rType, const OUString& rTarget );
/** Adds new relation to part's relations.
......
......@@ -188,7 +188,7 @@ public:
/** Copies nBytes bytes from the current position to the passed output stream.
*/
void copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes = SAL_MAX_INT64, sal_Int32 nAtomSize = 1 );
void copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes = SAL_MAX_INT64 );
protected:
/** This dummy default c'tor will never call the c'tor of the virtual base
......
......@@ -73,7 +73,7 @@ public:
BinaryOutputStream& WriteUInt32(sal_uInt32 x) { writeValue(x); return *this; }
BinaryOutputStream& WriteInt64(sal_Int64 x) { writeValue(x); return *this; }
void writeCompressedUnicodeArray( const OUString& rString, bool bCompressed, bool bAllowNulChars = false );
void writeCompressedUnicodeArray( const OUString& rString, bool bCompressed );
void writeCharArrayUC( const OUString& rString, rtl_TextEncoding eTextEnc, bool bAllowNulChars = false );
......
......@@ -150,8 +150,7 @@ public:
static OUString getUnusedName(
const css::uno::Reference< css::container::XNameAccess >& rxNameAccess,
const OUString& rSuggestedName,
sal_Unicode cSeparator,
sal_Int32 nFirstIndexToAppend = 1 );
sal_Unicode cSeparator );
/** Inserts an object into a name container.
......@@ -167,8 +166,7 @@ public:
static bool insertByName(
const css::uno::Reference< css::container::XNameContainer >& rxNameContainer,
const OUString& rName,
const css::uno::Any& rObject,
bool bReplaceOldExisting = true );
const css::uno::Any& rObject );
/** Inserts an object into a name container.
......@@ -184,13 +182,9 @@ public:
@param rObject The object to be inserted.
@param bRenameOldExisting Specifies behaviour if an object with the
suggested name already exists. If false (default), the new object
will be inserted with a name not yet extant in the container (this
is done by appending a numerical index to the suggested name). If
true, the existing object will be removed and inserted with an
unused name, and the new object will be inserted with the suggested
name.
The new object
will be inserted with a name not yet extant in the container (this
is done by appending a numerical index to the suggested name).
@return The final name the object is inserted with. Will always be
equal to the suggested name, if parameter bRenameOldExisting is
......@@ -200,8 +194,7 @@ public:
const css::uno::Reference< css::container::XNameContainer >& rxNameContainer,
const OUString& rSuggestedName,
sal_Unicode cSeparator,
const css::uno::Any& rObject,
bool bRenameOldExisting = false );
const css::uno::Any& rObject );
// std::vector and std::map element access --------------------------------
......
......@@ -54,7 +54,7 @@ public:
position of the wrapped stream at construction time). */
void align( size_t nSize );
void pad( sal_Int32 nBytes, size_t nAtomSize = 1);
void pad( sal_Int32 nBytes );
/** Aligns the stream according to the passed type and reads a value. */
template< typename Type >
......@@ -84,13 +84,13 @@ public:
{ if( startNextProperty() ) maOutStrm.writeAligned< StreamType >( ornValue ); }
/** Write a boolean property value to the stream, the
respective flag in the property mask is set. */
void writeBoolProperty( bool orbValue, bool bReverse = false );
void writeBoolProperty( bool orbValue );
/** Write a pair property the stream, the respective flag in
the property mask is set. */
void writePairProperty( AxPairData& orPairData );
/** Write a string property to the stream, the respective flag
in the property mask is set. */
void writeStringProperty( OUString& orValue, bool bCompressed = true );
void writeStringProperty( OUString& orValue );
/** Skips the next property clears the respective
flag in the property mask. */
......@@ -100,7 +100,7 @@ public:
void finalizeExport();
private:
bool ensureValid( bool bCondition = true );
bool ensureValid();
bool startNextProperty( bool bSkip = false );
private:
......
......@@ -118,8 +118,7 @@ public:
*/
void importVbaProject(
StorageBase& rVbaPrjStrg,
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr = true );
const GraphicHelper& rGraphicHelper );
bool importVbaProject(
StorageBase& rVbaPrjStrg );
......
......@@ -246,8 +246,7 @@ public:
/** Converts position and formatting into the passed existing XShape. */
void convertFormatting(
const css::uno::Reference< css::drawing::XShape >& rxShape,
const ShapeParentAnchor* pParentAnchor = nullptr ) const;
const css::uno::Reference< css::drawing::XShape >& rxShape ) const;
protected:
explicit ShapeBase( Drawing& rDrawing );
......
......@@ -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
......
......@@ -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;
};
......
......@@ -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
......
......@@ -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();
}
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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 ) :
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment