[Libreoffice-commits] core.git: sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Sat May 16 07:57:36 UTC 2020


 sw/source/filter/ascii/parasc.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit f33d2d8b5b7ae022eebfa3e22deac71351b3f4e1
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sat May 16 09:09:56 2020 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sat May 16 09:57:02 2020 +0200

    tdf#133077: fix lone CR handling in plain text clipboard on Windows
    
    Failing to treat CRs without corresponding LFs resulted in 0 inserted
    in the place of the CR, but the text up to this position not inserted,
    and pLastStt not updated. Thus all following text was dropped when the
    insertion was finally performed (when CRLF or EOF was reached), because
    of the 0 marking end of inserted text. But that was inconsistent with
    how other Windows applications treated stand-alone CRs, and also with
    our own handling of them when they happened in the end of the internal
    read buffer.
    
    Change-Id: Idf4876b0cccd4aa3f14f6efede54d27670f55c35
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94277
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index 5bc3999b358c..2cf851d0b558 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -401,19 +401,17 @@ ErrCode SwASCIIParser::ReadChars()
                         *pStt = 0;
                         ++pStt;
 
-                        bool bChkSplit = false;
+                        bool bChkSplit = true;
                         if( LINEEND_CRLF == pUseMe->GetParaFlags() )
                         {
                             if( pStt == pEnd )
+                            {
                                 cLastCR = 0x0d;
+                                bChkSplit = false;
+                            }
                             else if( 0x0a == *pStt )
-                            {
                                 ++pStt;
-                                bChkSplit = true;
-                            }
                         }
-                        else
-                            bChkSplit = true;
 
                         // We skip the last one at the end
                         if( bChkSplit && ( !rInput.eof() || pEnd != pStt ))


More information about the Libreoffice-commits mailing list