diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-11-24 16:40:56 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-11-24 16:56:11 +0100 |
commit | 67d11883740da4ef242d0002acde83f67d4b327a (patch) | |
tree | 451ae65318d39bad2b408a98c54d0a5241f725a4 /sw/source/core/unocore/unodraw.cxx | |
parent | ca6fec87e0ebc32a748f9f44143e6336b008399e (diff) |
tdf#113938 sw: apply new default vertical orientation only during import
Commit c79467ba954987f1d239c594c1e1b3af3f5515f6 changed the default
vertical orientation for shapes in Writer; it turns out that at
least one extension assumes the previous default.
Tweak SwXShape so that the new default is used for shapes that are
created during file import, otherwise the old default.
Change-Id: I1dc4d3342dd53ce8e0857984456717b8ffcc97c7
Diffstat (limited to 'sw/source/core/unocore/unodraw.cxx')
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 3d080b56391a..c0a5f75b9fb1 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -73,6 +73,7 @@ using namespace ::com::sun::star; class SwShapeDescriptor_Impl { + bool m_isInReading; SwFormatHoriOrient* pHOrient; SwFormatVertOrient* pVOrient; SwFormatAnchor* pAnchor; @@ -95,7 +96,9 @@ public: bool bInitializedPropertyNotifier; public: - SwShapeDescriptor_Impl() : + SwShapeDescriptor_Impl(SwDoc const*const pDoc) + : m_isInReading(pDoc && pDoc->IsInReading()) + , // #i32349# - no defaults, in order to determine on // adding a shape, if positioning attributes are set or not. pHOrient( nullptr ), @@ -149,7 +152,8 @@ public: { if(bCreate && !pVOrient) { - if (!GetAnchor(true) || pAnchor->GetAnchorId() == RndStdIds::FLY_AS_CHAR) + if (m_isInReading && // tdf#113938 extensions might rely on old default + (!GetAnchor(true) || pAnchor->GetAnchorId() == RndStdIds::FLY_AS_CHAR)) { // for as-char, NONE ("from-top") is not a good default pVOrient = new SwFormatVertOrient(0, text::VertOrientation::TOP, text::RelOrientation::FRAME); } @@ -381,9 +385,9 @@ uno::Reference< drawing::XShape > SwFmDrawPage::CreateShape( SdrObject *pObj ) c xRet = nullptr; uno::Reference< beans::XPropertySet > xPrSet; if ( pObj->IsGroupObject() && (!pObj->Is3DObj() || (dynamic_cast<const E3dScene*>( pObj) != nullptr)) ) - xPrSet = new SwXGroupShape( xCreate ); + xPrSet = new SwXGroupShape(xCreate, nullptr); else - xPrSet = new SwXShape( xCreate ); + xPrSet = new SwXShape(xCreate, nullptr); xRet.set(xPrSet, uno::UNO_QUERY); } } @@ -900,10 +904,12 @@ namespace } } -SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) : +SwXShape::SwXShape(uno::Reference<uno::XInterface> & xShape, + SwDoc const*const pDoc) + : m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SHAPE)), m_pPropertyMapEntries(aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_TEXT_SHAPE)), - pImpl(new SwShapeDescriptor_Impl()), + pImpl(new SwShapeDescriptor_Impl(pDoc)), m_bDescriptor(true) { if(!xShape.is()) // default Ctor @@ -2716,8 +2722,9 @@ css::drawing::PolyPolygonBezierCoords SwXShape::ConvertPolyPolygonBezierToLayout return aConvertedPath; } -SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) : - SwXShape(xShape) +SwXGroupShape::SwXGroupShape(uno::Reference<XInterface> & xShape, + SwDoc const*const pDoc) + : SwXShape(xShape, pDoc) { #if OSL_DEBUG_LEVEL > 0 uno::Reference<XShapes> xShapes(xShapeAgg, uno::UNO_QUERY); |