diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-02-08 01:50:55 +0100 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-02-08 02:59:50 +0100 |
commit | feae30c4ce1a1aa303500371b858f871d4ef88fc (patch) | |
tree | 114b264463bac0cb391df8c0c6af7611c91de6a2 /xmloff/source | |
parent | drawingML export/import: text frames with vertical alignment (diff) | |
download | core-feae30c4ce1a1aa303500371b858f871d4ef88fc.tar.gz core-feae30c4ce1a1aa303500371b858f871d4ef88fc.zip |
ODF export/import: text vertical adjustment attribute of text frames
ODF standard handle 'textarea-vertical-align' as a
'graphic-property' which "specifies formatting
properties for chart, draw, graphic, and frame elements".
So this change fit to the standard.
Change-Id: I956f512953380983c2c882e943178335fd4dbfeb
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/text/txtprhdl.cxx | 17 | ||||
-rw-r--r-- | xmloff/source/text/txtprmap.cxx | 1 |
2 files changed, 16 insertions, 2 deletions
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 951fa1f6fd01..032a055dac84 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -45,6 +45,7 @@ #include "txtprhdl.hxx" // OD 2004-05-05 #i28701# #include <com/sun/star/text/WrapInfluenceOnPosition.hpp> +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -211,7 +212,7 @@ static SvXMLEnumMapEntry const pXML_FontRelief_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_VerticalAlign_Enum[] = +static SvXMLEnumMapEntry const pXML_ParaVerticalAlign_Enum[] = { { XML_TOP, ParagraphVertAlign::TOP }, { XML_MIDDLE, ParagraphVertAlign::CENTER }, @@ -231,6 +232,15 @@ static SvXMLEnumMapEntry const pXML_WrapInfluenceOnPosition_Enum[] = { XML_TOKEN_INVALID, 0 } }; +static SvXMLEnumMapEntry const pXML_VerticalAlign_Enum[] = +{ + { XML_TOP, drawing::TextVerticalAdjust_TOP }, + { XML_MIDDLE, drawing::TextVerticalAdjust_CENTER }, + { XML_BOTTOM, drawing::TextVerticalAdjust_BOTTOM }, + { XML_JUSTIFY, drawing::TextVerticalAdjust_BLOCK }, + { XML_TOKEN_INVALID, 0 } +}; + static SvXMLEnumMapEntry const pXML_FillStyle_Enum[] = { { XML_NONE, drawing::FillStyle_NONE }, @@ -1347,7 +1357,7 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler GetXMLToken( XML_LINE_HEIGHT ) ); break; case XML_TYPE_TEXT_VERTICAL_ALIGN: - pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID ); + pHdl = new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum, XML_TOKEN_INVALID ); break; case XML_TYPE_TEXT_RUBY_POSITION: pHdl = new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_ABOVE, @@ -1383,6 +1393,9 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler case XML_TYPE_FILLSTYLE: pHdl = new XMLConstantsPropertyHandler( pXML_FillStyle_Enum, XML_TOKEN_INVALID ); break; + case XML_TYPE_VERTICAL_ALIGN: + pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID ); + break; } return pHdl; diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index a1f9898f2f91..90cb26e56869 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -786,6 +786,7 @@ XMLPropertyMapEntry aXMLFramePropMap[] = MG_E( "UserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), MAP_EXT("RelativeWidthRelation", XML_NAMESPACE_LO_EXT, XML_REL_WIDTH_REL, XML_TYPE_TEXT_HORIZONTAL_REL|XML_TYPE_PROP_GRAPHIC, CTF_RELWIDTHREL), MAP_EXT("RelativeHeightRelation", XML_NAMESPACE_LO_EXT, XML_REL_HEIGHT_REL, XML_TYPE_TEXT_VERTICAL_REL|XML_TYPE_PROP_GRAPHIC, CTF_RELHEIGHTREL), + MG_E("TextVerticalAdjust", DRAW, TEXTAREA_VERTICAL_ALIGN, XML_TYPE_VERTICAL_ALIGN, 0), M_END() }; |