diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-04-24 14:58:51 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-05-09 09:17:23 +0200 |
commit | 21ac2dae6a84b2c686abdbefb5d9bd10fed42680 (patch) | |
tree | 7961cd9bb5564c8e963dfc819ef7d7b5f9b92207 | |
parent | 286ee5a966d5c729fef5cefd58b572247697c4fc (diff) |
sc,xmloff: ODF 1.3: adapt XMLPropertyMapEntry
Map the following property attributes to ODFSVER_013:
* OFFICE-2173 table:tab-color
* OFFICE-3767 text:contextual-spacing
* OFFICE-3857 table:scale-to-X/table:scale-to-Y
Change-Id: I3585560a3654c71353bbcaf66da20eacba8ebd1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92861
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Jenkins
-rw-r--r-- | sc/source/filter/xml/xmlstyle.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterStyleMap.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/text/txtprmap.cxx | 6 |
3 files changed, 17 insertions, 14 deletions
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index ff38c1cbdaaf..1cb5fb26591e 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -51,6 +51,7 @@ using namespace ::xmloff::token; using namespace ::formula; #define MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFSVER_010, false } +#define MAP_ODF13(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFSVER_013, false } // extensions import/export #define MAP_EXT(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, false } // extensions import only @@ -163,8 +164,8 @@ const XMLPropertyMapEntry aXMLScTableStylesImportProperties[] = MAP( "IsVisible", XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TYPE_PROP_TABLE|XML_TYPE_BOOL, 0 ), MAP( "PageStyle", XML_NAMESPACE_STYLE, XML_MASTER_PAGE_NAME, XML_TYPE_PROP_TABLE|XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM, CTF_SC_MASTERPAGENAME ), MAP( "TableLayout", XML_NAMESPACE_STYLE, XML_WRITING_MODE, XML_TYPE_PROP_TABLE|XML_TYPE_TEXT_WRITING_MODE, 0 ), - MAP( "TabColor", XML_NAMESPACE_TABLE, XML_TAB_COLOR, XML_TYPE_PROP_TABLE|XML_TYPE_COLORAUTO, 0 ), - MAP_EXT( "TabColor", XML_NAMESPACE_TABLE_EXT, XML_TAB_COLOR, XML_TYPE_PROP_TABLE|XML_TYPE_COLORAUTO, 0 ), + MAP_ODF13( "TabColor", XML_NAMESPACE_TABLE, XML_TAB_COLOR, XML_TYPE_PROP_TABLE|XML_TYPE_COLORAUTO, 0 ), + MAP_ODF13( "TabColor", XML_NAMESPACE_TABLE_EXT, XML_TAB_COLOR, XML_TYPE_PROP_TABLE|XML_TYPE_COLORAUTO, 0 ), MAP_END() }; @@ -173,7 +174,9 @@ const XMLPropertyMapEntry aXMLScTableStylesProperties[] = MAP( "IsVisible", XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TYPE_PROP_TABLE|XML_TYPE_BOOL, 0 ), MAP( "PageStyle", XML_NAMESPACE_STYLE, XML_MASTER_PAGE_NAME, XML_TYPE_PROP_TABLE|XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM, CTF_SC_MASTERPAGENAME ), MAP( "TableLayout", XML_NAMESPACE_STYLE, XML_WRITING_MODE, XML_TYPE_PROP_TABLE|XML_TYPE_TEXT_WRITING_MODE, 0 ), - MAP_EXT( "TabColor", XML_NAMESPACE_TABLE_EXT, XML_TAB_COLOR, XML_TYPE_PROP_TABLE|XML_TYPE_COLORAUTO, 0 ), + // ODF 1.3 OFFICE-2173 + MAP_ODF13( "TabColor", XML_NAMESPACE_TABLE, XML_TAB_COLOR, XML_TYPE_PROP_TABLE|XML_TYPE_COLORAUTO, 0 ), + MAP_ODF13( "TabColor", XML_NAMESPACE_TABLE_EXT, XML_TAB_COLOR, XML_TYPE_PROP_TABLE|XML_TYPE_COLORAUTO, 0 ), MAP_END() }; diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index ff897d7804d9..9229b38de7df 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -24,15 +24,12 @@ using namespace ::xmloff::token; #define MAP(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version, false } -#define MAP_IMPORT(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version, true } #define PLMAP(name,prefix,token,type,context) \ MAP(name, prefix, token, type|XML_TYPE_PROP_PAGE_LAYOUT, context, SvtSaveOptions::ODFSVER_010) #define PLMAP_12(name,prefix,token,type,context) \ MAP(name, prefix, token, type|XML_TYPE_PROP_PAGE_LAYOUT, context, SvtSaveOptions::ODFSVER_012) -#define PLMAP_EXT(name,prefix,token,type,context) \ - MAP(name, prefix, token, type|XML_TYPE_PROP_PAGE_LAYOUT, context, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED) -#define PLMAP_EXT_IMPORT(name,prefix,token,type,context) \ - MAP_IMPORT(name, prefix,token, type|XML_TYPE_PROP_PAGE_LAYOUT, context, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED) +#define PLMAP_ODF13(name,prefix,token,type,context) \ + MAP(name, prefix, token, type|XML_TYPE_PROP_PAGE_LAYOUT, context, SvtSaveOptions::ODFSVER_013) #define HFMAP(name,prefix,token,type,context) \ MAP(name, prefix, token, type|XML_TYPE_PROP_HEADER_FOOTER, context, SvtSaveOptions::ODFSVER_010) @@ -87,10 +84,11 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = PLMAP( "FirstPageNumber", XML_NAMESPACE_STYLE, XML_FIRST_PAGE_NUMBER, XML_PM_TYPE_FIRSTPAGENUMBER, 0 ), PLMAP( "PageScale", XML_NAMESPACE_STYLE, XML_SCALE_TO, XML_TYPE_PERCENT16, CTF_PM_SCALETO ), PLMAP( "ScaleToPages", XML_NAMESPACE_STYLE, XML_SCALE_TO_PAGES, XML_TYPE_NUMBER16, CTF_PM_SCALETOPAGES ), - PLMAP_EXT_IMPORT( "ScaleToPagesX", XML_NAMESPACE_STYLE, XML_SCALE_TO_X, XML_TYPE_NUMBER16, CTF_PM_SCALETOX ), - PLMAP_EXT_IMPORT( "ScaleToPagesY", XML_NAMESPACE_STYLE, XML_SCALE_TO_Y, XML_TYPE_NUMBER16, CTF_PM_SCALETOY ), - PLMAP_EXT( "ScaleToPagesX", XML_NAMESPACE_LO_EXT, XML_SCALE_TO_X, XML_TYPE_NUMBER16, CTF_PM_SCALETOX ), - PLMAP_EXT( "ScaleToPagesY", XML_NAMESPACE_LO_EXT, XML_SCALE_TO_Y, XML_TYPE_NUMBER16, CTF_PM_SCALETOY ), + // ODF 1.3 OFFICE-3857 + PLMAP_ODF13( "ScaleToPagesX", XML_NAMESPACE_STYLE, XML_SCALE_TO_X, XML_TYPE_NUMBER16, CTF_PM_SCALETOX ), + PLMAP_ODF13( "ScaleToPagesY", XML_NAMESPACE_STYLE, XML_SCALE_TO_Y, XML_TYPE_NUMBER16, CTF_PM_SCALETOY ), + PLMAP_ODF13( "ScaleToPagesX", XML_NAMESPACE_LO_EXT, XML_SCALE_TO_X, XML_TYPE_NUMBER16, CTF_PM_SCALETOX ), + PLMAP_ODF13( "ScaleToPagesY", XML_NAMESPACE_LO_EXT, XML_SCALE_TO_Y, XML_TYPE_NUMBER16, CTF_PM_SCALETOY ), PLMAP( "CenterHorizontally", XML_NAMESPACE_STYLE, XML_TABLE_CENTERING, XML_PM_TYPE_CENTER_HORIZONTAL | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, 0 ), PLMAP( "CenterVertically", XML_NAMESPACE_STYLE, XML_TABLE_CENTERING, XML_PM_TYPE_CENTER_VERTICAL | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, 0 ), PLMAP( "TextColumns", XML_NAMESPACE_STYLE, XML_COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_PM_TEXTCOLUMNS ), diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 60ec65b66026..4f779c43cdc2 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -74,6 +74,8 @@ using namespace ::xmloff::token; #define MC_E( a, p, l, t, c ) \ M_E_( a, p, l, (t|XML_TYPE_PROP_TABLE_CELL), c ) +#define MAP_ODF13(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFSVER_013, false } + // extensions import/export #define MAP_EXT(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, false } // extensions import only @@ -127,8 +129,8 @@ XMLPropertyMapEntry const aXMLParaPropMap[] = MP_E( "ParaTopMarginRelative", FO, MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), MP_E( "ParaBottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ), MP_E( "ParaBottomMarginRelative",FO, MARGIN_BOTTOM, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ), - MAP_EXT_I( "ParaContextMargin", XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ), // proposed ODF 1.2+ and was written by LO<=4.2 - MAP_EXT( "ParaContextMargin", XML_NAMESPACE_LO_EXT, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ), // extension namespace + MAP_ODF13( "ParaContextMargin", XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ), // ODF 1.3 OFFICE-3767 and was written by LO<=4.2 + MAP_ODF13( "ParaContextMargin", XML_NAMESPACE_LO_EXT, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ), // extension namespace // RES_CHRATR_CASEMAP MT_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), MT_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ), |