summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-04-29 12:31:25 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-05-06 11:25:46 +0200
commit49f0501f8ba4acd36067a84590469944e9d3234c (patch)
treefa35e7868a3b62c905a6f655e60909e8dc47760f /xmloff
parentc91584ef805866b46b06fe7451b077f9f33419b4 (diff)
sw from-bottom relative orientation: add ODF filter
Map between RelOrientation::PAGE_PRINT_AREA_BOTTOM and loext:vertical-rel="page-content-bottom". Conflicts: sw/qa/extras/odfexport/odfexport.cxx Change-Id: I1d614bf7c82a76285f4268b8008e08c25ef9b7f0
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmltoken.cxx2
-rw-r--r--xmloff/source/style/xmlexppr.cxx13
-rw-r--r--xmloff/source/text/txtprhdl.cxx2
-rw-r--r--xmloff/source/text/txtprmap.cxx6
-rw-r--r--xmloff/source/token/tokens.txt1
5 files changed, 22 insertions, 2 deletions
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index e0f6e4d7a216..b37e90f0b568 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3360,6 +3360,8 @@ namespace xmloff { namespace token {
// For recording whether comments/annotations are resolved
TOKEN( "resolved", XML_RESOLVED ),
+ TOKEN( "page-content-bottom", XML_PAGE_CONTENT_BOTTOM ),
+
#if OSL_DEBUG_LEVEL > 0
{ 0, nullptr, nullptr, XML_TOKEN_END }
#else
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 76fd72c71deb..cd94fccae8dd 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -1030,10 +1030,10 @@ void SvXMLExportPropertyMapper::_exportXML(
if( bRemove )
rAttrList.RemoveAttribute( sName );
+ // We don't seem to have a generic mechanism to write an attribute in the extension
+ // namespace in case of certain attribute values only, so do this manually.
if (IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), XML_WRITING_MODE))
{
- // We don't seem to have a generic mechanism to write an attribute in the extension
- // namespace in case of certain attribute values only, so do this manually.
if (IsXMLToken(aValue, XML_BT_LR))
{
sName = rNamespaceMap.GetQNameByKey(
@@ -1041,6 +1041,15 @@ void SvXMLExportPropertyMapper::_exportXML(
mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
}
}
+ else if (IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), XML_VERTICAL_REL))
+ {
+ if (IsXMLToken(aValue, XML_PAGE_CONTENT_BOTTOM))
+ {
+ sName = rNamespaceMap.GetQNameByKey(
+ XML_NAMESPACE_LO_EXT,
+ mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
+ }
+ }
rAttrList.AddAttribute( sName, aValue );
}
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index 32644e5f7f1c..13770a7de558 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -153,6 +153,7 @@ static SvXMLEnumMapEntry<sal_uInt16> const pXML_VertRel_Enum[] =
// DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
{ XML_PAGE, RelOrientation::PAGE_FRAME },
{ XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
+ { XML_PAGE_CONTENT_BOTTOM, RelOrientation::PAGE_PRINT_AREA_BOTTOM },
{ XML_FRAME, RelOrientation::FRAME }, // import only
{ XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, // import only
// OD 13.11.2003 #i22341# - new vertical alignment at top of line
@@ -166,6 +167,7 @@ static SvXMLEnumMapEntry<sal_uInt16> const pXML_VertRelPage_Enum[] =
{ XML_PAGE_CONTENT, RelOrientation::PRINT_AREA },
{ XML_PAGE, RelOrientation::PAGE_FRAME },
{ XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
+ { XML_PAGE_CONTENT_BOTTOM, RelOrientation::PAGE_PRINT_AREA_BOTTOM },
{ XML_TOKEN_INVALID, 0 }
};
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index ebd91ebc3062..e3597b7c6f50 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -736,6 +736,9 @@ XMLPropertyMapEntry const aXMLFramePropMap[] =
MG_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL, CTF_VERTICALREL ),
MG_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_PAGE ),
MG_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_FRAME ),
+ MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL|XML_TYPE_PROP_GRAPHIC|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_VERTICALREL ),
+ MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT|XML_TYPE_PROP_GRAPHIC|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_VERTICALREL_PAGE ),
+ MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT|XML_TYPE_PROP_GRAPHIC|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_VERTICALREL_FRAME ),
// RES_HORI_ORIENT
MG_ED( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_HORIZONTALPOS ),
MG_ED( "PageToggle", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_HORIZONTALMIRROR ),
@@ -901,6 +904,9 @@ XMLPropertyMapEntry const aXMLShapePropMap[] =
MG_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL, CTF_SHAPE_VERTICALREL ),
MG_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_SHAPE_VERTICALREL_PAGE ),
MG_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_SHAPE_VERTICALREL_FRAME ),
+ MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL|XML_TYPE_PROP_GRAPHIC, CTF_VERTICALREL ),
+ MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT|XML_TYPE_PROP_GRAPHIC, CTF_VERTICALREL_PAGE ),
+ MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT|XML_TYPE_PROP_GRAPHIC, CTF_VERTICALREL_FRAME ),
// RES_HORI_ORIENT
MG_E( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_SHAPE_HORIZONTALPOS ),
MG_E( "PageToggle", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_SHAPE_HORIZONTALMIRROR ),
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 921ff2b63b5a..ef2aaca8ea77 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -3127,4 +3127,5 @@ newline
creator-initials
transliteration-spellout
resolved
+page-content-bottom
TOKEN_END_DUMMY