[Libreoffice-commits] core.git: 5 commits - lotuswordpro/source
Stephan Bergmann
sbergman at redhat.com
Tue Oct 13 09:30:51 PDT 2015
lotuswordpro/source/filter/lwpatomholder.cxx | 2 +-
lotuswordpro/source/filter/lwpfootnote.cxx | 2 --
lotuswordpro/source/filter/lwpframelayout.cxx | 2 --
lotuswordpro/source/filter/lwpfribptr.cxx | 6 ++----
lotuswordpro/source/filter/lwptools.cxx | 8 ++------
lotuswordpro/source/filter/lwptools.hxx | 2 +-
6 files changed, 6 insertions(+), 16 deletions(-)
New commits:
commit 6cc9c8c6b540bb6a830bf6571b69b8bd031fa195
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 13 18:06:13 2015 +0200
clang-analyzer-deadcode.DeadStores
Change-Id: If934445fc597015198486445c9d33ad2994d6fee
diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx
index bf72f62..525471b 100644
--- a/lotuswordpro/source/filter/lwpframelayout.cxx
+++ b/lotuswordpro/source/filter/lwpframelayout.cxx
@@ -462,8 +462,6 @@ void LwpFrame::ApplyPosType(XFFrameStyle* pFrameStyle)
{
eXPos = enumXFFrameXPosFromLeft;
eXRel = enumXFFrameXRelPage;
- eYPos = enumXFFrameYPosBelow; //below
- eYRel = enumXFFrameYRelChar; //from char
//set vertical position
LwpVirtualLayout* pContainer = m_pLayout->GetContainerLayout();
if(pContainer && pContainer->IsPage())//in page
commit 7ea8f8af1c78c2144d0d6fe86c9e72ebca2038b7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 13 17:57:14 2015 +0200
clang-analyzer-deadcode.DeadStores
...and reduction of variable scope
Change-Id: I1fa14c04646bf9faf35de9e54969589be64ea006
diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx
index 5e3d1e5..e149f62 100644
--- a/lotuswordpro/source/filter/lwpfribptr.cxx
+++ b/lotuswordpro/source/filter/lwpfribptr.cxx
@@ -90,11 +90,9 @@ LwpFribPtr::LwpFribPtr()
LwpFribPtr::~LwpFribPtr()
{
- LwpFrib* pNextFrib = m_pFribs;
- LwpFrib* pCurFrib = m_pFribs;
- while(pCurFrib)
+ for (LwpFrib* pCurFrib = m_pFribs; pCurFrib;)
{
- pNextFrib = pCurFrib -> GetNext();
+ LwpFrib* pNextFrib = pCurFrib -> GetNext();
delete pCurFrib;
pCurFrib = pNextFrib;
}
commit a6aec01230185e3dbd1118e5f2cb690d2998d034
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 13 17:54:23 2015 +0200
clang-analyzer-deadcode.DeadStores
...ever since cc316b39d9110c536e1758a4f814738ca209bb02 "Port of Lotus Word Pro
filter, by Fong Lin and Noel Power"
Change-Id: Ia060ac0fb631d076fefb168ee96d8d2054634fca
diff --git a/lotuswordpro/source/filter/lwpfootnote.cxx b/lotuswordpro/source/filter/lwpfootnote.cxx
index 3001db6..4a319c0 100644
--- a/lotuswordpro/source/filter/lwpfootnote.cxx
+++ b/lotuswordpro/source/filter/lwpfootnote.cxx
@@ -254,7 +254,6 @@ LwpDocument* LwpFootnote::GetFootnoteTableDivision()
case FN_DIVISIONGROUP_SEPARATE:
{
pDivision = pPrev->GetLastInGroupWithContents();
- pPrev = pDivision;
break;
}
case FN_DOCUMENT:
@@ -263,7 +262,6 @@ LwpDocument* LwpFootnote::GetFootnoteTableDivision()
pDivision = pFootnoteDivision->GetRootDocument();
if (pDivision)
pDivision = pDivision->GetLastDivisionWithContents();
- pPrev = pDivision;
break;
}
commit 7f44f0b5083fda151f32955f4334b318e2386681
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 13 17:51:17 2015 +0200
Return value of LwpTools::QuickReadUnicode is unused
...since previous commit
Change-Id: I439c8d66a826624a3131b56d96ff3fdd030abb28
diff --git a/lotuswordpro/source/filter/lwptools.cxx b/lotuswordpro/source/filter/lwptools.cxx
index 4838521..6c2a3c1 100644
--- a/lotuswordpro/source/filter/lwptools.cxx
+++ b/lotuswordpro/source/filter/lwptools.cxx
@@ -80,12 +80,10 @@ using namespace ::osl;
/**
* @descr read lwp unicode string from stream to OUString per aEncoding
*/
-sal_uInt16 LwpTools::QuickReadUnicode(LwpObjectStream* pObjStrm,
+void LwpTools::QuickReadUnicode(LwpObjectStream* pObjStrm,
OUString& str, sal_uInt16 strlen, rtl_TextEncoding aEncoding)
//strlen: length of bytes
{
-
- sal_uInt16 readLen = 0;
OUStringBuffer strBuf(128);
if( !IsUnicodePacked(pObjStrm, strlen) )
@@ -100,11 +98,9 @@ sal_uInt16 LwpTools::QuickReadUnicode(LwpObjectStream* pObjStrm,
buf[len] = '\0';
strBuf.append( OUString(buf, len, aEncoding) );
strlen -= len;
- readLen += len;
if(!len) break;
}
str = strBuf.makeStringAndClear();
- return readLen;
}
else
{
@@ -116,6 +112,7 @@ sal_uInt16 LwpTools::QuickReadUnicode(LwpObjectStream* pObjStrm,
bool flag = false; //switch if unicode part reached
sal_uInt16 sublen = 0;
+ sal_uInt16 readLen = 0;
while(readLen<strlen)
{
if(!flag) //Not unicode string
@@ -174,7 +171,6 @@ sal_uInt16 LwpTools::QuickReadUnicode(LwpObjectStream* pObjStrm,
}
}
str = strBuf.makeStringAndClear();
- return readLen;
}
}
diff --git a/lotuswordpro/source/filter/lwptools.hxx b/lotuswordpro/source/filter/lwptools.hxx
index 05ea62e..c5d11e6 100644
--- a/lotuswordpro/source/filter/lwptools.hxx
+++ b/lotuswordpro/source/filter/lwptools.hxx
@@ -86,7 +86,7 @@ class LwpTools
{
public:
- static sal_uInt16 QuickReadUnicode( LwpObjectStream* pObjStrm,
+ static void QuickReadUnicode( LwpObjectStream* pObjStrm,
OUString& str, sal_uInt16 strlen, rtl_TextEncoding aEncoding );
static bool IsUnicodePacked(LwpObjectStream* pObjStrm, sal_uInt16 len);
commit 4646c9474f062282ac32919700a5c3749d54300e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 13 17:48:09 2015 +0200
clang-analyzer-deadcode.DeadStores
...ever since cc316b39d9110c536e1758a4f814738ca209bb02 "Port of Lotus Word Pro
filter, by Fong Lin and Noel Power"
Change-Id: Ia7eb16a63c53a43f6c57e26aa629f7c9cf7ef089
diff --git a/lotuswordpro/source/filter/lwpatomholder.cxx b/lotuswordpro/source/filter/lwpatomholder.cxx
index 922ef65..f28a4c0 100644
--- a/lotuswordpro/source/filter/lwpatomholder.cxx
+++ b/lotuswordpro/source/filter/lwpatomholder.cxx
@@ -84,7 +84,7 @@ void LwpAtomHolder::Read(LwpObjectStream *pStrm)
//rtl_TextEncoding rEncode = osl_getThreadTextEncoding();
rtl_TextEncoding rEncode = RTL_TEXTENCODING_MS_1252;
- len = LwpTools::QuickReadUnicode(pStrm, m_String, diskSize-sizeof(diskSize), rEncode);
+ LwpTools::QuickReadUnicode(pStrm, m_String, diskSize-sizeof(diskSize), rEncode);
}
/**
* @descr skip the atom holder in object stream
More information about the Libreoffice-commits
mailing list