bump product version to 5.0.4.1
[LibreOffice.git] / reportdesign / source / ui / inspection / DataProviderHandler.cxx
blobce18a3e2f7805a3f30a5667c4063806e2725496a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #include "DataProviderHandler.hxx"
20 #include <com/sun/star/lang/XInitialization.hpp>
21 #include <comphelper/namedvaluecollection.hxx>
22 #include <comphelper/property.hxx>
23 #include <comphelper/types.hxx>
24 #include <cppuhelper/supportsservice.hxx>
25 #include "uistrings.hrc"
26 #include <toolkit/helper/vclunohelper.hxx>
27 #include <unotools/syslocale.hxx>
28 #include <com/sun/star/form/inspection/FormComponentPropertyHandler.hpp>
29 #include <com/sun/star/inspection/PropertyControlType.hpp>
30 #include <com/sun/star/inspection/PropertyLineElement.hpp>
31 #include <com/sun/star/chart/ChartDataRowSource.hpp>
32 #include <com/sun/star/chart2/FormattedString.hpp>
33 #include <com/sun/star/chart2/XDiagram.hpp>
34 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
35 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
36 #include <com/sun/star/chart2/XChartType.hpp>
37 #include <com/sun/star/chart2/XTitled.hpp>
38 #include <com/sun/star/chart2/XTitle.hpp>
39 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
40 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
41 #include <com/sun/star/report/XReportDefinition.hpp>
42 #include <com/sun/star/report/XSection.hpp>
43 #include <com/sun/star/script/Converter.hpp>
44 #include <com/sun/star/inspection/XNumericControl.hpp>
45 #include <com/sun/star/container/XNameContainer.hpp>
46 #include <com/sun/star/util/MeasureUnit.hpp>
47 #include <tools/fldunit.hxx>
48 #include "metadata.hxx"
49 #include <vcl/svapp.hxx>
50 #include <osl/mutex.hxx>
51 #include "helpids.hrc"
52 #include "RptResId.hrc"
53 #include "PropertyForward.hxx"
55 namespace rptui
58 using namespace ::com::sun::star;
60 DataProviderHandler::DataProviderHandler(uno::Reference< uno::XComponentContext > const & context)
61 :DataProviderHandler_Base(m_aMutex)
62 ,m_xContext(context)
63 ,m_pInfoService( new OPropertyInfoService() )
65 try
67 m_xFormComponentHandler = form::inspection::FormComponentPropertyHandler::create(m_xContext);
68 m_xTypeConverter = script::Converter::create(m_xContext);
70 }catch(const uno::Exception &)
75 OUString SAL_CALL DataProviderHandler::getImplementationName( ) throw(uno::RuntimeException, std::exception)
77 return getImplementationName_Static();
80 sal_Bool SAL_CALL DataProviderHandler::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException, std::exception)
82 return cppu::supportsService(this, ServiceName);
85 uno::Sequence< OUString > SAL_CALL DataProviderHandler::getSupportedServiceNames( ) throw(uno::RuntimeException, std::exception)
87 return getSupportedServiceNames_static();
90 OUString DataProviderHandler::getImplementationName_Static( ) throw(uno::RuntimeException)
92 return OUString("com.sun.star.comp.report.DataProviderHandler");
95 uno::Sequence< OUString > DataProviderHandler::getSupportedServiceNames_static( ) throw(uno::RuntimeException)
97 uno::Sequence< OUString > aSupported(1);
98 aSupported[0] = "com.sun.star.report.inspection.DataProviderHandler";
99 return aSupported;
102 uno::Reference< uno::XInterface > SAL_CALL DataProviderHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
104 return *(new DataProviderHandler( _rxContext ));
106 // override WeakComponentImplHelperBase::disposing()
107 // This function is called upon disposing the component,
108 // if your component needs special work when it becomes
109 // disposed, do it here.
110 void SAL_CALL DataProviderHandler::disposing()
112 ::comphelper::disposeComponent(m_xFormComponentHandler);
113 ::comphelper::disposeComponent( m_xMasterDetails );
114 ::comphelper::disposeComponent(m_xTypeConverter);
116 void SAL_CALL DataProviderHandler::addEventListener(const uno::Reference< lang::XEventListener > & xListener) throw (uno::RuntimeException, std::exception)
118 m_xFormComponentHandler->addEventListener(xListener);
121 void SAL_CALL DataProviderHandler::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw (uno::RuntimeException, std::exception)
123 m_xFormComponentHandler->removeEventListener(aListener);
126 // inspection::XPropertyHandler:
128 /********************************************************************************/
129 void SAL_CALL DataProviderHandler::inspect(const uno::Reference< uno::XInterface > & Component) throw (uno::RuntimeException, lang::NullPointerException, std::exception)
133 uno::Reference< container::XNameContainer > xNameCont(Component,uno::UNO_QUERY);
134 const OUString sFormComponent("FormComponent");
135 if ( xNameCont->hasByName(sFormComponent) )
137 uno::Reference<beans::XPropertySet> xProp(xNameCont->getByName(sFormComponent),uno::UNO_QUERY);
138 const OUString sModel("Model");
139 if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(sModel) )
141 m_xChartModel.set(xProp->getPropertyValue(sModel),uno::UNO_QUERY);
142 if ( m_xChartModel.is() )
143 m_xFormComponent = m_xChartModel->getDataProvider();
146 m_xDataProvider.set(m_xFormComponent,uno::UNO_QUERY);
147 m_xReportComponent.set( xNameCont->getByName("ReportComponent"), uno::UNO_QUERY );
148 if ( m_xDataProvider.is() )
150 ::boost::shared_ptr<AnyConverter> aNoConverter(new AnyConverter());
151 TPropertyNamePair aPropertyMediation;
152 aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_MASTERFIELDS, TPropertyConverter(PROPERTY_MASTERFIELDS,aNoConverter) ) );
153 aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_DETAILFIELDS, TPropertyConverter(PROPERTY_DETAILFIELDS,aNoConverter) ) );
155 m_xMasterDetails = new OPropertyMediator( m_xDataProvider.get(), m_xReportComponent.get(), aPropertyMediation,true );
158 catch(const uno::Exception &)
160 throw lang::NullPointerException();
162 if ( m_xFormComponent.is() )
164 m_xFormComponentHandler->inspect(m_xFormComponent);
168 uno::Any SAL_CALL DataProviderHandler::getPropertyValue(const OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
170 ::osl::MutexGuard aGuard( m_aMutex );
171 uno::Any aPropertyValue;
172 const sal_Int32 nId = OPropertyInfoService::getPropertyId(PropertyName);
173 switch(nId)
175 case PROPERTY_ID_CHARTTYPE:
176 // TODO: We need a possibility to get the UI of the selected chart type
177 // LEM: this business of ignoring ChartType seems very fishy!
178 //if( m_xChartModel.is() )
180 // uno::Reference< chart2::XDiagram > xDiagram( m_xChartModel->getFirstDiagram() );
181 // if( xDiagram.is() )
182 // {
183 // OUString sChartTypes;
184 // uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
185 // const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
186 // const uno::Reference< chart2::XCoordinateSystem >* pIter = aCooSysSeq.getConstArray();
187 // const uno::Reference< chart2::XCoordinateSystem >* pEnd = pIter + aCooSysSeq.getLength();
188 // for(;pIter != pEnd;++pIter)
189 // {
190 // const uno::Reference< chart2::XChartTypeContainer > xCTCnt( *pIter, uno::UNO_QUERY_THROW );
191 // const uno::Sequence< uno::Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes());
192 // const uno::Reference< chart2::XChartType >* pChartTypeIter = aCTSeq.getConstArray();
193 // const uno::Reference< chart2::XChartType >* pChartTypeEnd = pChartTypeIter + aCTSeq.getLength();
194 // for(;pChartTypeIter != pChartTypeEnd;++pChartTypeIter)
195 // {
196 // sChartTypes += (*pChartTypeIter)->getChartType();
197 // sChartTypes += ";";
198 // }
199 // }
200 // aPropertyValue;// <<= sChartTypes;
201 // }
203 break;
204 case PROPERTY_ID_PREVIEW_COUNT:
205 aPropertyValue <<= m_xDataProvider->getRowLimit();
206 break;
207 default:
208 aPropertyValue = m_xFormComponentHandler->getPropertyValue( PropertyName );
209 break;
211 return aPropertyValue;
214 void SAL_CALL DataProviderHandler::setPropertyValue(const OUString & PropertyName, const uno::Any & Value) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
216 ::osl::MutexGuard aGuard( m_aMutex );
217 const sal_Int32 nId = OPropertyInfoService::getPropertyId(PropertyName);
218 switch(nId)
220 case PROPERTY_ID_CHARTTYPE:
221 break;
222 case PROPERTY_ID_PREVIEW_COUNT:
223 m_xDataProvider->setPropertyValue(PropertyName,Value);
224 break;
225 default:
226 m_xFormComponentHandler->setPropertyValue(PropertyName, Value);
227 break;
231 void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any& _aValue)
233 uno::Reference<chart2::XTitled> xTitled(m_xChartModel,uno::UNO_QUERY);
234 if ( xTitled.is() )
236 uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
237 if ( !xTitle.is() )
239 xTitle.set(m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.chart2.Title",m_xContext),uno::UNO_QUERY);
240 xTitled->setTitleObject(xTitle);
242 if ( xTitle.is() )
244 uno::Reference< chart2::XFormattedString2> xFormatted = chart2::FormattedString::create(m_xContext);
245 OUString sStr;
246 _aValue >>= sStr;
247 xFormatted->setString(sStr);
248 uno::Sequence< uno::Reference< chart2::XFormattedString> > aArgs(1);
249 aArgs[0] = xFormatted;
250 xTitle->setText(aArgs);
255 beans::PropertyState SAL_CALL DataProviderHandler::getPropertyState(const OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
257 return m_xFormComponentHandler->getPropertyState(PropertyName);
260 inspection::LineDescriptor SAL_CALL DataProviderHandler::describePropertyLine(const OUString & PropertyName, const uno::Reference< inspection::XPropertyControlFactory > & _xControlFactory) throw (beans::UnknownPropertyException, lang::NullPointerException,uno::RuntimeException, std::exception)
262 inspection::LineDescriptor aOut;
263 const sal_Int32 nId = OPropertyInfoService::getPropertyId(PropertyName);
264 switch(nId)
266 case PROPERTY_ID_CHARTTYPE:
267 aOut.PrimaryButtonId = UID_RPT_PROP_CHARTTYPE_DLG;
268 aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::TextField , sal_True);
269 aOut.HasPrimaryButton = sal_True;
270 break;
271 case PROPERTY_ID_PREVIEW_COUNT:
272 aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::NumericField , sal_False);
273 break;
274 case PROPERTY_ID_MASTERFIELDS:
275 case PROPERTY_ID_DETAILFIELDS:
276 aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::StringListField , sal_False);
277 aOut.PrimaryButtonId = UID_RPT_PROP_DLG_LINKFIELDS;
278 aOut.HasPrimaryButton = sal_True;
279 break;
280 default:
281 aOut = m_xFormComponentHandler->describePropertyLine(PropertyName, _xControlFactory);
283 if ( nId != -1 )
285 aOut.Category = ((OPropertyInfoService::getPropertyUIFlags(nId ) & PROP_FLAG_DATA_PROPERTY) != 0) ?
286 OUString("Data")
288 OUString("General");
289 aOut.HelpURL = HelpIdUrl::getHelpURL( OPropertyInfoService::getPropertyHelpId( nId ) );
290 aOut.DisplayName = OPropertyInfoService::getPropertyTranslation(nId);
292 return aOut;
295 uno::Any SAL_CALL DataProviderHandler::convertToPropertyValue(const OUString & _rPropertyValue, const uno::Any & _rControlValue) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
297 ::osl::MutexGuard aGuard( m_aMutex );
298 uno::Any aPropertyValue( _rControlValue );
299 const sal_Int32 nId = OPropertyInfoService::getPropertyId(_rPropertyValue);
300 switch(nId)
302 case PROPERTY_ID_CHARTTYPE:
303 break;
304 case PROPERTY_ID_PREVIEW_COUNT:
307 aPropertyValue = m_xTypeConverter->convertTo( _rControlValue, ::cppu::UnoType<sal_Int32>::get());
309 catch( const uno::Exception& )
311 OSL_FAIL( "DataProviderHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
313 break;
314 case PROPERTY_ID_MASTERFIELDS:
315 case PROPERTY_ID_DETAILFIELDS:
316 break;
317 default:
318 aPropertyValue = m_xFormComponentHandler->convertToPropertyValue(_rPropertyValue, _rControlValue);
320 return aPropertyValue;
323 uno::Any SAL_CALL DataProviderHandler::convertToControlValue(const OUString & _rPropertyName, const uno::Any & _rPropertyValue, const uno::Type & ControlValueType) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
325 uno::Any aControlValue( _rPropertyValue );
326 if ( !aControlValue.hasValue() )
327 // NULL is converted to NULL
328 return aControlValue;
330 ::osl::MutexGuard aGuard( m_aMutex );
331 const sal_Int32 nId = OPropertyInfoService::getPropertyId(_rPropertyName);
332 switch(nId)
334 case PROPERTY_ID_CHARTTYPE:
335 break;
336 case PROPERTY_ID_MASTERFIELDS:
337 case PROPERTY_ID_DETAILFIELDS:
338 case PROPERTY_ID_PREVIEW_COUNT:
341 aControlValue = m_xTypeConverter->convertTo( _rPropertyValue, ControlValueType);
343 catch( const uno::Exception& )
345 OSL_FAIL( "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
347 break;
348 default:
349 aControlValue = m_xFormComponentHandler->convertToControlValue(_rPropertyName, _rPropertyValue, ControlValueType);
351 return aControlValue;
354 void SAL_CALL DataProviderHandler::addPropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & Listener) throw (uno::RuntimeException, lang::NullPointerException, std::exception)
356 m_xFormComponentHandler->addPropertyChangeListener(Listener);
359 void SAL_CALL DataProviderHandler::removePropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) throw (uno::RuntimeException, std::exception)
361 m_xFormComponentHandler->removePropertyChangeListener(_rxListener);
364 uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedProperties() throw (uno::RuntimeException, std::exception)
366 ::std::vector< beans::Property > aNewProps;
367 if( m_xChartModel.is() )
369 rptui::OPropertyInfoService::getExcludeProperties( aNewProps, m_xFormComponentHandler );
370 beans::Property aValue;
371 static const OUString s_pProperties[] =
373 OUString(PROPERTY_CHARTTYPE)
374 ,OUString(PROPERTY_MASTERFIELDS)
375 ,OUString(PROPERTY_DETAILFIELDS)
376 ,OUString(PROPERTY_PREVIEW_COUNT)
379 for (size_t nPos = 0; nPos < sizeof(s_pProperties)/sizeof(s_pProperties[0]) ;++nPos )
381 aValue.Name = s_pProperties[nPos];
382 aNewProps.push_back(aValue);
385 return uno::Sequence< beans::Property >(aNewProps.data(), aNewProps.size());
388 uno::Sequence< OUString > SAL_CALL DataProviderHandler::getSupersededProperties() throw (uno::RuntimeException, std::exception)
390 uno::Sequence< OUString > aRet(1);
391 aRet[0] = PROPERTY_TITLE; // have a look at OPropertyInfoService::getExcludeProperties
392 return aRet;
395 uno::Sequence< OUString > SAL_CALL DataProviderHandler::getActuatingProperties() throw (uno::RuntimeException, std::exception)
397 ::osl::MutexGuard aGuard( m_aMutex );
399 uno::Sequence< OUString > aSeq(1);
400 aSeq[0] = PROPERTY_TITLE;
401 return ::comphelper::concatSequences(m_xFormComponentHandler->getActuatingProperties(),aSeq);
404 sal_Bool SAL_CALL DataProviderHandler::isComposable( const OUString& _rPropertyName ) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
406 return OPropertyInfoService::isComposable( _rPropertyName, m_xFormComponentHandler );
409 inspection::InteractiveSelectionResult SAL_CALL DataProviderHandler::onInteractivePropertySelection(const OUString & PropertyName, sal_Bool Primary, uno::Any & out_Data, const uno::Reference< inspection::XObjectInspectorUI > & _rxInspectorUI) throw (uno::RuntimeException, beans::UnknownPropertyException, lang::NullPointerException, std::exception)
411 if ( !_rxInspectorUI.is() )
412 throw lang::NullPointerException();
414 inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled;
415 ::osl::ClearableMutexGuard aGuard( m_aMutex );
417 const sal_Int32 nId = OPropertyInfoService::getPropertyId(PropertyName);
418 switch(nId)
420 case PROPERTY_ID_CHARTTYPE:
421 if ( impl_dialogChartType_nothrow(aGuard) )
422 eResult = inspection::InteractiveSelectionResult_ObtainedValue;
423 break;
424 case PROPERTY_ID_MASTERFIELDS:
425 case PROPERTY_ID_DETAILFIELDS:
426 if ( impl_dialogLinkedFields_nothrow( aGuard ) )
427 eResult = inspection::InteractiveSelectionResult_Success;
428 break;
429 default:
430 eResult = m_xFormComponentHandler->onInteractivePropertySelection(PropertyName, Primary, out_Data, _rxInspectorUI);
433 return eResult;
436 void SAL_CALL DataProviderHandler::actuatingPropertyChanged(const OUString & ActuatingPropertyName, const uno::Any & NewValue, const uno::Any & OldValue, const uno::Reference< inspection::XObjectInspectorUI > & InspectorUI, sal_Bool FirstTimeInit) throw (uno::RuntimeException, lang::NullPointerException, std::exception)
438 ::osl::ClearableMutexGuard aGuard( m_aMutex );
440 if ( ActuatingPropertyName == PROPERTY_COMMAND )
442 if ( NewValue != OldValue )
444 uno::Reference< report::XReportDefinition> xReport = m_xReportComponent->getSection()->getReportDefinition();
445 bool bDoEnableMasterDetailFields = xReport.is() && !xReport->getCommand().isEmpty() && !m_xDataProvider->getCommand().isEmpty();
446 InspectorUI->enablePropertyUIElements( PROPERTY_DETAILFIELDS, inspection::PropertyLineElement::PrimaryButton, bDoEnableMasterDetailFields );
447 InspectorUI->enablePropertyUIElements( PROPERTY_MASTERFIELDS, inspection::PropertyLineElement::PrimaryButton, bDoEnableMasterDetailFields );
449 bool bModified = xReport->isModified();
450 // this fills the chart again
451 ::comphelper::NamedValueCollection aArgs;
452 aArgs.put( "CellRangeRepresentation", uno::makeAny( OUString( "all" ) ) );
453 aArgs.put( "HasCategories", uno::makeAny( sal_True ) );
454 aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) );
455 aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
456 uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xChartModel,uno::UNO_QUERY_THROW);
457 xReceiver->setArguments( aArgs.getPropertyValues() );
458 if ( !bModified )
459 xReport->setModified(sal_False);
461 m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, InspectorUI, FirstTimeInit);
463 else if ( ActuatingPropertyName == PROPERTY_TITLE )
465 if ( NewValue != OldValue )
466 impl_updateChartTitle_throw(NewValue);
468 else
470 const sal_Int32 nId = OPropertyInfoService::getPropertyId(ActuatingPropertyName);
471 switch(nId)
474 case PROPERTY_ID_MASTERFIELDS:
475 break;
476 case PROPERTY_ID_DETAILFIELDS:
477 break;
478 default:
479 m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, InspectorUI, FirstTimeInit);
484 sal_Bool SAL_CALL DataProviderHandler::suspend(sal_Bool Suspend) throw (uno::RuntimeException, std::exception)
486 return m_xFormComponentHandler->suspend(Suspend);
488 bool DataProviderHandler::impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
490 uno::Sequence<uno::Any> aSeq(6);
491 beans::PropertyValue aParam;
492 aParam.Name = "ParentWindow";
493 aParam.Value <<= m_xContext->getValueByName("DialogParentWindow");
494 aSeq[0] <<= aParam;
495 aParam.Name = "Detail";
496 aParam.Value <<= m_xDataProvider;
497 aSeq[1] <<= aParam;
498 aParam.Name = "Master";
499 aParam.Value <<= m_xReportComponent->getSection()->getReportDefinition();
500 aSeq[2] <<= aParam;
502 aParam.Name = "Explanation";
503 aParam.Value <<= OUString(ModuleRes(RID_STR_EXPLANATION));
504 aSeq[3] <<= aParam;
505 aParam.Name = "DetailLabel";
506 aParam.Value <<= OUString(ModuleRes(RID_STR_DETAILLABEL));
507 aSeq[4] <<= aParam;
508 aParam.Name = "MasterLabel";
509 aParam.Value <<= OUString(ModuleRes(RID_STR_MASTERLABEL));
510 aSeq[5] <<= aParam;
512 uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
513 m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
514 OUString("org.openoffice.comp.form.ui.MasterDetailLinkDialog"),aSeq
515 , m_xContext), uno::UNO_QUERY);
517 _rClearBeforeDialog.clear();
518 return ( xDialog->execute() != 0 );
521 bool DataProviderHandler::impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
523 uno::Sequence<uno::Any> aSeq(2);
524 beans::PropertyValue aParam;
525 aParam.Name = "ParentWindow";
526 aParam.Value <<= m_xContext->getValueByName("DialogParentWindow");
527 aSeq[0] <<= aParam;
528 aParam.Name = "ChartModel";
529 aParam.Value <<= m_xChartModel;
530 aSeq[1] <<= aParam;
532 uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
533 m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
534 OUString("com.sun.star.comp.chart2.ChartTypeDialog"),aSeq
535 , m_xContext), uno::UNO_QUERY);
537 _rClearBeforeDialog.clear();
538 return ( xDialog->execute() != 0 );
541 } // namespace rptui
544 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */