summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-12-22 19:35:30 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-12-22 19:57:37 +0100
commit71061656d459abecfe55e8725900d699174325df (patch)
tree8f81edfd498d209322631a6ec979b2f634192cbf
parent6869aaa2b36316e50b512e0ba4819743d834ceaa (diff)
fdo#57886 fix import of RTF_MLIMLOC
The RTF spec says control words are case sensitive, and page 252 of the v1.9.1 spec defines \mlimloc, but earlier page 118 and 125 also defines \mlimLoc, so let's accept both.
-rw-r--r--sw/CppunitTest_sw_subsequent_rtfimport.mk3
-rw-r--r--sw/qa/extras/rtfimport/data/fdo57886.rtf23
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx8
-rw-r--r--writerfilter/source/rtftok/rtfcontrolwords.cxx1
4 files changed, 35 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_subsequent_rtfimport.mk b/sw/CppunitTest_sw_subsequent_rtfimport.mk
index 0f1b2bdeb151..2bcd4296ee7c 100644
--- a/sw/CppunitTest_sw_subsequent_rtfimport.mk
+++ b/sw/CppunitTest_sw_subsequent_rtfimport.mk
@@ -71,16 +71,19 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfimport,\
basic/util/sb \
comphelper/util/comphelp \
configmgr/source/configmgr \
+ embeddedobj/util/embobj \
fileaccess/source/fileacc \
filter/source/config/cache/filterconfig1 \
framework/util/fwk \
i18npool/util/i18npool \
linguistic/source/lng \
package/util/package2 \
+ package/source/xstor/xstor \
sax/source/expatwrap/expwrap \
sw/util/sw \
sw/util/swd \
sfx2/util/sfx \
+ starmath/util/sm \
svl/source/fsstor/fsstorage \
svtools/util/svt \
toolkit/util/tk \
diff --git a/sw/qa/extras/rtfimport/data/fdo57886.rtf b/sw/qa/extras/rtfimport/data/fdo57886.rtf
new file mode 100644
index 000000000000..04699e02940e
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo57886.rtf
@@ -0,0 +1,23 @@
+{\rtf1
+{\mmath
+{\*\moMathPara
+{\*\moMath
+{\mnary
+{\mnaryPr
+{\mlimLoc undOvr}
+}
+{\msub
+{\mr firstlower}
+}
+{\msup
+{\mr firstupper}
+}
+{\me
+{\mr firstbody}
+}
+}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index dce1b90c92be..d7390da0ef90 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -129,6 +129,7 @@ public:
void testFdo57708();
void testFdo54473();
void testFdo49934();
+ void testFdo57886();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -208,6 +209,7 @@ void Test::run()
{"fdo57708.rtf", &Test::testFdo57708},
{"fdo54473.rtf", &Test::testFdo54473},
{"fdo49934.rtf", &Test::testFdo49934},
+ {"fdo57886.rtf", &Test::testFdo57886},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -960,6 +962,12 @@ void Test::testFdo49934()
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+void Test::testFdo57886()
+{
+ // Was 'int from <?> to <?> <?>'.
+ CPPUNIT_ASSERT_EQUAL(OUString("int from {firstlower} to {firstupper} {firstbody}"), getFormula(getRun(getParagraph(1), 1)));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index 9ecf9becaa0f..d2653f7648d5 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -887,6 +887,7 @@ RTFSymbol aRTFControlWords[] = {
{"mjc", CONTROL_VALUE, RTF_MJC},
{"mlim", CONTROL_DESTINATION, RTF_MLIM},
{"mlimloc", CONTROL_DESTINATION, RTF_MLIMLOC},
+ {"mlimLoc", CONTROL_DESTINATION, RTF_MLIMLOC},
{"mlimlow", CONTROL_DESTINATION, RTF_MLIMLOW},
{"mlimLow", CONTROL_DESTINATION, RTF_MLIMLOW},
{"mlimlowPr", CONTROL_DESTINATION, RTF_MLIMLOWPR},