sw/qa/extras/odfexport/odfexport.cxx | 10 ++++++++++ sw/source/core/layout/wsfrm.cxx | 7 +++++++ 2 files changed, 17 insertions(+)
New commits: commit ad96f6f378a9fce11c2f7d9ad39a8203189444e3 Author: Miklos Vajna <[email protected]> AuthorDate: Thu May 23 21:44:20 2019 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Fri May 24 09:06:28 2019 +0200 sw btlr writing mode: fix btlr <-> tbrl switch for fly frames The "BT" flag was not clear, so if the fly frame was first tbrl, then switched to btlr, then this was changed back, the result was not tbrl but tblr. Change-Id: I9a258e64e7a6e5849edd5a6a21a6182f642e44ab Reviewed-on: https://gerrit.libreoffice.org/72881 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index eeb16f2d9ef7..90a467b0d05c 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -1453,6 +1453,16 @@ DECLARE_ODFEXPORT_TEST(testBtlrFrame, "btlr-frame.odt") auto* pFlyFrame = dynamic_cast<SwFlyFrame*>(rAnchored[0]); CPPUNIT_ASSERT(pFlyFrame); CPPUNIT_ASSERT(pFlyFrame->IsVertLRBT()); + + if (!mbExported) + // Not yet exported, don't modify the doc model for test purposes. + return; + + // Make sure that btlr -> tbrl transition clears the "BT" flag. + xTextFrame->setPropertyValue("WritingMode", uno::makeAny(static_cast<sal_Int16>(text::WritingMode2::TB_LR))); + pFlyFrame = dynamic_cast<SwFlyFrame*>(rAnchored[0]); + CPPUNIT_ASSERT(pFlyFrame); + CPPUNIT_ASSERT(!pFlyFrame->IsVertLRBT()); } DECLARE_ODFEXPORT_TEST(testFdo86963, "fdo86963.odt") diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index c3e751f3b6f2..c5854a9d2bde 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -353,14 +353,21 @@ void SwFrame::CheckDir( SvxFrameDirection nDir, bool bVert, bool bOnlyBiDi, bool { mbVertical = false; mbVertLR = false; + mbVertLRBT = false; } else { mbVertical = true; if(SvxFrameDirection::Vertical_RL_TB == nDir) + { mbVertLR = false; + mbVertLRBT = false; + } else if(SvxFrameDirection::Vertical_LR_TB==nDir) + { mbVertLR = true; + mbVertLRBT = false; + } else if (nDir == SvxFrameDirection::Vertical_LR_BT) { mbVertLR = true; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
