Kaydet (Commit) 01afbf12 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen Kaydeden (comit) Björn Michaelsen

reintroduce CONV2CHAR/CONV2LINE split

Change-Id: I02a3a46d2222b8bfe955eb17ca655d36d9155b48
Reviewed-on: https://gerrit.libreoffice.org/31867Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst a4c6d5c8
......@@ -278,7 +278,8 @@ namespace sw
NO_CONV,
CONV2PG,
CONV2COL_OR_PARA,
CONV2CHAR_OR_LINE,
CONV2CHAR,
CONV2LINE,
RELTOTABLECELL
};
struct WW8AnchorConvResult final
......
......@@ -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;
}
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment