From 758945b077220fe151c1565c6d5b0bad02de6d58 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 21 May 2022 18:09:59 +0200 Subject: 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 Tested-by: Jenkins --- sw/source/core/unocore/unosett.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sw') 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) { -- cgit