sw/qa/extras/rtfimport/data/fdo61909.rtf | 24 +++++++++++++++++++++++- sw/qa/extras/rtfimport/rtfimport.cxx | 3 +++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-)
New commits: commit c412cba28ebc00783041bcec74978fc959cc1351 Author: Miklos Vajna <[email protected]> Date: Mon Mar 18 14:49:02 2013 +0100 fdo#61909 fix import of RTF_HIGHLIGHT It's an index in the color table, not a color value. Change-Id: Ifa7b14e88231e5053c84dfbdd9b453715df1aaa6 diff --git a/sw/qa/extras/rtfimport/data/fdo61909.rtf b/sw/qa/extras/rtfimport/data/fdo61909.rtf index eeb7724..e31414a 100644 --- a/sw/qa/extras/rtfimport/data/fdo61909.rtf +++ b/sw/qa/extras/rtfimport/data/fdo61909.rtf @@ -2,5 +2,27 @@ {\fonttbl {\f000 Courier New;} } -#include<iostream.h>\par +{\colortbl +\red000\green000\blue000; +\red255\green255\blue255; +\red255\green128\blue000; +\red255\green255\blue255; +\red000\green000\blue255; +\red255\green255\blue255; +\red128\green128\blue128; +\red255\green255\blue255; +\red128\green128\blue128; +\red255\green255\blue255; +\red128\green064\blue000; +\red255\green255\blue255; +\red000\green000\blue128; +\red255\green255\blue255; +\red000\green000\blue000; +\red255\green255\blue255; +\red128\green000\blue255; +\red255\green255\blue255; +\red000\green000\blue000; +\red255\green255\blue255; +} +\highlight11 #include<iostream.h>\par } diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index e72604f..4d042dc 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1171,7 +1171,10 @@ void Test::testFdo60722() void Test::testFdo61909() { uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + // Was the Writer default font. CPPUNIT_ASSERT_EQUAL(OUString("Courier New"), getProperty<OUString>(xTextRange, "CharFontName")); + // Was 0x008000. + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(xTextRange, "CharBackColor")); } CPPUNIT_TEST_SUITE_REGISTRATION(Test); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 873090a..4fbb6cc 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2841,7 +2841,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) break; case RTF_HIGHLIGHT: { - RTFValue::Pointer_t pValue(new RTFValue(nParam)); + RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam))); m_aStates.top().aCharacterSprms.set(NS_sprm::LN_CHighlight, pValue); } break; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
