sw/source/core/text/porfly.cxx | 2 +- writerfilter/source/rtftok/rtfdispatchdestination.cxx | 9 ++++----- writerfilter/source/rtftok/rtfsdrimport.cxx | 1 + 3 files changed, 6 insertions(+), 6 deletions(-)
New commits: commit 8a9f78a10726a71905d916ba48b99b8ab8760b05 Author: Michael Stahl <[email protected]> Date: Mon Dec 18 21:38:48 2017 +0100 tdf#114212 sw: fix layout of as-char anchored text-frame of shape Commit c79467ba954987f1d239c594c1e1b3af3f5515f6 changed the vertical orientation of the shape, and the effect on shapes with text-frames (or TextBox) is surprising: the shape itself, as imported from DOCX, now has the "top" vertical orientation, where it previously had "from-bottom", which was wrong, because it was different from Word. However the associated text-frame now is positioned wrongly, stacked on top of the shape; the problem is in SwFlyCntPortion::SetBase() where the text-frame is manually positioned depending on the shape's position; using "top" there does not actually result in the correct position because it disables the use of the computed vertical offset; fix the offset so it looks right. Change-Id: I2ff38577d0cae2e9f796402545503cc6351a9d2b (cherry picked from commit bdcbf601410f29642aa27e2b8fab312f929d569f) Reviewed-on: https://gerrit.libreoffice.org/46750 Tested-by: Jenkins <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 1d867836d1ca..1c985700a672 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -363,7 +363,7 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, const Point &rBase, SwFormatVertOrient aVert(pTextBox->GetVertOrient()); aVert.SetVertOrient(css::text::VertOrientation::NONE); - sal_Int32 nTop = aTextRectangle.getY() - rFrame.getFrameArea().Top() - nFlyAsc; + sal_Int32 const nTop = aTextRectangle.getY() - rFrame.getFrameArea().Top(); aVert.SetPos(nTop); pTextBox->LockModify(); commit 65eb3e3fbcead337eaae694f59d21779b8b00dc5 Author: Michael Stahl <[email protected]> Date: Mon Dec 18 17:17:44 2017 +0100 tdf#114303 writerfilter: RTF import: fix default vert orient of shapes The bugdoc is affected by the change of default vertical alignment, it doesn't contain anything that would set the VertOrient property. (regression from c79467ba954987f1d239c594c1e1b3af3f5515f6) Setting the AnchorType property before adding the shape is actually not as effective as expected: it does cause the old default vertical alignment to be used, but does not actually set the anchor type because there is no anchor position and so SwXDrawPage::add resets the anchor type to FLY_AT_PAGE; it's less confusing to set the VertOrient property instead. Change-Id: Ib0a71d20d479776ab5e4c21c3dd13c0c307a045e (cherry picked from commit 706728df38830536354ba902978cc8297f787dfc) Reviewed-on: https://gerrit.libreoffice.org/46731 Tested-by: Jenkins <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/writerfilter/source/rtftok/rtfdispatchdestination.cxx b/writerfilter/source/rtftok/rtfdispatchdestination.cxx index f844de1bf94c..0f795c7d50e0 100644 --- a/writerfilter/source/rtftok/rtfdispatchdestination.cxx +++ b/writerfilter/source/rtftok/rtfdispatchdestination.cxx @@ -11,7 +11,7 @@ #include <com/sun/star/document/DocumentProperties.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> -#include <com/sun/star/text/TextContentAnchorType.hpp> +#include <com/sun/star/text/VertOrientation.hpp> #include <filter/msfilter/escherex.hxx> #include <rtl/character.hxx> @@ -598,11 +598,10 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) if (xDrawSupplier.is()) { uno::Reference<drawing::XShape> xShape(xGroupShape, uno::UNO_QUERY); - // set AnchorType before inserting + // set default VertOrient before inserting uno::Reference<beans::XPropertySet>(xShape, uno::UNO_QUERY) - ->setPropertyValue( - "AnchorType", - uno::makeAny(text::TextContentAnchorType_AT_CHARACTER)); + ->setPropertyValue("VertOrient", + uno::makeAny(text::VertOrientation::NONE)); xDrawSupplier->getDrawPage()->add(xShape); } m_pSdrImport->pushParent(xGroupShape); diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 5605f5cfb27d..b79d37123399 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -341,6 +341,7 @@ int RTFSdrImport::initShape(uno::Reference<drawing::XShape>& o_xShape, o_xPropSet->setPropertyValue( "FillColor", uno::makeAny(sal_uInt32(0xffffff))); // White in Word, kind of blue in Writer. + o_xPropSet->setPropertyValue("VertOrient", uno::makeAny(text::VertOrientation::NONE)); } return nType; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
