[Libreoffice-commits] core.git: 3 commits - lingucomponent/source sc/source

Caolán McNamara caolanm at redhat.com
Mon Jun 20 11:35:21 UTC 2016


 lingucomponent/source/spellcheck/spell/sspellimp.cxx |    4 +---
 sc/source/ui/cctrl/checklistmenu.cxx                 |    2 +-
 sc/source/ui/unoobj/docuno.cxx                       |    2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 7423629f0abec966bd9403800ca0bd5c96a8b3a6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 20 09:30:02 2016 +0100

    cppcheck: oppositeInnerCondition if new fails, its going to throw
    
    not return nullptr
    
    Change-Id: I8f46e49b28fd9547fb3e32dca0c6b99ee2cd5c7d

diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 69836bc..1d291f1 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -334,9 +334,7 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rL
 #endif
 
                     aDicts[i] = new Hunspell(aTmpaff.getStr(),aTmpdict.getStr());
-                    aDEncs[i] = RTL_TEXTENCODING_DONTKNOW;
-                    if (aDicts[i])
-                        aDEncs[i] = getTextEncodingFromCharset(aDicts[i]->get_dic_encoding());
+                    aDEncs[i] = getTextEncodingFromCharset(aDicts[i]->get_dic_encoding());
                 }
                 pMS = aDicts[i];
                 eEnc = aDEncs[i];
commit a2effff0d0c9b5f86cd6721982fa2e162b73142f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 20 09:23:20 2016 +0100

    cppcheck: catchExceptionByValue
    
    Change-Id: I1e6001d2c806a5808b2c2a8057d0ea403ab0f894

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index b41a200..ac0314a 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -777,7 +777,7 @@ OString ScModelObj::getTextSelection(const char* pMimeType, OString& rUsedMimeTy
     {
         aAny = xTransferable->getTransferData(aFlavor);
     }
-    catch (const datatransfer::UnsupportedFlavorException e)
+    catch (const datatransfer::UnsupportedFlavorException& e)
     {
         OSL_TRACE("Caught UnsupportedFlavorException '%s'", OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
         return OString();
commit 83524482162caf4b875a6ea2c404f5aca46b26a0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 20 09:22:53 2016 +0100

    cppcheck: redundantCondition
    
    Change-Id: I02566ed92197a2573cd4a1a6c7e9fe54aeab3301

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index b3634b9..32e2e11 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1707,7 +1707,7 @@ void ScCheckListBox::CheckEntry( SvTreeListEntry* pParent, bool bCheck )
 SvTreeListEntry* ScCheckListBox::ShowCheckEntry( const OUString& sName, ScCheckListMember& rMember, bool bShow, bool bCheck )
 {
     SvTreeListEntry* pEntry = nullptr;
-    if ( !rMember.mbDate || ( rMember.mbDate && rMember.mpParent ) )
+    if (!rMember.mbDate || rMember.mpParent)
         pEntry = FindEntry( rMember.mpParent, sName );
 
     if ( bShow )


More information about the Libreoffice-commits mailing list