summaryrefslogtreecommitdiff
path: root/sw/source/core/text/txtfrm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/text/txtfrm.cxx')
-rw-r--r--sw/source/core/text/txtfrm.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 85a179880780..81e71b8176f9 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -614,16 +614,29 @@ void SwTextFrame::SwitchVerticalToHorizontal( Point& rPoint ) const
// calc offset inside frame
if ( IsVertLR() )
+ // X offset is Y - left.
nOfstX = rPoint.X() - getFrameArea().Left();
else
{
+ // X offset is right - X.
if ( mbIsSwapped )
nOfstX = getFrameArea().Left() + getFrameArea().Height() - rPoint.X();
else
nOfstX = getFrameArea().Left() + getFrameArea().Width() - rPoint.X();
}
- const long nOfstY = rPoint.Y() - getFrameArea().Top();
+ long nOfstY;
+ if (IsVertLRBT())
+ {
+ // Y offset is bottom - Y.
+ if (mbIsSwapped)
+ nOfstY = getFrameArea().Top() + getFrameArea().Width() - rPoint.Y();
+ else
+ nOfstY = getFrameArea().Top() + getFrameArea().Height() - rPoint.Y();
+ }
+ else
+ // Y offset is Y - top.
+ nOfstY = rPoint.Y() - getFrameArea().Top();
// calc rotated coords
rPoint.setX( getFrameArea().Left() + nOfstY );