summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/inc/Title.hxx (renamed from chart2/source/model/main/Title.hxx)4
-rw-r--r--chart2/source/model/main/Title.cxx2
-rw-r--r--chart2/source/tools/TitleHelper.cxx104
-rw-r--r--solenv/clang-format/excludelist2
4 files changed, 52 insertions, 60 deletions
diff --git a/chart2/source/model/main/Title.hxx b/chart2/source/inc/Title.hxx
index 426fd5ef4219..091c558dba44 100644
--- a/chart2/source/model/main/Title.hxx
+++ b/chart2/source/inc/Title.hxx
@@ -18,14 +18,14 @@
*/
#pragma once
-#include <OPropertySet.hxx>
+#include "OPropertySet.hxx"
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <ModifyListenerHelper.hxx>
+#include "ModifyListenerHelper.hxx"
namespace chart
{
diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx
index ab32d7a306e6..98004e30a2d4 100644
--- a/chart2/source/model/main/Title.cxx
+++ b/chart2/source/model/main/Title.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Title.hxx"
+#include <Title.hxx>
#include <LinePropertiesHelper.hxx>
#include <FillProperties.hxx>
#include <CloneHelper.hxx>
diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx
index ece3ec239d1b..943adace7913 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -18,6 +18,7 @@
*/
#include <TitleHelper.hxx>
+#include <Title.hxx>
#include <ChartModel.hxx>
#include <ChartModelHelper.hxx>
#include <Axis.hxx>
@@ -197,7 +198,7 @@ uno::Reference< XTitle > TitleHelper::createTitle(
, const uno::Reference< uno::XComponentContext > & xContext
, ReferenceSizeProvider * pRefSizeProvider )
{
- uno::Reference< XTitle > xTitle;
+ rtl::Reference< ::chart::Title > xTitle;
uno::Reference< XTitled > xTitled( lcl_getTitleParent( eTitleType, xModel ) );
if( !xTitled.is() )
@@ -226,71 +227,62 @@ uno::Reference< XTitle > TitleHelper::createTitle(
{
rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xModel ) );
- xTitle.set( xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.Title",
- xContext ), uno::UNO_QUERY );
+ xTitle = new ::chart::Title();
- if(xTitle.is())
+ // default char height (main: 13.0 == default)
+ float fDefaultCharHeightSub = 11.0;
+ float fDefaultCharHeightAxis = 9.0;
+ switch( eTitleType )
{
- // default char height (main: 13.0 == default)
- float fDefaultCharHeightSub = 11.0;
- float fDefaultCharHeightAxis = 9.0;
- switch( eTitleType )
- {
- case TitleHelper::SUB_TITLE:
- TitleHelper::setCompleteString(
- rTitleText, xTitle, xContext, & fDefaultCharHeightSub );
- break;
- case TitleHelper::X_AXIS_TITLE:
- case TitleHelper::Y_AXIS_TITLE:
- case TitleHelper::Z_AXIS_TITLE:
- case TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION:
- case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION:
- case TitleHelper::SECONDARY_X_AXIS_TITLE:
- case TitleHelper::SECONDARY_Y_AXIS_TITLE:
- TitleHelper::setCompleteString(
- rTitleText, xTitle, xContext, & fDefaultCharHeightAxis );
- break;
- default:
- TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
- break;
- }
+ case TitleHelper::SUB_TITLE:
+ TitleHelper::setCompleteString(
+ rTitleText, xTitle, xContext, & fDefaultCharHeightSub );
+ break;
+ case TitleHelper::X_AXIS_TITLE:
+ case TitleHelper::Y_AXIS_TITLE:
+ case TitleHelper::Z_AXIS_TITLE:
+ case TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION:
+ case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION:
+ case TitleHelper::SECONDARY_X_AXIS_TITLE:
+ case TitleHelper::SECONDARY_Y_AXIS_TITLE:
+ TitleHelper::setCompleteString(
+ rTitleText, xTitle, xContext, & fDefaultCharHeightAxis );
+ break;
+ default:
+ TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
+ break;
+ }
- // set/clear autoscale
- if( pRefSizeProvider )
- pRefSizeProvider->setValuesAtTitle( xTitle );
+ // set/clear autoscale
+ if( pRefSizeProvider )
+ pRefSizeProvider->setValuesAtTitle( xTitle );
- xTitled->setTitleObject( xTitle );
+ xTitled->setTitleObject( xTitle );
- //default rotation 90 degree for y axis title in normal coordinatesystems or for x axis title for swapped coordinatesystems
- if( eTitleType == TitleHelper::X_AXIS_TITLE ||
- eTitleType == TitleHelper::Y_AXIS_TITLE ||
- eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE ||
- eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE )
+ //default rotation 90 degree for y axis title in normal coordinatesystems or for x axis title for swapped coordinatesystems
+ if( eTitleType == TitleHelper::X_AXIS_TITLE ||
+ eTitleType == TitleHelper::Y_AXIS_TITLE ||
+ eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE ||
+ eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE )
+ {
+ try
{
- try
- {
- bool bDummy = false;
- bool bIsVertical = DiagramHelper::getVertical( xDiagram, bDummy, bDummy );
-
- Reference< beans::XPropertySet > xTitleProps( xTitle, uno::UNO_QUERY );
- if( xTitleProps.is() )
- {
- if( (!bIsVertical && eTitleType == TitleHelper::Y_AXIS_TITLE)
- || (bIsVertical && eTitleType == TitleHelper::X_AXIS_TITLE)
- || (!bIsVertical && eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE)
- || (bIsVertical && eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE) )
- {
- xTitleProps->setPropertyValue( "TextRotation", uno::Any( 90.0 ));
- }
- }
- }
- catch( const uno::Exception & )
+ bool bDummy = false;
+ bool bIsVertical = DiagramHelper::getVertical( xDiagram, bDummy, bDummy );
+
+ if( (!bIsVertical && eTitleType == TitleHelper::Y_AXIS_TITLE)
+ || (bIsVertical && eTitleType == TitleHelper::X_AXIS_TITLE)
+ || (!bIsVertical && eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE)
+ || (bIsVertical && eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE) )
{
- DBG_UNHANDLED_EXCEPTION("chart2");
+ xTitle->setPropertyValue( "TextRotation", uno::Any( 90.0 ));
}
}
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
}
}
return xTitle;
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 4311ce590973..9b8a5d679aac 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -1067,6 +1067,7 @@ chart2/source/inc/Scaling.hxx
chart2/source/inc/SceneProperties.hxx
chart2/source/inc/StatisticsHelper.hxx
chart2/source/inc/ThreeDHelper.hxx
+chart2/source/inc/Title.hxx
chart2/source/inc/TitleHelper.hxx
chart2/source/inc/UncachedDataSequence.hxx
chart2/source/inc/UserDefinedProperties.hxx
@@ -1107,7 +1108,6 @@ chart2/source/model/main/PageBackground.hxx
chart2/source/model/main/PolarCoordinateSystem.cxx
chart2/source/model/main/StockBar.cxx
chart2/source/model/main/Title.cxx
-chart2/source/model/main/Title.hxx
chart2/source/model/main/UndoManager.cxx
chart2/source/model/main/UndoManager.hxx
chart2/source/model/main/Wall.cxx