Kaydet (Commit) db346dde authored tarafından Miklos Vajna's avatar Miklos Vajna

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 c2d1ab73 (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/67717Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
üst 00673456
......@@ -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: */
......@@ -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);
......
......@@ -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
......
......@@ -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;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment