[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Nov 20 08:57:30 PST 2014
sw/qa/extras/ooxmlexport/data/num-override-start.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 7 +++++++
writerfilter/source/dmapper/NumberingManager.cxx | 11 +++++++++++
3 files changed, 18 insertions(+)
New commits:
commit 1f73ba915794a881f0e3956a5465e46432b184c9
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Nov 20 17:49:11 2014 +0100
DOCX filter: import <w:startOverride>
Change-Id: Id95518c7ea38a974593a1880b4ef581ff49bcb90
diff --git a/sw/qa/extras/ooxmlexport/data/num-override-start.docx b/sw/qa/extras/ooxmlexport/data/num-override-start.docx
new file mode 100644
index 0000000..b57a02c
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/num-override-start.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 96b0d0ee..d120db3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -599,6 +599,13 @@ DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx")
CPPUNIT_ASSERT_EQUAL(OUString("00000a"), parseDump("//Special[@nType='POR_NUMBER']/pFont", "color"));
}
+DECLARE_OOXMLEXPORT_TEST(testNumOverrideStart, "num-override-start.docx")
+{
+ uno::Reference<container::XIndexAccess> xRules = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules");
+ // This was 1, i.e. the numbering on the second level was "1.1", not "1.3".
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(3), comphelper::SequenceAsHashMap(xRules->getByIndex(1))["StartWith"].get<sal_Int16>());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index af2c2e3..2412f8c 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -1047,6 +1047,17 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
pProperties->resolve(*this);
}
break;
+ case NS_ooxml::LN_CT_NumLvl_startOverride:
+ {
+ if(m_pCurrentDefinition)
+ {
+ if (ListLevel::Pointer pCurrentLevel = m_pCurrentDefinition->GetCurrentLevel())
+ // <w:num> -> <w:lvlOverride> -> <w:startOverride> is the non-abstract equivalent of
+ // <w:abstractNum> -> <w:lvl> -> <w:start>
+ pCurrentLevel->SetValue(NS_ooxml::LN_CT_Lvl_start, nIntValue);
+ }
+ }
+ break;
case NS_ooxml::LN_CT_AbstractNum_numStyleLink:
{
OUString sStyleName = rSprm.getValue( )->getString( );
More information about the Libreoffice-commits
mailing list