diff options
-rwxr-xr-x | sw/qa/extras/layout/data/tdf131707_flyWrap.doc | bin | 0 -> 41472 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 31 |
3 files changed, 25 insertions, 16 deletions
diff --git a/sw/qa/extras/layout/data/tdf131707_flyWrap.doc b/sw/qa/extras/layout/data/tdf131707_flyWrap.doc Binary files differnew file mode 100755 index 000000000000..c32e5dafd924 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf131707_flyWrap.doc diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 2a24e68ccd35..70cf21c1ef8a 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2279,6 +2279,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf114163) // This failed, if the legend first label is not "Data3". The legend position is right. } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf131707) +{ + createDoc("tdf131707_flyWrap.doc"); + xmlDocPtr pXmlDoc = parseLayoutDump(); + + assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/infos/bounds", "top", "2185"); + // the image should be inside of the cell boundary - so the same top or higher + assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/anchored/fly/infos/bounds", "top", "2185"); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125335) { SwDoc* pDoc = createDoc("tdf125335.odt"); diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index a7ffd2c51920..c7424c95d4a8 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -702,8 +702,7 @@ SwFlyNotify::~SwFlyNotify() // #i54138# - suppress restart of the layout process // on changed frame height. // Note: It doesn't seem to be necessary and can cause layout loops. - // Also suppress on initial positioning - required to trigger text wrapping (tdf#119748). - if ( bPosChgd && maFrame.Pos().X() != FAR_AWAY ) + if ( bPosChgd ) { // indicate a restart of the layout process pFly->SetRestartLayoutProcess( true ); @@ -712,21 +711,21 @@ SwFlyNotify::~SwFlyNotify() { // lock position pFly->LockPosition(); + } - if ( !pFly->ConsiderForTextWrap() ) - { - // indicate that object has to be considered for text wrap - pFly->SetConsiderForTextWrap( true ); - // invalidate 'background' in order to allow its 'background' - // to wrap around it. - pFly->NotifyBackground( pFly->GetPageFrame(), - pFly->GetObjRectWithSpaces(), - PrepareHint::FlyFrameArrive ); - // invalidate position of anchor frame in order to force - // a re-format of the anchor frame, which also causes a - // re-format of the invalid previous frames of the anchor frame. - pFly->AnchorFrame()->InvalidatePos(); - } + if ( !pFly->ConsiderForTextWrap() ) + { + // indicate that object has to be considered for text wrap + pFly->SetConsiderForTextWrap( true ); + // invalidate 'background' in order to allow its 'background' + // to wrap around it. + pFly->NotifyBackground( pFly->GetPageFrame(), + pFly->GetObjRectWithSpaces(), + PrepareHint::FlyFrameArrive ); + // invalidate position of anchor frame in order to force + // a re-format of the anchor frame, which also causes a + // re-format of the invalid previous frames of the anchor frame. + pFly->AnchorFrame()->InvalidatePos(); } } } |