summaryrefslogtreecommitdiff
path: root/sw/source/core/text/redlnitr.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-02-12 16:38:47 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-02-12 18:18:53 +0100
commite8b9572bf89f55463f2c879a401ed62efc165d95 (patch)
treebb14bef40f4ee43df2249c0e9ea43a449e84f331 /sw/source/core/text/redlnitr.cxx
parent4bbb0bcb88614d3ccaaab4bea4fe2309c92b881e (diff)
sw btlr writing mode: implement initial layout
The bulk of this commit is reasonably straightforward, the interesting parts are: - SwFrame::CheckDir() is where the layout reads the doc model, i.e. sets the new SwFrame::mbVertLRBT. - We had 3 text directions previously: horizontal, vertical (implicitly RL) and vertical LR (implicitly TB). This adds a 4th text direction for the LRBT case. - SwTextFrame::SwitchHorizontalToVertical() is responsible for re-locating the origo of a string to be painted from the top left to the bottom left corner (in addition to the height/width swap that's done for all vertical directions). - Finally MapDirection() is the place where we map Writer's new btlr mode (with no character rotation) to VCL's 900 (90 degrees) rotated direction. No functional changes intended for existing text directions. Lots of places are still not yet adapted, but this is good enough to paint a single word in a table cell at the correct position with the correct direction. Change-Id: I465c62db6562d8a2be140c3d37473e590830139e Reviewed-on: https://gerrit.libreoffice.org/67740 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/text/redlnitr.cxx')
-rw-r--r--sw/source/core/text/redlnitr.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 3b481b762914..95ce480d11b5 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -307,7 +307,8 @@ void SwAttrIter::InitFontAndAttrHandler(
SwTextNode const& rPropsNode,
SwTextNode const& rTextNode,
OUString const& rText,
- bool const*const pbVertLayout)
+ bool const*const pbVertLayout,
+ bool const*const pbVertLayoutLRBT)
{
// Build a font matching the default paragraph style:
SwFontAccess aFontAccess( &rPropsNode.GetAnyFormatColl(), m_pViewShell );
@@ -328,7 +329,10 @@ void SwAttrIter::InitFontAndAttrHandler(
// if it's a re-init, the vert flag never changes
if (pbVertLayout ? *pbVertLayout : m_aAttrHandler.IsVertLayout())
{
- m_pFont->SetVertical( m_pFont->GetOrientation(), true );
+ bool bVertLayoutLRBT = false;
+ if (pbVertLayoutLRBT)
+ bVertLayoutLRBT = *pbVertLayoutLRBT;
+ m_pFont->SetVertical(m_pFont->GetOrientation(), true, bVertLayoutLRBT);
}
// Initialize the default attribute of the attribute handler
@@ -385,6 +389,7 @@ void SwAttrIter::CtorInitAttrIter(SwTextNode & rTextNode,
// set font to vertical if frame layout is vertical
bool bVertLayout = false;
+ bool bVertLayoutLRBT = false;
bool bRTL = false;
if ( pFrame )
{
@@ -392,6 +397,10 @@ void SwAttrIter::CtorInitAttrIter(SwTextNode & rTextNode,
{
bVertLayout = true;
}
+ if (pFrame->IsVertLRBT())
+ {
+ bVertLayoutLRBT = true;
+ }
bRTL = pFrame->IsRightToLeft();
m_pMergedPara = pFrame->GetMergedPara();
}
@@ -405,7 +414,8 @@ void SwAttrIter::CtorInitAttrIter(SwTextNode & rTextNode,
m_pMergedPara ? *m_pMergedPara->pParaPropsNode : rTextNode,
rTextNode,
m_pMergedPara ? m_pMergedPara->mergedText : rTextNode.GetText(),
- & bVertLayout);
+ & bVertLayout,
+ & bVertLayoutLRBT);
m_nStartIndex = m_nEndIndex = m_nPosition = m_nChgCnt = 0;
m_nPropFont = 0;