summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-12-11 16:15:58 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2016-12-12 11:41:31 +0000
commit01afbf12788b070b90eb306d86ea2870857a1328 (patch)
tree98b21a042b02909bc353d55c68fd7f9e7e97f929 /sw
parenta4c6d5c8a05716e0f1a3237ef710b5955e28b6f0 (diff)
reintroduce CONV2CHAR/CONV2LINE split
Change-Id: I02a3a46d2222b8bfe955eb17ca655d36d9155b48 Reviewed-on: https://gerrit.libreoffice.org/31867 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/frmfmt.hxx3
-rw-r--r--sw/source/core/draw/dcontact.cxx20
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx19
3 files changed, 20 insertions, 22 deletions
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 562c4a76e31d..029eea14b7d4 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -278,7 +278,8 @@ namespace sw
NO_CONV,
CONV2PG,
CONV2COL_OR_PARA,
- CONV2CHAR_OR_LINE,
+ CONV2CHAR,
+ CONV2LINE,
RELTOTABLECELL
};
struct WW8AnchorConvResult final
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 9c3d29c33a1d..2ef6e6d2eb31 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1366,7 +1366,7 @@ namespace
}
return pAnchorFormat;
}
- Point lcl_GetWW8Pos(SwAnchoredObject* pAnchoredObj, const bool bFollowTextFlow, const bool bHori, sw::WW8AnchorConv& reConv)
+ Point lcl_GetWW8Pos(SwAnchoredObject* pAnchoredObj, const bool bFollowTextFlow, sw::WW8AnchorConv& reConv)
{
switch(reConv)
{
@@ -1380,8 +1380,10 @@ namespace
}
case sw::WW8AnchorConv::CONV2COL_OR_PARA:
return pAnchoredObj->GetRelPosToAnchorFrame();
- case sw::WW8AnchorConv::CONV2CHAR_OR_LINE:
- return bHori ? pAnchoredObj->GetRelPosToChar() : pAnchoredObj->GetRelPosToLine();
+ case sw::WW8AnchorConv::CONV2CHAR:
+ return pAnchoredObj->GetRelPosToChar();
+ case sw::WW8AnchorConv::CONV2LINE:
+ return pAnchoredObj->GetRelPosToLine();
default: ;
}
assert(false);
@@ -1563,16 +1565,8 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
sw::WW8AnchorConvResult& rResult(pWW8AnchorConvHint->m_rResult);
// No distinction between layout directions, because of missing
// information about WW8 in vertical layout.
- rResult.m_aPos.setX(lcl_GetWW8Pos(
- pAnchoredObj,
- bFollowTextFlow,
- true,
- rResult.m_eHoriConv).getX());
- rResult.m_aPos.setY(lcl_GetWW8Pos(
- pAnchoredObj,
- bFollowTextFlow,
- false,
- rResult.m_eHoriConv).getY());
+ rResult.m_aPos.setX(lcl_GetWW8Pos(pAnchoredObj, bFollowTextFlow, rResult.m_eHoriConv).getX());
+ rResult.m_aPos.setY(lcl_GetWW8Pos(pAnchoredObj, bFollowTextFlow, rResult.m_eHoriConv).getY());
rResult.m_bConverted = true;
}
}
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 71f83fd63ad8..6382e8860a44 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2449,7 +2449,7 @@ void SwEscherEx::FinishEscher()
namespace
{
template<typename OrientType>
- void lcl_SetRelationOrient(OrientType& rOrient, const sw::WW8AnchorConv eConv, const bool bHori, std::function<void()> fDefault)
+ void lcl_SetRelationOrient(OrientType& rOrient, const sw::WW8AnchorConv eConv, std::function<void()> fDefault)
{
switch(eConv)
{
@@ -2463,11 +2463,14 @@ namespace
case sw::WW8AnchorConv::CONV2COL_OR_PARA:
rOrient.SetRelationOrient(text::RelOrientation::FRAME);
break;
- case sw::WW8AnchorConv::CONV2CHAR_OR_LINE:
- rOrient.SetRelationOrient(bHori ? text::RelOrientation::CHAR : text::RelOrientation::TEXT_LINE);
+ case sw::WW8AnchorConv::CONV2CHAR:
+ rOrient.SetRelationOrient(text::RelOrientation::CHAR);
+ break;
+ case sw::WW8AnchorConv::CONV2LINE:
+ rOrient.SetRelationOrient(text::RelOrientation::TEXT_LINE);
break;
default:
- fDefault();//rOrient.SetHoriOrient(text::HoriOrientation::NONE);
+ fDefault();
}
}
}
@@ -2590,7 +2593,7 @@ bool WinwordAnchoring::ConvertPosition( SwFormatHoriOrient& _iorHoriOri,
case text::RelOrientation::CHAR:
{
if ( bConvDueToOrientation )
- eHoriConv = sw::WW8AnchorConv::CONV2CHAR_OR_LINE;
+ eHoriConv = sw::WW8AnchorConv::CONV2CHAR;
}
break;
default:
@@ -2658,7 +2661,7 @@ bool WinwordAnchoring::ConvertPosition( SwFormatHoriOrient& _iorHoriOri,
if ( bConvDueToOrientation ||
_iorVertOri.GetVertOrient() == text::VertOrientation::NONE )
{
- eVertConv = sw::WW8AnchorConv::CONV2CHAR_OR_LINE;
+ eVertConv = sw::WW8AnchorConv::CONV2LINE;
}
}
break;
@@ -2678,9 +2681,9 @@ bool WinwordAnchoring::ConvertPosition( SwFormatHoriOrient& _iorHoriOri,
_rFrameFormat.CallSwClientNotify(sw::WW8AnchorConvHint(aResult));
if(!aResult.m_bConverted)
return false;
- lcl_SetRelationOrient(_iorHoriOri, eHoriConv, true, [&_iorHoriOri]() {_iorHoriOri.SetHoriOrient(text::HoriOrientation::NONE);} );
+ lcl_SetRelationOrient(_iorHoriOri, eHoriConv, [&_iorHoriOri]() {_iorHoriOri.SetHoriOrient(text::HoriOrientation::NONE);} );
_iorHoriOri.SetPos(aResult.m_aPos.X());
- lcl_SetRelationOrient(_iorVertOri, eVertConv, false, [&_iorVertOri]() {_iorVertOri.SetVertOrient(text::VertOrientation::NONE);} );
+ lcl_SetRelationOrient(_iorVertOri, eVertConv, [&_iorVertOri]() {_iorVertOri.SetVertOrient(text::VertOrientation::NONE);} );
_iorVertOri.SetPos(aResult.m_aPos.Y());
return true;
}