svtools/source/svrtf/svparser.cxx |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 89070c8021d483ec84a3b6f465543c733208b1dc
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Dec 12 09:17:27 2021 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Dec 12 08:39:40 2021 +0100

    Small simplification
    
    Change-Id: I9a6d134b9af46e84560a9f6160c4f9fa1d2631ec
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126696
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/svtools/source/svrtf/svparser.cxx 
b/svtools/source/svrtf/svparser.cxx
index dd5068976ff7..ca0a8816851a 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -253,19 +253,10 @@ sal_uInt32 SvParser<T>::GetNextChar()
             {
                 const sal_uInt64 nPos = rInput.Tell();
                 rInput.ReadUtf16(cUC);
-                bErr = !rInput.good();
-                if (!bErr)
-                {
-                    if (rtl::isLowSurrogate(cUC))
-                        c = rtl::combineSurrogates(c, cUC);
-                    else
-                        rInput.Seek(nPos); // process lone high surrogate
-                }
+                if (rtl::isLowSurrogate(cUC)) // can only be true when 
ReadUtf16 succeeded
+                    c = rtl::combineSurrogates(c, cUC);
                 else
-                {
-                    bErr = false; // process lone high surrogate
-                    rInput.Seek(nPos); // maybe step 1 byte back
-                }
+                    rInput.Seek(nPos); // process lone high surrogate
             }
         }
     }

Reply via email to