Refactored OutputDevice::DrawGradient

There are two version of OutputDevice::DrawGradient(). They both have
common code, I have moved this into their own private functions to
allow for code reuse.

The first function checks to see if the drawing mode is
DRAWMODE_BLACKGRADIENT, DRAWMODE_WHITEGRADIENT or
DRAWMODE_SETTINGSGRADIENT (for Window background color) - this
just sets the color to black (for XOR operations), white (mainly
used for printing) or the background color of a Window (not sure
what this is used for!).

The second function sets grayscale start and end colors.

Change-Id: Idaa85c3b5cfbd8a211fd7b0714eeb8e5b9e9e434
Reviewed-on: https://gerrit.libreoffice.org/8880
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>