[Libreoffice-commits] core.git: l10ntools/source linguistic/source lotuswordpro/source mysqlc/source

Noel Grandin noel.grandin at collabora.co.uk
Sun Jun 25 15:20:11 UTC 2017


 l10ntools/source/cfgmerge.cxx                           |    3 +--
 l10ntools/source/export.cxx                             |    6 ++----
 l10ntools/source/lngmerge.cxx                           |   11 +++--------
 linguistic/source/dlistimp.cxx                          |   12 ++++--------
 linguistic/source/iprcache.cxx                          |    2 +-
 linguistic/source/lngopt.cxx                            |    3 +--
 linguistic/source/lngsvcmgr.cxx                         |   12 +++++-------
 lotuswordpro/source/filter/LotusWordProImportFilter.cxx |    5 ++---
 lotuswordpro/source/filter/bencont.cxx                  |    4 +---
 lotuswordpro/source/filter/explode.cxx                  |    3 +--
 lotuswordpro/source/filter/lwpatomholder.cxx            |    4 +---
 lotuswordpro/source/filter/lwpdrawobj.cxx               |    6 ++----
 lotuswordpro/source/filter/lwpframelayout.cxx           |    4 +---
 lotuswordpro/source/filter/lwpfribmark.cxx              |    7 ++-----
 lotuswordpro/source/filter/lwpmarker.cxx                |   16 ++++------------
 lotuswordpro/source/filter/lwpobjstrm.cxx               |    3 +--
 lotuswordpro/source/filter/lwptblformula.cxx            |    3 +--
 lotuswordpro/source/filter/xfilter/xftextcontent.cxx    |    3 +--
 mysqlc/source/mysqlc_databasemetadata.cxx               |    3 +--
 mysqlc/source/mysqlc_preparedstatement.cxx              |    3 +--
 mysqlc/source/mysqlc_resultset.cxx                      |    3 +--
 mysqlc/source/mysqlc_statement.cxx                      |    3 +--
 22 files changed, 38 insertions(+), 81 deletions(-)

New commits:
commit 93d42c1b23721120fd2b61ee0b8842a14fd9b6b8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Jun 23 16:05:57 2017 +0200

    loplugin:oncevar in l10ntools..mysqlc
    
    Change-Id: Ifd4826f8ba4e10f2e012172fa693794d68bb6b4d
    Reviewed-on: https://gerrit.libreoffice.org/39188
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index d8ec518c1a3a..e7596e85d0fc 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -262,9 +262,8 @@ void CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
             else
             {
                 OString sError( "Misplaced close tag: " );
-                OString sInFile(" in file ");
                 sError += sToken;
-                sError += sInFile;
+                sError += " in file ";
                 sError += global::inputPathname;
                 yyerror(sError.getStr());
                 std::exit(EXIT_FAILURE);
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index b4995ca04fb5..a3f98ef3f2ac 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -152,8 +152,7 @@ bool ResData::SetId( const OString& rId, IdLevel nLevel )
 
         if ( bChild && bChildWithText )
         {
-            OString sError("ResId after child definition");
-            yyerror(sError.getStr());
+            yyerror("ResId after child definition");
             SetError();
         }
 
@@ -830,9 +829,8 @@ OString Export::FullId()
     }
     if (sFull.getLength() > 255)
     {
-        OString sError("GroupId > 255 chars");
         printf("GroupID = %s\n", sFull.getStr());
-        yyerror(sError.getStr());
+        yyerror("GroupId > 255 chars");
     }
 
     return sFull.makeStringAndClear();
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 540110f99822..0537dd8ebb44 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -122,14 +122,9 @@ void LngParser::WritePO(PoOfstream &aPOStream,
     OStringHashMap &rText_inout, const OString &rActFileName,
     const OString &rID)
 {
-
-   bool bExport = true;
-   if ( bExport )
-    {
-        common::writePoEntry(
-            "Ulfex", aPOStream, rActFileName, "LngText",
-            rID, OString(), rText_inout.count("x-comment") ? rText_inout["x-comment"] : OString(), rText_inout["en-US"]);
-   }
+    common::writePoEntry(
+        "Ulfex", aPOStream, rActFileName, "LngText",
+        rID, OString(), rText_inout.count("x-comment") ? rText_inout["x-comment"] : OString(), rText_inout["en-US"]);
 }
 
 bool LngParser::isNextGroup(OString &sGroup_out, const OString &sLine_in)
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index bff87e2f66ad..02bd690bd314 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -289,8 +289,6 @@ void DicList::SearchForDictionaries(
     const OUString *pDirCnt = aDirCnt.getConstArray();
     sal_Int32 nEntries = aDirCnt.getLength();
 
-    OUString aDCN("dcn");
-    OUString aDCP("dcp");
     for (sal_Int32 i = 0;  i < nEntries;  ++i)
     {
         OUString     aURL( pDirCnt[i] );
@@ -303,9 +301,9 @@ void DicList::SearchForDictionaries(
             sal_Int32 nPos  = aURL.indexOf('.');
             OUString aExt( aURL.copy(nPos + 1).toAsciiLowerCase() );
 
-            if (aDCN.equals(aExt))       // negativ
+            if ("dcn" == aExt)       // negativ
                 bNeg = true;
-            else if (aDCP.equals(aExt))  // positiv
+            else if ("dcp" == aExt)  // positiv
                 bNeg = false;
             else
                 continue;          // andere Files
@@ -350,7 +348,6 @@ sal_Int32 DicList::GetDicPos(const uno::Reference< XDictionary > &xDic)
 {
     osl::MutexGuard aGuard( GetLinguMutex() );
 
-    sal_Int32 nPos = -1;
     DictionaryVec_t& rDicList = GetOrCreateDicList();
     size_t n = rDicList.size();
     for (size_t i = 0;  i < n;  i++)
@@ -358,7 +355,7 @@ sal_Int32 DicList::GetDicPos(const uno::Reference< XDictionary > &xDic)
         if ( rDicList[i] == xDic )
             return i;
     }
-    return nPos;
+    return -1;
 }
 
 /// @throws Exception
@@ -613,9 +610,8 @@ void DicList::CreateDicList()
 
     // create IgnoreAllList dictionary with empty URL (non persistent)
     // and add it to list
-    OUString aDicName( "IgnoreAllList" );
     uno::Reference< XDictionary > xIgnAll(
-            createDictionary( aDicName, LinguLanguageToLocale( LANGUAGE_NONE ),
+            createDictionary( "IgnoreAllList", LinguLanguageToLocale( LANGUAGE_NONE ),
                               DictionaryType_POSITIVE, OUString() ) );
     if (xIgnAll.is())
     {
diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx
index 1b8881ff7867..2f729de770e0 100644
--- a/linguistic/source/iprcache.cxx
+++ b/linguistic/source/iprcache.cxx
@@ -155,7 +155,7 @@ void SAL_CALL FlushListener::processDictionaryListEvent(
     if (rDicListEvent.Source == xDicList)
     {
         sal_Int16 nEvt = rDicListEvent.nCondensedEvent;
-        sal_Int16 nFlushFlags =
+        sal_Int16 const nFlushFlags =
                 DictionaryListEventFlags::ADD_NEG_ENTRY     |
                 DictionaryListEventFlags::DEL_POS_ENTRY     |
                 DictionaryListEventFlags::ACTIVATE_NEG_DIC  |
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index 8a7cfb4d7dca..dd70c516be09 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -126,8 +126,7 @@ OUString LinguOptions::GetName( sal_Int32 nWID )
 
     OUString aRes;
 
-    sal_Int32 nLen = SAL_N_ELEMENTS(aWID_Name);
-    if (0 <= nWID && nWID < nLen && aWID_Name[ nWID ].nWID == nWID)
+    if (0 <= nWID && nWID < sal_Int32(SAL_N_ELEMENTS(aWID_Name)) && aWID_Name[ nWID ].nWID == nWID)
         aRes = OUString::createFromAscii(aWID_Name[nWID].pPropertyName);
     else
         OSL_FAIL("lng : unknown WID");
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index dbaf1de9c0d6..e3f91af32ff2 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -308,7 +308,7 @@ void SAL_CALL
 
     // "translate" DictionaryList event into linguistic2::LinguServiceEvent
     sal_Int16 nLngSvcEvt = 0;
-    sal_Int16 nSpellCorrectFlags =
+    sal_Int16 const nSpellCorrectFlags =
             linguistic2::DictionaryListEventFlags::ADD_NEG_ENTRY        |
             linguistic2::DictionaryListEventFlags::DEL_POS_ENTRY        |
             linguistic2::DictionaryListEventFlags::ACTIVATE_NEG_DIC |
@@ -316,7 +316,7 @@ void SAL_CALL
     if (0 != (nDlEvt & nSpellCorrectFlags))
         nLngSvcEvt |= linguistic2::LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
 
-    sal_Int16 nSpellWrongFlags =
+    sal_Int16 const nSpellWrongFlags =
             linguistic2::DictionaryListEventFlags::ADD_POS_ENTRY        |
             linguistic2::DictionaryListEventFlags::DEL_NEG_ENTRY        |
             linguistic2::DictionaryListEventFlags::ACTIVATE_POS_DIC |
@@ -324,7 +324,7 @@ void SAL_CALL
     if (0 != (nDlEvt & nSpellWrongFlags))
         nLngSvcEvt |= linguistic2::LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
 
-    sal_Int16 nHyphenateFlags =
+    sal_Int16 const nHyphenateFlags =
             linguistic2::DictionaryListEventFlags::ADD_POS_ENTRY        |
             linguistic2::DictionaryListEventFlags::DEL_POS_ENTRY        |
             linguistic2::DictionaryListEventFlags::ACTIVATE_POS_DIC |
@@ -392,28 +392,26 @@ void LngSvcMgrListenerHelper::DisposeAndClear( const lang::EventObject &rEvtObj
 bool LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster(
         const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster )
 {
-    bool bRes = false;
     if (rxBroadcaster.is())
     {
         aLngSvcEvtBroadcasters.addInterface( rxBroadcaster );
         rxBroadcaster->addLinguServiceEventListener(
                 static_cast<linguistic2::XLinguServiceEventListener *>(this) );
     }
-    return bRes;
+    return false;
 }
 
 
 bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster(
         const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster )
 {
-    bool bRes = false;
     if (rxBroadcaster.is())
     {
         aLngSvcEvtBroadcasters.removeInterface( rxBroadcaster );
         rxBroadcaster->removeLinguServiceEventListener(
                 static_cast<linguistic2::XLinguServiceEventListener *>(this) );
     }
-    return bRes;
+    return false;
 }
 
 
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);
diff --git a/mysqlc/source/mysqlc_databasemetadata.cxx b/mysqlc/source/mysqlc_databasemetadata.cxx
index 17b845b2b03b..366b74a8e0d7 100644
--- a/mysqlc/source/mysqlc_databasemetadata.cxx
+++ b/mysqlc/source/mysqlc_databasemetadata.cxx
@@ -659,8 +659,7 @@ rtl::OUString SAL_CALL ODatabaseMetaData::getUserName()
 
 rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName()
 {
-    rtl::OUString aValue( "MySQL Connector/OO.org" );
-    return aValue;
+    return rtl::OUString( "MySQL Connector/OO.org" );
 }
 
 rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion()
diff --git a/mysqlc/source/mysqlc_preparedstatement.cxx b/mysqlc/source/mysqlc_preparedstatement.cxx
index 55223e4c4bea..84d353ef5873 100644
--- a/mysqlc/source/mysqlc_preparedstatement.cxx
+++ b/mysqlc/source/mysqlc_preparedstatement.cxx
@@ -728,8 +728,7 @@ void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,cons
 void OPreparedStatement::checkParameterIndex(sal_Int32 column)
 {
     if (column < 1 || column > (sal_Int32) m_paramCount) {
-        rtl::OUString buf( "Parameter index out of range" );
-        throw SQLException(buf, *this, rtl::OUString(), 1, Any ());
+        throw SQLException("Parameter index out of range", *this, rtl::OUString(), 1, Any ());
     }
 }
 
diff --git a/mysqlc/source/mysqlc_resultset.cxx b/mysqlc/source/mysqlc_resultset.cxx
index ef112b931b8b..d0c3a8303887 100644
--- a/mysqlc/source/mysqlc_resultset.cxx
+++ b/mysqlc/source/mysqlc_resultset.cxx
@@ -1045,8 +1045,7 @@ void OResultSet::checkColumnIndex(sal_Int32 index)
 {
     if ((index < 1 || index > (int) fieldCount)) {
         /* static object for efficiency or thread safety is a problem ? */
-        rtl::OUString buf( "index out of range" );
-        throw SQLException(buf, *this, rtl::OUString(), 1, Any());
+        throw SQLException("index out of range", *this, rtl::OUString(), 1, Any());
     }
 }
 
diff --git a/mysqlc/source/mysqlc_statement.cxx b/mysqlc/source/mysqlc_statement.cxx
index e881dda8ddd4..94e340cb07c9 100644
--- a/mysqlc/source/mysqlc_statement.cxx
+++ b/mysqlc/source/mysqlc_statement.cxx
@@ -291,9 +291,8 @@ sal_Bool OCommonStatement::convertFastPropertyValue(
         Any & /* rConvertedValue */, Any & /* rOldValue */,
         sal_Int32 /* nHandle */, const Any& /* rValue */)
 {
-    bool bConverted = false;
     // here we have to try to convert
-    return bConverted;
+    return false;
 }
 
 void OCommonStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& /* rValue */)


More information about the Libreoffice-commits mailing list