summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNithin Kumar Padavu <nithinrao@gmail.com>2018-04-07 15:10:06 +0000
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-04-08 16:57:19 +0200
commit4f5928ea8022d879764cc882f01a1b642645d66f (patch)
treea93800a04c9f927740069e5f9ea69acfa58968e2 /xmloff
parent08297b3022180ee169a44230edc43d020d97cf42 (diff)
tdf#112384 sw: Allow New line as a label followed by chapter numbering
reference-language also added to token list Change-Id: I32713508d3611dc2bce10b2c5abb1e1a4167bdaf Reviewed-on: https://gerrit.libreoffice.org/52561 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmltoken.cxx1
-rw-r--r--xmloff/source/style/xmlnume.cxx7
-rw-r--r--xmloff/source/style/xmlnumi.cxx11
-rw-r--r--xmloff/source/token/tokens.txt2
4 files changed, 19 insertions, 2 deletions
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 1475d4f99b19..7566c1065119 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3305,6 +3305,7 @@ namespace xmloff { namespace token {
// for optional language-dependent reference formats
TOKEN( "reference-language", XML_REFERENCE_LANGUAGE ),
+ TOKEN( "newline", XML_NEWLINE ),
#if OSL_DEBUG_LEVEL > 0
{ 0, nullptr, nullptr, XML_TOKEN_END }
#else
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index e3965469916c..dea4bb10d5a8 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -485,6 +485,13 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
GetExport().AddAttribute( XML_NAMESPACE_TEXT,
XML_LABEL_FOLLOWED_BY, eValue );
+ if (eLabelFollowedBy == LabelFollow::NEWLINE)
+ {
+ eValue = XML_NEWLINE;
+ GetExport().AddAttribute( XML_NAMESPACE_LO_EXT,
+ XML_LABEL_FOLLOWED_BY, eValue );
+ }
+
if ( eLabelFollowedBy == LabelFollow::LISTTAB &&
nListtabStopPosition > 0 )
{
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 42ccda81d3ea..ad1a081a3957 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -928,6 +928,8 @@ static const SvXMLTokenMapEntry* lcl_getStyleAlignmentAttributesAttrTokenMap()
{
{ XML_NAMESPACE_TEXT, XML_LABEL_FOLLOWED_BY,
XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY },
+ { XML_NAMESPACE_LO_EXT, XML_LABEL_FOLLOWED_BY,
+ XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY },
{ XML_NAMESPACE_TEXT, XML_LIST_TAB_STOP_POSITION,
XML_TOK_STYLE_ATTRIBUTES_ATTR_LISTTAB_STOP_POSITION },
{ XML_NAMESPACE_FO, XML_TEXT_INDENT,
@@ -951,6 +953,7 @@ SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::SvxXMLListLevelStyleLabelAli
SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ sal_Int16 eLabelFollowedBy = LabelFollow::LISTTAB;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
const OUString& rAttrName = xAttrList->getNameByIndex( i );
@@ -965,12 +968,15 @@ SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::SvxXMLListLevelStyleLabelAli
{
case XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY:
{
- sal_Int16 eLabelFollowedBy = LabelFollow::LISTTAB;
+ if( eLabelFollowedBy == LabelFollow::NEWLINE)
+ //NewLine from LO_EXT has precedence over other values of the Non LO_EXT namespace
+ break;
if( IsXMLToken( rValue, XML_SPACE ) )
eLabelFollowedBy = LabelFollow::SPACE;
else if( IsXMLToken( rValue, XML_NOTHING ) )
eLabelFollowedBy = LabelFollow::NOTHING;
- rListLevel.SetLabelFollowedBy( eLabelFollowedBy );
+ else if( IsXMLToken( rValue, XML_NEWLINE ) )
+ eLabelFollowedBy = LabelFollow::NEWLINE;
}
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_LISTTAB_STOP_POSITION:
@@ -987,6 +993,7 @@ SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::SvxXMLListLevelStyleLabelAli
break;
}
}
+ rListLevel.SetLabelFollowedBy( eLabelFollowedBy );
}
void SvxXMLListStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 6c68ea0c339b..04275393f2bc 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -3077,4 +3077,6 @@ max-numerator-digits
zeros-numerator-digits
zeros-denominator-digits
integer-fraction-delimiter
+reference-language
+newline
TOKEN_END_DUMMY