[Libreoffice-commits] core.git: Branch 'private/mst/sw_redlinehide_3' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 19 09:38:51 UTC 2018


 sw/source/core/text/pormulti.cxx |    2 +-
 sw/source/core/text/txtfrm.cxx   |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 0f66e1d9a89cce85a5e23dc7bf99dfe30ac77cb3
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Oct 19 11:12:14 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Oct 19 11:37:00 2018 +0200

    sw_redlinehide_3: fix some unnecessary loops
    
    PVS-Studio complains about the funny code.
    
    Change-Id: I58e2ebcca7e13baa78cfbcc4a654d5badab8d037

diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 3e659366264d..cfc9f858c0d0 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -883,7 +883,7 @@ namespace sw {
             SwpHints const*const pHints(m_pNode->GetpSwpHints());
             if (pHints)
             {
-                while (m_CurrentHint < pHints->Count())
+                if (m_CurrentHint < pHints->Count())
                 {
                     SwTextAttr const*const pHint(pHints->Get(m_CurrentHint));
                     ++m_CurrentHint;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index a07d712cd4c7..74d6253381d4 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -138,7 +138,7 @@ namespace sw {
             SwpHints const*const pHints(m_pNode->GetpSwpHints());
             if (pHints)
             {
-                while (m_CurrentHint < pHints->Count())
+                if (m_CurrentHint < pHints->Count())
                 {
                     SwTextAttr const*const pHint(pHints->Get(m_CurrentHint));
                     ++m_CurrentHint;
@@ -175,7 +175,7 @@ namespace sw {
             SwpHints const*const pHints(m_pNode->GetpSwpHints());
             if (pHints)
             {
-                while (m_CurrentHint < pHints->Count())
+                if (m_CurrentHint < pHints->Count())
                 {
                     SwTextAttr const*const pHint(
                             pHints->GetSortedByEnd(m_CurrentHint));
@@ -273,7 +273,7 @@ namespace sw {
             SwpHints const*const pHints(m_pNode->GetpSwpHints());
             if (pHints)
             {
-                while (0 < m_CurrentHint)
+                if (0 < m_CurrentHint)
                 {
                     SwTextAttr const*const pHint(pHints->GetSortedByEnd(m_CurrentHint - 1));
                     --m_CurrentHint;


More information about the Libreoffice-commits mailing list