[Libreoffice-commits] core.git: sd/source
Mark Hung
marklh9 at gmail.com
Wed May 30 13:18:13 UTC 2018
sd/source/ui/view/drviews3.cxx | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit ebe5f65a8d0e90ff577ea54ba69a10b967463b1a
Author: Mark Hung <marklh9 at gmail.com>
Date: Mon May 21 15:25:32 2018 +0800
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 at libreoffice.org>
Reviewed-by: Mark Hung <marklh9 at gmail.com>
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() );
More information about the Libreoffice-commits
mailing list