summaryrefslogtreecommitdiff
path: root/lotuswordpro/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-23 16:05:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-25 17:19:48 +0200
commit93d42c1b23721120fd2b61ee0b8842a14fd9b6b8 (patch)
tree5a2c4108ad65f7171a6c9bbf87199c874693a703 /lotuswordpro/source
parenta006f60b6ae22db6acb57d06167a3c6fd8bc6f1b (diff)
loplugin:oncevar in l10ntools..mysqlc
Change-Id: Ifd4826f8ba4e10f2e012172fa693794d68bb6b4d Reviewed-on: https://gerrit.libreoffice.org/39188 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r--lotuswordpro/source/filter/LotusWordProImportFilter.cxx5
-rw-r--r--lotuswordpro/source/filter/bencont.cxx4
-rw-r--r--lotuswordpro/source/filter/explode.cxx3
-rw-r--r--lotuswordpro/source/filter/lwpatomholder.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpdrawobj.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpframelayout.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpfribmark.cxx7
-rw-r--r--lotuswordpro/source/filter/lwpmarker.cxx16
-rw-r--r--lotuswordpro/source/filter/lwpobjstrm.cxx3
-rw-r--r--lotuswordpro/source/filter/lwptblformula.cxx3
-rw-r--r--lotuswordpro/source/filter/xfilter/xftextcontent.cxx3
11 files changed, 17 insertions, 41 deletions
diff --git a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
index 2979e6cd5bd1..525f057d7108 100644
--- a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
+++ b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
@@ -66,9 +66,8 @@ bool SAL_CALL LotusWordProImportFilter::importImpl( const Sequence< css::beans::
return false;
// An XML import service: what we push sax messages to..
- OUString sXMLImportService ( "com.sun.star.comp.Writer.XMLImporter" );
-
- uno::Reference< XDocumentHandler > xInternalHandler( mxContext->getServiceManager()->createInstanceWithContext( sXMLImportService, mxContext ), UNO_QUERY );
+ uno::Reference< XDocumentHandler > xInternalHandler(
+ mxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.comp.Writer.XMLImporter", mxContext ), UNO_QUERY );
uno::Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
if (xImporter.is())
xImporter->setTargetDocument(mxDoc);
diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx
index ed15dc9858a6..8bd6ab2331df 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -72,8 +72,6 @@ const char gsBenMagicBytes[] = BEN_MAGIC_BYTES;
*/
sal_uLong BenOpenContainer(LwpSvStream * pStream, LtcBenContainer ** ppContainer)
{
- BenError Err;
-
*ppContainer = nullptr;
if (nullptr == pStream)
@@ -82,7 +80,7 @@ sal_uLong BenOpenContainer(LwpSvStream * pStream, LtcBenContainer ** ppContainer
}
LtcBenContainer * pContainer = new LtcBenContainer(pStream);
- if ((Err = pContainer->Open()) != BenErr_OK) // delete two inputs
+ if (pContainer->Open() != BenErr_OK) // delete two inputs
{
delete pContainer;
return BenErr_InvalidTOC;
diff --git a/lotuswordpro/source/filter/explode.cxx b/lotuswordpro/source/filter/explode.cxx
index 2e95dd03d34b..54fe504fa48f 100644
--- a/lotuswordpro/source/filter/explode.cxx
+++ b/lotuswordpro/source/filter/explode.cxx
@@ -445,8 +445,7 @@ void Decompression::fillArray()
m_iArrayOfM[0] = 7;
for (int i=1; i < 16; i++)
{
- double dR = 2.0;
- m_iArrayOfM[i] = m_iArrayOfM[i - 1]+ (sal_uInt32)pow(dR, i-1);//2
+ m_iArrayOfM[i] = m_iArrayOfM[i - 1]+ (sal_uInt32)pow(2.0, i-1);//2
}
}
diff --git a/lotuswordpro/source/filter/lwpatomholder.cxx b/lotuswordpro/source/filter/lwpatomholder.cxx
index f28a4c020a22..52bba078da0e 100644
--- a/lotuswordpro/source/filter/lwpatomholder.cxx
+++ b/lotuswordpro/source/filter/lwpatomholder.cxx
@@ -82,9 +82,7 @@ void LwpAtomHolder::Read(LwpObjectStream *pStrm)
}
m_nAtom = m_nAssocAtom = len;
- //rtl_TextEncoding rEncode = osl_getThreadTextEncoding();
- rtl_TextEncoding rEncode = RTL_TEXTENCODING_MS_1252;
- LwpTools::QuickReadUnicode(pStrm, m_String, diskSize-sizeof(diskSize), rEncode);
+ LwpTools::QuickReadUnicode(pStrm, m_String, diskSize-sizeof(diskSize), RTL_TEXTENCODING_MS_1252);
}
/**
* @descr skip the atom holder in object stream
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 19649affe271..08688aa6037c 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1073,9 +1073,8 @@ OUString LwpDrawTextBox::RegisterStyle()
// the pFont need to be deleted myself?
rtl::Reference<XFFont> pFont = new XFFont();
- rtl_TextEncoding aEncoding = RTL_TEXTENCODING_MS_1252;
OUString aFontName = OUString(reinterpret_cast<char*>(m_aTextRec.tmpTextFaceName),
- strlen(reinterpret_cast<char*>(m_aTextRec.tmpTextFaceName)), aEncoding);
+ strlen(reinterpret_cast<char*>(m_aTextRec.tmpTextFaceName)), RTL_TEXTENCODING_MS_1252);
pFont->SetFontName(aFontName);
SetFontStyle(pFont, &m_aTextRec);
@@ -1278,9 +1277,8 @@ OUString LwpDrawTextArt::RegisterStyle()
// the pFont need to be deleted myself?
rtl::Reference<XFFont> pFont = new XFFont();
- rtl_TextEncoding aEncoding = RTL_TEXTENCODING_MS_1252;
OUString aFontName = OUString(reinterpret_cast<char*>(m_aTextArtRec.tmpTextFaceName),
- strlen(reinterpret_cast<char*>(m_aTextArtRec.tmpTextFaceName)), aEncoding);
+ strlen(reinterpret_cast<char*>(m_aTextArtRec.tmpTextFaceName)), RTL_TEXTENCODING_MS_1252);
pFont->SetFontName(aFontName);
LwpDrawTextBox::SetFontStyle(pFont, &m_aTextArtRec);
diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx
index 553f907ca742..0a01e9bcccc9 100644
--- a/lotuswordpro/source/filter/lwpframelayout.cxx
+++ b/lotuswordpro/source/filter/lwpframelayout.cxx
@@ -592,8 +592,6 @@ void LwpFrame::ParseAnchorType(XFFrame *pXFFrame)
//set position
double fXOffset = 0;
double fYOffset = 0;
- //page number
- sal_uInt16 nPageNum = 0;
//set anchor type
enumXFAnchor eAnchor = enumXFAnchorNone;
@@ -705,7 +703,7 @@ void LwpFrame::ParseAnchorType(XFFrame *pXFFrame)
pXFFrame->SetX(fXOffset);
pXFFrame->SetY(fYOffset);
- pXFFrame->SetAnchorPage(nPageNum);
+ pXFFrame->SetAnchorPage(0);
pXFFrame->SetAnchorType(eAnchor);
}
diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx
index f1578c128da1..05f4bc81daea 100644
--- a/lotuswordpro/source/filter/lwpfribmark.cxx
+++ b/lotuswordpro/source/filter/lwpfribmark.cxx
@@ -368,14 +368,11 @@ void LwpFribField::RegisterTimeField(LwpFieldMark* pFieldMark)
RegisterTotalTimeStyle();
else
{
- sal_Int32 index;
- sal_Unicode ch1(0x0020);//space
- OUString tag;
- index = sFormula.indexOf(ch1);
+ sal_Int32 index = sFormula.indexOf(0x20); //space
if (index < 0)
return;
- tag = sFormula.copy(0,index);
+ OUString tag = sFormula.copy(0,index);
if (tag == "Now()" || tag == "CreateDate" || tag == "EditDate")
RegisterDateTimeStyle(sFormula.copy(index+1,sFormula.getLength()-index-1));
}
diff --git a/lotuswordpro/source/filter/lwpmarker.cxx b/lotuswordpro/source/filter/lwpmarker.cxx
index 4d1f85943cc9..97ddd200511e 100644
--- a/lotuswordpro/source/filter/lwpmarker.cxx
+++ b/lotuswordpro/source/filter/lwpmarker.cxx
@@ -421,11 +421,7 @@ bool LwpFieldMark::IsFormulaInsert()
bool LwpFieldMark::IsDateTimeField(sal_uInt8& type,OUString& formula)
{
OUString sFormula = m_Formula.str();
- sal_Int32 index;
- sal_Unicode ch1(0x0020);//space
- OUString tag;
-
- index = sFormula.indexOf(ch1);
+ sal_Int32 index = sFormula.indexOf(0x20); // space
if (index < 0)
{
if (sFormula == "TotalEditingTime")
@@ -436,7 +432,7 @@ bool LwpFieldMark::IsDateTimeField(sal_uInt8& type,OUString& formula)
return false;
}
- tag = sFormula.copy(0,index);
+ OUString tag = sFormula.copy(0,index);
if (tag == "Now()")
{
type = DATETIME_NOW;
@@ -468,11 +464,7 @@ bool LwpFieldMark::IsDateTimeField(sal_uInt8& type,OUString& formula)
bool LwpFieldMark::IsCrossRefField(sal_uInt8& nType, OUString& sMarkName)
{
OUString sFormula = m_Formula.str();
- sal_Int32 index;
- sal_Unicode ch1(0x0020);//space
- OUString tag;
-
- index = sFormula.indexOf(ch1);
+ sal_Int32 index = sFormula.indexOf(0x20); // space
if (index < 0)
{
LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
@@ -487,7 +479,7 @@ bool LwpFieldMark::IsCrossRefField(sal_uInt8& nType, OUString& sMarkName)
return false;
}
- tag = sFormula.copy(0,index);
+ OUString tag = sFormula.copy(0,index);
if (tag == "PageRef")
{
sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1);
diff --git a/lotuswordpro/source/filter/lwpobjstrm.cxx b/lotuswordpro/source/filter/lwpobjstrm.cxx
index 398a45dce2a5..f199fe1d2847 100644
--- a/lotuswordpro/source/filter/lwpobjstrm.cxx
+++ b/lotuswordpro/source/filter/lwpobjstrm.cxx
@@ -371,8 +371,7 @@ OUString LwpObjectStream::QuickReadStringPtr()
QuickReaduInt16(); //len
OUString str;
- rtl_TextEncoding rEncode = RTL_TEXTENCODING_MS_1252;
- LwpTools::QuickReadUnicode(this, str, diskSize-sizeof(diskSize), rEncode);
+ LwpTools::QuickReadUnicode(this, str, diskSize-sizeof(diskSize), RTL_TEXTENCODING_MS_1252);
return str;
}
diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx
index f9266770ca86..7ec008bc37c0 100644
--- a/lotuswordpro/source/filter/lwptblformula.cxx
+++ b/lotuswordpro/source/filter/lwptblformula.cxx
@@ -123,14 +123,13 @@ bool LwpFormulaInfo::ReadCellID()
{
LwpRowSpecifier RowSpecifier;
LwpColumnSpecifier ColumnSpecifier;
- bool readSucceeded = true;
RowSpecifier.QuickRead(m_pObjStrm.get());
ColumnSpecifier.QuickRead(m_pObjStrm.get());
m_aStack.push_back( new LwpFormulaCellAddr(ColumnSpecifier.ColumnID(cColumn),
RowSpecifier.RowID(m_nFormulaRow)) );
- return readSucceeded;
+ return true;
}
void LwpFormulaInfo::ReadCellRange()
diff --git a/lotuswordpro/source/filter/xfilter/xftextcontent.cxx b/lotuswordpro/source/filter/xfilter/xftextcontent.cxx
index 1492b09415f7..61a1dccff68a 100644
--- a/lotuswordpro/source/filter/xfilter/xftextcontent.cxx
+++ b/lotuswordpro/source/filter/xfilter/xftextcontent.cxx
@@ -78,7 +78,6 @@ void XFTextContent::SetText(const OUString& text)
void XFTextContent::ToXml(IXFStream *pStrm)
{
// pStrm->Characters(m_strText);
- OUString sSpaceToken(" ");
OUString sSubString;
sal_Int32 nIndex = 0;
sal_Int32 nSize = m_strText.getLength();
@@ -86,7 +85,7 @@ void XFTextContent::ToXml(IXFStream *pStrm)
for (i=0; i<nSize;)
{
sSubString = m_strText.copy(i,nSize-i);
- nIndex = sSubString.indexOf(sSpaceToken);
+ nIndex = sSubString.indexOf(" ");
if (nIndex == -1)
{
pStrm->Characters(sSubString);