[Libreoffice-commits] core.git: svx/source
Armin Le Grand
alg at apache.org
Tue Jun 18 01:18:21 PDT 2013
svx/source/xoutdev/xtabdash.cxx | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
New commits:
commit 445ebce3e08973dd1701791974477d7fa64835fa
Author: Armin Le Grand <alg at apache.org>
Date: Wed Apr 10 15:51:45 2013 +0000
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
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index bf5deff..a6d9d29 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 )
More information about the Libreoffice-commits
mailing list