diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-09-30 11:28:02 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-10-26 14:19:41 +0100 |
commit | c277bedb0ac82194b05b4eac2e6e7367672c185f (patch) | |
tree | 9073f19b07488a5f15f0ee309df9dc87290ec4f1 /sd | |
parent | ceef6a891e30a9aab35911f795b75277c96b843e (diff) |
Don't insert hyperlink outside the page
Change-Id: Ida562bdf4eab479b4df2bba7917466d5da788a6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103673
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104804
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 7 |
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); |