summaryrefslogtreecommitdiff
path: root/chart2/source/view/main/ChartView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view/main/ChartView.cxx')
-rw-r--r--chart2/source/view/main/ChartView.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index a5e0ab5da984..4b6b1fa9b48f 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2137,10 +2137,16 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
return apVTitle;
//create title
+ awt::Size aTextMaxWidth(rPageSize.Width, rPageSize.Height);
+ if (eType == TitleHelper::MAIN_TITLE || eType == TitleHelper::SUB_TITLE)
+ {
+ aTextMaxWidth.Width = static_cast<sal_Int32>(rPageSize.Width * 0.8);
+ aTextMaxWidth.Height = static_cast<sal_Int32>(rPageSize.Height * 0.5);
+ }
apVTitle = std::make_shared<VTitle>(xTitle);
OUString aCID = ObjectIdentifier::createClassifiedIdentifierForObject(xTitle, rModel);
apVTitle->init(xPageShapes, xShapeFactory, aCID);
- apVTitle->createShapes(awt::Point(0,0), rPageSize);
+ apVTitle->createShapes(awt::Point(0, 0), rPageSize, aTextMaxWidth);
awt::Size aTitleUnrotatedSize = apVTitle->getUnrotatedSize();
awt::Size aTitleSize = apVTitle->getFinalSize();