summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-03-27 08:32:05 +0300
committerJustin Luth <justin_luth@sil.org>2020-03-28 20:17:19 +0100
commitcd868678583fa92833c37a63089131ba905dd3a6 (patch)
tree0f7644f3823e99fb86bd47abb6fe8a64fe000611 /sw/source/filter
parentbefd6880873cc3f63a0566b76246d2ae54f8a3c5 (diff)
tdf#80635 ww8import:2 take float table RIGHT to inlined table
Since SW has problems with floating tables, any unnecessarily floated tables are converted to inline. However, the positioning of the tables is mostly lost. So the choice is either to refuse to inline a strangely positioned table or else to transfer the positioning onto the inlined table. Transferring is easier said than done. But for right-aligned tables, hopefully it is easy to copy that without causing trouble. I didn't find any real-world examples in existing unit tests or bug reports, so I made up my own complicated one using both right margin and BIDI. Change-Id: I855ae62531b5930cbc9a3272c3a7228dd7b0df53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91272 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 3b1615793482..775dae384f6d 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2428,7 +2428,13 @@ void WW8TabDesc::CreateSwTable()
if ( m_pIo->m_xSFlyPara && !m_pIo->m_xSFlyPara->pFlyFormat )
{
// Get the table orientation from the fly
- if ( m_pIo->m_xSFlyPara->eHAlign == text::HoriOrientation::CENTER )
+ // Do we also need to check m_pIo->m_xSFlyPara->bToggelPos/IsPosToggle()? [Probably not - layout-only concern]
+ const bool bAdjustMargin = m_pIo->m_xSFlyPara->eHRel == text::RelOrientation::PAGE_FRAME || m_pIo->m_xSFlyPara->nXPos;
+ const bool bIsInsideMargin = m_bIsBiDi ? m_pIo->m_xSFlyPara->eHAlign == text::HoriOrientation::RIGHT
+ : m_pIo->m_xSFlyPara->eHAlign == text::HoriOrientation::LEFT;
+ if ( bIsInsideMargin && bAdjustMargin )
+ m_eOri = text::HoriOrientation::LEFT_AND_WIDTH;
+ else if ( m_pIo->m_xSFlyPara->eHAlign != text::HoriOrientation::NONE )
m_eOri = m_pIo->m_xSFlyPara->eHAlign;
}