tdf#137683 writerfilter Char highlight: import "none"
Importing a charHighlight of NONE is critical, since charHighlight can be set on a higher para-style, and so there needs to be a way to cancel it with direct formatting. DOC already imports NONE. This adds it for RTF and DOCX. (None of the formats EXPORT it though. So that needs to be done, but try not to spam NONE settings where they are not necessary, please.) Change-Id: Ic5d03ceb81a3a079c827b81561deb9068ae8259e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106314 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
parent
7f477f8dd8
commit
81ecdd52ef
3 changed files with 10 additions and 1 deletions
BIN
sw/qa/extras/ooxmlexport/data/tdf137683_charHighlightTests.docx
Normal file
BIN
sw/qa/extras/ooxmlexport/data/tdf137683_charHighlightTests.docx
Normal file
Binary file not shown.
|
@ -719,6 +719,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136441_commentInFootnote, "tdf136441_
|
|||
// (MS Word's UI doesn't allow adding comments to a footnote.)
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testTdf137683_charHighlightTests, "tdf137683_charHighlightTests.docx")
|
||||
{
|
||||
uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(10), 2, "no highlight"), uno::UNO_QUERY_THROW);
|
||||
// This test was failing with a cyan charHighlight of 65535 (0x00FFFF), instead of COL_TRANSPARENT (0xFFFFFFFF)
|
||||
if ( !mbExported ) //TODO: export COL_TRANSPARENT
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_AUTO), getProperty<sal_Int32>(xRun, "CharHighlight"));
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(2, getPages());
|
||||
|
|
|
@ -3801,7 +3801,7 @@ void DomainMapper::handleParaJustification(const sal_Int32 nIntValue, const ::to
|
|||
bool DomainMapper::getColorFromId(const Id nId, sal_Int32 &nColor)
|
||||
{
|
||||
nColor = 0;
|
||||
if ((nId < NS_ooxml::LN_Value_ST_HighlightColor_black) || (nId > NS_ooxml::LN_Value_ST_HighlightColor_lightGray))
|
||||
if ((nId < NS_ooxml::LN_Value_ST_HighlightColor_black) || (nId > NS_ooxml::LN_Value_ST_HighlightColor_none))
|
||||
return false;
|
||||
|
||||
switch (nId)
|
||||
|
@ -3822,6 +3822,7 @@ bool DomainMapper::getColorFromId(const Id nId, sal_Int32 &nColor)
|
|||
case NS_ooxml::LN_Value_ST_HighlightColor_darkYellow: nColor=0x808000; break;
|
||||
case NS_ooxml::LN_Value_ST_HighlightColor_darkGray: nColor=0x808080; break;
|
||||
case NS_ooxml::LN_Value_ST_HighlightColor_lightGray: nColor=0xC0C0C0; break;
|
||||
case NS_ooxml::LN_Value_ST_HighlightColor_none: nColor=0xFFFFFFFF; break; //COL_AUTO
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue