diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-02-12 12:04:19 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-12 14:35:44 +0100 |
commit | db346dde6179e7414289681d91b153a6ed259d05 (patch) | |
tree | aafbf0e427fd59fcdeac67a778df424dd65e3e7a | |
parent | 006734562be1fec6b8fa4ff291c51b6043265653 (diff) |
sw btlr wrting mode: implement document model
btLr is not a writing mode that would be used by any natural language,
the reason it makes sense to support this is that the Word UI makes it
easy to rotate text 90 degrees counter-clockwise for Latin (lrtb) text,
which then triggers this feature. This is common in the first column of
tables to create text that looks like a row header.
An import-time workaround to handle <w:textDirection w:val="btLr"/> was
added in commit c2d1ab73165d5fa19037e6244b1d634c6c455efc (tentative fix
for fdo#30474#, 2010-11-26), but rotating text at a text portion level
has various unwanted side effects, just counting my own fixes, I had 7
workarounds on top of that workaround to hide problems where the root
cause is this missing writing direction in sw core.
This commit just extends the sw core doc model, everything else is to be
done in follow-up commits.
Change-Id: I89e02cd4b40de78699dbf14885fc128e870de3b8
Reviewed-on: https://gerrit.libreoffice.org/67717
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | editeng/source/items/frmitems.cxx | 11 | ||||
-rw-r--r-- | include/editeng/frmdir.hxx | 5 | ||||
-rw-r--r-- | include/editeng/frmdiritem.hxx | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/text/WritingMode2.idl | 7 |
4 files changed, 23 insertions, 1 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 622e557a0517..2d6c98d59531 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3917,4 +3917,15 @@ bool SvxFrameDirectionItem::QueryValue( css::uno::Any& rVal, return bRet; } +void SvxFrameDirectionItem::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("SvxFrameDirectionItem")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nWhich"), + BAD_CAST(OString::number(Which()).getStr())); + xmlTextWriterWriteAttribute( + pWriter, BAD_CAST("m_nValue"), + BAD_CAST(OString::number(static_cast<sal_Int16>(GetValue())).getStr())); + xmlTextWriterEndElement(pWriter); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/frmdir.hxx b/include/editeng/frmdir.hxx index b0ada2cce30a..f8801cc77020 100644 --- a/include/editeng/frmdir.hxx +++ b/include/editeng/frmdir.hxx @@ -48,7 +48,10 @@ enum class SvxFrameDirection Vertical_LR_TB = css::text::WritingMode2::TB_LR, /** Use the value from the environment, can only be used in frames. */ - Environment = css::text::WritingMode2::CONTEXT + Environment = css::text::WritingMode2::CONTEXT, + + /** Vertical, from bottom to top, from left to right. */ + Vertical_LR_BT = css::text::WritingMode2::BT_LR, }; const char* getFrmDirResId(size_t nIndex); diff --git a/include/editeng/frmdiritem.hxx b/include/editeng/frmdiritem.hxx index 929cbc5b0b3e..1ec32483077d 100644 --- a/include/editeng/frmdiritem.hxx +++ b/include/editeng/frmdiritem.hxx @@ -58,6 +58,7 @@ public: } SvxFrameDirectionItem(SvxFrameDirectionItem const &) = default; // SfxPoolItem copy function dichotomy + void dumpAsXml(struct _xmlTextWriter* pWriter) const override; }; #endif // INCLUDED_EDITENG_FRMDIRITEM_HXX diff --git a/offapi/com/sun/star/text/WritingMode2.idl b/offapi/com/sun/star/text/WritingMode2.idl index 4f1800b06a0d..1edc467e7a0f 100644 --- a/offapi/com/sun/star/text/WritingMode2.idl +++ b/offapi/com/sun/star/text/WritingMode2.idl @@ -76,6 +76,13 @@ published constants WritingMode2 /** obtain actual writing mode from the context of the object. */ const short CONTEXT = 4; + + /** text within a line is written bottom-to-top. Lines and blocks are + placed left-to-right. + + @since LibreOffice 6.3 + */ + const short BT_LR = 5; }; |