sw/source/core/unocore/unosett.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 758945b077220fe151c1565c6d5b0bad02de6d58
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Sat May 21 18:09:59 2022 +0200
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Fri Jun 10 22:27:37 2022 +0200

    tdf#75297 sw uno: override default num char style when NONE
    
    The problem was during ODT import. When no text:style-name
    is provided, or if it is an empty string, then the default
    "Numbering symbols" character style remained active,
    preventing the ability to round-trip a NONE char style.
    
    Since this depends on the built-in name
    (and that name can easily enough change)
    there is not much point in creating a unit test.
    
    Change-Id: Id942060abd3e024758f93f3d279ef8b561cfc5a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134888
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/unocore/unosett.cxx 
b/sw/source/core/unocore/unosett.cxx
index 5a94663ff121..c68a4fac048f 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1574,10 +1574,11 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
             OUString sCharFormatName;
             SwStyleNameMapper::FillUIName( uTmp, sCharFormatName, 
SwGetPoolIdFromName::ChrFmt );
             SwDoc *const pLocalDoc = pDocShell ? pDocShell->GetDoc() : pDoc;
-            if (sCharFormatName == UNO_NAME_CHARACTER_FORMAT_NONE)
+            if (sCharFormatName.isEmpty() || sCharFormatName == 
UNO_NAME_CHARACTER_FORMAT_NONE)
             {
                 rCharStyleName = aInvalidStyle;
                 aFormat.SetCharFormat(nullptr);
+                aFormat.SetCharFormatName("");
             }
             else if (pLocalDoc)
             {

Reply via email to