[Libreoffice-commits] core.git: sw/qa sw/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jun 21 04:04:27 UTC 2021
sw/qa/extras/ww8export/ww8export3.cxx | 2 +-
sw/source/filter/ww8/ww8par3.cxx | 26 ++++++++++++++------------
2 files changed, 15 insertions(+), 13 deletions(-)
New commits:
commit 10dbee56f7cf9a19b04f484b8a4b2465323ec622
Author: Justin Luth <justin_luth at sil.org>
AuthorDate: Tue Apr 20 15:31:23 2021 +0200
Commit: Justin Luth <justin_luth at sil.org>
CommitDate: Mon Jun 21 06:03:45 2021 +0200
tdf#106541 doc import: always register listLevel
LFO and listLevel are NOT a required pair.
The path on the Paragraph side is safe to re-enter.
This patch makes the style side safe to re-run
with partial information.
If we don't register immediately, then a non-existant LFO
means that we totally lose the provided listLevel.
So just RegisterNumFormat even though it
likely will be run again by Read_LFOPosition.
Change-Id: Iad10cdd1ff7e6fc0a77b01849b3b157703945556
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114400
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth at sil.org>
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 67b4993bc9b1..d8d6d4ef3d7f 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -794,7 +794,7 @@ DECLARE_WW8EXPORT_TEST(testTdf106541_inheritChapterNumbering, "tdf106541_inherit
{
// The level and numbering are inherited from Heading 1.
uno::Reference<beans::XPropertySet> xPara(getParagraph(3, "Letter A"), uno::UNO_QUERY);
- //TEMPORARY CPPUNIT_ASSERT_EQUAL(OUString("a."), getProperty<OUString>(xPara, "ListLabelString"));
+ CPPUNIT_ASSERT_EQUAL(OUString("a."), getProperty<OUString>(xPara, "ListLabelString"));
}
DECLARE_WW8EXPORT_TEST(testTdf106541_inheritChapterNumberingB, "tdf106541_inheritChapterNumberingB.doc")
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index a5f363e9bbf2..7060c85d9d33 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1680,21 +1680,20 @@ void SwWW8ImplReader::SetStylesList(sal_uInt16 nStyle, sal_uInt16 nCurrentLFO,
if( !m_pCurrentColl )
return;
- // only save the Parameters for now. The actual List will be appended
- // at a later point, when the Listdefinitions is read...
- if (
- (USHRT_MAX > nCurrentLFO) &&
- (WW8ListManager::nMaxLevel > nCurrentLevel)
- )
- {
+ if (nCurrentLFO < USHRT_MAX)
rStyleInf.m_nLFOIndex = nCurrentLFO;
+ if (nCurrentLevel < MAXLEVEL)
rStyleInf.m_nListLevel = nCurrentLevel;
+ // only save the Parameters for now. The actual List will be appended
+ // at a later point, when the Listdefinitions is read...
+ if (rStyleInf.m_nLFOIndex < USHRT_MAX && rStyleInf.m_nListLevel < WW8ListManager::nMaxLevel)
+ {
std::vector<sal_uInt8> aParaSprms;
SwNumRule* pNmRule = m_xLstManager->GetNumRuleForActivation(
- nCurrentLFO, nCurrentLevel, aParaSprms);
+ rStyleInf.m_nLFOIndex, rStyleInf.m_nListLevel, aParaSprms);
if (pNmRule)
- UseListIndent(rStyleInf, pNmRule->Get(nCurrentLevel));
+ UseListIndent(rStyleInf, pNmRule->Get(rStyleInf.m_nListLevel));
}
}
@@ -1881,11 +1880,14 @@ void SwWW8ImplReader::Read_ListLevel(sal_uInt16, const sal_uInt8* pData,
m_xStyles->mnWwNumLevel = m_nListLevel;
}
- if (WW8ListManager::nMaxLevel <= m_nListLevel )
+ // Treat an invalid level as body-level
+ if (WW8ListManager::nMaxLevel < m_nListLevel)
m_nListLevel = WW8ListManager::nMaxLevel;
- else if (USHRT_MAX > m_nLFOPosition)
+
+ RegisterNumFormat(m_nLFOPosition, m_nListLevel);
+ if (USHRT_MAX > m_nLFOPosition)
{
- RegisterNumFormat(m_nLFOPosition, m_nListLevel);
+ assert(false && "m_nLFOPosition is usually reset immediately, so we rarely ever get here.");
m_nLFOPosition = USHRT_MAX;
m_nListLevel = MAXLEVEL;
}
More information about the Libreoffice-commits
mailing list