Kaydet (Commit) 44bdc8bb authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

fix text rendering for titles

Change-Id: I1072c8af6d822422943dc2d29bbaee351c735349
üst 413415dd
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#include <basegfx/point/b2dpoint.hxx> #include <basegfx/point/b2dpoint.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx> #include <basegfx/matrix/b3dhommatrix.hxx>
#include "RelativeSizeHelper.hxx"
#include <algorithm> #include <algorithm>
#include <iostream> #include <iostream>
using namespace std; using namespace std;
...@@ -411,12 +413,22 @@ uno::Reference< drawing::XShape > ...@@ -411,12 +413,22 @@ uno::Reference< drawing::XShape >
OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget, OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget,
const awt::Size& rSize, const awt::Point& rPos, const awt::Size& rSize, const awt::Point& rPos,
uno::Sequence< uno::Reference< chart2::XFormattedString > >& rFormattedString, uno::Sequence< uno::Reference< chart2::XFormattedString > >& rFormattedString,
const uno::Reference< beans::XPropertySet > &, const uno::Reference< beans::XPropertySet > & xTextProperties,
double, const OUString& rName) double, const OUString& rName)
{ {
dummy::DummyFormattedText* pText = new dummy::DummyFormattedText( rFormattedString ); 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->setPosition(rPos);
pText->setSize(rSize); pText->setSize(awt::Size(0,0));
pText->setName(rName); pText->setName(rName);
xTarget->add(pText); xTarget->add(pText);
return pText; return pText;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment