merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / model / main / ImplChartModel.cxx
blob3cb7a7a4d41f1f98b17d7b6d56c65567720068de
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ImplChartModel.cxx,v $
10 * $Revision: 1.17.44.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
33 #include "ImplChartModel.hxx"
34 #include "DataSeries.hxx"
35 #include "macros.hxx"
36 #include "PageBackground.hxx"
37 #include "DiagramHelper.hxx"
38 #include "NameContainer.hxx"
39 #include "CloneHelper.hxx"
40 #include "ModifyListenerHelper.hxx"
41 #include "DataSourceHelper.hxx"
42 #include "DisposeHelper.hxx"
43 #include "ChartModelHelper.hxx"
44 #include "ThreeDHelper.hxx"
45 #include "AxisHelper.hxx"
47 // header for class SvNumberFormatter
48 #include <svtools/zforlist.hxx>
49 // header for class SvNumberFormatsSupplierObj
50 #include <svtools/numuno.hxx>
51 #include <vcl/svapp.hxx>
52 #include <cppuhelper/component_context.hxx>
54 #include <com/sun/star/chart2/LegendPosition.hpp>
55 #include <com/sun/star/chart2/XDataSeries.hpp>
56 #include <com/sun/star/chart/ChartDataRowSource.hpp>
57 #include <com/sun/star/uno/XComponentContext.hpp>
58 #include <com/sun/star/embed/XStorage.hpp>
59 #include <com/sun/star/embed/ElementModes.hpp>
60 #include <com/sun/star/document/XFilter.hpp>
61 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
62 #include <com/sun/star/util/XModifyBroadcaster.hpp>
63 #include <com/sun/star/drawing/FillStyle.hpp>
64 #include <com/sun/star/drawing/Hatch.hpp>
65 #include <com/sun/star/drawing/LineDash.hpp>
66 #include <com/sun/star/drawing/LineStyle.hpp>
67 #include <com/sun/star/awt/Gradient.hpp>
68 #include <com/sun/star/drawing/ProjectionMode.hpp>
70 #include <vector>
71 #include <algorithm>
72 #include <functional>
74 using namespace ::com::sun::star;
75 using namespace ::chart::CloneHelper;
77 using ::com::sun::star::uno::Reference;
78 using ::com::sun::star::uno::Sequence;
80 using ::rtl::OUString;
82 namespace
85 struct lcl_removeListener : public ::std::unary_function< Reference< chart2::XDiagram >, void >
87 explicit lcl_removeListener( const Reference< util::XModifyListener > & xListener ) :
88 m_xListener( xListener )
91 void operator() ( const Reference< chart2::XDiagram > & xDia )
93 Reference< util::XModifyBroadcaster > xBroadcaster( xDia, uno::UNO_QUERY );
94 if( xBroadcaster.is() && m_xListener.is())
95 xBroadcaster->removeModifyListener( m_xListener );
97 private:
98 Reference< util::XModifyListener > m_xListener;
101 } // anonymous namespace
103 namespace chart
105 namespace impl
108 ImplChartModel::ImplChartModel(
109 Reference< uno::XComponentContext > const & xContext,
110 const Reference< util::XModifyListener > & xListener ) :
111 m_xContext( xContext ),
112 m_spChartData( new ChartData( m_xContext )),
113 m_bIsDisposed( false ),
114 m_xPageBackground( new PageBackground( m_xContext )),
115 m_xUndoManager( ChartModelHelper::createUndoManager() ),
116 m_xDashTable( createNameContainer( ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)),
117 C2U( "com.sun.star.drawing.DashTable" ), C2U( "com.sun.star.comp.chart.DashTable" ) )),
118 m_xGradientTable( createNameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
119 C2U( "com.sun.star.drawing.GradientTable" ), C2U( "com.sun.star.comp.chart.GradientTable" ) )),
120 m_xHatchTable( createNameContainer( ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)),
121 C2U( "com.sun.star.drawing.HatchTable" ), C2U( "com.sun.star.comp.chart.HatchTable" ) )),
122 m_xBitmapTable( createNameContainer( ::getCppuType( reinterpret_cast< const OUString * >(0)), // URL
123 C2U( "com.sun.star.drawing.BitmapTable" ), C2U( "com.sun.star.comp.chart.BitmapTable" ) )),
124 m_xTransparencyGradientTable( createNameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
125 C2U( "com.sun.star.drawing.TransparencyGradientTable" ), C2U( "com.sun.star.comp.chart.TransparencyGradientTable" ) )),
126 m_xXMLNamespaceMap( createNameContainer( ::getCppuType( (const OUString*) 0 ),
127 C2U( "com.sun.star.xml.NamespaceMap" ), C2U( "com.sun.star.comp.chart.XMLNameSpaceMap" ) ), uno::UNO_QUERY),
128 m_xModifyListener( xListener )
130 ModifyListenerHelper::addListener( m_xPageBackground, m_xModifyListener );
131 m_xChartTypeManager.set(
132 xContext->getServiceManager()->createInstanceWithContext(
133 C2U( "com.sun.star.chart2.ChartTypeManager" ),
134 xContext ), uno::UNO_QUERY );
136 GetStyleFamilies();
137 CreateDefaultChartTypeTemplate();
140 ImplChartModel::ImplChartModel( const ImplChartModel & rOther, const Reference< util::XModifyListener > & xListener ) :
141 m_xContext( rOther.m_xContext ),
142 m_spChartData( rOther.m_spChartData ),
143 m_bIsDisposed( rOther.m_bIsDisposed ),
144 m_xModifyListener( xListener )
146 m_xFamilies.set( CreateRefClone< Reference< container::XNameAccess > >()( rOther.m_xFamilies ));
147 m_xChartTypeManager.set( CreateRefClone< Reference< chart2::XChartTypeManager > >()( rOther.m_xChartTypeManager ));
148 m_xChartTypeTemplate.set( CreateRefClone< Reference< chart2::XChartTypeTemplate > >()( rOther.m_xChartTypeTemplate ));
149 m_xTitle.set( CreateRefClone< Reference< chart2::XTitle > >()( rOther.m_xTitle ));
150 ModifyListenerHelper::addListener( m_xTitle, m_xModifyListener );
151 m_xPageBackground.set( CreateRefClone< Reference< beans::XPropertySet > >()( rOther.m_xPageBackground ));
152 ModifyListenerHelper::addListener( m_xPageBackground, m_xModifyListener );
154 m_xDashTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xDashTable ));
155 m_xGradientTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xGradientTable ));
156 m_xHatchTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xHatchTable ));
157 m_xBitmapTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xBitmapTable ));
158 m_xTransparencyGradientTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xTransparencyGradientTable ));
160 m_xXMLNamespaceMap.set( CreateRefClone< Reference< container::XNameAccess > >()( rOther.m_xXMLNamespaceMap ));
162 CloneRefVector< Reference< chart2::XDiagram > >( rOther.m_aDiagrams, m_aDiagrams );
165 ImplChartModel::~ImplChartModel()
168 Reference< container::XNameAccess > ImplChartModel::GetStyleFamilies()
170 return m_xFamilies;
173 // Diagram Access
175 void ImplChartModel::RemoveAllDiagrams()
177 ModifyListenerHelper::removeListenerFromAllElements( m_aDiagrams, m_xModifyListener );
178 m_aDiagrams.clear();
181 void ImplChartModel::AppendDiagram( const Reference< chart2::XDiagram > & xDiagram )
183 Reference< util::XModifyBroadcaster > xBroadcaster( xDiagram, uno::UNO_QUERY );
184 ModifyListenerHelper::addListener( xDiagram, m_xModifyListener );
185 m_aDiagrams.push_back( xDiagram );
188 Reference< chart2::XDiagram > ImplChartModel::GetDiagram( size_t nIndex ) const
189 throw( container::NoSuchElementException )
191 if( nIndex >= m_aDiagrams.size() )
192 throw container::NoSuchElementException();
194 return m_aDiagrams[ nIndex ];
197 void ImplChartModel::SetDataProvider(
198 const Reference< chart2::data::XDataProvider > & xProvider )
200 OSL_ASSERT( m_spChartData.get() );
202 m_spChartData->setDataProvider( xProvider );
204 //the numberformatter is kept independent of the data provider!
206 // release other ressources
208 // @todo: maybe we need to save some properties of the old diagrams. When
209 // the data provider changes from an outside Calc to an internal Calc,
210 // e.g. when copying a chart into the clipboard as "standalone" format
211 // if( bDeleteDiagrams && ! m_aDiagrams.empty())
212 // m_aDiagrams.clear();
215 Reference< chart2::data::XDataProvider > ImplChartModel::GetDataProvider() const
217 OSL_ASSERT( m_spChartData.get() );
219 return m_spChartData->getDataProvider();
222 void ImplChartModel::CreateInternalDataProvider(
223 bool bCloneExistingData,
224 const Reference< chart2::XChartDocument > & xChartDoc )
226 m_spChartData->createInternalData( bCloneExistingData, xChartDoc );
229 bool ImplChartModel::HasInternalDataProvider() const
231 OSL_ASSERT( m_spChartData.get() );
233 return m_spChartData->hasInternalData();
236 Reference< chart2::data::XDataSource > SAL_CALL ImplChartModel::SetArguments(
237 const Sequence< beans::PropertyValue > & aArguments,
238 bool bSetData )
239 throw (lang::IllegalArgumentException)
241 Reference< chart2::data::XDataSource > xResult;
244 OSL_ASSERT( m_spChartData.get() );
246 Reference< chart2::data::XDataProvider > xDataProvider(
247 m_spChartData->getDataProvider());
248 if( xDataProvider.is() )
250 xResult.set( xDataProvider->createDataSource( aArguments ));
252 if( bSetData && xResult.is())
253 SetNewData( xResult, aArguments );
256 catch( lang::IllegalArgumentException & )
258 throw;
260 catch( uno::Exception & ex )
262 ASSERT_EXCEPTION( ex );
265 return xResult;
268 Reference< chart2::data::XDataSource > SAL_CALL ImplChartModel::SetRangeRepresentation(
269 const OUString & rRangeRepresentation, bool bSetData )
270 throw (::com::sun::star::lang::IllegalArgumentException)
272 uno::Sequence< beans::PropertyValue > aArgs( 4 );
273 aArgs[0] = beans::PropertyValue(
274 ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
275 uno::makeAny( rRangeRepresentation ), beans::PropertyState_DIRECT_VALUE );
276 aArgs[1] = beans::PropertyValue(
277 ::rtl::OUString::createFromAscii("HasCategories"), -1,
278 uno::makeAny( true ), beans::PropertyState_DIRECT_VALUE );
279 aArgs[2] = beans::PropertyValue(
280 ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
281 uno::makeAny( true ), beans::PropertyState_DIRECT_VALUE );
282 aArgs[3] = beans::PropertyValue(
283 ::rtl::OUString::createFromAscii("DataRowSource"), -1,
284 uno::makeAny( ::com::sun::star::chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
285 return SetArguments( aArgs, bSetData );
287 uno::Sequence< beans::PropertyValue > aArgs();
289 Reference< chart2::data::XDataProvider > xDataProvider( this->GetDataProvider() );
290 if( xDataProvider.is() )
291 aArgs = xDataProvider->detectArguments( DataSourceHelper::getUsedData( xChartModel ) ),
293 ::rtl::OUString aRangeString;
294 uno::Sequence< sal_Int32 > aSequenceMapping;
295 bool bUseColumns = true;
296 bool bFirstCellAsLabel = true;
297 bool bHasCategories = true;
299 DataSourceHelper::detectRangeSegmentation(
300 uno::Reference< frame::XModel >( m_xChartDoc, uno::UNO_QUERY ),
301 aRangeString, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories );
303 aArgs = createArguments( rRangeRepresentation, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories ) );
305 return SetArguments( aArgs, bSetData );
309 void ImplChartModel::SetChartTypeManager(
310 const Reference< chart2::XChartTypeManager > & xManager )
312 m_xChartTypeManager = xManager;
315 Reference< chart2::XChartTypeManager > ImplChartModel::GetChartTypeManager()
317 return m_xChartTypeManager;
320 Reference< chart2::XChartTypeTemplate > ImplChartModel::GetChartTypeTemplate()
322 return m_xChartTypeTemplate;
325 void ImplChartModel::CreateDefaultChart()
327 CreateDefaultChartTypeTemplate();
329 // clean up
330 RemoveAllDiagrams();
332 Reference< chart2::XChartTypeTemplate > xTemplate( GetChartTypeTemplate());
333 if( xTemplate.is())
337 Reference< chart2::data::XDataSource > xDataSource( CreateDefaultData());
338 Sequence< beans::PropertyValue > aParam;
340 Sequence< OUString > aParamNames( xTemplate->getAvailableCreationParameterNames());
341 const OUString * pBeg = aParamNames.getConstArray();
342 const OUString * pEnd = pBeg + aParamNames.getLength();
343 const OUString * pFound( ::std::find( pBeg, pEnd, C2U("HasCategories")));
344 if( pFound != pEnd )
346 aParam.realloc( 1 );
347 aParam[0] = beans::PropertyValue( C2U("HasCategories"), -1, uno::makeAny( true ),
348 beans::PropertyState_DIRECT_VALUE );
351 Reference< chart2::XDiagram > xDiagram( xTemplate->createDiagramByDataSource( xDataSource, aParam ) );
353 AppendDiagram( xDiagram );
355 bool bIsRTL = Application::GetSettings().GetLayoutRTL();
356 //reverse x axis for rtl charts
357 if( bIsRTL )
358 AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) );
360 // create and attach legend
361 Reference< chart2::XLegend > xLegend(
362 m_xContext->getServiceManager()->createInstanceWithContext(
363 C2U( "com.sun.star.chart2.Legend" ), m_xContext ), uno::UNO_QUERY_THROW );
364 Reference< beans::XPropertySet > xLegendProperties( xLegend, uno::UNO_QUERY );
365 if( xLegendProperties.is() )
367 xLegendProperties->setPropertyValue( C2U( "FillStyle" ), uno::makeAny( drawing::FillStyle_NONE ));
368 xLegendProperties->setPropertyValue( C2U( "LineStyle" ), uno::makeAny( drawing::LineStyle_NONE ));
369 xLegendProperties->setPropertyValue( C2U( "LineColor" ), uno::makeAny( static_cast< sal_Int32 >( 0xb3b3b3 ) )); // gray30
370 xLegendProperties->setPropertyValue( C2U( "FillColor" ), uno::makeAny( static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
372 if( bIsRTL )
373 xLegendProperties->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( chart2::LegendPosition_LINE_START ));
375 if(xDiagram.is())
376 xDiagram->setLegend( xLegend );
378 // set simple 3D look
379 Reference< beans::XPropertySet > xDiagramProperties( xDiagram, uno::UNO_QUERY );
380 if( xDiagramProperties.is() )
382 xDiagramProperties->setPropertyValue( C2U("RightAngledAxes"), uno::makeAny( sal_True ));
383 xDiagramProperties->setPropertyValue( C2U("D3DScenePerspective"), uno::makeAny( drawing::ProjectionMode_PARALLEL ));
384 ThreeDHelper::setScheme( xDiagram, ThreeDLookScheme_Simple );
387 //set some new 'defaults' for wall and floor
388 if( xDiagram.is() )
390 Reference< beans::XPropertySet > xWall( xDiagram->getWall() );
391 if( xWall.is() )
393 xWall->setPropertyValue( C2U( "LineStyle" ), uno::makeAny( drawing::LineStyle_SOLID ) );
394 xWall->setPropertyValue( C2U( "FillStyle" ), uno::makeAny( drawing::FillStyle_NONE ) );
395 xWall->setPropertyValue( C2U( "LineColor" ), uno::makeAny( static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
396 xWall->setPropertyValue( C2U( "FillColor" ), uno::makeAny( static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
398 Reference< beans::XPropertySet > xFloor( xDiagram->getFloor() );
399 if( xFloor.is() )
401 xFloor->setPropertyValue( C2U( "LineStyle" ), uno::makeAny( drawing::LineStyle_NONE ) );
402 xFloor->setPropertyValue( C2U( "FillStyle" ), uno::makeAny( drawing::FillStyle_SOLID ) );
403 xFloor->setPropertyValue( C2U( "LineColor" ), uno::makeAny( static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
404 xFloor->setPropertyValue( C2U( "FillColor" ), uno::makeAny( static_cast< sal_Int32 >( 0xcccccc ) ) ); // gray20
409 catch( uno::Exception & ex )
411 ASSERT_EXCEPTION( ex );
416 Reference< chart2::XTitle > ImplChartModel::GetTitle()
418 return m_xTitle;
421 void ImplChartModel::SetTitle( const Reference< chart2::XTitle >& rTitle )
423 if( m_xTitle.is())
424 ModifyListenerHelper::removeListener( m_xTitle, m_xModifyListener );
425 m_xTitle = rTitle;
426 ModifyListenerHelper::addListener( m_xTitle, m_xModifyListener );
429 void ImplChartModel::dispose()
431 // exception is thrown by ChartModel
432 if( m_bIsDisposed )
433 return;
435 m_spChartData.reset();
436 m_xNumberFormatsSupplier.clear();
438 DisposeHelper::DisposeAndClear( m_xFamilies );
439 DisposeHelper::DisposeAndClear( m_xOwnNumberFormatsSupplier );
440 DisposeHelper::DisposeAndClear( m_xChartTypeManager );
441 DisposeHelper::DisposeAndClear( m_xChartTypeTemplate );
442 DisposeHelper::DisposeAllElements( m_aDiagrams );
443 m_aDiagrams.clear();
444 DisposeHelper::DisposeAndClear( m_xTitle );
445 DisposeHelper::DisposeAndClear( m_xPageBackground );
446 DisposeHelper::DisposeAndClear( m_xDashTable );
447 DisposeHelper::DisposeAndClear( m_xGradientTable );
448 DisposeHelper::DisposeAndClear( m_xHatchTable );
449 DisposeHelper::DisposeAndClear( m_xBitmapTable );
450 DisposeHelper::DisposeAndClear( m_xTransparencyGradientTable );
452 DisposeHelper::DisposeAndClear( m_xXMLNamespaceMap );
454 // note: m_xModifyListener is the ChartModel, so don't call dispose()
455 m_xModifyListener.clear();
457 m_bIsDisposed = true;
460 Reference< beans::XPropertySet > ImplChartModel::GetPageBackground()
462 return m_xPageBackground;
465 Reference< chart2::XUndoManager > ImplChartModel::GetUndoManager()
467 return m_xUndoManager;
470 void ImplChartModel::SetNewData( const Reference< chart2::data::XDataSource > & xDataSource,
471 const Sequence< beans::PropertyValue > & rArgs )
473 Reference< chart2::XDiagram > xDia;
474 if( m_aDiagrams.size() > 0 )
475 xDia.set( GetDiagram(0));
476 Reference< chart2::XChartTypeTemplate > xTemplate;
478 if( xDia.is())
480 // apply new data
481 DiagramHelper::tTemplateWithServiceName aTemplateAndService =
482 DiagramHelper::getTemplateForDiagram(
483 xDia, Reference< lang::XMultiServiceFactory >( m_xChartTypeManager, uno::UNO_QUERY ));
484 xTemplate.set( aTemplateAndService.first );
487 if( !xTemplate.is())
488 xTemplate.set( GetChartTypeTemplate());
490 if( xTemplate.is())
492 if( xDia.is())
493 xTemplate->changeDiagramData( xDia, xDataSource, rArgs );
494 else
496 RemoveAllDiagrams();
497 AppendDiagram( xTemplate->createDiagramByDataSource( xDataSource, rArgs ));
502 Reference< chart2::data::XDataSource > ImplChartModel::CreateDefaultData()
504 Reference< chart2::data::XDataSource > xResult;
505 if( m_spChartData->createDefaultData())
506 xResult.set( SetRangeRepresentation( C2U("all"), false /* bSetData */ ));
507 return xResult;
510 void ImplChartModel::CreateDefaultChartTypeTemplate()
512 // set default chart type
513 Reference< lang::XMultiServiceFactory > xFact( m_xChartTypeManager, uno::UNO_QUERY );
514 if( xFact.is() )
516 m_xChartTypeTemplate.set(
517 xFact->createInstance( C2U( "com.sun.star.chart2.template.Column" ) ), uno::UNO_QUERY );
521 Reference< uno::XInterface > ImplChartModel::GetDashTable() const
523 return Reference< uno::XInterface >( m_xDashTable );
525 Reference< uno::XInterface > ImplChartModel::GetGradientTable() const
527 return Reference< uno::XInterface >( m_xGradientTable );
529 Reference< uno::XInterface > ImplChartModel::GetHatchTable() const
531 return Reference< uno::XInterface >( m_xHatchTable );
533 Reference< uno::XInterface > ImplChartModel::GetBitmapTable() const
535 return Reference< uno::XInterface >( m_xBitmapTable );
537 Reference< uno::XInterface > ImplChartModel::GetTransparencyGradientTable() const
539 return Reference< uno::XInterface >( m_xTransparencyGradientTable );
542 Reference< uno::XInterface > ImplChartModel::GetXMLNameSpaceMap() const
544 return Reference< uno::XInterface >( m_xXMLNamespaceMap );
547 void ImplChartModel::SetNumberFormatsSupplier(
548 const Reference< util::XNumberFormatsSupplier > & xNew )
550 if( xNew==m_xNumberFormatsSupplier )
551 return;
552 if( xNew==m_xOwnNumberFormatsSupplier )
553 return;
554 if( m_xOwnNumberFormatsSupplier.is() && xNew.is() )
556 //@todo
557 //merge missing numberformats from own to new formatter
559 else if( !xNew.is() )
561 if( m_xNumberFormatsSupplier.is() )
563 //@todo
564 //merge missing numberformats from old numberformatter to own numberformatter
565 //create own numberformatter if necessary
569 m_xNumberFormatsSupplier.set( xNew );
570 m_xOwnNumberFormatsSupplier.clear();
573 Reference< util::XNumberFormatsSupplier > ImplChartModel::GetNumberFormatsSupplier()
575 if( !m_xNumberFormatsSupplier.is() )
577 if( !m_xOwnNumberFormatsSupplier.is() )
579 Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY );
580 m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ) );
581 //pOwnNumberFormatter->ChangeStandardPrec( 15 ); todo?
583 m_xNumberFormatsSupplier = m_xOwnNumberFormatsSupplier;
585 return m_xNumberFormatsSupplier;
588 } // namespace impl
589 } // namespace chart