Kaydet (Commit) 445ebce3 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Caolán McNamara

Resolves: #i121791# Enhanced look of the LineStyle previews

(cherry picked from commit 35f96c96)

Conflicts:
	svx/source/xoutdev/xtabdash.cxx
	svx/source/xoutdev/xtable.cxx

Change-Id: Idcff1f8ca317bc17757a88c88ff2bd89a82f6f9d
üst 8956854d
......@@ -72,6 +72,10 @@ public:
SdrObject* getLineObject() const { return mpLineObject; }
};
// to avoid rendering trouble (e.g. vcl renderer) and to get better AAed quality,
// use double prerender size
static bool bUseDoubleSize = true;
void XDashList::impCreate()
{
if(!mpData)
......@@ -83,7 +87,9 @@ void XDashList::impCreate()
OSL_ENSURE(0 != pVirDev, "XDashList: no VirtualDevice created!" );
pVirDev->SetMapMode(MAP_100TH_MM);
const Size& rSize = rStyleSettings.GetListBoxPreviewDefaultPixelSize();
const Size aSize(pVirDev->PixelToLogic(Size(rSize.Width() * 2, rSize.Height())));
const Size aSize(pVirDev->PixelToLogic(Size(
bUseDoubleSize ? rSize.Width() * 5 : rSize.Width() * 5 / 2,
bUseDoubleSize ? rSize.Height() * 2 : rSize.Height())));
pVirDev->SetOutputSize(aSize);
pVirDev->SetDrawMode(rStyleSettings.GetHighContrastMode()
? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
......@@ -102,8 +108,10 @@ void XDashList::impCreate()
pBackgroundObject->SetMergedItem(XLineStyleItem(XLINE_NONE));
pBackgroundObject->SetMergedItem(XFillColorItem(String(), rStyleSettings.GetFieldColor()));
const basegfx::B2DPoint aStart(0, aSize.Height() / 2);
const basegfx::B2DPoint aEnd(aSize.Width(), aSize.Height() / 2);
const sal_uInt32 nHalfHeight(aSize.Height() / 2);
const basegfx::B2DPoint aStart(0, nHalfHeight);
const basegfx::B2DPoint aEnd(aSize.Width(), nHalfHeight);
basegfx::B2DPolygon aPolygon;
aPolygon.append(aStart);
aPolygon.append(aEnd);
......@@ -113,7 +121,7 @@ void XDashList::impCreate()
pLineObject->SetMergedItem(XLineStyleItem(XLINE_DASH));
pLineObject->SetMergedItem(XLineColorItem(String(), rStyleSettings.GetFieldTextColor()));
const Size aLineWidth(pVirDev->PixelToLogic(Size(rStyleSettings.GetListBoxPreviewDefaultLineWidth(), 0)));
pLineObject->SetMergedItem(XLineWidthItem(aLineWidth.getWidth()));
pLineObject->SetMergedItem(XLineWidthItem(bUseDoubleSize ? aLineWidth.getWidth() * 2 : aLineWidth.getWidth()));
mpData = new impXDashList(pVirDev, pSdrModel, pBackgroundObject, pLineObject);
OSL_ENSURE(0 != mpData, "XDashList: data creation went wrong!" );
}
......@@ -202,7 +210,16 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash)
aPainter.ProcessDisplay(aDisplayInfo);
const Point aZero(0, 0);
return pVD->GetBitmap(aZero, pVD->GetOutputSize());
Bitmap aResult(pVD->GetBitmap(aZero, pVD->GetOutputSize()));
if(bUseDoubleSize)
{
const Size aCurrentSize(aResult.GetSizePixel());
aResult.Scale(Size(aCurrentSize.Width() / 2, aCurrentSize.Height() / 2), BMP_SCALE_DEFAULT);
}
return aResult;
}
Bitmap XDashList::CreateBitmapForUI( long nIndex )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment