diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-30 20:33:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-07 14:22:07 +0100 |
commit | 8295a3344704ce9a18489933c499a50c403f1a3d (patch) | |
tree | 92a10017311909e3010624b39acddfcf7d3eba00 /sw/source/filter/ww8/docxsdrexport.cxx | |
parent | 8accfa30343195b5d7cfd111301677a6a9b6a21b (diff) |
remove E3D_INVENTOR_FLAG and convert SdrObjKind to scoped enum
We don't need E3D_INVENTOR_FLAG, we can just check if the SdrObjKind is
in the right range.
Which exposes some dodgy code in DrawViewShell::GetMenuStateSel
SfxItemState::DEFAULT == rSet.GetItemState( OBJ_TITLETEXT ) ||
SfxItemState::DEFAULT == rSet.GetItemState( OBJ_OUTLINETEXT ) ||
which has been there ever since
commit f47a9d9db3d06927380bb79b04bb6d4721a92d2b
Date: Mon Sep 18 16:07:07 2000 +0000
initial import
just remove that.
In SwFEShell::ImpEndCreate() move some logic around to avoid
using an out-of-range SdrObjKind value
Change-Id: I4620bfe61aca8f7415503debe3c84bfe5f4368a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127763
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8/docxsdrexport.cxx')
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 7166ed49565f..4541714fdf00 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -144,11 +144,11 @@ bool lcl_IsRotateAngleValid(const SdrObject& rObj) // have been incorporated. switch (rObj.GetObjIdentifier()) { - case OBJ_GRUP: - case OBJ_LINE: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_PATHFILL: + case SdrObjKind::Group: + case SdrObjKind::Line: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: return false; default: return true; @@ -302,7 +302,7 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj) basegfx::B2DPolyPolygon aPolyPolygon; switch (pSdrObj->GetObjIdentifier()) { - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: { // EnhancedCustomShapeEngine::GetLineGeometry() is not directly usable, because the wrap // polygon acts on the untransformed shape in Word. We do here similar as in @@ -371,19 +371,19 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj) aPolyPolygon.transform(aTranslateToCenter); break; } // end case OBJ_CUSTOMSHAPE - case OBJ_LINE: + case SdrObjKind::Line: { aContour.Insert(0, Point(0, 0)); aContour.Insert(1, Point(21600, 21600)); aContour.Insert(2, Point(0, 0)); return aContour; } - case OBJ_PATHFILL: - case OBJ_PATHLINE: - case OBJ_FREEFILL: - case OBJ_FREELINE: - case OBJ_PATHPOLY: - case OBJ_PATHPLIN: + case SdrObjKind::PathFill: + case SdrObjKind::PathLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::FreehandLine: + case SdrObjKind::PathPoly: + case SdrObjKind::PathPolyLine: // case OBJ_POLY: FixMe: Creating wrap polygon would work, but export to DML is currently // case OBJ_PLIN: disabled for unknown reason; related bug 75254. { @@ -424,7 +424,7 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj) aPolyPolygon.transform(aTranslateToCenter); break; } - case OBJ_NONE: + case SdrObjKind::NONE: default: break; } @@ -736,7 +736,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons sal_Int32 nTopExt(0); sal_Int32 nBottomExt(0); - if ((!pObj) || (pObj && (pObj->GetObjIdentifier() == SwFlyDrawObjIdentifier))) + if ((!pObj) || (pObj && (pObj->GetObjIdentifier() == SdrObjKind::SwFlyDrawObjIdentifier))) { // Frame objects have a restricted shadow and no further effects. They have border instead of // stroke. LO includes shadow and border in the object size, but Word not. @@ -804,7 +804,8 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons { // Word 2007 makes no width-height-swap for images. Detect this situation. sal_Int32 nMode = m_pImpl->getExport().getWordCompatibilityModeFromGrabBag(); - bool bIsWord2007Image(nMode > 0 && nMode < 14 && pObj->GetObjIdentifier() == OBJ_GRAF); + bool bIsWord2007Image(nMode > 0 && nMode < 14 + && pObj->GetObjIdentifier() == SdrObjKind::Graphic); // Word cannot handle negative EffectExtent although allowed in OOXML, the 'dist' attributes // may not be negative. Take care of that. @@ -926,7 +927,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons aPos.X += nPosXDiff; // Make the postponed position move of frames. aPos.Y += nPosYDiff; if (pObj && lcl_IsRotateAngleValid(*pObj) - && pObj->GetObjIdentifier() != SwFlyDrawObjIdentifier) + && pObj->GetObjIdentifier() != SdrObjKind::SwFlyDrawObjIdentifier) lclMovePositionWithRotation(aPos, rSize, pObj->GetRotateAngle()); const char* relativeFromH; |