summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-04 13:41:22 +0200
committerNoel Grandin <noel@peralex.com>2016-03-04 14:01:19 +0200
commit1fd781e7cd33f325ec7e467ecd49e0cb6ff4762b (patch)
tree9ede2ca7b2f7336365f675d9388dafc2a1994be6 /oox
parenta4c17041271eca2181cf11e5a0b59f4001c20cee (diff)
loplugin:unuseddefaultparam in oox/reportdesign/sd
Change-Id: Ia26cf182ddc7c903d86bf74a8175858adb88121c
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/drawingml/textcharacterproperties.hxx3
-rw-r--r--oox/source/core/fastparser.cxx4
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx22
-rw-r--r--oox/source/helper/binaryinputstream.cxx27
-rw-r--r--oox/source/helper/binaryoutputstream.cxx10
5 files changed, 28 insertions, 38 deletions
diff --git a/oox/inc/drawingml/textcharacterproperties.hxx b/oox/inc/drawingml/textcharacterproperties.hxx
index 8f84e8ab0f99..6d7229a6a461 100644
--- a/oox/inc/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/drawingml/textcharacterproperties.hxx
@@ -71,8 +71,7 @@ struct TextCharacterProperties
/** Writes the properties to the passed property map. */
void pushToPropMap(
PropertyMap& rPropMap,
- const ::oox::core::XmlFilterBase& rFilter,
- bool bUseOptional = false ) const;
+ const ::oox::core::XmlFilterBase& rFilter ) const;
/** Writes the properties to the passed property set. */
void pushToPropSet(
diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx
index 6410a42901b6..5a9121d2820d 100644
--- a/oox/source/core/fastparser.cxx
+++ b/oox/source/core/fastparser.cxx
@@ -118,12 +118,12 @@ void FastParser::parseStream( const InputSource& rInputSource, bool bCloseStream
mxParser->parseStream( rInputSource );
}
-void FastParser::parseStream( const Reference< XInputStream >& rxInStream, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException )
+void FastParser::parseStream( const Reference< XInputStream >& rxInStream, const OUString& rStreamName ) throw( SAXException, IOException, RuntimeException )
{
InputSource aInputSource;
aInputSource.sSystemId = rStreamName;
aInputSource.aInputStream = rxInStream;
- parseStream( aInputSource, bCloseStream );
+ parseStream( aInputSource );
}
void FastParser::parseStream( StorageBase& rStorage, const OUString& rStreamName ) throw( SAXException, IOException, RuntimeException )
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index acf337ee1a8b..3d71c2db5824 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -66,7 +66,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
maGradientProps.assignUsed( rSourceProps.maGradientProps );
}
-void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter, bool bUseOptional ) const
+void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter ) const
{
OUString aFontName;
sal_Int16 nFontPitch = 0;
@@ -140,19 +140,15 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap.setProperty( PROP_CharEscapementHeight, sal_Int8(100)); // 100%
}
- if( !bUseOptional || moBold.has() ) {
- float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL;
- rPropMap.setProperty( PROP_CharWeight, fWeight);
- rPropMap.setProperty( PROP_CharWeightAsian, fWeight);
- rPropMap.setProperty( PROP_CharWeightComplex, fWeight);
- }
+ float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL;
+ rPropMap.setProperty( PROP_CharWeight, fWeight);
+ rPropMap.setProperty( PROP_CharWeightAsian, fWeight);
+ rPropMap.setProperty( PROP_CharWeightComplex, fWeight);
- if( !bUseOptional || moItalic.has() ) {
- awt::FontSlant eSlant = moItalic.get( false ) ? awt::FontSlant_ITALIC : awt::FontSlant_NONE;
- rPropMap.setProperty( PROP_CharPosture, eSlant);
- rPropMap.setProperty( PROP_CharPostureAsian, eSlant);
- rPropMap.setProperty( PROP_CharPostureComplex, eSlant);
- }
+ awt::FontSlant eSlant = moItalic.get( false ) ? awt::FontSlant_ITALIC : awt::FontSlant_NONE;
+ rPropMap.setProperty( PROP_CharPosture, eSlant);
+ rPropMap.setProperty( PROP_CharPostureAsian, eSlant);
+ rPropMap.setProperty( PROP_CharPostureComplex, eSlant);
bool bUnderlineFillFollowText = moUnderlineFillFollowText.get( false );
if( moUnderline.has() && maUnderlineColor.isUsed() && !bUnderlineFillFollowText )
diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx
index 7f35f6d3e280..5b5eb5b2d01c 100644
--- a/oox/source/helper/binaryinputstream.cxx
+++ b/oox/source/helper/binaryinputstream.cxx
@@ -102,23 +102,20 @@ OUString BinaryInputStream::readCompressedUnicodeArray( sal_Int32 nChars, bool b
readUnicodeArray( nChars, bAllowNulChars );
}
-void BinaryInputStream::copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes )
+void BinaryInputStream::copyToStream( BinaryOutputStream& rOutStrm )
{
- if( nBytes > 0 )
+ sal_Int64 nBytes = SAL_MAX_INT64;
+ sal_Int32 nBufferSize = INPUTSTREAM_BUFFERSIZE;
+ StreamDataSequence aBuffer( nBufferSize );
+ while( nBytes > 0 )
{
- // make buffer size a multiple of the passed atom size
- 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 );
- rOutStrm.writeData( aBuffer );
- if( nReadSize == nBytesRead )
- nBytes -= nReadSize;
- else
- nBytes = 0;
- }
+ sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, nBufferSize );
+ sal_Int32 nBytesRead = readData( aBuffer, nReadSize );
+ rOutStrm.writeData( aBuffer );
+ if( nReadSize == nBytesRead )
+ nBytes -= nReadSize;
+ else
+ nBytes = 0;
}
}
diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx
index c35f15bc1834..c6d0f50f6749 100644
--- a/oox/source/helper/binaryoutputstream.cxx
+++ b/oox/source/helper/binaryoutputstream.cxx
@@ -99,20 +99,18 @@ void BinaryXOutputStream::writeMemory( const void* pMem, sal_Int32 nBytes, size_
}
void
-BinaryOutputStream::writeCharArrayUC( const OUString& rString, rtl_TextEncoding eTextEnc, bool bAllowNulChars )
+BinaryOutputStream::writeCharArrayUC( const OUString& rString, rtl_TextEncoding eTextEnc )
{
OString sBuf( OUStringToOString( rString, eTextEnc ) );
- if( !bAllowNulChars )
- sBuf = sBuf.replace( '\0', '?' );
+ sBuf = sBuf.replace( '\0', '?' );
writeMemory( static_cast< const void* >( sBuf.getStr() ), sBuf.getLength() );
}
void
-BinaryOutputStream::writeUnicodeArray( const OUString& rString, bool bAllowNulChars )
+BinaryOutputStream::writeUnicodeArray( const OUString& rString )
{
OUString sBuf( rString );
- if( !bAllowNulChars )
- sBuf = sBuf.replace( '\0', '?' );
+ sBuf = sBuf.replace( '\0', '?' );
#ifdef OSL_BIGENDIAN
// need a non-const buffer for swapping byte order
sal_Unicode notConst[sBuf.getLength()];