[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Mar 18 08:39:23 PDT 2011
sc/source/ui/unoobj/shapeuno.cxx | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
New commits:
commit c081a27a6a1837924cc404005bf20323fe02baf4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 18 10:27:20 2011 -0400
simplify lcl_GetRelativePos.
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index ab64c32..424f268 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -332,22 +332,10 @@ awt::Point lcl_GetRelativePos( uno::Reference< drawing::XShape >& xShape, ScDocu
{
awt::Point aUnoPoint;
rRange = lcl_GetAnchorCell(xShape, pDoc, nTab, aUnoPoint, rUnoSize, rCaptionPoint);
- if (pDoc->IsNegativePage(nTab))
- {
- Rectangle aRect(pDoc->GetMMRect( rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aStart.Tab() ));
- Point aPoint(aRect.TopRight());
- aUnoPoint.X -= aPoint.X();
- aUnoPoint.Y -= aPoint.Y();
- }
- else
- {
- ScRange aRange = pDoc->GetRange( nTab, Rectangle( VCLPoint(aUnoPoint), VCLPoint(aUnoPoint) ));
- Rectangle aRect(pDoc->GetMMRect( rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aStart.Tab() ));
- Point aPoint(aRect.TopLeft());
- aUnoPoint.X -= aPoint.X();
- aUnoPoint.Y -= aPoint.Y();
- }
-
+ Rectangle aRect(pDoc->GetMMRect( rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aStart.Tab() ));
+ Point aPoint = pDoc->IsNegativePage(nTab) ? aRect.TopRight() : aRect.TopLeft();
+ aUnoPoint.X -= aPoint.X();
+ aUnoPoint.Y -= aPoint.Y();
return aUnoPoint;
}
More information about the Libreoffice-commits
mailing list