summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-02 09:36:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-02 10:53:07 +0200
commit1b56843a77f0c86f483e96032b5b6ff2214968b0 (patch)
treef65dd01a29527c877cc0a6057bd51b90dbdb2fb3 /filter
parentc87da778e35214655c8cf825ea46cb720426c5d7 (diff)
loplugin:reducevarscope in filter
Change-Id: I665531de5b8a94c4646e2a85373a6f67a60f1c08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103812 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx3
-rw-r--r--filter/source/graphicfilter/icgm/class4.cxx6
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.cxx9
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx39
-rw-r--r--filter/source/graphicfilter/itiff/ccidecom.cxx6
-rw-r--r--filter/source/msfilter/escherex.cxx9
-rw-r--r--filter/source/msfilter/msdffimp.cxx22
-rw-r--r--filter/source/msfilter/mstoolbar.cxx3
-rw-r--r--filter/source/msfilter/svdfppt.cxx12
-rw-r--r--filter/source/pdf/pdfexport.cxx2
-rw-r--r--filter/source/svg/svgexport.cxx2
-rw-r--r--filter/source/svg/svgwriter.cxx9
-rw-r--r--filter/source/t602/t602filter.cxx3
13 files changed, 66 insertions, 59 deletions
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 9958c946310a..61502b06c503 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -1060,10 +1060,9 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
case MetaActionType::POP :
{
rVDev.Pop();
- StackMember* pGS;
if( pGDIStack )
{
- pGS = pGDIStack;
+ StackMember* pGS = pGDIStack;
pGDIStack = pGS->pSucc;
aDashArray = pGS->aDashArray;
eJoinType = pGS->eJoinType;
diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx
index 2e3f3c439cdb..394c2ada5f89 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -362,7 +362,7 @@ void CGM::ImplDoClass4()
case 0x0d : /*Circular Arc 3 Point*/
{
- FloatPoint aStartingPoint, aIntermediatePoint, aEndingPoint, aCenterPoint;
+ FloatPoint aStartingPoint, aIntermediatePoint, aEndingPoint;
ImplGetPoint( aStartingPoint, true );
ImplGetPoint( aIntermediatePoint, true );
ImplGetPoint( aEndingPoint, true );
@@ -379,6 +379,7 @@ void CGM::ImplDoClass4()
if ( fG != 0 )
{
+ FloatPoint aCenterPoint;
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint );
@@ -435,7 +436,7 @@ void CGM::ImplDoClass4()
if ( mbFigure )
mpOutAct->CloseRegion();
- FloatPoint aStartingPoint, aIntermediatePoint, aEndingPoint, aCenterPoint;
+ FloatPoint aStartingPoint, aIntermediatePoint, aEndingPoint;
ImplGetPoint( aStartingPoint );
ImplGetPoint( aIntermediatePoint );
ImplGetPoint( aEndingPoint );
@@ -452,6 +453,7 @@ void CGM::ImplDoClass4()
if ( fG != 0 )
{
+ FloatPoint aCenterPoint;
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint );
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index 898dc6159ecb..3d9e6c9ed463 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -49,14 +49,13 @@ Color DXF2GDIMetaFile::ConvertColor(sal_uInt8 nColor)
long DXF2GDIMetaFile::GetEntityColor(const DXFBasicEntity & rE)
{
long nColor;
- const DXFLayer * pLayer;
nColor=rE.nColor;
if (nColor==256) {
if (rE.m_sLayer.getLength() < 2) {
nColor=nParentLayerColor;
} else {
- pLayer=pDXF->aTables.SearchLayer(rE.m_sLayer);
+ const DXFLayer * pLayer=pDXF->aTables.SearchLayer(rE.m_sLayer);
if (pLayer!=nullptr) nColor=pLayer->nColor;
else nColor=nParentLayerColor;
}
@@ -315,7 +314,6 @@ void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform
double frx,fry;
sal_uInt16 nPoints,i;
DXFVector aC;
- Point aPS,aPE;
if (!SetLineAttribute(rE)) return;
double fA1=rE.fStart;
@@ -330,6 +328,7 @@ void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform
DXFVector aVE(cos((fA1+fdA)/180.0*3.14159265359),sin((fA1+fdA)/180.0*3.14159265359),0.0);
aVE*=rE.fRadius;
aVE+=rE.aP0;
+ Point aPS,aPE;
if (rTransform.Mirror()) {
rTransform.Transform(aVS,aPS);
rTransform.Transform(aVE,aPE);
@@ -430,7 +429,6 @@ void DXF2GDIMetaFile::DrawSolidEntity(const DXFSolidEntity & rE, const DXFTransf
void DXF2GDIMetaFile::DrawTextEntity(const DXFTextEntity & rE, const DXFTransform & rTransform)
{
DXFVector aV;
- Point aPt;
double fA;
sal_uInt16 nHeight;
short nAng;
@@ -443,6 +441,7 @@ void DXF2GDIMetaFile::DrawTextEntity(const DXFTextEntity & rE, const DXFTransfor
if ( SetFontAttribute( rE,nAng, nHeight ) )
{
OUString const aUString(pDXF->ToOUString(rE.m_sText));
+ Point aPt;
aT.Transform( DXFVector( 0, 0, 0 ), aPt );
pVirDev->DrawText( aPt, aUString );
}
@@ -491,7 +490,6 @@ void DXF2GDIMetaFile::DrawAttribEntity(const DXFAttribEntity & rE, const DXFTran
return;
DXFVector aV;
- Point aPt;
double fA;
sal_uInt16 nHeight;
short nAng;
@@ -504,6 +502,7 @@ void DXF2GDIMetaFile::DrawAttribEntity(const DXFAttribEntity & rE, const DXFTran
if (SetFontAttribute(rE,nAng,nHeight))
{
OUString const aUString(pDXF->ToOUString(rE.m_sText));
+ Point aPt;
aT.Transform( DXFVector( 0, 0, 0 ), aPt );
pVirDev->DrawText( aPt, aUString );
}
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 54f56f932f53..7746b579df1d 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -1133,9 +1133,14 @@ void OS2METReader::ReadFullArc(bool bGivenPos, sal_uInt16 nOrderSize)
nP = o3tl::saturating_toggle_sign(nP);
if (nQ < 0)
nQ = o3tl::saturating_toggle_sign(nQ);
- sal_uInt32 nMul(0); sal_uInt16 nMulS(0);
- if (nOrderSize>=4) pOS2MET->ReadUInt32( nMul );
- else { pOS2MET->ReadUInt16( nMulS ); nMul=static_cast<sal_uInt32>(nMulS)<<8; }
+ sal_uInt32 nMul(0);
+ if (nOrderSize>=4)
+ pOS2MET->ReadUInt32( nMul );
+ else {
+ sal_uInt16 nMulS(0);
+ pOS2MET->ReadUInt16( nMulS );
+ nMul=static_cast<sal_uInt32>(nMulS)<<8;
+ }
if (nMul!=0x00010000) {
nP=(nP*nMul)>>16;
nQ=(nQ*nMul)>>16;
@@ -1180,9 +1185,14 @@ void OS2METReader::ReadPartialArc(bool bGivenPos, sal_uInt16 nOrderSize)
nP = o3tl::saturating_toggle_sign(nP);
if (nQ < 0)
nQ = o3tl::saturating_toggle_sign(nQ);
- sal_uInt32 nMul(0); sal_uInt16 nMulS(0);
- if (nOrderSize>=12) pOS2MET->ReadUInt32( nMul );
- else { pOS2MET->ReadUInt16( nMulS ); nMul=static_cast<sal_uInt32>(nMulS)<<8; }
+ sal_uInt32 nMul(0);
+ if (nOrderSize>=12)
+ pOS2MET->ReadUInt32( nMul );
+ else {
+ sal_uInt16 nMulS(0);
+ pOS2MET->ReadUInt16( nMulS );
+ nMul=static_cast<sal_uInt32>(nMulS)<<8;
+ }
if (nMul!=0x00010000) {
nP=(nP*nMul)>>16;
nQ=(nQ*nMul)>>16;
@@ -1714,7 +1724,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
case GOrdPIvAtr: PushAttr(nOrderID);
[[fallthrough]];
case GOrdSIvAtr: {
- sal_uInt8 nA, nP, nFlags, nMix;
+ sal_uInt8 nA, nP, nFlags;
Color aCol;
RasterOp eROP;
pOS2MET->ReadUChar( nA ).ReadUChar( nP ).ReadUChar( nFlags );
@@ -1763,6 +1773,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
}
}
else {
+ sal_uInt8 nMix;
pOS2MET->ReadUChar( nMix );
if (nMix==0) {
switch (nP) {
@@ -1790,7 +1801,6 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
[[fallthrough]];
case GOrdSIxCol: {
sal_uInt8 nFlags;
- Color aCol;
pOS2MET->ReadUChar( nFlags );
if ((nFlags&0x80)!=0) {
aAttr.aLinCol=aDefAttr.aLinCol;
@@ -1800,6 +1810,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
aAttr.aImgCol=aDefAttr.aImgCol;
}
else {
+ Color aCol;
const auto nVal = ReadLittleEndian3BytesLong();
if ((nFlags&0x40)!=0 && nVal==1) aCol=COL_BLACK;
else if ((nFlags&0x40)!=0 && nVal==2) aCol=COL_WHITE;
@@ -1817,10 +1828,9 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
[[fallthrough]];
case GOrdSColor:
case GOrdSXtCol: {
- sal_uInt8 nbyte;
sal_uInt16 nVal;
- Color aCol;
if (nOrderID==GOrdPColor || nOrderID==GOrdSColor) {
+ sal_uInt8 nbyte;
pOS2MET->ReadUChar( nbyte ); nVal=static_cast<sal_uInt16>(nbyte)|0xff00;
}
else pOS2MET->ReadUInt16( nVal );
@@ -1832,6 +1842,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
aAttr.aImgCol=aDefAttr.aImgCol;
}
else {
+ Color aCol;
if (nVal==0x0007) aCol=COL_WHITE;
else if (nVal==0x0008) aCol=COL_BLACK;
else if (nVal==0xff08) aCol=GetPaletteColor(1);
@@ -1846,7 +1857,6 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
[[fallthrough]];
case GOrdSBgCol: {
sal_uInt16 nVal;
- Color aCol;
pOS2MET->ReadUInt16( nVal );
if (nVal==0x0000 || nVal==0xff00) {
aAttr.aLinBgCol=aDefAttr.aLinBgCol;
@@ -1856,6 +1866,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
aAttr.aImgBgCol=aDefAttr.aImgBgCol;
}
else {
+ Color aCol;
if (nVal==0x0007) aCol=COL_WHITE;
else if (nVal==0x0008) aCol=COL_BLACK;
else if (nVal==0xff08) aCol=GetPaletteColor(0);
@@ -1869,7 +1880,6 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
[[fallthrough]];
case GOrdSBxCol: {
sal_uInt8 nFlags;
- Color aCol;
pOS2MET->ReadUChar( nFlags );
if ((nFlags&0x80)!=0) {
aAttr.aLinBgCol=aDefAttr.aLinBgCol;
@@ -1879,6 +1889,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
aAttr.aImgBgCol=aDefAttr.aImgBgCol;
}
else {
+ Color aCol;
const auto nVal = ReadLittleEndian3BytesLong();
if ((nFlags&0x40)!=0 && nVal==1) aCol=COL_BLACK;
else if ((nFlags&0x40)!=0 && nVal==2) aCol=COL_WHITE;
@@ -2042,7 +2053,6 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
case GOrdPChCel: PushAttr(nOrderID);
[[fallthrough]];
case GOrdSChCel: {
- sal_uInt8 nbyte;
sal_uInt16 nLen=nOrderLen;
auto nWidth = ReadCoord(bCoord32);
auto nHeight = ReadCoord(bCoord32);
@@ -2055,6 +2065,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
pOS2MET->SeekRel(4); nLen-=4;
}
if (nLen>=2) {
+ sal_uInt8 nbyte;
pOS2MET->ReadUChar( nbyte );
if ((nbyte&0x80)==0 && aAttr.aChrCellSize==Size(0,0))
aAttr.aChrCellSize = aDefAttr.aChrCellSize;
@@ -2109,12 +2120,12 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
case GOrdPMkCel: PushAttr(nOrderID);
[[fallthrough]];
case GOrdSMkCel: {
- sal_uInt8 nbyte;
sal_uInt16 nLen=nOrderLen;
aAttr.aMrkCellSize.setWidth(ReadCoord(bCoord32) );
aAttr.aMrkCellSize.setHeight(ReadCoord(bCoord32) );
if (bCoord32) nLen-=8; else nLen-=4;
if (nLen>=2) {
+ sal_uInt8 nbyte;
pOS2MET->ReadUChar( nbyte );
if ((nbyte&0x80)==0 && aAttr.aMrkCellSize==Size(0,0))
aAttr.aMrkCellSize=aDefAttr.aMrkCellSize;
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 9e3e37b42930..9c9b916a1d8c 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -793,10 +793,9 @@ bool CCIDecompressor::ReadEOL()
bool CCIDecompressor::Read2DTag()
{
- sal_uInt8 nByte;
-
// read a bit and return sal_True if it's 0, otherwise return sal_False
if (nInputBitsBufSize==0) {
+ sal_uInt8 nByte;
pIStream->ReadUChar( nByte );
if ( nOptions & CCI_OPTION_INVERSEBITORDER )
nByte = pByteSwap[ nByte ];
@@ -810,10 +809,9 @@ bool CCIDecompressor::Read2DTag()
sal_uInt8 CCIDecompressor::ReadBlackOrWhite()
{
- sal_uInt8 nByte;
-
// read a bit and deliver 0x00 if it's 0, otherwise 0xff
if (nInputBitsBufSize==0) {
+ sal_uInt8 nByte;
pIStream->ReadUChar( nByte );
if ( nOptions & CCI_OPTION_INVERSEBITORDER )
nByte = pByteSwap[ nByte ];
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 24dcabe0277e..f9f3f7197f21 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1484,10 +1484,8 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans
bool bCreateFillStyles = false;
std::unique_ptr<GraphicAttr> pGraphicAttr;
- OUString aGraphicUrl;
uno::Reference<graphic::XGraphic> xGraphic;
- drawing::BitmapMode eBitmapMode(drawing::BitmapMode_NO_REPEAT);
uno::Any aAny;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, rSource ) )
@@ -1500,6 +1498,8 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans
sal_Int16 nGreen(0);
sal_Int16 nBlue(0);
double fGamma(1.0);
+ drawing::BitmapMode eBitmapMode(drawing::BitmapMode_NO_REPEAT);
+ OUString aGraphicUrl;
sal_uInt16 nAngle = 0;
if ( rSource == "MetaFile" )
@@ -2194,7 +2194,6 @@ bool EscherPropertyContainer::CreateConnectorProperties(
if ( rXShape.is() )
{
- awt::Point aStartPoint, aEndPoint;
uno::Reference<beans::XPropertySet> aXPropSet;
uno::Reference<drawing::XShape> aShapeA, aShapeB;
uno::Any aAny( rXShape->queryInterface( cppu::UnoType<beans::XPropertySet>::get()));
@@ -2206,10 +2205,10 @@ bool EscherPropertyContainer::CreateConnectorProperties(
aAny >>= eCt;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "EdgeStartPoint" ) )
{
- aStartPoint = *o3tl::doAccess<awt::Point>(aAny);
+ awt::Point aStartPoint = *o3tl::doAccess<awt::Point>(aAny);
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "EdgeEndPoint" ) )
{
- aEndPoint = *o3tl::doAccess<awt::Point>(aAny);
+ awt::Point aEndPoint = *o3tl::doAccess<awt::Point>(aAny);
rShapeFlags = ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty | ShapeFlag::Connector;
rGeoRect = awt::Rectangle( aStartPoint.X, aStartPoint.Y,
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 08657c686369..314675319449 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1117,10 +1117,11 @@ static void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyRe
sal_uInt32 nPos = rIn.Tell();
if ( rProperties.IsProperty( DFF_Prop_fillShadeColors ) )
{
- sal_uInt16 i = 0, nNumElem = 0, nNumElemReserved = 0, nSize = 0;
+ sal_uInt16 i = 0, nNumElem = 0;
bool bOk = false;
if (rProperties.SeekToContent(DFF_Prop_fillShadeColors, rIn))
{
+ sal_uInt16 nNumElemReserved = 0, nSize = 0;
rIn.ReadUInt16( nNumElem ).ReadUInt16( nNumElemReserved ).ReadUInt16( nSize );
//sanity check that the stream is long enough to fulfill nNumElem * 2 sal_Int32s
bOk = rIn.remainingSize() / (2*sizeof(sal_Int32)) >= nNumElem;
@@ -2394,11 +2395,11 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
{
css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair > aGluePoints;
sal_uInt16 nNumElemVert = 0;
- sal_uInt16 nNumElemMemVert = 0;
sal_uInt16 nElemSizeVert = 8;
if ( SeekToContent( DFF_Prop_connectorPoints, rIn ) )
{
+ sal_uInt16 nNumElemMemVert = 0;
rIn.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert ).ReadUInt16( nElemSizeVert );
// If this value is 0xFFF0 then this record is an array of truncated 8 byte elements. Only the 4
// low-order bytes are recorded
@@ -2783,7 +2784,6 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet, sal_uInt32 eMSO_F
//So below var is defined.
sal_Int32 nChgColors = 0;
sal_Int32 nAngle = GetPropertyValue( DFF_Prop_fillAngle, 0 );
- sal_Int32 nRotateAngle = 0;
if(nAngle >= 0)
nChgColors ^= 1;
@@ -2796,7 +2796,7 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet, sal_uInt32 eMSO_F
//Rotate angle
if ( mbRotateGranientFillWithAngle )
{
- nRotateAngle = GetPropertyValue( DFF_Prop_Rotation, 0 );
+ sal_Int32 nRotateAngle = GetPropertyValue( DFF_Prop_Rotation, 0 );
if(nRotateAngle)//fixed point number
nRotateAngle = ( static_cast<sal_Int16>( nRotateAngle >> 16) * 100L ) + ( ( ( nRotateAngle & 0x0000ffff) * 100L ) >> 16 );
nRotateAngle = ( nRotateAngle + 5 ) / 10 ;//round up
@@ -3760,7 +3760,6 @@ static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Gra
SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, const DffObjData& rObjData )
{
SdrObject* pRet = nullptr;
- OUString aFileName;
OUString aLinkFileName, aLinkFilterName;
tools::Rectangle aVisArea;
@@ -3771,6 +3770,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
// Graphic linked
bLinkGrf = 0 != ( eFlags & mso_blipflagLinkToFile );
{
+ OUString aFileName;
Graphic aGraf; // be sure this graphic is deleted before swapping out
if( SeekToContent( DFF_Prop_pibName, rSt ) )
aFileName = MSDFFReadZString( rSt, GetPropertyValue( DFF_Prop_pibName, 0 ), true );
@@ -4596,7 +4596,6 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
// result in wrong positions in Writer and Calc, see tdf#124029.
// We workaround this problem, by setting a suitable viewBox.
bool bIsImportPPT(GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_PPT);
- css::awt::Rectangle aViewBox_LO; // in LO coordinate system
if (bIsImportPPT || aPieRect_MS.getWidth() == 0 || aPieRect_MS.getHeight() == 0)
{ // clear item, so that default from EnhancedCustomShapeGeometry is used
aGeometryItem.ClearPropertyValue(sViewBox);
@@ -4605,6 +4604,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
{
double fX((aPieRect_MS.getMinX() - aEllipseRect_MS.getMinX()) / 2.0);
double fY((aPieRect_MS.getMinY() - aEllipseRect_MS.getMinY()) / 2.0);
+ css::awt::Rectangle aViewBox_LO; // in LO coordinate system
aViewBox_LO.X = static_cast<sal_Int32>(fX);
aViewBox_LO.Y = static_cast<sal_Int32>(fY);
aViewBox_LO.Width = static_cast<sal_Int32>(aPieRect_MS.getWidth() / 2.0);
@@ -5797,7 +5797,7 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL )
if (!nOffsDggL)
return;
- sal_uInt32 nDummy, nOldPos = rStCtrl.Tell();
+ sal_uInt32 nOldPos = rStCtrl.Tell();
if (nOffsDggL == rStCtrl.Seek(nOffsDggL))
{
@@ -5809,6 +5809,7 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL )
{
aDggAtomHd.SeekToContent( rStCtrl );
sal_uInt32 nCurMaxShapeId;
+ sal_uInt32 nDummy;
rStCtrl.ReadUInt32( nCurMaxShapeId )
.ReadUInt32( mnIdClusters )
.ReadUInt32( nDummy )
@@ -7144,9 +7145,6 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo
return xObj;
}
- // TODO/LATER: ViewAspect must be passed from outside!
- sal_Int64 nViewAspect = embed::Aspects::MSOLE_CONTENT;
-
// JP 26.10.2001: Bug 93374 / 91928 the writer
// objects need the correct visarea needs the
// correct visarea, but this is not true for
@@ -7158,6 +7156,8 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo
// TODO/LATER: it might make sense in future to set the size stored in internal object
if( !pName && ( sStarName == "swriter" || sStarName == "scalc" ) )
{
+ // TODO/LATER: ViewAspect must be passed from outside!
+ sal_Int64 nViewAspect = embed::Aspects::MSOLE_CONTENT;
MapMode aMapMode( VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nViewAspect ) ) );
Size aSz;
if ( rVisArea.IsEmpty() )
@@ -7337,9 +7337,9 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
if ( nAspect != embed::Aspects::MSOLE_ICON )
{
// working with visual area can switch the object to running state
- awt::Size aAwtSz;
try
{
+ awt::Size aAwtSz;
// the provided visual area should be used, if there is any
if ( rVisArea.IsEmpty() )
{
diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx
index 6bed0d99351f..43d31aeccd25 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -327,12 +327,11 @@ void TBCData::ImportToolBarControl( CustomToolBarImportHelper& helper, std::vect
else if ( rHeader.getTct() == 0x0a )
{
aProp.Name = "CommandURL";
- OUString sMenuBar("private:resource/menubar/");
TBCMenuSpecific* pMenu = getMenuSpecific();
if ( pMenu )
{
- sMenuBar += pMenu->Name();
+ OUString sMenuBar = "private:resource/menubar/" + pMenu->Name();
aProp.Value <<= sMenuBar; // name of popup
}
nStyle |= ui::ItemStyle::DROP_DOWN;
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 4e2811d04772..5d29ed9a3a4f 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -628,13 +628,14 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic
{
for ( ; i > 0; i-- )
{
- sal_uInt32 nIndex, nPos = rSt.Tell();
- sal_uInt8 nDummy, nRed, nGreen, nBlue;
+ sal_uInt32 nPos = rSt.Tell();
sal_uInt16 nChanged;
rSt.ReadUInt16( nChanged );
if ( nChanged & 1 )
{
+ sal_uInt8 nDummy, nRed, nGreen, nBlue;
sal_uInt32 nColor = 0;
+ sal_uInt32 nIndex;
rSt.ReadUChar( nDummy )
.ReadUChar( nRed )
.ReadUChar( nDummy )
@@ -2121,12 +2122,12 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
if ( aAt.nPersistPtr && ( aAt.nPersistPtr < m_nPersistPtrCnt ) )
{
- sal_uInt32 nId;
rStCtrl.Seek( m_pPersistPtr[ aAt.nPersistPtr ] );
DffRecordHeader aHd;
ReadDffRecordHeader( rStCtrl, aHd );
if ( aHd.nRecType == DFF_PST_ExOleObjStg )
{
+ sal_uInt32 nId;
rStCtrl.ReadUInt32( nId );
aOleObjectList.emplace_back(
aAt.nId, aHd.nFilePos, pShell, nRecType, aAt.nAspect );
@@ -3252,11 +3253,11 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
auto nHdEndRecPos = DffPropSet::SanitizeEndPos(rSt, aHd.GetRecEndFilePos());
while ( ( rSt.GetError() == ERRCODE_NONE ) && ( rSt.Tell() < nHdEndRecPos ) )
{
- sal_uInt16 nType;
DffRecordHeader aBuGraAtomHd;
ReadDffRecordHeader( rSt, aBuGraAtomHd );
if ( aBuGraAtomHd.nRecType == PPT_PST_ExtendedBuGraAtom )
{
+ sal_uInt16 nType;
rSt.ReadUInt16( nType );
Graphic aGraphic;
if ( SvxMSDffManager::GetBLIPDirect( rSt, aGraphic ) )
@@ -4899,7 +4900,7 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, const DffRecordHeader
}
if ( nMask & 0x0020 ) // buColor
{
- sal_uInt32 nVal32, nHiByte;
+ sal_uInt32 nVal32;
rIn.ReadUInt32( nVal32 );
if (!rIn.good())
{
@@ -4907,6 +4908,7 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, const DffRecordHeader
}
else
{
+ sal_uInt32 nHiByte;
nHiByte = nVal32 >> 24;
if ( nHiByte <= 8 )
nVal32 = nHiByte | PPT_COLSCHEME;
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 169b78bfea75..09dc879f85d9 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -330,7 +330,6 @@ static OUString getMimetypeForDocument( const Reference< XComponentContext >& xC
if ( !aDocServiceName.isEmpty() )
{
// get the actual filter name
- OUString aFilterName;
Reference< lang::XMultiServiceFactory > xConfigProvider =
configuration::theDefaultProvider::get( xContext );
uno::Sequence< uno::Any > aArgs( 1 );
@@ -348,6 +347,7 @@ static OUString getMimetypeForDocument( const Reference< XComponentContext >& xC
xSOFConfig->getByName( aDocServiceName ) >>= xApplConfig;
if ( xApplConfig.is() )
{
+ OUString aFilterName;
xApplConfig->getByName( "ooSetupFactoryActualFilter" ) >>= aFilterName;
if( !aFilterName.isEmpty() )
{
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 1b8dec4d6672..8ca9eb0327d6 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1220,11 +1220,11 @@ void SVGFilter::implGenerateMetaData()
}
sal_Int32 nChange(0);
- double fSlideDuration(0);
if( xPropSet->getPropertySetInfo()->hasPropertyByName( "Change" ) &&
(xPropSet->getPropertyValue( "Change" ) >>= nChange ) && nChange == 1 )
{
+ double fSlideDuration(0);
if( xPropSet->getPropertySetInfo()->hasPropertyByName( "HighResDuration" ) &&
(xPropSet->getPropertyValue( "HighResDuration" ) >>= fSlideDuration) )
{
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 4a35b01e9dfd..5790836fbb6d 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -342,7 +342,7 @@ void SVGAttributeWriter::SetFontAttr( const vcl::Font& rFont )
if( rFont == rCurFont )
return;
- OUString aFontStyle, aTextDecoration;
+ OUString aFontStyle;
sal_Int32 nFontWeight;
rCurFont = rFont;
@@ -387,6 +387,7 @@ void SVGAttributeWriter::SetFontAttr( const vcl::Font& rFont )
if( mrExport.IsUseNativeTextDecoration() )
{
+ OUString aTextDecoration;
if( rFont.GetUnderline() != LINESTYLE_NONE || rFont.GetStrikeout() != STRIKEOUT_NONE )
{
if( rFont.GetUnderline() != LINESTYLE_NONE )
@@ -1122,9 +1123,6 @@ bool SVGTextWriter::nextTextPortion()
mbIsPlaceholderShape = false;
if( mrTextPortionEnumeration.is() && mrTextPortionEnumeration->hasMoreElements() )
{
-#if OSL_DEBUG_LEVEL > 0
- OUString sInfo;
-#endif
Reference< XPropertySet > xPortionPropSet( mrTextPortionEnumeration->nextElement(), UNO_QUERY );
Reference< XPropertySetInfo > xPortionPropInfo( xPortionPropSet->getPropertySetInfo() );
Reference < XTextRange > xPortionTextRange( xPortionPropSet, UNO_QUERY);
@@ -1132,6 +1130,7 @@ bool SVGTextWriter::nextTextPortion()
&& xPortionPropInfo->hasPropertyByName( "TextPortionType" ) )
{
#if OSL_DEBUG_LEVEL > 0
+ OUString sInfo;
OUString sPortionType;
if( xPortionPropSet->getPropertyValue( "TextPortionType" ) >>= sPortionType )
{
@@ -2788,7 +2787,6 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx,
bool bCached = false;
Graphic aGraphic;
- bool bPNG = false;
bool bJPG = false;
if (pShape)
{
@@ -2798,6 +2796,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx,
const BitmapEx& rGraphicBitmap = aGraphic.GetBitmapExRef();
if (rGraphicBitmap.GetChecksum() == rBmpEx.GetChecksum())
{
+ bool bPNG = false;
GfxLink aGfxLink = aGraphic.GetGfxLink();
if (aGfxLink.GetType() == GfxLinkType::NativePng)
{
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index 13a1841f7f7e..ddc50a74ab62 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -610,7 +610,6 @@ sal_Int16 T602ImportFilter::readnum(unsigned char *ch, bool show)
unsigned char T602ImportFilter::Setformat602(const char *cmd)
{
unsigned char ch;
- sal_Int16 i;
ch = Readchar602();
@@ -637,7 +636,7 @@ unsigned char T602ImportFilter::Setformat602(const char *cmd)
else if (cmd[0]=='P' && cmd[1]=='L') format602.pl = readnum(&ch,false);
else if (cmd[0]=='P' && cmd[1]=='A') { if(pst.pars) par602(true); }
else if (cmd[0]=='C' && cmd[1]=='P') {
- i = readnum(&ch,false);
+ sal_Int16 i = readnum(&ch,false);
if ((i+pst.pars/2) > (format602.pl-format602.mt-format602.mb))
if(pst.pars) par602(true);
}