summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-02 10:00:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-02 10:37:48 +0100
commit8c7946db697103b56d34ed159d80555f751e55c5 (patch)
tree6c7e04544f5e4de34702453d0711adf66e05f7e0 /lotuswordpro
parent4ebb3eae7b4abb7ecc37df73c6f80e3fd2069ed7 (diff)
loplugin:reducevarscope in lotuswordpro
Change-Id: Ie0aa6b91fe13d24b5cf60abc14cf43c2106b53da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105165 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpbulletstylemgr.cxx3
-rw-r--r--lotuswordpro/source/filter/lwpcontent.cxx2
-rw-r--r--lotuswordpro/source/filter/lwpgrfobj.cxx2
-rw-r--r--lotuswordpro/source/filter/lwpoleobject.cxx2
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx7
-rw-r--r--lotuswordpro/source/filter/xfilter/xfstylecont.cxx2
6 files changed, 8 insertions, 10 deletions
diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
index d22a234ece60..6f5c9711d5b4 100644
--- a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
+++ b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
@@ -114,11 +114,10 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, const LwpBulletO
}
LwpParaProperty* pProp = pPara->GetProperty(PP_LOCAL_INDENT);
- LwpParaIndentProperty* pIndentProp = nullptr;
LwpObjectID aIndentID;
if (pProp)
{
- pIndentProp = static_cast<LwpParaIndentProperty*>(pProp);
+ LwpParaIndentProperty* pIndentProp = static_cast<LwpParaIndentProperty*>(pProp);
aIndentID = pIndentProp->GetIndentID();
}
diff --git a/lotuswordpro/source/filter/lwpcontent.cxx b/lotuswordpro/source/filter/lwpcontent.cxx
index f4f16484303b..0df9f9cb7497 100644
--- a/lotuswordpro/source/filter/lwpcontent.cxx
+++ b/lotuswordpro/source/filter/lwpcontent.cxx
@@ -90,7 +90,6 @@ void LwpContent::Read()
//ClassName.Read(pStrm);
m_ClassName.Read(pStrm);
- LwpObjectID SkipID;
if(LwpFileHeader::m_nFileRevision >= 0x0006)
{
//SkipID.ReadIndexed(pStrm);
@@ -101,6 +100,7 @@ void LwpContent::Read()
if (LwpFileHeader::m_nFileRevision >= 0x0007)
{
+ LwpObjectID SkipID;
if(LwpFileHeader::m_nFileRevision < 0x000B)
{
SkipID.ReadIndexed(pStrm);
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 8d32472ac0c7..986cdff85195 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -571,7 +571,6 @@ void LwpGraphicObject::CreateGrafObject()
};
LwpRect aFrameRect(-fOffsetX, (fDisFrameWidth-fOffsetX), (-fOffsetY), (fDisFrameHeight-fOffsetY));
LwpRect aImageRect(0, fSclGrafWidth, 0, fSclGrafHeight);
- LwpRect aCropRect;
if (aFrameRect.fRight <= aImageRect.fLeft || aFrameRect.fLeft >= aImageRect.fRight
||aFrameRect.fBottom <= aImageRect.fTop|| aFrameRect.fTop >= aImageRect.fBottom)
@@ -581,6 +580,7 @@ void LwpGraphicObject::CreateGrafObject()
else// need cropped
{
// horizontal crop
+ LwpRect aCropRect;
if (aFrameRect.fLeft > aImageRect.fLeft)
{
aCropRect.fLeft = (aFrameRect.fLeft - aImageRect.fLeft) / fXRatio;
diff --git a/lotuswordpro/source/filter/lwpoleobject.cxx b/lotuswordpro/source/filter/lwpoleobject.cxx
index 92e3154f0632..6da021f210d6 100644
--- a/lotuswordpro/source/filter/lwpoleobject.cxx
+++ b/lotuswordpro/source/filter/lwpoleobject.cxx
@@ -198,10 +198,10 @@ void LwpOleObject::Read()
cPersistentFlags = m_pObjStrm->QuickReaduInt16();
// qCMarker read
- LwpObjectID ID;
if (LwpFileHeader::m_nFileRevision >= 0x0004)
{
+ LwpObjectID ID;
m_pObjStrm->QuickReaduInt16();
m_pObjStrm->QuickReadStringPtr();
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index ffbd05208d9b..b6a61d9198ce 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -791,17 +791,16 @@ void LwpTableLayout::ParseTable()
//process header rows
LwpTableHeadingLayout* pTableHeading;
pTableHeading = pSuper->GetTableHeadingLayout();
- sal_uInt16 nStartHeadRow;
- sal_uInt16 nEndHeadRow;
- sal_uInt16 nContentRow;
if (pTableHeading)
{
+ sal_uInt16 nStartHeadRow;
+ sal_uInt16 nEndHeadRow;
pTableHeading->GetStartEndRow(nStartHeadRow,nEndHeadRow);
if (nStartHeadRow != 0)
ConvertTable(m_pXFTable,0,nRow,0,nCol);
else
{
- nContentRow = ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1);
+ sal_uInt16 nContentRow = ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1);
ConvertTable(m_pXFTable,nContentRow,nRow,0,nCol);
}
}
diff --git a/lotuswordpro/source/filter/xfilter/xfstylecont.cxx b/lotuswordpro/source/filter/xfilter/xfstylecont.cxx
index 2d8f9139aaaa..16fe9725cd72 100644
--- a/lotuswordpro/source/filter/xfilter/xfstylecont.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfstylecont.cxx
@@ -84,7 +84,6 @@ IXFStyleRet XFStyleContainer::AddStyle(std::unique_ptr<IXFStyle> pStyle)
IXFStyleRet aRet;
IXFStyle *pConStyle = nullptr;
- OUString name;
if( !pStyle )
return aRet;
@@ -102,6 +101,7 @@ IXFStyleRet XFStyleContainer::AddStyle(std::unique_ptr<IXFStyle> pStyle)
}
else
{
+ OUString name;
if( pStyle->GetStyleName().isEmpty() )
{
name = m_strStyleNamePrefix + OUString::number(m_aStyles.size()+1);