summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-10-15 16:29:35 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-10-15 17:03:21 +0200
commit1f6435d986fff97095c5619a908ea67906405e3c (patch)
treee5dda70ab609ee2e2823298cd736793b4a6383ab
parent8ab1c6103d5cbc414531c78c3cbaa93bfd99149f (diff)
WW8 import: fix handling of sprmPIlfo when sprmPIlvl is missing
Commit 542a0d7260e4767d8aff839eb593e748a82ced48 (#100044# Cleanup for optimization defines->enums, 2002-08-14) added the problematic "else" without mentioning the reason, so I assume it's safe to just revert that part. Change-Id: Id90fbdfb1116be458a76c9653fec0633edc34fac
-rwxr-xr-xsw/qa/extras/ww8import/data/list-nolevel.docbin0 -> 23040 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx10
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx2
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8import/data/list-nolevel.doc b/sw/qa/extras/ww8import/data/list-nolevel.doc
new file mode 100755
index 000000000000..04e34996fe39
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/list-nolevel.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 79fc47086089..345f0dc06b41 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -36,6 +36,7 @@ public:
void testPageBorder();
void testN823651();
void testFdo36868();
+ void testListNolevel();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -64,6 +65,7 @@ void Test::run()
{"page-border.doc", &Test::testPageBorder},
{"n823651.doc", &Test::testN823651},
{"fdo36868.doc", &Test::testFdo36868},
+ {"list-nolevel.doc", &Test::testListNolevel},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -294,6 +296,14 @@ void Test::testFdo36868()
CPPUNIT_ASSERT_EQUAL(OUString("2.1"), aText);
}
+void Test::testListNolevel()
+{
+ // Similar to fdo#36868, numbering portions had wrong values.
+ OUString aText = parseDump("/root/page/body/txt[1]/Special[@nType='POR_NUMBER']", "rText");
+ // POR_NUMBER was completely missing.
+ CPPUNIT_ASSERT_EQUAL(OUString("1."), aText);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 80195fad85e7..2888fa342aaf 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -2065,7 +2065,7 @@ void SwWW8ImplReader::Read_LFOPosition(sal_uInt16, const sal_uInt8* pData,
{
if (WW8ListManager::nMaxLevel == nListLevel)
nListLevel = 0;
- else if (WW8ListManager::nMaxLevel > nListLevel)
+ if (WW8ListManager::nMaxLevel > nListLevel)
{
RegisterNumFmt(nLFOPosition, nListLevel);
nLFOPosition = USHRT_MAX;