summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2022-09-07 07:00:59 -0400
committerJustin Luth <jluth@mail.com>2022-09-07 16:41:47 +0200
commitc24fe44064c6624fefe642508086c8562c372fba (patch)
treea1b1e0af54f48ab334de354c153111db7e73b02e
parent9220716bed8ff4337453f06788233aa73463d63b (diff)
tdf#149547 fix "tdf#75297 sw uno: override default num char style"
The problem was that things like chapter numbering were creating this style on import. Interesting that it didn't do it for my use case. This fixes 7.5 commit 758945b077220fe151c1565c6d5b0bad02de6d58. Originally I left this clause "as is" because I had not yet removed the obsolete part of the condition. But now I can change anything in that .isEmpty() clause since commit 1a57418e2837e7fd07b0619804feed06e1acfe41 remove unused sw UNO_NAME_CHARACTER_FORMAT_NONE Change-Id: Ie52a0d1392d49ba6ae8a5620ab453ff7129bce7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139584 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r--sw/qa/extras/odfexport/odfexport2.cxx3
-rw-r--r--sw/source/core/unocore/unosett.cxx2
2 files changed, 4 insertions, 1 deletions
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx
index 5d2f91b92d5d..018f7afd0cb6 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -36,6 +36,9 @@ DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, "testTdf52065_centerTabs.odt")
CPPUNIT_ASSERT(nTabStop < 4000);
CPPUNIT_ASSERT(3000 < nTabStop);
CPPUNIT_ASSERT_EQUAL(OUString(u"Pečiatka zamestnávateľa"), parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[4]", "portion"));
+
+ // tdf#149547: __XXX___invalid CharacterStyles should not be imported/exported
+ CPPUNIT_ASSERT(!getStyles("CharacterStyles")->hasByName("__XXX___invalid"));
}
DECLARE_ODFEXPORT_TEST(testTdf104254_noHeaderWrapping, "tdf104254_noHeaderWrapping.odt")
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 064f23b30a48..e92bade7875f 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1567,7 +1567,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
SwDoc *const pLocalDoc = pDocShell ? pDocShell->GetDoc() : pDoc;
if (sCharFormatName.isEmpty())
{
- rCharStyleName = aInvalidStyle;
+ rCharStyleName.clear();
aFormat.SetCharFormat(nullptr);
aFormat.SetCharFormatName("");
}