diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-12-17 23:44:38 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-12-18 00:12:09 +0100 |
commit | 22355042a6fc7aecf3caab69b3fa3be1430b697f (patch) | |
tree | de4b9c61c1e1997bd11d6e73cf7eb8704ec5bb6f /sw | |
parent | 975f62aeaa0c88cca1b7926ff34df1d7afb577c4 (diff) |
fdo#72452: ODF import/export: fix handling of style:page-number
Class XMLNumberWithAutoInsteadZeroPropHdl (which appears to be used only
for this attribute) needs to be adapted to the change that
"PageNumberOffset" value 0 is no longer invalid; use "void" value for
invalid instead, which appears more appropriate anyway.
Unfortunately the type of style:page-number is positiveInteger so
writing 0 would be invalid; write "auto" instead for now.
Change-Id: I9621ea201fd928087b863c562607c3d77a3b0269
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index eb540b4d58d5..24341509202c 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -710,7 +710,11 @@ bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_PAGEDESC_PAGENUMOFFSET: { sal_Int16 nOffset = 0; - if(rVal >>= nOffset) + if (!rVal.hasValue()) + { + SetNumOffset(boost::none); + } + else if (rVal >>= nOffset) SetNumOffset( nOffset ); else bRet = false; diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index abe355de4f77..b1e5182bf6d0 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -1005,7 +1005,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId ) { ::boost::optional<sal_uInt16> oNumOffset = pPageDesc->GetNumOffset(); - if (oNumOffset) + if (oNumOffset && oNumOffset.get() > 0) { // #i114163# positiveInteger only! sal_Int32 const number(oNumOffset.get()); |