[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source
Mark Hung
marklh9 at gmail.com
Tue Feb 3 06:59:06 PST 2015
sw/qa/extras/ooxmlexport/data/cjklist44.docx |binary
sw/qa/extras/ooxmlexport/data/numlist-zhcn.odt |binary
sw/qa/extras/ooxmlexport/data/numlist-zhtw.odt |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 25 +++++++++++++++++++++++
sw/source/filter/ww8/docxattributeoutput.cxx | 2 -
writerfilter/source/dmapper/ConversionHelper.cxx | 2 -
6 files changed, 27 insertions(+), 2 deletions(-)
New commits:
commit f5d305a605b9c8f8d22eebce7c5556ed9e134025
Author: Mark Hung <marklh9 at gmail.com>
Date: Sat Jan 24 07:10:20 2015 -0800
Update for CJK numbered list enhancement.
1. Revert koreanDigital2 back to NUMBER_HANGUL_KO (import).
2. Map NUMBER_LOWER_ZH in Simplified Chinese document to
chineseCountingThousand (export).
Change-Id: I62ec255626c250802288bf7fbec7371076e727d3
Reviewed-on: https://gerrit.libreoffice.org/14155
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlexport/data/cjklist44.docx b/sw/qa/extras/ooxmlexport/data/cjklist44.docx
new file mode 100644
index 0000000..98538e9
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/cjklist44.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/numlist-zhcn.odt b/sw/qa/extras/ooxmlexport/data/numlist-zhcn.odt
new file mode 100644
index 0000000..0ced2b6
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/numlist-zhcn.odt differ
diff --git a/sw/qa/extras/ooxmlexport/data/numlist-zhtw.odt b/sw/qa/extras/ooxmlexport/data/numlist-zhtw.odt
new file mode 100644
index 0000000..62a729d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/numlist-zhtw.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 1815242..dcdef6a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -585,6 +585,31 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist35, "cjklist35.docx")
CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_LOWER_ZH, numFormat);
}
+DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist44, "cjklist44.docx")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_HANGUL_KO, numFormat);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testOoxmlNumListZHTW, "numlist-zhtw.odt")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/numbering.xml");
+ if (!pXmlDoc)
+ return;
+
+ assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","taiwaneseCountingThousand" );
+}
+
+DECLARE_OOXMLEXPORT_TEST(testOoxmlNumListZHCN, "numlist-zhcn.odt")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/numbering.xml");
+ if (!pXmlDoc)
+ return;
+
+ assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","chineseCountingThousand" );
+}
+
DECLARE_OOXMLEXPORT_TEST(testNumParentStyle, "num-parent-style.docx")
{
// This was "Outline", i.e. <w:numId> was not imported from the Heading 2 paragraph style.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index faaa740..6b191ea 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5576,7 +5576,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut
const LanguageType eLang = rLang.GetLanguage();
if (LANGUAGE_CHINESE_SIMPLIFIED == eLang) {
- aType="taiwaneseCountingThousand";
+ aType="chineseCountingThousand";
}
}
break;
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index 7b6dc5f..495ab69 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -516,6 +516,7 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
case NS_ooxml::LN_Value_ST_NumberFormat_koreanLegal:
case NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital:
case NS_ooxml::LN_Value_ST_NumberFormat_koreanCounting:
+ case NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital2:
nRet = style::NumberingType::NUMBER_HANGUL_KO;
break;
case NS_ooxml::LN_Value_ST_NumberFormat_ideographLegalTraditional:
@@ -536,7 +537,6 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
case NS_ooxml::LN_Value_ST_NumberFormat_taiwaneseCountingThousand:
case NS_ooxml::LN_Value_ST_NumberFormat_ideographDigital:
case NS_ooxml::LN_Value_ST_NumberFormat_chineseCountingThousand:
- case NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital2:
nRet = style::NumberingType::NUMBER_LOWER_ZH;
break;
case NS_ooxml::LN_Value_ST_NumberFormat_chineseLegalSimplified:
More information about the Libreoffice-commits
mailing list