summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf131594.docxbin0 -> 17358 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx7
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx25
3 files changed, 22 insertions, 10 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf131594.docx b/sw/qa/extras/ooxmlexport/data/tdf131594.docx
new file mode 100644
index 000000000000..009c6d56bd85
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf131594.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 3f217e35d96c..81f286c6e3da 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -784,6 +784,13 @@ DECLARE_OOXMLEXPORT_TEST(testImageCommentAtChar, "image-comment-at-char.docx")
getProperty<OUString>(getRun(xPara, 5), "TextPortionType"));
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131594, "tdf131594.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ // lnNumType should not be exported if w:countBy="0"
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:lnNumType", 0);
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121663, "tdf121663.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index d84c94b2fbfe..e69e3796160b 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2018,19 +2018,24 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
{
uno::Reference< text::XLineNumberingProperties > xLineNumberingProperties( m_pImpl->GetTextDocument(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xLineNumberingPropSet = xLineNumberingProperties->getLineNumberingProperties();
- xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_IS_ON ), uno::makeAny(true) );
- if( aSettings.nInterval )
- xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_INTERVAL ), uno::makeAny(static_cast<sal_Int16>(aSettings.nInterval)) );
- if( aSettings.nDistance != -1 )
- xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_DISTANCE ), uno::makeAny(aSettings.nDistance) );
+ if( aSettings.nInterval == 0 )
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_IS_ON ), uno::makeAny(false) );
else
{
- // set Auto value (0.5 cm)
- xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_DISTANCE ), uno::makeAny(static_cast<sal_Int32>(500)) );
- if( pSectionContext )
- pSectionContext->SetdxaLnn( static_cast<sal_Int32>(283) );
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_IS_ON ), uno::makeAny(true) );
+ if( aSettings.nInterval )
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_INTERVAL ), uno::makeAny(static_cast<sal_Int16>(aSettings.nInterval)) );
+ if( aSettings.nDistance != -1 )
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_DISTANCE ), uno::makeAny(aSettings.nDistance) );
+ else
+ {
+ // set Auto value (0.5 cm)
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_DISTANCE ), uno::makeAny(static_cast<sal_Int32>(500)) );
+ if( pSectionContext )
+ pSectionContext->SetdxaLnn( static_cast<sal_Int32>(283) );
+ }
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny(aSettings.bRestartAtEachPage) );
}
- xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny(aSettings.bRestartAtEachPage) );
}
catch( const uno::Exception& )
{