summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfexport/data/pgnucrm.rtf23
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx6
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx4
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx7
4 files changed, 39 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfexport/data/pgnucrm.rtf b/sw/qa/extras/rtfexport/data/pgnucrm.rtf
new file mode 100644
index 000000000000..ce0bbf2b94d8
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/pgnucrm.rtf
@@ -0,0 +1,23 @@
+{\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\pgnucrm
+{\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 }
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 6a7d19f2a78c..c08735bfb6cc 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1013,6 +1013,12 @@ DECLARE_RTFEXPORT_TEST(testPgnlcltr, "pgnlcltr.rtf")
CPPUNIT_ASSERT_EQUAL(style::NumberingType::CHARS_LOWER_LETTER_N, getProperty<sal_Int16>(getStyles("PageStyles")->getByName("Converted1"), "NumberingType"));
}
+DECLARE_RTFEXPORT_TEST(testPgnucrm, "pgnucrm.rtf")
+{
+ // The second page's numbering type: this was style::NumberingType::ARABIC.
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::ROMAN_UPPER, getProperty<sal_Int16>(getStyles("PageStyles")->getByName("Converted1"), "NumberingType"));
+}
+
DECLARE_RTFEXPORT_TEST(testTdf98806, "tdf98806.rtf")
{
uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 4fd72e034dfa..784b5c8d77d4 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -997,6 +997,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
// a, b, ...
pSectionContext->SetPageNumberType(style::NumberingType::CHARS_LOWER_LETTER_N);
break;
+ case NS_ooxml::LN_Value_ST_NumberFormat_upperRoman:
+ // I, II, ...
+ pSectionContext->SetPageNumberType(style::NumberingType::ROMAN_UPPER);
+ break;
}
}
break;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 6d5b1d3a1d23..7ce53d95fb57 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3278,7 +3278,6 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
}
break;
case RTF_PGNDEC:
- case RTF_PGNUCRM:
case RTF_PGNLCRM:
case RTF_PGNBIDIA:
case RTF_PGNBIDIB:
@@ -3609,6 +3608,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_PGNUCRM:
+ {
+ auto pIntValue = std::make_shared<RTFValue>(NS_ooxml::LN_Value_ST_NumberFormat_upperRoman);
+ 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) << "'");