diff options
author | Mark Hung <marklh9@gmail.com> | 2018-01-21 21:29:00 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2018-03-02 12:06:00 +0100 |
commit | 1e034575584930c5bfb57838383ac2cf151c1b92 (patch) | |
tree | a122c5a1bc4e1fa06cafdffd51751ff6fe0f7e6c /xmloff/source/text | |
parent | 584fc20be3bb6f90d17ef8a131575af9871cb1c4 (diff) |
tdf#35301 xmloff: load / store loext:ruby-position.
Add a new property loext:ruby-position to ODF filter
for the new attribute value "inter-character".
Change-Id: I193eb93fba0e2e7861b6c8635244cac36eb29a06
Reviewed-on: https://gerrit.libreoffice.org/48328
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/txtprhdl.cxx | 22 | ||||
-rw-r--r-- | xmloff/source/text/txtprmap.cxx | 3 |
2 files changed, 22 insertions, 3 deletions
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 382c283e1a57..993b100976bd 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/RubyAdjust.hpp> +#include <com/sun/star/text/RubyPosition.hpp> #include <com/sun/star/text/FontEmphasis.hpp> #include <com/sun/star/text/ParagraphVertAlign.hpp> #include <sax/tools/converter.hxx> @@ -198,6 +199,21 @@ static SvXMLEnumMapEntry<RubyAdjust> const pXML_RubyAdjust_Enum[] = { XML_TOKEN_INVALID, RubyAdjust(0) } }; +static SvXMLEnumMapEntry<sal_Int16> const pXML_RubyPosition_Enum[] = +{ + { XML_ABOVE, RubyPosition::ABOVE}, + { XML_BELOW, RubyPosition::BELOW}, + { XML_INTER_CHARACTER, RubyPosition::INTER_CHARACTER}, + { XML_TOKEN_INVALID, 0 } +}; + +static SvXMLEnumMapEntry<sal_Int16> const pXML_RubyIsAbove_Enum[] = +{ + { XML_ABOVE, RubyPosition::ABOVE}, + { XML_BELOW, RubyPosition::BELOW}, + { XML_TOKEN_INVALID, 0 } +}; + static SvXMLEnumMapEntry<sal_uInt16> const pXML_FontRelief_Enum[] = { { XML_NONE, FontRelief::NONE }, @@ -1256,8 +1272,10 @@ static const XMLPropertyHandler *GetPropertyHandler pHdl = new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum, XML_TOKEN_INVALID ); break; case XML_TYPE_TEXT_RUBY_POSITION: - pHdl = new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_ABOVE, - ::xmloff::token::XML_BELOW ); + pHdl = new XMLConstantsPropertyHandler( pXML_RubyPosition_Enum, XML_TOKEN_INVALID ); + break; + case XML_TYPE_TEXT_RUBY_IS_ABOVE: + pHdl = new XMLConstantsPropertyHandler( pXML_RubyIsAbove_Enum, XML_TOKEN_INVALID ); break; // OD 2004-05-05 #i28701# case XML_TYPE_WRAP_INFLUENCE_ON_POSITION: diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 1dac3b40ffe1..b6b90c1c538a 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -964,7 +964,8 @@ XMLPropertyMapEntry const aXMLSectionPropMap[] = XMLPropertyMapEntry const aXMLRubyPropMap[] = { MR_E( "RubyAdjust", STYLE, RUBY_ALIGN, XML_TYPE_TEXT_RUBY_ADJUST, 0 ), - MR_E( "RubyIsAbove", STYLE, RUBY_POSITION, XML_TYPE_TEXT_RUBY_POSITION, 0 ), + MR_E( "RubyPosition", STYLE, RUBY_POSITION, XML_TYPE_TEXT_RUBY_IS_ABOVE, 0 ), + MR_E( "RubyPosition", LO_EXT, RUBY_POSITION, XML_TYPE_TEXT_RUBY_POSITION | MID_FLAG_MERGE_PROPERTY, 0 ), M_END() }; |