summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-09 08:52:44 +0200
committerNoel Grandin <noel@peralex.com>2015-03-19 10:45:02 +0200
commitcfeeceab9ea03b5507cdb7ddb90fcc1b8b1a4e85 (patch)
tree49a8da3198093cd37134911db1ecd828b19e621e /filter
parent94d3d0a27763a34c3ee72f341264fbe4fc99574b (diff)
loplugin:constantfunction: filter
Change-Id: I11e616ec1e3249573797bd2a4bb2b52f11c115ee
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx10
-rw-r--r--filter/source/graphicfilter/ipbm/ipbm.cxx22
-rw-r--r--filter/source/graphicfilter/ipcd/ipcd.cxx17
-rw-r--r--filter/source/graphicfilter/ipcx/ipcx.cxx10
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx10
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx20
-rw-r--r--filter/source/msfilter/eschesdo.cxx12
-rw-r--r--filter/source/msfilter/eschesdo.hxx1
-rw-r--r--filter/source/msfilter/mscodec.cxx2
-rw-r--r--filter/source/msfilter/svdfppt.cxx12
-rw-r--r--filter/source/xsltfilter/LibXSLTTransformer.cxx11
-rw-r--r--filter/source/xsltfilter/LibXSLTTransformer.hxx2
12 files changed, 12 insertions, 117 deletions
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index e72a9d6799ec..4a77e38f1c3b 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -373,8 +373,6 @@ private:
SvStream * pOrdFile;
- bool Callback(sal_uInt16 nPercent);
-
void AddPointsToPath(const Polygon & rPoly);
void AddPointsToArea(const Polygon & rPoly);
void CloseFigure();
@@ -433,11 +431,6 @@ public:
//=================== Methods of OS2METReader ==============================
-bool OS2METReader::Callback(sal_uInt16 /*nPercent*/)
-{
- return false;
-}
-
OS2METReader::OS2METReader()
: ErrorCode(0)
, pOS2MET(NULL)
@@ -2625,7 +2618,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
sal_uInt64 const nStartPos = pOS2MET->Tell();
sal_uInt64 const nRemaining = pOS2MET->remainingSize();
- Callback(0); nLastPercent=0;
+ nLastPercent=0;
sal_uInt64 nPos = pOS2MET->Tell();
@@ -2633,7 +2626,6 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
nPercent = (nPos-nStartPos)*100 / nRemaining;
if (nLastPercent+4<=nPercent) {
- if (Callback((sal_uInt16)nPercent)) break;
nLastPercent=nPercent;
}
diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx
index 113b67629bb8..95472946a4d0 100644
--- a/filter/source/graphicfilter/ipbm/ipbm.cxx
+++ b/filter/source/graphicfilter/ipbm/ipbm.cxx
@@ -40,7 +40,6 @@ private:
sal_uLong mnWidth, mnHeight; // dimensions in pixel
sal_uLong mnCol;
sal_uLong mnMaxVal; // max value in the <missing comment>
- bool ImplCallback( sal_uInt16 nPercent );
bool ImplReadBody();
bool ImplReadHeader();
@@ -70,21 +69,6 @@ PBMReader::~PBMReader()
{
}
-bool PBMReader::ImplCallback( sal_uInt16 /*nPercent*/ )
-{
-/*
- if ( pCallback != NULL )
- {
- if ( ( (*pCallback)( pCallerData, nPercent ) ) == sal_True )
- {
- mrPBM.SetError( SVSTREAM_FILEFORMAT_ERROR );
- return sal_True;
- }
- }
-*/
- return false;
-}
-
bool PBMReader::ReadPBM(Graphic & rGraphic )
{
sal_uInt16 i;
@@ -285,7 +269,6 @@ bool PBMReader::ImplReadBody()
nShift = 0;
nWidth = 0;
nHeight++;
- ImplCallback( (sal_uInt16)( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
}
break;
@@ -304,7 +287,6 @@ bool PBMReader::ImplReadBody()
{
nWidth = 0;
nHeight++;
- ImplCallback( (sal_uInt16)( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
}
break;
@@ -327,7 +309,6 @@ bool PBMReader::ImplReadBody()
{
nWidth = 0;
nHeight++;
- ImplCallback( (sal_uInt16) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
}
break;
@@ -366,7 +347,6 @@ bool PBMReader::ImplReadBody()
nWidth = 0;
if ( ++nHeight == mnHeight )
bFinished = true;
- ImplCallback( (sal_uInt16) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
}
else
@@ -395,7 +375,6 @@ bool PBMReader::ImplReadBody()
nWidth = 0;
if ( ++nHeight == mnHeight )
bFinished = true;
- ImplCallback( (sal_uInt16) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
continue;
}
@@ -470,7 +449,6 @@ bool PBMReader::ImplReadBody()
nWidth = 0;
if ( ++nHeight == mnHeight )
bFinished = true;
- ImplCallback( (sal_uInt16) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
continue;
}
diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx
index 5ab1cfc6fd52..3d6ca9035f91 100644
--- a/filter/source/graphicfilter/ipcd/ipcd.cxx
+++ b/filter/source/graphicfilter/ipcd/ipcd.cxx
@@ -66,15 +66,13 @@ private:
sal_uLong nBMPWidth;
sal_uLong nBMPHeight;
- void MayCallback(sal_uLong nPercent);
-
void CheckPCDImagePacFile();
// checks whether it's a Photo-CD file with 'Image Pac'
void ReadOrientation();
// reads the orientation and sets nOrientation
- void ReadImage(sal_uLong nMinPercent, sal_uLong nMaxPercent);
+ void ReadImage();
public:
@@ -105,8 +103,6 @@ bool PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
bStatus = true;
nLastPercent = 0;
- MayCallback( 0 );
-
// is it a PCD file with a picture? ( sets bStatus == sal_False, if that's not the case):
CheckPCDImagePacFile();
@@ -163,7 +159,7 @@ bool PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
if ( ( mpAcc = aBmp.AcquireWriteAccess() ) == 0 )
return false;
- ReadImage( 5 ,65 );
+ ReadImage();
aBmp.ReleaseAccess( mpAcc ), mpAcc = NULL;
rGraphic = aBmp;
@@ -173,12 +169,6 @@ bool PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
-void PCDReader::MayCallback(sal_uLong /*nPercent*/)
-{
-}
-
-
-
void PCDReader::CheckPCDImagePacFile()
{
char Buf[ 8 ];
@@ -203,7 +193,7 @@ void PCDReader::ReadOrientation()
-void PCDReader::ReadImage(sal_uLong nMinPercent, sal_uLong nMaxPercent)
+void PCDReader::ReadImage()
{
sal_uLong nx,ny,nW2,nH2,nYPair,ndy,nXPair;
long nL,nCb,nCr,nRed,nGreen,nBlue;
@@ -360,7 +350,6 @@ void PCDReader::ReadImage(sal_uLong nMinPercent, sal_uLong nMaxPercent)
if ( m_rPCD.GetError() )
bStatus = false;
- MayCallback( nMinPercent + ( nMaxPercent - nMinPercent ) * nYPair / nH2 );
if ( bStatus == false )
break;
}
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 6bbcc07f4577..d5cc51b4dd7d 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -43,10 +43,9 @@ private:
sal_uInt16 nResX, nResY; // resolution in pixel per inch oder 0,0
sal_uInt16 nDestBitsPerPixel; // bits per pixel in destination bitmap 1,4,8 or 24
sal_uInt8* pPalette;
- bool nStatus; // from now on do not read status from stream ( SJ )
+ bool nStatus; // from now on do not read status from stream ( SJ )
- bool Callback( sal_uInt16 nPercent );
void ImplReadBody(BitmapWriteAccess * pAcc);
void ImplReadPalette( sal_uLong nCol );
void ImplReadHeader();
@@ -83,11 +82,6 @@ PCXReader::~PCXReader()
delete[] pPalette;
}
-bool PCXReader::Callback( sal_uInt16 /*nPercent*/ )
-{
- return false;
-}
-
bool PCXReader::ReadPCX(Graphic & rGraphic)
{
if ( m_rPCX.GetError() )
@@ -239,8 +233,6 @@ void PCXReader::ImplReadBody(BitmapWriteAccess * pAcc)
if ( ny == 0 || nLastPercent + 4 <= nPercent )
{
nLastPercent = nPercent;
- if ( Callback( (sal_uInt16)nPercent ) )
- break;
}
for ( np = 0; np < nPlanes; np++)
{
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 683819cab047..ed4da5bab4b6 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -170,8 +170,6 @@ private:
Fraction aHRes;
Fraction aVRes;
- bool Callback(sal_uInt16 nPercent);
-
Point ReadPoint();
Point ReadDeltaH(Point aBase);
@@ -360,11 +358,6 @@ void PictReader::SetFillColor( const Color& rColor )
pVirDev->SetFillColor( rColor );
}
-bool PictReader::Callback(sal_uInt16 /*nPercent*/)
-{
- return false;
-}
-
Point PictReader::ReadPoint()
{
short nx,ny;
@@ -1896,7 +1889,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
sal_uInt64 const nStartPos=pPict->Tell();
sal_uInt64 const nRemaining = pPict->remainingSize();
- Callback(0); nLastPercent=0;
+ nLastPercent=0;
ReadHeader();
@@ -1909,7 +1902,6 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
nPercent = (nPos-nStartPos) * 100 / nRemaining;
if (nLastPercent+4<=nPercent) {
- if (Callback((sal_uInt16)nPercent)) break;
nLastPercent=nPercent;
}
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index edd1aa01fd8e..7bc0f03908d9 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -99,8 +99,6 @@ private:
sal_uInt8* pMap[ 4 ]; // temporary Scanline
- void MayCallback( sal_uLong nPercent );
-
sal_uLong DataTypeSize();
sal_uLong ReadIntData();
double ReadDoubleData();
@@ -108,7 +106,7 @@ private:
void ReadHeader();
void ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen );
- bool ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent );
+ bool ReadMap();
// reads/decompresses the bitmap data and fills pMap
sal_uLong GetBits( const sal_uInt8 * pSrc, sal_uLong nBitsPos, sal_uLong nBitsCount );
@@ -194,12 +192,6 @@ public:
//=================== Methods of TIFFReader ==============================
-void TIFFReader::MayCallback( sal_uLong /*nPercent*/ )
-{
-}
-
-
-
sal_uLong TIFFReader::DataTypeSize()
{
sal_uLong nSize;
@@ -538,7 +530,7 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen)
-bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
+bool TIFFReader::ReadMap()
{
if ( nCompression == 1 || nCompression == 32771 )
{
@@ -559,7 +551,6 @@ bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
pTIFF->Read( pMap[ np ], nBytesPerRow );
if ( pTIFF->GetError() )
return false;
- MayCallback( nMinPercent + ( nMaxPercent - nMinPercent ) * ( np * nImageLength + ny) / ( nImageLength * nPlanes ) );
}
if ( !ConvertScanline( ny ) )
return false;
@@ -618,7 +609,6 @@ bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
return false;
if ( pTIFF->GetError() )
return false;
- MayCallback(nMinPercent+(nMaxPercent-nMinPercent)*(np*nImageLength+ny)/(nImageLength*nPlanes));
}
if ( !ConvertScanline( ny ) )
return false;
@@ -647,7 +637,6 @@ bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
}
if ( ( aLZWDecom.Decompress( pMap[ np ], nBytesPerRow ) != nBytesPerRow ) || pTIFF->GetError() )
return false;
- MayCallback(nMinPercent+(nMaxPercent-nMinPercent)*(np*nImageLength+ny)/(nImageLength*nPlanes));
}
if ( !ConvertScanline( ny ) )
return false;
@@ -707,7 +696,6 @@ bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
} while ( nRowBytesLeft != 0 );
if ( pTIFF->GetError() )
return false;
- MayCallback(nMinPercent+(nMaxPercent-nMinPercent)*(np*nImageLength+ny)/(nImageLength*nPlanes));
}
if ( !ConvertScanline( ny ) )
return false;
@@ -1177,8 +1165,6 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
// number format of pTIFF at the beginning
SvStreamEndian nOrigNumberFormat = pTIFF->GetEndian();
- MayCallback( 0 );
-
// read header:
ReadHeader();
@@ -1359,7 +1345,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
pMaskAcc = pAlphaMask->AcquireWriteAccess();
}
- if (bStatus && ReadMap(10, 60))
+ if (bStatus && ReadMap())
{
nMaxPos = std::max( pTIFF->Tell(), nMaxPos );
MakePalCol();
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 2e9227042eb7..063a2f084a50 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -168,13 +168,6 @@ void ImplEESdrWriter::ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherProperty
rObj.GetShapeId() ) ); \
}
-//Map from twips to export units, generally twips as well, only excel and word
-//export is happening here, so native units are export units, leave as
-//placeholder if required in future
-void ImplEESdrWriter::MapRect(ImplEESdrObject& /* rObj */ )
-{
-}
-
sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
EscherSolverContainer& rSolverContainer,
ImplEESdrPageType ePageType, const bool bOOxmlExport )
@@ -472,7 +465,6 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
{
::com::sun::star::awt::Rectangle aNewRect;
aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_LINE, false, aNewRect, NULL );
- MapRect(rObj);
//i27942: Poly/Lines/Bezier do not support text.
mpEscherEx->OpenContainer( ESCHER_SpContainer );
@@ -498,7 +490,6 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, false, aNewRect, NULL );
- MapRect(rObj);
aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
rObj.SetAngle( 0 );
}
@@ -510,7 +501,6 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, false, aNewRect, NULL );
- MapRect(rObj);
aPropOpt.CreateLineProperties( rObj.mXPropSet, false );
rObj.SetAngle( 0 );
}
@@ -522,7 +512,6 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, true, aNewRect, NULL );
- MapRect(rObj);
aPropOpt.CreateLineProperties( rObj.mXPropSet, false );
rObj.SetAngle( 0 );
}
@@ -537,7 +526,6 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, true, aNewRect, NULL );
- MapRect(rObj);
aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
rObj.SetAngle( 0 );
}
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index 7ef49a2d5fc1..e655ce95b7db 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -169,7 +169,6 @@ public:
Point ImplMapPoint( const Point& rPoint );
Size ImplMapSize( const Size& rSize );
EscherExHostAppData* ImplGetHostData() { return mpHostAppData; }
- void MapRect(ImplEESdrObject& rObj);
};
diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx
index 7a00f1666a9a..77c572ee07fd 100644
--- a/filter/source/msfilter/mscodec.cxx
+++ b/filter/source/msfilter/mscodec.cxx
@@ -280,7 +280,7 @@ static void lcl_PrintDigest(const sal_uInt8* pDigest, const char* msg)
printf("\n");
}
#else
-static void lcl_PrintDigest(const sal_uInt8* /*pDigest*/, const char* /*msg*/)
+static inline void lcl_PrintDigest(const sal_uInt8* /*pDigest*/, const char* /*msg*/)
{
}
#endif
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 6f0fb8645966..9947068fc43d 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -3099,13 +3099,6 @@ void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader& rHd, HeaderF
}
}
-// no longer needed
-sal_Unicode SdrPowerPointImport::PPTSubstitute( sal_uInt16 /*nFont*/, sal_Unicode /*nChar*/,
- sal_uInt32& /*nMappedFontId*/, vcl::Font& /*rFont*/, char /*nDefault*/) const
-{
- return 0;
-}
-
PPTBuGraEntry::PPTBuGraEntry( Graphic& rGraphic, sal_uInt32 nInst ) :
nInstance ( nInst ),
aBuGra ( rGraphic ) {}
@@ -5748,7 +5741,6 @@ PPTParagraphObj::PPTParagraphObj( PPTStyleTextPropReader& rPropReader,
PPTParagraphObj::~PPTParagraphObj()
{
- ImplClear();
}
void PPTParagraphObj::AppendPortion( PPTPortionObj& rPPTPortion )
@@ -6280,10 +6272,6 @@ PPTPortionObj* PPTParagraphObj::Next()
return &m_PortionList[i];
}
-void PPTParagraphObj::ImplClear()
-{
-}
-
PPTFieldEntry::~PPTFieldEntry()
{
delete pField1;
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 64a390fbab35..d6eafdaf2e3f 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -88,10 +88,9 @@ namespace XSLT
return tmp->read(buffer, len);
}
static int
- on_close(void * context)
+ on_close(void * )
{
- Reader * tmp = static_cast<Reader*> (context);
- return tmp->closeInput();
+ return 0;
}
};
/**
@@ -258,12 +257,6 @@ namespace XSLT
}
int
- Reader::closeInput()
- {
- return 0;
- }
-
- int
Reader::closeOutput()
{
css::uno::Reference<XOutputStream> xos = m_transformer->getOutputStream();
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.hxx b/filter/source/xsltfilter/LibXSLTTransformer.hxx
index cc078b9eb5c4..ce0ddbe9d669 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.hxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.hxx
@@ -163,8 +163,6 @@ namespace XSLT
int SAL_CALL
write(const char * buffer, int len);
int SAL_CALL
- closeInput();
- int SAL_CALL
closeOutput();
private: