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

Markus Mohrhard markus.mohrhard at collabora.co.uk
Mon Feb 24 19:55:19 PST 2014


 chart2/source/view/main/OpenglShapeFactory.cxx |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 3126e49a45408e09048428584686e03b14dd1902
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Feb 25 04:49:05 2014 +0100

    fix text rendering for titles
    
    Change-Id: I1072c8af6d822422943dc2d29bbaee351c735349

diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index 5b19a5b..9fc4241 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -51,6 +51,8 @@
 #include <basegfx/point/b2dpoint.hxx>
 #include <basegfx/matrix/b3dhommatrix.hxx>
 
+#include "RelativeSizeHelper.hxx"
+
 #include <algorithm>
 #include <iostream>
 using namespace std;
@@ -411,12 +413,22 @@ uno::Reference< drawing::XShape >
         OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget,
                 const awt::Size& rSize, const awt::Point& rPos,
                 uno::Sequence< uno::Reference< chart2::XFormattedString > >& rFormattedString,
-                const uno::Reference< beans::XPropertySet > &,
+                const uno::Reference< beans::XPropertySet > & xTextProperties,
                 double, const OUString& rName)
 {
     dummy::DummyFormattedText* pText = new dummy::DummyFormattedText( rFormattedString );
+    uno::Reference< drawing::XShape > xShape(pText);
+    uno::Reference< beans::XPropertySet > xTargetProps(xShape, uno::UNO_QUERY_THROW);
+    awt::Size aOldRefSize;
+    bool bHasRefPageSize =
+        ( xTextProperties->getPropertyValue( "ReferencePageSize") >>= aOldRefSize );
+    // adapt font size according to page size
+    if( bHasRefPageSize )
+    {
+        RelativeSizeHelper::adaptFontSizes( xTargetProps, aOldRefSize, rSize );
+    }
     pText->setPosition(rPos);
-    pText->setSize(rSize);
+    pText->setSize(awt::Size(0,0));
     pText->setName(rName);
     xTarget->add(pText);
     return pText;


More information about the Libreoffice-commits mailing list