sc/source/ui/view/output2.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 56c965372e2de4ea53b1ab09056906c85fbff06b
Author:     Czeber László Ádám <czeber.laszloa...@nisz.hu>
AuthorDate: Mon Jun 12 16:12:05 2023 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Thu Jun 29 10:54:19 2023 +0200

    tdf#122676 sc: fix format with * (filling) and NBSP thousand separator
    
    Numbers containing no-break space (NBSP) thousand separator enabled
    the EditEngine layout, losing filling e.g. for stretching spaces.
    Enable EditEngine for NBSP characters only if there is no filling
    in the number format code, fixing MSO interoperability, too.
    
    In number format codes, asterisk (*) followed by a character is used
    to fill the available space in the column with that character, e.g.
    format code
    
    [>0]" "* # ##0" € ";[<0]-* # ##0" € ";" "* -#" € ";" "@" "
    
    put the minus sign at the left side of the column, while
    the number at the right side of the column. Because of the NBSP
    thousand separator, bigger numbers got different layout previously,
    i.e. minus signs right next to the numbers.
    
    Note: there is a better solution for the layout problem: using narrow
    no-break space (U-202F), which is the proposed thousand separator in
    typography, and it's back-compatible, because it doesn't enable the 
different layout.
    
    Change-Id: Ia35f01733687ee6005f06ff3ab999b7a4b712ad4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152901
    Reviewed-by: László Németh <nem...@numbertext.org>
    Tested-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 72e70088dc45fbe15f809abf5263247b13d937ac)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153337
    Tested-by: Jenkins

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 649ccdd7349e..fe8d06684517 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -815,6 +815,11 @@ bool ScDrawStringsVars::HasEditCharacters() const
         switch(aString[nIdx])
         {
             case CHAR_NBSP:
+                // tdf#122676: Ignore CHAR_NBSP (this is thousand separator in 
any number)
+                // if repeat character is set
+                if (nRepeatPos < 0)
+                    return true;
+                break;
             case CHAR_SHY:
             case CHAR_ZWSP:
             case CHAR_LRM:

Reply via email to