summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-04-10 15:51:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-18 09:17:55 +0100
commit445ebce3e08973dd1701791974477d7fa64835fa (patch)
tree9277feb13d598905f9e619b822a79cd3852f6540 /svx
parent8956854d8e7294b41e65d5aacbc43e11d1795711 (diff)
Resolves: #i121791# Enhanced look of the LineStyle previews
(cherry picked from commit 35f96c967abb1a8b4723c7261c253661d409732c) Conflicts: svx/source/xoutdev/xtabdash.cxx svx/source/xoutdev/xtable.cxx Change-Id: Idcff1f8ca317bc17757a88c88ff2bd89a82f6f9d
Diffstat (limited to 'svx')
-rw-r--r--svx/source/xoutdev/xtabdash.cxx27
1 files changed, 22 insertions, 5 deletions
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index bf5deff7cc96..a6d9d2984999 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -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 )