Use basegfx library function to clamp numbers

Change-Id: I3142f55ecf94ce2143e92492243bc5959322704f