summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/flylay.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-11-07 18:18:44 +0100
committerArmin Le Grand <Armin.Le.Grand@cib.de>2017-11-18 13:07:44 +0100
commitda05b60cdb72d301c6b16c8cb31135f46f4ed2c0 (patch)
tree20e05072d856d7fa8a09b5506929892b36698f24 /sw/source/core/layout/flylay.cxx
parent51ee0c5ba6b0ffcd4b12e652de48e3f775cccc7d (diff)
RotateFlyFrame3: Late-Updating of Areas
When Layouting the update of the Areas is needed, but during layout needs to be stable on the unrotated values. Hard to find the right spot to do this, decided to use the inner/outer frame, layout both, and trigger the updates when the inner frame is layouted to non- rotated Areas for inner and outer frame. Still not sure if this will be correct, but is close to working well. Some repaints/updates missing Change-Id: I3d7dcbf624f3f32392e5e98420cb348d11d7d322
Diffstat (limited to 'sw/source/core/layout/flylay.cxx')
-rw-r--r--sw/source/core/layout/flylay.cxx59
1 files changed, 29 insertions, 30 deletions
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index e21991a32f4b..0fdf70face11 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -111,7 +111,8 @@ void SwFlyFreeFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
if ( !GetAnchorFrame() || IsLocked() || IsColLocked() )
return;
- // #i28701# - use new method <GetPageFrame()>
+
+ // #i28701# - use new method <GetPageFrame()>
if( !GetPageFrame() && GetAnchorFrame() && GetAnchorFrame()->IsInFly() )
{
SwFlyFrame* pFly = AnchorFrame()->FindFlyFrame();
@@ -119,8 +120,11 @@ void SwFlyFreeFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
if( pPageFrame )
pPageFrame->AppendFlyToPage( this );
}
+
if( !GetPageFrame() )
+ {
return;
+ }
Lock(); // The curtain drops
@@ -225,9 +229,10 @@ void SwFlyFreeFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
nLoopControlRuns = 0;
}
- // RotateFlyFrame3 - inner frame
- // After the unrotated layout is finished, apply possible set rotation to it
- const double fRotation(getRotation());
+ // RotateFlyFrame3 - outer frame
+ // Do not refresh transforms/Areas self here, this will be done
+ // when inner and outer frame are layouted, in SwNoTextFrame::MakeAll
+ const double fRotation(getFrameRotation());
if(basegfx::fTools::equalZero(fRotation))
{
@@ -235,27 +240,6 @@ void SwFlyFreeFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
maFrameAreaTransformation.identity();
maFramePrintAreaTransformation.identity();
}
- else
- {
- // save Transformations to local maFrameAreaTransformation
- // and maFramePrintAreaTransformation.
-
- // get center from outer frame (layout frame) to be on the safe side
- const Point aCenter(GetUpper() ? GetUpper()->getFrameArea().Center() : getFrameArea().Center());
- const basegfx::B2DPoint aB2DCenter(aCenter.X(), aCenter.Y());
-
- createFrameAreaTransformations(
- maFrameAreaTransformation,
- maFramePrintAreaTransformation,
- fRotation,
- aB2DCenter);
-
- // create BoundRects of FrameAreas and re-set the FrameArea definitions
- // to represent the rotated geometry in the layout object
- setFrameAreaDefinitionsToBoundRangesOfTransformations(
- maFrameAreaTransformation,
- maFramePrintAreaTransformation);
- }
Unlock();
@@ -268,6 +252,21 @@ void SwFlyFreeFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
#endif
}
+void SwFlyFreeFrame::updateTransformationsAndAreas(
+ double fRotation,
+ const basegfx::B2DPoint& rCenter)
+{
+ createFrameAreaTransformations(
+ maFrameAreaTransformation,
+ maFramePrintAreaTransformation,
+ fRotation,
+ rCenter);
+
+ setFrameAreaDefinitionsToBoundRangesOfTransformations(
+ maFrameAreaTransformation,
+ maFramePrintAreaTransformation);
+}
+
// RotateFlyFrame3 - Support for Transformations - outer frame
basegfx::B2DHomMatrix SwFlyFreeFrame::getFrameAreaTransformation() const
{
@@ -293,8 +292,8 @@ basegfx::B2DHomMatrix SwFlyFreeFrame::getFramePrintAreaTransformation() const
return SwFlyFrame::getFramePrintAreaTransformation();
}
-// RotateFlyFrame3 - inner frame
-double SwFlyFreeFrame::getRotation() const
+// RotateFlyFrame3 - outer frame
+double SwFlyFreeFrame::getFrameRotation() const
{
// SwLayoutFrame::Lower() != SwFrame::GetLower(), but SwFrame::GetLower()
// calls SwLayoutFrame::Lower() when it's a SwLayoutFrame - so use GetLower()
@@ -302,11 +301,11 @@ double SwFlyFreeFrame::getRotation() const
if(nullptr != pSwNoTextFrame)
{
- return pSwNoTextFrame->getRotation();
+ return pSwNoTextFrame->getFrameRotation();
}
- // call parent
- return SwFlyFrame::getRotation();
+ // no rotation
+ return 0.0;
}
/** determines, if direct environment of fly frame has 'auto' size