summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-10-15 15:17:09 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-10-15 16:10:04 +0200
commit74904ca6b083f16074e1c5b60729890fc972ad42 (patch)
treec213de6159e8d4c5eacfdaca8045b56300e96ddd
parent706c5a54f662ea58e3b3a64f189eb5120191152a (diff)
fdo#36868 WW8 import: allow outline numbering and list style in the same ...
.. paragraph style The original problem (from a user's point of view) was that the second level of the numbering started from 1.1 instead of 2.1 in the bugdoc. This was fixed by using outline numbering for level 2 as well, but this is problematic in many cases: we want to have outline numbering exactly when outline numbering is enabled for the given paragraph style. So revert the change in SwWW8ImplReader::SetStylesList() and fix it differently: SwWW8ImplReader::RegisterNumFmtOnStyle() explicitly ignores list style if outline numbering is available with no good reason. Both the WW8 format and Writer core allows to have outline numbering and a list style at the same time, so set list style even when outline numbering is available. This fixes the original issue, too -- without introducing nasty fake outline numbering usage. Also add a testcase for the original issue. (regression from e3d5c3e0746916c4056389dd8c2daa6c451c8f6e) Change-Id: Id7d2d67a96a858aee3230110cb518fea51d19d38
-rw-r--r--sw/qa/extras/ww8import/data/fdo36868.docbin0 -> 23552 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx9
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx9
3 files changed, 11 insertions, 7 deletions
diff --git a/sw/qa/extras/ww8import/data/fdo36868.doc b/sw/qa/extras/ww8import/data/fdo36868.doc
new file mode 100644
index 000000000000..382c6b267d4c
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/fdo36868.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index c61c9ed54727..79fc47086089 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -35,6 +35,7 @@ public:
void testN816593();
void testPageBorder();
void testN823651();
+ void testFdo36868();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -62,6 +63,7 @@ void Test::run()
{"n816593.doc", &Test::testN816593},
{"page-border.doc", &Test::testPageBorder},
{"n823651.doc", &Test::testN823651},
+ {"fdo36868.doc", &Test::testFdo36868},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -285,6 +287,13 @@ void Test::testN823651()
CPPUNIT_ASSERT_EQUAL(7.5f, getProperty<float>(getParagraphOfText(1, xText), "CharHeight"));
}
+void Test::testFdo36868()
+{
+ OUString aText = parseDump("/root/page/body/txt[3]/Special[@nType='POR_NUMBER']", "rText");
+ // This was 1.1.
+ CPPUNIT_ASSERT_EQUAL(OUString("2.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 e7b0b40702ef..80195fad85e7 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1741,8 +1741,6 @@ void SwWW8ImplReader::SetStylesList(sal_uInt16 nStyle, sal_uInt16 nActLFO,
{
rStyleInf.nLFOIndex = nActLFO;
rStyleInf.nListLevel = nActLevel;
- if (nActLevel > 0) // it must be an outline list
- rStyleInf.nOutlineLevel = nActLevel;
if (
(USHRT_MAX > nActLFO) &&
@@ -1791,12 +1789,9 @@ void SwWW8ImplReader::RegisterNumFmtOnStyle(sal_uInt16 nStyle)
{
if( MAXLEVEL > rStyleInf.nOutlineLevel )
rStyleInf.pOutlineNumrule = pNmRule;
- else
- {
- rStyleInf.pFmt->SetFmtAttr(
+ rStyleInf.pFmt->SetFmtAttr(
SwNumRuleItem( pNmRule->GetName() ) );
- rStyleInf.bHasStyNumRule = true;
- }
+ rStyleInf.bHasStyNumRule = true;
}
}