[Libreoffice-commits] core.git: writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Oct 1 00:01:10 PDT 2014
writerfilter/source/dmapper/DomainMapper.cxx | 3 +--
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 2 +-
writerfilter/source/dmapper/PropertyMap.cxx | 2 +-
writerfilter/source/ooxml/model.xml | 6 +++---
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 +-
5 files changed, 7 insertions(+), 8 deletions(-)
New commits:
commit d620629521aee48dc820b6970ca446c329d0b09a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Oct 1 09:00:00 2014 +0200
Use constants for ST_LineNumberRestart values
Change-Id: I9fe7909bb8f6174ac05edb340a7d5606f077679d
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index a624e12..18800ac 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -864,8 +864,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
pSectionContext->SetdxaLnn( nIntValue );
break;
case NS_ooxml::LN_CT_LineNumber_restart:
- //page:empty, probably 0,section:1,continuous:2;
- aSettings.bRestartAtEachPage = nIntValue < 1;
+ aSettings.bRestartAtEachPage = nIntValue == NS_ooxml::LN_Value_ST_LineNumberRestart_newPage;
OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
if( pSectionContext )
pSectionContext->SetLnc( nIntValue );
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index a416ea1..24889e5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4529,7 +4529,7 @@ void DomainMapper_Impl::SetLineNumbering( sal_Int32 nLnnMod, sal_Int32 nLnc, sal
xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_DISTANCE ), uno::makeAny( ConversionHelper::convertTwipToMM100(ndxaLnn) ));
xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_NUMBER_POSITION ), uno::makeAny( style::LineNumberPosition::LEFT));
xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_NUMBERING_TYPE ), uno::makeAny( style::NumberingType::ARABIC));
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny( nLnc == 0 ));
+ xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny( nLnc == NS_ooxml::LN_Value_ST_LineNumberRestart_newPage ));
}
catch( const uno::Exception& )
{}
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index c6dcc39..105f69a 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1047,7 +1047,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
{
bool bFirst = rDM_Impl.IsLineNumberingSet();
rDM_Impl.SetLineNumbering( m_nLnnMod, m_nLnc, m_ndxaLnn );
- if( m_nLnnMin > 0 || (bFirst && m_nLnc == 1))
+ if( m_nLnnMin > 0 || (bFirst && m_nLnc == NS_ooxml::LN_Value_ST_LineNumberRestart_newSection))
{
//set the starting value at the beginning of the section
try
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index ddfc717..410ae60 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -17686,9 +17686,9 @@
<value tokenid="ooxml:Value_ST_ChapterSep_enDash">enDash</value>
</resource>
<resource name="ST_LineNumberRestart" resource="List">
- <value tokenid="0">newPage</value>
- <value tokenid="1">newSection</value>
- <value tokenid="2">continuous</value>
+ <value tokenid="ooxml:Value_ST_LineNumberRestart_newPage">newPage</value>
+ <value tokenid="ooxml:Value_ST_LineNumberRestart_newSection">newSection</value>
+ <value tokenid="ooxml:Value_ST_LineNumberRestart_continuous">continuous</value>
</resource>
<resource name="CT_LineNumber" resource="Properties">
<attribute name="countBy" tokenid="ooxml:CT_LineNumber_countBy"/>
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 33b83dd..d4415a9 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3153,7 +3153,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_LINEPPAGE:
case RTF_LINECONT:
{
- RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LINEPPAGE ? 0 : 2));
+ RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LINEPPAGE ? NS_ooxml::LN_Value_ST_LineNumberRestart_newPage : NS_ooxml::LN_Value_ST_LineNumberRestart_continuous));
lcl_putNestedAttribute(m_aStates.top().aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_lnNumType, NS_ooxml::LN_CT_LineNumber_restart, pValue);
}
More information about the Libreoffice-commits
mailing list