summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sd/source/ui/view/drviewse.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 30b160ea88f7..33ed1a0ff2d6 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1500,8 +1500,11 @@ void DrawViewShell::InsertURLField(const OUString& rURL, const OUString& rText,
::tools::Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
aPos = aRect.Center();
aPos = GetActiveWindow()->PixelToLogic(aPos);
- aPos.AdjustX( -(aSize.Width() / 2) );
- aPos.AdjustY( -(aSize.Height() / 2) );
+
+ if (aPos.getX() - (aSize.Width() / 2) >= 0)
+ aPos.AdjustX( -(aSize.Width() / 2) );
+ if (aPos.getY() - (aSize.Height() / 2) >= 0)
+ aPos.AdjustY( -(aSize.Height() / 2) );
::tools::Rectangle aLogicRect(aPos, aSize);
pRectObj->SetLogicRect(aLogicRect);