diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-02-13 14:01:57 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-13 15:17:34 +0100 |
commit | 8af98ac8bf0ac8795999ecbf061d3c094f7c3be4 (patch) | |
tree | dc93f5888dcdce57d780f538493668d74452a89b /sw/source/filter/xml/xmlimpit.cxx | |
parent | b6de43a14a768e261d2233df57cf5fa46480d991 (diff) |
sw btlr writing mode: implement ODF filter
An easy way would be to just extend aXML_WritingDirection_Enum, but then
we would write the new attribute value to a non-extension namespace.
So special case the new attribute value during both import and export
(and only for table cells as a start).
Change-Id: I431bf99693c4a3452e91f241bd2f0fcfc72c68fd
Reviewed-on: https://gerrit.libreoffice.org/67770
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter/xml/xmlimpit.cxx')
-rw-r--r-- | sw/source/filter/xml/xmlimpit.cxx | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 1e921ac9dce6..0ba10f9cfd25 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -42,6 +42,7 @@ #include <editeng/formatbreakitem.hxx> #include <editeng/keepitem.hxx> #include <editeng/brushitem.hxx> +#include <editeng/frmdir.hxx> #include <fmtpdsc.hxx> #include <fmtornt.hxx> #include <fmtfsize.hxx> @@ -52,6 +53,7 @@ #include <xmloff/xmlprhdl.hxx> #include "xmlithlp.hxx" #include <com/sun/star/uno/Any.hxx> +#include <sal/log.hxx> using ::editeng::SvxBorderLine; using namespace ::com::sun::star; @@ -905,14 +907,25 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_FRAMEDIR: { - std::unique_ptr<XMLPropertyHandler> pWritingModeHandler = - XMLPropertyHandlerFactory::CreatePropertyHandler( - XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT ); - Any aAny; - bOk = pWritingModeHandler->importXML( rValue, aAny, - rUnitConverter ); - if( bOk ) - bOk = rItem.PutValue( aAny, 0 ); + if (IsXMLToken(rValue, XML_BT_LR)) + { + // Read bt-lr from the extension namespace, handle other values + // below. + Any aAny; + aAny <<= static_cast<sal_uInt16>(SvxFrameDirection::Vertical_LR_BT); + bOk = rItem.PutValue(aAny, 0); + } + else + { + std::unique_ptr<XMLPropertyHandler> pWritingModeHandler = + XMLPropertyHandlerFactory::CreatePropertyHandler( + XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT ); + Any aAny; + bOk = pWritingModeHandler->importXML( rValue, aAny, + rUnitConverter ); + if( bOk ) + bOk = rItem.PutValue( aAny, 0 ); + } } break; |