summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-05-21 15:25:32 +0800
committerMark Hung <marklh9@gmail.com>2018-05-30 15:17:48 +0200
commitebe5f65a8d0e90ff577ea54ba69a10b967463b1a (patch)
tree568eee44fc617d92881f45ddbea69a8ab7b90d7e /sd
parent45cdce55093abb742e4e51de7a1542edd9b9e7b2 (diff)
tdf#104376 fix positions of the ruler handles for tables.
Use the cell boundary to decide correct SvxLRSpaceItem values. Change-Id: I1906eaf34a7ff5f852b729114371ddb5387692d3 Reviewed-on: https://gerrit.libreoffice.org/54615 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviews3.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 90160c3e521a..11690795a70c 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -29,6 +29,7 @@
#include <editeng/frmdiritem.hxx>
#include <editeng/adjustitem.hxx>
#include <svx/ruler.hxx>
+#include <svx/svdotable.hxx>
#include <editeng/numitem.hxx>
#include <svx/rulritem.hxx>
#include <sfx2/zoomitem.hxx>
@@ -932,7 +933,16 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet)
aPointItem.SetValue( aPos );
- aLRSpace.SetLeft( aPagePos.X() + maMarkRect.Left() );
+ ::tools::Rectangle aParaRect(maMarkRect);
+ if (pObj->GetObjIdentifier() == OBJ_TABLE)
+ {
+ sdr::table::SdrTableObj* pTable = static_cast<sdr::table::SdrTableObj*>(pObj);
+ sdr::table::CellPos cellpos;
+ pTable->getActiveCellPos(cellpos);
+ pTable->getCellBounds(cellpos, aParaRect);
+ }
+
+ aLRSpace.SetLeft(aPagePos.X() + aParaRect.Left());
if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET )
{
@@ -941,7 +951,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet)
aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD );
}
- aLRSpace.SetRight( aRect.Right() + aPageSize.Width() - maMarkRect.Right() );
+ aLRSpace.SetRight(aRect.Right() + aPageSize.Width() - aParaRect.Right());
aULSpace.SetUpper( aPagePos.Y() + maMarkRect.Top() );
aULSpace.SetLower( aRect.Bottom() + aPageSize.Height() - maMarkRect.Bottom() );