sc/source/ui/dbgui/csvgrid.cxx |   18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

New commits:
commit 626b4d63431b4cd10aed515cb6d66899b4c60502
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Tue Jan 24 16:15:13 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Jan 31 11:15:31 2023 +0000

    tdf#45147 - CSV Import: Remove special handling for mixed script types
    
    In the CSV import dialog, remove the special handling for mixed script 
types. Otherwise, right-to-left words appear in the wrong order.
    
    The special handling of mixed script types was introduced in 
https://bz.apache.org/ooo/show_bug.cgi?id=60296 which is handled in the edit 
engine now.
    
    Change-Id: Ic6dc3f2051ea41f79db5398a8442f78116da52de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146096
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <er...@redhat.com>
    (cherry picked from commit a362c0145731031834bc3a73c8e3577bf6c12720)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146331
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index b44cca04dee7..16b7ca61e35f 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -1130,22 +1130,8 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, 
const OUString& rText )
     OUString aPlainText = rText.replaceAll( "\t", " " );
     aPlainText = aPlainText.replaceAll( "\n", " " );
     mpEditEngine->SetPaperSize( maEdEngSize );
-
-    /*  #i60296# If string contains mixed script types, the space character
-        U+0020 may be drawn with a wrong width (from non-fixed-width Asian or
-        Complex font). Now we draw every non-space portion separately. */
-    sal_Int32 nCharIxInt {aPlainText.isEmpty() ? -1 : 0};
-    while (nCharIxInt>=0)
-    {
-        sal_Int32 nBeginIx = nCharIxInt;
-        const OUString aToken = aPlainText.getToken( 0, ' ', nCharIxInt );
-        if( !aToken.isEmpty() )
-        {
-            sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx;
-            mpEditEngine->SetTextCurrentDefaults( aToken );
-            mpEditEngine->Draw(*mpBackgrDev, Point(nX, rPos.Y()));
-        }
-    }
+    mpEditEngine->SetTextCurrentDefaults(aPlainText);
+    mpEditEngine->Draw(*mpBackgrDev, rPos);
 
     sal_Int32 nCharIx = 0;
     while( (nCharIx = rText.indexOf( '\t', nCharIx )) != -1 )

Reply via email to