summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-03-27 08:09:29 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-03-30 09:37:35 +0200
commitba989a99ea19ffd0aafeea01f9b737ea79fa952a (patch)
tree3860c07cdc4f28e97eb40d38c5b7c46c49e6e797 /sw/source
parent79b578b7f8b5e3a80fcd0fd86e83d96d7c900bb1 (diff)
tdf#80635 ww8import:3 take float table orient 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. For absolutely positioned flies, which are LEFT_AND_WIDTH, pass the X position to the left margin. Change-Id: I996a06c753e8b9b1151f7deea8ad4caf5724dd0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91273 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 775dae384f6d..3f3ff253a44e 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2425,6 +2425,7 @@ void WW8TabDesc::CreateSwTable()
// Because SW cannot handle multi-page floating frames,
// _any unnecessary_ floating tables have been converted to inline.
+ long nLeft = 0;
if ( m_pIo->m_xSFlyPara && !m_pIo->m_xSFlyPara->pFlyFormat )
{
// Get the table orientation from the fly
@@ -2436,6 +2437,17 @@ void WW8TabDesc::CreateSwTable()
m_eOri = text::HoriOrientation::LEFT_AND_WIDTH;
else if ( m_pIo->m_xSFlyPara->eHAlign != text::HoriOrientation::NONE )
m_eOri = m_pIo->m_xSFlyPara->eHAlign;
+ if ( m_eOri == text::HoriOrientation::LEFT_AND_WIDTH )
+ {
+ nLeft = m_pIo->m_xSFlyPara->nXPos;
+ if ( m_pIo->m_xSFlyPara->eHRel == text::RelOrientation::PAGE_FRAME )
+ {
+ if ( !m_bIsBiDi )
+ nLeft -= m_pIo->m_aSectionManager.GetPageLeft();
+ else
+ nLeft += m_pIo->m_aSectionManager.GetPageRight();
+ }
+ }
}
// The table is small: The number of columns is the lowest count of
@@ -2527,13 +2539,12 @@ void WW8TabDesc::CreateSwTable()
//ability to set the margin.
SvxLRSpaceItem aL( RES_LR_SPACE );
- long nLeft = 0;
if (!m_bIsBiDi)
- nLeft = GetMinLeft();
+ nLeft += GetMinLeft();
else
{
const short nTableWidth = m_nPreferredWidth ? m_nPreferredWidth : m_nSwWidth;
- nLeft = m_pIo->m_aSectionManager.GetTextAreaWidth();
+ nLeft += m_pIo->m_aSectionManager.GetTextAreaWidth();
nLeft = nLeft - nTableWidth - GetMinLeft();
}
aL.SetLeft(nLeft);