diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-05-23 21:44:20 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-05-24 09:06:28 +0200 |
commit | ad96f6f378a9fce11c2f7d9ad39a8203189444e3 (patch) | |
tree | 0983689bf4b4d57e1dddb48da2553e44d6a2cb0b | |
parent | 8a70f02c7d5b7dc4f947138052002499b24b3903 (diff) |
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 <vmiklos@collabora.com>
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 7 |
2 files changed, 17 insertions, 0 deletions
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; |