[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - chart2/source

Jan Holesovsky kendy at collabora.com
Sun May 25 02:42:38 PDT 2014


 chart2/source/view/main/3DChartObjects.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 89a4bbf6a7bb9be0f4c4060704975a54ffc685f8
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Sun May 25 11:12:59 2014 +0200

    Improve computation of the text area to make it nicer.
    
    Change-Id: I24fb1caedc55dcc297fb013acb63b3c660fcf0a2

diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index c77a273..3432bac 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -78,18 +78,14 @@ const BitmapEx& TextCache::getText(OUString rText)
     Font aFont = aDevice.GetFont();
     aFont.SetSize(Size(0, 96));
     aFont.SetColor(COL_BLACK);
-    ::Rectangle aRect;
     aDevice.SetFont(aFont);
     aDevice.Erase();
-    aDevice.GetTextBoundRect(aRect, rText);
-    Size aSize = aRect.GetSize();
-    aSize.Width() += 5;
-    aSize.Height() *= 1.6;
-    aDevice.SetOutputSizePixel(aSize);
+
+    aDevice.SetOutputSize(Size(aDevice.GetTextWidth(rText), aDevice.GetTextHeight()));
     aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
     aDevice.DrawText(Point(0,0), rText);
 
-    BitmapEx* pText = new BitmapEx(aDevice.GetBitmapEx(Point(0,0), aSize));
+    BitmapEx* pText = new BitmapEx(aDevice.GetBitmapEx(Point(0,0), aDevice.GetOutputSize()));
     maTextCache.insert(rText, pText);
     return *pText;
 }


More information about the Libreoffice-commits mailing list