diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-02-25 04:49:05 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-25 04:53:59 +0100 |
commit | 44bdc8bbc96a29ee73c6af9ad1dd12ee6df86a41 (patch) | |
tree | 765ee2861bef14ee999755b121fdbf8eec313f21 /chart2 | |
parent | 413415dd7a3dad60fd0d98266d4aae8498cbc265 (diff) |
fix text rendering for titles
Change-Id: I1072c8af6d822422943dc2d29bbaee351c735349
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/OpenglShapeFactory.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx index 5b19a5be6974..9fc424152baa 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; |