summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-03-24 22:20:02 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-03-25 22:50:50 -0400
commit44fc32edcddc7f290e3e5162be9a80917c499ade (patch)
treeb62bf9cf371d688d9f127b08df752dcf5deb95f6 /chart2/source
parent05efb605b36ea340762ef1583b3aea6a6b5cdddb (diff)
Properly import and export the new chart type to and from ODF.
Change-Id: I38e9813c6eb853dfb92b1537cea0b9ad97473b57
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx11
-rw-r--r--chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx4
-rw-r--r--chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx6
-rw-r--r--chart2/source/model/template/ChartTypeManager.cxx5
-rw-r--r--chart2/source/model/template/GL3DBarChartTypeTemplate.cxx2
5 files changed, 25 insertions, 3 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index dea17aa52161..c7eb4ef3b6bd 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -91,6 +91,7 @@ enum eServiceType
SERVICE_NAME_STOCK_DIAGRAM,
SERVICE_NAME_XY_DIAGRAM,
SERVICE_NAME_BUBBLE_DIAGRAM,
+ SERVICE_NAME_GL3DBAR_DIAGRAM,
SERVICE_NAME_DASH_TABLE,
SERVICE_NAME_GARDIENT_TABLE,
@@ -121,6 +122,7 @@ tServiceNameMap & lcl_getStaticServiceNameMap()
( "com.sun.star.chart.StockDiagram", SERVICE_NAME_STOCK_DIAGRAM )
( "com.sun.star.chart.XYDiagram", SERVICE_NAME_XY_DIAGRAM )
( "com.sun.star.chart.BubbleDiagram", SERVICE_NAME_BUBBLE_DIAGRAM )
+ ( "com.sun.star.chart.GL3DBarDiagram", SERVICE_NAME_GL3DBAR_DIAGRAM )
( "com.sun.star.drawing.DashTable", SERVICE_NAME_DASH_TABLE )
( "com.sun.star.drawing.GradientTable", SERVICE_NAME_GARDIENT_TABLE )
@@ -1263,6 +1265,15 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
bCreateDiagram = true;
}
break;
+ case SERVICE_NAME_GL3DBAR_DIAGRAM:
+ if( xManagerFact.is())
+ {
+ xTemplate.set(
+ xManagerFact->createInstance("com.sun.star.chart2.template.GL3DBar"),
+ uno::UNO_QUERY );
+ bCreateDiagram = true;
+ }
+ break;
case SERVICE_NAME_DASH_TABLE:
case SERVICE_NAME_GARDIENT_TABLE:
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 1dc2dd19fda4..04670ad0f127 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -522,6 +522,9 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
{
const OUString aName( rTemplateServiceName.copy( aPrefix.getLength()));
+ if (aName.indexOf("GL3DBar") != -1)
+ return OUString("com.sun.star.chart.GL3DBarDiagram");
+
// "Area" "StackedArea" "PercentStackedArea" "ThreeDArea"
// "StackedThreeDArea" "PercentStackedThreeDArea"
if( aName.indexOf( "Area" ) != -1 )
@@ -597,6 +600,7 @@ const tMakeStringStringMap& lcl_getChartTypeNameMap()
( "com.sun.star.chart2.NetChartType", "com.sun.star.chart.NetDiagram" )
( "com.sun.star.chart2.CandleStickChartType", "com.sun.star.chart.StockDiagram" )
( "com.sun.star.chart2.BubbleChartType", "com.sun.star.chart.BubbleDiagram" )
+ ( "com.sun.star.chart2.GL3DBarChartType", "com.sun.star.chart.GL3DBarDiagram" )
;
return g_aChartTypeNameMap;
}
diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
index 053cbe744660..1b3bfdc1be71 100644
--- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
+++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
@@ -33,8 +33,10 @@ Image GL3DBarChartDialogController::getImage()
const tTemplateServiceChartTypeParameterMap&
GL3DBarChartDialogController::getTemplateMap() const
{
- static tTemplateServiceChartTypeParameterMap aMap(
- "com.sun.star.chart2.template.GL3DBarRoundedRectangle", ChartTypeParameter(1));
+ static tTemplateServiceChartTypeParameterMap aMap =
+ tTemplateServiceChartTypeParameterMap
+ ("com.sun.star.chart2.template.GL3DBar", ChartTypeParameter(1))
+ ("com.sun.star.chart2.template.GL3DBarRoundedRectangle", ChartTypeParameter(2));
return aMap;
}
diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx
index 49775f9d4900..f6ebbee5e483 100644
--- a/chart2/source/model/template/ChartTypeManager.cxx
+++ b/chart2/source/model/template/ChartTypeManager.cxx
@@ -122,6 +122,7 @@ enum TemplateId
TEMPLATE_STOCKVOLUMELOWHIGHCLOSE,
TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE,
TEMPLATE_BUBBLE,
+ TEMPLATE_GL3DBAR,
TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE,
// TEMPLATE_SURFACE,
// TEMPLATE_ADDIN,
@@ -198,6 +199,7 @@ const tTemplateMapType & lcl_DefaultChartTypeMap()
( "com.sun.star.chart2.template.StockVolumeLowHighClose", TEMPLATE_STOCKVOLUMELOWHIGHCLOSE )
( "com.sun.star.chart2.template.StockVolumeOpenLowHighClose", TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE )
( "com.sun.star.chart2.template.Bubble", TEMPLATE_BUBBLE )
+ ( "com.sun.star.chart2.template.GL3DBar", TEMPLATE_GL3DBAR )
( "com.sun.star.chart2.template.GL3DBarRoundedRectangle", TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE )
// ( "com.sun.star.chart2.template.Surface", TEMPLATE_SURFACE )
// ( "com.sun.star.chart2.template.Addin", TEMPLATE_ADDIN )
@@ -532,6 +534,9 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier ));
break;
+ case TEMPLATE_GL3DBAR:
+ xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier));
+ break;
case TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE:
xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier));
break;
diff --git a/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx b/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx
index e65c8f562c48..c551111e8dd2 100644
--- a/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx
+++ b/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx
@@ -19,7 +19,7 @@ namespace chart {
namespace {
-const OUString aServiceName("com.sun.star.chart2.BubbleChartTypeTemplate");
+const OUString aServiceName("com.sun.star.chart2.GL3DBarChartTypeTemplate");
}