diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-03-18 14:49:02 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-03-18 15:06:30 +0100 |
commit | c412cba28ebc00783041bcec74978fc959cc1351 (patch) | |
tree | e7af60a3a4511aaa97c6a4dd143db554921b6450 | |
parent | aebfd023c116047ab467f7abebd84e4c9acd5bbf (diff) |
fdo#61909 fix import of RTF_HIGHLIGHT
It's an index in the color table, not a color value.
Change-Id: Ifa7b14e88231e5053c84dfbdd9b453715df1aaa6
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo61909.rtf | 24 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 |
3 files changed, 27 insertions, 2 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo61909.rtf b/sw/qa/extras/rtfimport/data/fdo61909.rtf index eeb77243ff46..e31414a9b655 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 e72604f1b1c2..4d042dcd9d8d 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 873090a2c4c4..4fbb6cc7f657 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; |