diff options
-rw-r--r-- | include/svx/dlgctrl.hxx | 1 | ||||
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 17 |
2 files changed, 14 insertions, 4 deletions
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index eb587a299378..a355c50e2907 100644 --- a/include/svx/dlgctrl.hxx +++ b/include/svx/dlgctrl.hxx @@ -478,6 +478,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC XRectPreview : public PreviewBase private: SdrObject* mpRectangleObject; + tools::Rectangle GetPreviewSize() const; public: XRectPreview(); virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index b7a3e6c5f92e..dce8c6d4b4b0 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -2270,27 +2270,36 @@ XRectPreview::XRectPreview() { } +// expand to avoid 1 pixel band to the right and bottom of previews +// in color/gradient/bitmap/pattern/hatch subpages of area tab +// in e.g. page dialog +tools::Rectangle XRectPreview::GetPreviewSize() const +{ + tools::Rectangle aObjectSize(Point(), GetOutputSizePixel()); + aObjectSize.AdjustRight(1); + aObjectSize.AdjustBottom(1); + return aObjectSize; +} + void XRectPreview::SetDrawingArea(weld::DrawingArea* pDrawingArea) { PreviewBase::SetDrawingArea(pDrawingArea); InitSettings(); // create RectangleObject - const tools::Rectangle aObjectSize(Point(), GetOutputSizePixel()); mpRectangleObject = new SdrRectObj( getModel(), - aObjectSize); + GetPreviewSize()); } void XRectPreview::Resize() { - const tools::Rectangle aObjectSize(Point(), GetOutputSizePixel()); SdrObject *pOrigObject = mpRectangleObject; if (pOrigObject) { mpRectangleObject = new SdrRectObj( getModel(), - aObjectSize); + GetPreviewSize()); SetAttributes(pOrigObject->GetMergedItemSet()); SdrObject::Free(pOrigObject); } |