summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-11-17 18:47:07 +0100
committerArmin Le Grand <Armin.Le.Grand@cib.de>2017-11-17 18:47:07 +0100
commit8c103b56b91a3b5037300036b57e3d9f96d7255a (patch)
tree8c3ddd0135e7a1540bd3f8577dcf407b38af54d4
parentRotateFlyFrame3: add support for AutoContour (diff)
downloadcore-feature/RotateFlyFrame3.tar.gz
core-feature/RotateFlyFrame3.zip
RotateFlyFrame3: Corrected wrong static_cast feature/RotateFlyFrame3
Change-Id: Ia3e0748d0b4ba11ec84a85e823472cdac9bf987a
-rw-r--r--sw/source/core/layout/fly.cxx42
1 files changed, 22 insertions, 20 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 569a0ec86282..8f440743b736 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2447,8 +2447,6 @@ bool SwFlyFrame::GetContour( tools::PolyPolygon& rContour,
if(bIsCandidate)
{
- const SwFlyFreeFrame* pSwFlyFreeFrame(static_cast< const SwFlyFreeFrame* >(this));
-
if(GetFormat()->GetSurround().IsContour())
{
SwNoTextNode *pNd = const_cast<SwNoTextNode*>(static_cast<const SwNoTextNode*>(static_cast<const SwContentFrame*>(Lower())->GetNode()));
@@ -2543,6 +2541,8 @@ bool SwFlyFrame::GetContour( tools::PolyPolygon& rContour,
}
else
{
+ const SwFlyFreeFrame* pSwFlyFreeFrame(dynamic_cast< const SwFlyFreeFrame* >(this));
+
if(nullptr != pSwFlyFreeFrame &&
pSwFlyFreeFrame->supportsAutoContour() &&
// isTransformableSwFrame already used in supportsAutoContour(), but
@@ -2558,27 +2558,29 @@ bool SwFlyFrame::GetContour( tools::PolyPolygon& rContour,
}
}
- if(bRet &&
- 0 != rContour.Count() &&
- nullptr != pSwFlyFreeFrame &&
- pSwFlyFreeFrame->isTransformableSwFrame())
+ if(bRet && 0 != rContour.Count())
{
- // Need to adapt contour to transformation
- basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
- getFrameAreaTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
+ const SwFlyFreeFrame* pSwFlyFreeFrame(dynamic_cast< const SwFlyFreeFrame* >(this));
- if(!basegfx::fTools::equalZero(fRotate))
+ if(nullptr != pSwFlyFreeFrame && pSwFlyFreeFrame->isTransformableSwFrame())
{
- basegfx::B2DPolyPolygon aSource(rContour.getB2DPolyPolygon());
- const basegfx::B2DPoint aCenter(getFrameAreaTransformation() * basegfx::B2DPoint(0.5, 0.5));
- const basegfx::B2DHomMatrix aRotateAroundCenter(
- basegfx::utils::createRotateAroundPoint(
- aCenter.getX(),
- aCenter.getY(),
- fRotate));
- aSource.transform(aRotateAroundCenter);
- rContour = tools::PolyPolygon(aSource);
+ // Need to adapt contour to transformation
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getFrameAreaTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ if(!basegfx::fTools::equalZero(fRotate))
+ {
+ basegfx::B2DPolyPolygon aSource(rContour.getB2DPolyPolygon());
+ const basegfx::B2DPoint aCenter(getFrameAreaTransformation() * basegfx::B2DPoint(0.5, 0.5));
+ const basegfx::B2DHomMatrix aRotateAroundCenter(
+ basegfx::utils::createRotateAroundPoint(
+ aCenter.getX(),
+ aCenter.getY(),
+ fRotate));
+ aSource.transform(aRotateAroundCenter);
+ rContour = tools::PolyPolygon(aSource);
+ }
}
}
}