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 20:22:04 +0100
commit8313aae33b689486fde276af8ab065f557dea74d (patch)
tree1538bcf0a9eaafb20a657d301c2cbe5e5a4303b0
parent835cae7e323b9831d11f5f4957933728f561e71a (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. (cherry picked from commit 71061656d459abecfe55e8725900d699174325df)
-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 ca1c00c8de9b..337282373153 100644
--- a/sw/CppunitTest_sw_subsequent_rtfimport.mk
+++ b/sw/CppunitTest_sw_subsequent_rtfimport.mk
@@ -70,16 +70,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 2df2e0508377..a2fdf223bdd9 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},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -958,6 +960,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},