Kaydet (Commit) 43a17602 authored tarafından Miklos Vajna's avatar Miklos Vajna

Related: tdf#65642 RTF filter: import \pgnlcltr

This as a side effect also implements support for DOCX <w:pgNumType
w:fmt="lowerLetter" .../>.

Change-Id: I47b60a0390ef081dc15b26e40393e35bf7bad130
üst 1250ad95
{\rtf1
\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0
{\field\fldedit
{\*\fldinst
{ PAGE \\* MERGEFORMAT }
}
{\fldrslt
{1}
}
}
\sect
\sectd\pgnrestart\pgnlcltr
{\field\fldedit
{\*\fldinst
{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid525329 PAGE \\* MERGEFORMAT }
}
{\fldrslt
{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid9597790 A}
}
}
{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid13321744
\par }
}
......@@ -1007,6 +1007,12 @@ DECLARE_RTFEXPORT_TEST(testTdf65642, "tdf65642.rtf")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), getProperty<sal_Int32>(getParagraph(2), "PageNumberOffset"));
}
DECLARE_RTFEXPORT_TEST(testPgnlcltr, "pgnlcltr.rtf")
{
// The second page's numbering type: this was style::NumberingType::ARABIC.
CPPUNIT_ASSERT_EQUAL(style::NumberingType::CHARS_LOWER_LETTER_N, getProperty<sal_Int16>(getStyles("PageStyles")->getByName("Converted1"), "NumberingType"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -993,6 +993,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
// A, B, ...
pSectionContext->SetPageNumberType(style::NumberingType::CHARS_UPPER_LETTER_N);
break;
case NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter:
// a, b, ...
pSectionContext->SetPageNumberType(style::NumberingType::CHARS_LOWER_LETTER_N);
break;
}
}
break;
......
......@@ -3280,7 +3280,6 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_PGNDEC:
case RTF_PGNUCRM:
case RTF_PGNLCRM:
case RTF_PGNLCLTR:
case RTF_PGNBIDIA:
case RTF_PGNBIDIB:
// These should be mapped to NS_ooxml::LN_EG_SectPrContents_pgNumType, but dmapper has no API for that at the moment.
......@@ -3604,6 +3603,12 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgNumType, NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
}
break;
case RTF_PGNLCLTR:
{
auto pIntValue = std::make_shared<RTFValue>(NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter);
lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgNumType, NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
}
break;
default:
{
SAL_INFO("writerfilter", "TODO handle flag '" << lcl_RtfToString(nKeyword) << "'");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment