sc/source/filter/rtf/rtfexp.cxx | 2 +- sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt |binary sw/qa/extras/uiwriter/uiwriter7.cxx | 20 ++++++++++++++++++++ sw/source/core/doc/docfmt.cxx | 5 +++++ 4 files changed, 26 insertions(+), 1 deletion(-)
New commits: commit d599e6aa16f5f7ec0d3fed789a214940a53570bb Author: Aron Budea <aron.bu...@collabora.com> AuthorDate: Thu Aug 3 21:54:55 2023 +0200 Commit: Aron Budea <aron.bu...@collabora.com> CommitDate: Thu Aug 3 21:54:55 2023 +0200 Fix build Change-Id: I0e680463f5c3be39b1e32c9b5d1ae43a7876d4cd diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx index b63570dfb249..5cde1ae45085 100644 --- a/sc/source/filter/rtf/rtfexp.cxx +++ b/sc/source/filter/rtf/rtfexp.cxx @@ -188,7 +188,7 @@ void ScRTFExport::WriteFontTable(const SvxFontItem& rFontItem, int nIndex) rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252; rtl_TextEncoding eChrSet = rFontItem.GetCharSet(); - if (IsOpenSymbol(rFontItem.GetFamilyName())) + if (IsStarSymbol(rFontItem.GetFamilyName())) eChrSet = RTL_TEXTENCODING_UTF8; else if( RTL_TEXTENCODING_DONTKNOW == eChrSet ) eChrSet = osl_getThreadTextEncoding(); commit d466d3b4422e6fc6405cf17bbeee48ae52fa1d3e Author: luigiiucci <luigi.iu...@collabora.com> AuthorDate: Thu Jun 15 23:31:26 2023 +0200 Commit: Aron Budea <aron.bu...@collabora.com> CommitDate: Thu Aug 3 21:54:13 2023 +0200 tdf#62032 use style list level when changing style If a style S1 has a list level L1, and we change the style to S1 in a text node that has list level L2, the new text node list level must be L1 Change-Id: Ic25b222202cb2da3153fc5c3723998c9f7f01247 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153161 Reviewed-by: Ashod Nakashian <a...@collabora.com> Tested-by: Jenkins (cherry picked from commit c1cfe85f8bba10d367ef9ef1d6d569f53969dd34) diff --git a/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt b/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt new file mode 100644 index 000000000000..86cda167ee8a Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index 833a35f97e61..f9f989fdba5b 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -2813,6 +2813,26 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149089) CPPUNIT_ASSERT_EQUAL(nGridWidth1, nGridWidth2); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf62032ApplyStyle) +{ + SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf62032_apply_style.odt"); + SwWrtShell* pWrtSh = pDoc->GetDocShell()->GetWrtShell(); + + pWrtSh->Down(/*bSelect=*/false); + + uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence({ + { "Style", uno::Any(OUString("A 2")) }, + { "FamilyName", uno::Any(OUString("ParagraphStyles")) }, + }); + dispatchCommand(mxComponent, ".uno:StyleApply", aPropertyValues); + + // Without the fix in place, it fails with: + // - Expected: 1.1 + // - Actual : 2 + CPPUNIT_ASSERT_EQUAL(OUString("1.1"), + getProperty<OUString>(getParagraph(2), "ListLabelString").trim()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index dbf8fefeda4a..519584baf812 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1065,6 +1065,11 @@ static bool lcl_SetTextFormatColl( SwNode* pNode, void* pArgs ) pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED ); pCNd->ResetAttr( RES_PARATR_LIST_ID ); } + else + { + // forcing reset of list level from parapgaph + pCNd->SetAttr(pFormat->GetFormatAttr(RES_PARATR_LIST_LEVEL)); + } } }