summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-01-24 16:42:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-01-27 20:58:35 +0100
commit8932ada4d8841499aa809f6b29efc1402fe95c1e (patch)
tree5ce8a2d8597bfbc3db396f5f4c74fe4e3d0b1309 /writerfilter
parente62058cddd3a55707abd022cddae5b30866e21ca (diff)
tdf#115153 writerfilter: RTF import: fix vert orient of Word 6 shapes
The bugdoc is affected by the change of default vertical alignment; apparently it's not even possible to set the vertical alignment of a Word 6 drawing object (\do) so we have to set the Word default. (regression from c79467ba954987f1d239c594c1e1b3af3f5515f6) (cherry picked from commit dc16cc0492ba96007078cc285fee1a8d03f40d55) tdf#115153 the missing test document (cherry picked from commit b7f12d8fd7493a7201ae5fd97e80e0296538f136) Change-Id: I4084a7a7e2a55f864cb569e04632e034d59eefdb Reviewed-on: https://gerrit.libreoffice.org/48524 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdispatchflag.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx
index 38c5f0e5a2a3..a50165506f81 100644
--- a/writerfilter/source/rtftok/rtfdispatchflag.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx
@@ -12,6 +12,7 @@
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
#include <filter/msfilter/escherex.hxx>
@@ -965,12 +966,19 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
getModelFactory()->createInstance("com.sun.star.drawing.CustomShape"),
uno::UNO_QUERY);
uno::Reference<drawing::XDrawPageSupplier> xDrawSupplier(m_xDstDoc, uno::UNO_QUERY);
+ m_aStates.top().aDrawingObject.xPropertySet.set(m_aStates.top().aDrawingObject.xShape,
+ uno::UNO_QUERY);
if (xDrawSupplier.is())
{
uno::Reference<drawing::XShapes> xShapes(xDrawSupplier->getDrawPage(),
uno::UNO_QUERY);
if (xShapes.is() && nKeyword != RTF_DPTXBX)
+ {
+ // set default VertOrient before inserting
+ m_aStates.top().aDrawingObject.xPropertySet->setPropertyValue(
+ "VertOrient", uno::makeAny(text::VertOrientation::NONE));
xShapes->add(m_aStates.top().aDrawingObject.xShape);
+ }
}
if (nType)
{
@@ -978,8 +986,6 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().aDrawingObject.xShape, uno::UNO_QUERY);
xDefaulter->createCustomShapeDefaults(OUString::number(nType));
}
- m_aStates.top().aDrawingObject.xPropertySet.set(m_aStates.top().aDrawingObject.xShape,
- uno::UNO_QUERY);
std::vector<beans::PropertyValue>& rPendingProperties
= m_aStates.top().aDrawingObject.aPendingProperties;
for (auto& rPendingProperty : rPendingProperties)