summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-08-14 23:01:07 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-08-15 15:28:56 +0200
commit424984afa82c090e974e3e87d94589079545284b (patch)
tree09766980d4e92b15c3a8483b5df2b407a88cc847 /writerfilter
parent820b043101a5b2c64a29ad2f60bc69366189c46c (diff)
sw btlr writing mode: RTF filter of Writer textframes
Both import and export needed fixing. (cherry picked from commit be92468ae3595d4384510a9cc0e15629c7cb0692) Conflicts: sw/qa/extras/rtfexport/rtfexport4.cxx Change-Id: Ie1728c3e67d8637e3720748d7f61a69c058eafe3 Reviewed-on: https://gerrit.libreoffice.org/77506 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 35addd606640..7cfd76f21a14 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/WritingMode.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -366,7 +367,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
uno::Any aLineColor = uno::makeAny(COL_BLACK);
// Default line width is 0.75 pt (26 mm100) in Word, 0 in Writer.
uno::Any aLineWidth = uno::makeAny(sal_Int32(26));
- text::WritingMode eWritingMode = text::WritingMode_LR_TB;
+ sal_Int16 eWritingMode = text::WritingMode2::LR_TB;
// Groupshape support
boost::optional<sal_Int32> oGroupLeft, oGroupTop, oGroupRight, oGroupBottom;
boost::optional<sal_Int32> oRelLeft, oRelTop, oRelRight, oRelBottom;
@@ -450,7 +451,10 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
{
case 1: // Top to bottom ASCII font
case 3: // Top to bottom non-ASCII font
- eWritingMode = text::WritingMode_TB_RL;
+ eWritingMode = text::WritingMode2::TB_RL;
+ break;
+ case 2: // Bottom to top non-ASCII font
+ eWritingMode = text::WritingMode2::BT_LR;
break;
}
}
@@ -857,10 +861,11 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
resolveDhgt(xPropertySet, *rShape.oZ, bOldStyle);
}
if (m_bTextFrame)
- // Writer textframes implement text::WritingMode2, which is a different data type.
- xPropertySet->setPropertyValue("WritingMode", uno::makeAny(sal_Int16(eWritingMode)));
+ xPropertySet->setPropertyValue("WritingMode", uno::makeAny(eWritingMode));
else
- xPropertySet->setPropertyValue("TextWritingMode", uno::makeAny(eWritingMode));
+ // Only Writer textframes implement text::WritingMode2.
+ xPropertySet->setPropertyValue("TextWritingMode",
+ uno::makeAny(text::WritingMode(eWritingMode)));
}
if (!m_aParents.empty() && m_aParents.top().is() && !m_bTextFrame)