merge the formfield patch from ooo-build
[ooovba.git] / reportdesign / source / ui / inspection / DataProviderHandler.cxx
blob495065f44061d59812a9dfdfb707f6cf4b2b52f3
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: DataProviderHandler.cxx,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
30 #include "precompiled_reportdesign.hxx"
31 #include "DataProviderHandler.hxx"
32 #include <com/sun/star/lang/XInitialization.hpp>
33 #include <comphelper/sequence.hxx>
34 #include <comphelper/property.hxx>
35 #include <comphelper/types.hxx>
36 #include "uistrings.hrc"
37 #include <toolkit/helper/vclunohelper.hxx>
38 #include <svtools/syslocale.hxx>
39 #include <com/sun/star/inspection/PropertyControlType.hpp>
40 #include <com/sun/star/inspection/PropertyLineElement.hpp>
41 #include <com/sun/star/chart/ChartDataRowSource.hpp>
42 #include <com/sun/star/chart2/XDiagram.hpp>
43 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
44 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
45 #include <com/sun/star/chart2/XChartType.hpp>
46 #include <com/sun/star/chart2/XFormattedString.hpp>
47 #include <com/sun/star/chart2/XTitled.hpp>
48 #include <com/sun/star/chart2/XTitle.hpp>
49 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
50 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
51 #include <com/sun/star/report/XReportDefinition.hpp>
52 #include <com/sun/star/report/XSection.hpp>
53 #include <com/sun/star/inspection/XNumericControl.hpp>
54 #include <com/sun/star/container/XNameContainer.hpp>
55 #include <com/sun/star/util/MeasureUnit.hpp>
56 #include <vcl/fldunit.hxx>
57 #include "metadata.hxx"
58 #include <vcl/svapp.hxx>
59 #include <vos/mutex.hxx>
60 #include "helpids.hrc"
61 #include "uistrings.hrc"
62 #include "RptResId.hrc"
63 #include "PropertyForward.hxx"
64 //........................................................................
65 namespace rptui
67 //........................................................................
68 using namespace ::com::sun::star;
70 DataProviderHandler::DataProviderHandler(uno::Reference< uno::XComponentContext > const & context)
71 :DataProviderHandler_Base(m_aMutex)
72 ,m_xContext(context)
73 ,m_pInfoService( new OPropertyInfoService() )
75 try
77 m_xFormComponentHandler.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.inspection.FormComponentPropertyHandler")),m_xContext),uno::UNO_QUERY_THROW);
78 m_xTypeConverter.set(m_xContext->getServiceManager()->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter" )),m_xContext),uno::UNO_QUERY_THROW);
80 }catch(uno::Exception)
85 //------------------------------------------------------------------------
86 ::rtl::OUString SAL_CALL DataProviderHandler::getImplementationName( ) throw(uno::RuntimeException)
88 return getImplementationName_Static();
91 //------------------------------------------------------------------------
92 sal_Bool SAL_CALL DataProviderHandler::supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException)
94 return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_static());
97 //------------------------------------------------------------------------
98 uno::Sequence< ::rtl::OUString > SAL_CALL DataProviderHandler::getSupportedServiceNames( ) throw(uno::RuntimeException)
100 return getSupportedServiceNames_static();
103 //------------------------------------------------------------------------
104 ::rtl::OUString DataProviderHandler::getImplementationName_Static( ) throw(uno::RuntimeException)
106 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.DataProviderHandler"));
109 //------------------------------------------------------------------------
110 uno::Sequence< ::rtl::OUString > DataProviderHandler::getSupportedServiceNames_static( ) throw(uno::RuntimeException)
112 uno::Sequence< ::rtl::OUString > aSupported(1);
113 aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.inspection.DataProviderHandler"));
114 return aSupported;
117 //------------------------------------------------------------------------
118 uno::Reference< uno::XInterface > SAL_CALL DataProviderHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
120 return *(new DataProviderHandler( _rxContext ));
122 // overload WeakComponentImplHelperBase::disposing()
123 // This function is called upon disposing the component,
124 // if your component needs special work when it becomes
125 // disposed, do it here.
126 void SAL_CALL DataProviderHandler::disposing()
128 ::comphelper::disposeComponent(m_xFormComponentHandler);
129 ::comphelper::disposeComponent( m_xMasterDetails );
130 ::comphelper::disposeComponent(m_xTypeConverter);
132 void SAL_CALL DataProviderHandler::addEventListener(const uno::Reference< lang::XEventListener > & xListener) throw (uno::RuntimeException)
134 m_xFormComponentHandler->addEventListener(xListener);
137 void SAL_CALL DataProviderHandler::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw (uno::RuntimeException)
139 m_xFormComponentHandler->removeEventListener(aListener);
142 // inspection::XPropertyHandler:
144 /********************************************************************************/
145 void SAL_CALL DataProviderHandler::inspect(const uno::Reference< uno::XInterface > & Component) throw (uno::RuntimeException, lang::NullPointerException)
149 uno::Reference< container::XNameContainer > xNameCont(Component,uno::UNO_QUERY);
150 const ::rtl::OUString sFormComponent(RTL_CONSTASCII_USTRINGPARAM("FormComponent"));
151 if ( xNameCont->hasByName(sFormComponent) )
153 uno::Reference<beans::XPropertySet> xProp(xNameCont->getByName(sFormComponent),uno::UNO_QUERY);
154 const ::rtl::OUString sModel(RTL_CONSTASCII_USTRINGPARAM("Model"));
155 if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(sModel) )
157 m_xChartModel.set(xProp->getPropertyValue(sModel),uno::UNO_QUERY);
158 if ( m_xChartModel.is() )
159 m_xFormComponent = m_xChartModel->getDataProvider();
162 m_xDataProvider.set(m_xFormComponent,uno::UNO_QUERY);
163 m_xReportComponent.set( xNameCont->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ReportComponent" ) ) ), uno::UNO_QUERY );
164 if ( m_xDataProvider.is() )
166 ::boost::shared_ptr<AnyConverter> aNoConverter(new AnyConverter());
167 TPropertyNamePair aPropertyMediation;
168 aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_MASTERFIELDS, TPropertyConverter(PROPERTY_MASTERFIELDS,aNoConverter) ) );
169 aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_DETAILFIELDS, TPropertyConverter(PROPERTY_DETAILFIELDS,aNoConverter) ) );
171 m_xMasterDetails = new OPropertyMediator( m_xDataProvider.get(), m_xReportComponent.get(), aPropertyMediation,sal_True );
174 //const ::rtl::OUString sRowSet(RTL_CONSTASCII_USTRINGPARAM("RowSet"));
175 //if ( xNameCont->hasByName(sRowSet) )
177 // uno::Reference<beans::XPropertySet> xProp(m_xFormComponentHandler,uno::UNO_QUERY);
178 // xProp->setPropertyValue(sRowSet,xNameCont->getByName(sRowSet));
181 catch(uno::Exception)
183 throw lang::NullPointerException();
185 if ( m_xFormComponent.is() )
187 m_xFormComponentHandler->inspect(m_xFormComponent);
191 uno::Any SAL_CALL DataProviderHandler::getPropertyValue(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
193 ::osl::MutexGuard aGuard( m_aMutex );
194 uno::Any aPropertyValue;
195 const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
196 switch(nId)
198 case PROPERTY_ID_CHARTTYPE:
199 // TODO: We need a possiblity to get the UI of the selected chart type
200 //if( m_xChartModel.is() )
202 // uno::Reference< chart2::XDiagram > xDiagram( m_xChartModel->getFirstDiagram() );
203 // if( xDiagram.is() )
204 // {
205 // ::rtl::OUString sChartTypes;
206 // uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
207 // const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
208 // const uno::Reference< chart2::XCoordinateSystem >* pIter = aCooSysSeq.getConstArray();
209 // const uno::Reference< chart2::XCoordinateSystem >* pEnd = pIter + aCooSysSeq.getLength();
210 // for(;pIter != pEnd;++pIter)
211 // {
212 // const uno::Reference< chart2::XChartTypeContainer > xCTCnt( *pIter, uno::UNO_QUERY_THROW );
213 // const uno::Sequence< uno::Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes());
214 // const uno::Reference< chart2::XChartType >* pChartTypeIter = aCTSeq.getConstArray();
215 // const uno::Reference< chart2::XChartType >* pChartTypeEnd = pChartTypeIter + aCTSeq.getLength();
216 // for(;pChartTypeIter != pChartTypeEnd;++pChartTypeIter)
217 // {
218 // sChartTypes += (*pChartTypeIter)->getChartType();
219 // sChartTypes += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
220 // }
221 // }
222 // aPropertyValue;// <<= sChartTypes;
223 // }
225 break;
226 case PROPERTY_ID_PREVIEW_COUNT:
227 aPropertyValue <<= m_xDataProvider->getRowLimit();
228 break;
229 default:
230 aPropertyValue = m_xFormComponentHandler->getPropertyValue( PropertyName );
231 break;
233 return aPropertyValue;
236 void SAL_CALL DataProviderHandler::setPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & Value) throw (uno::RuntimeException, beans::UnknownPropertyException)
238 ::osl::MutexGuard aGuard( m_aMutex );
239 uno::Any aPropertyValue;
240 const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
241 switch(nId)
243 case PROPERTY_ID_CHARTTYPE:
244 break;
245 case PROPERTY_ID_PREVIEW_COUNT:
246 m_xDataProvider->setPropertyValue(PropertyName,Value);
247 break;
248 default:
249 m_xFormComponentHandler->setPropertyValue(PropertyName, Value);
250 break;
253 // -----------------------------------------------------------------------------
254 void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any& _aValue)
256 uno::Reference<chart2::XTitled> xTitled(m_xChartModel,uno::UNO_QUERY);
257 if ( xTitled.is() )
259 uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
260 if ( !xTitle.is() )
262 xTitle.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.Title")),m_xContext),uno::UNO_QUERY);
263 xTitled->setTitleObject(xTitle);
265 if ( xTitle.is() )
267 uno::Reference< chart2::XFormattedString> xFormatted(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.FormattedString")),m_xContext),uno::UNO_QUERY);
268 ::rtl::OUString sStr;
269 _aValue>>= sStr;
270 xFormatted->setString(sStr);
271 uno::Sequence< uno::Reference< chart2::XFormattedString> > aArgs(1);
272 aArgs[0] = xFormatted;
273 xTitle->setText(aArgs);
275 } // if ( xTitled.is() )
278 beans::PropertyState SAL_CALL DataProviderHandler::getPropertyState(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
280 return m_xFormComponentHandler->getPropertyState(PropertyName);
283 inspection::LineDescriptor SAL_CALL DataProviderHandler::describePropertyLine(const ::rtl::OUString & PropertyName, const uno::Reference< inspection::XPropertyControlFactory > & _xControlFactory) throw (beans::UnknownPropertyException, lang::NullPointerException,uno::RuntimeException)
285 inspection::LineDescriptor aOut;
286 const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
287 switch(nId)
289 case PROPERTY_ID_CHARTTYPE:
290 aOut.PrimaryButtonId = UID_RPT_PROP_CHARTTYPE_DLG;
291 aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::TextField , sal_True);
292 aOut.HasPrimaryButton = sal_True;
293 break;
294 case PROPERTY_ID_PREVIEW_COUNT:
295 aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::NumericField , sal_False);
296 break;
297 case PROPERTY_ID_MASTERFIELDS:
298 case PROPERTY_ID_DETAILFIELDS:
299 aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::StringListField , sal_False);
300 aOut.PrimaryButtonId = UID_RPT_PROP_DLG_LINKFIELDS;
301 aOut.HasPrimaryButton = sal_True;
302 break;
303 default:
304 aOut = m_xFormComponentHandler->describePropertyLine(PropertyName, _xControlFactory);
306 if ( nId != -1 )
308 aOut.Category = ((m_pInfoService->getPropertyUIFlags(nId ) & PROP_FLAG_DATA_PROPERTY) != 0) ?
309 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"))
311 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("General"));
312 aOut.HelpURL = HelpIdUrl::getHelpURL( m_pInfoService->getPropertyHelpId( nId ) );
313 aOut.DisplayName = m_pInfoService->getPropertyTranslation(nId);
315 return aOut;
318 uno::Any SAL_CALL DataProviderHandler::convertToPropertyValue(const ::rtl::OUString & _rPropertyValue, const uno::Any & _rControlValue) throw (uno::RuntimeException, beans::UnknownPropertyException)
320 ::osl::MutexGuard aGuard( m_aMutex );
321 uno::Any aPropertyValue( _rControlValue );
322 const sal_Int32 nId = m_pInfoService->getPropertyId(_rPropertyValue);
323 switch(nId)
325 case PROPERTY_ID_CHARTTYPE:
326 break;
327 case PROPERTY_ID_PREVIEW_COUNT:
330 aPropertyValue = m_xTypeConverter->convertTo( _rControlValue, ::getCppuType((const sal_Int32*)0));
332 catch( const uno::Exception& )
334 OSL_ENSURE( sal_False, "DataProviderHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
336 break;
337 case PROPERTY_ID_MASTERFIELDS:
338 case PROPERTY_ID_DETAILFIELDS:
339 break;
340 default:
341 aPropertyValue = m_xFormComponentHandler->convertToPropertyValue(_rPropertyValue, _rControlValue);
343 return aPropertyValue;
346 uno::Any SAL_CALL DataProviderHandler::convertToControlValue(const ::rtl::OUString & _rPropertyName, const uno::Any & _rPropertyValue, const uno::Type & ControlValueType) throw (uno::RuntimeException, beans::UnknownPropertyException)
348 uno::Any aControlValue( _rPropertyValue );
349 if ( !aControlValue.hasValue() )
350 // NULL is converted to NULL
351 return aControlValue;
353 ::osl::MutexGuard aGuard( m_aMutex );
354 const sal_Int32 nId = m_pInfoService->getPropertyId(_rPropertyName);
355 switch(nId)
357 case PROPERTY_ID_CHARTTYPE:
358 break;
359 case PROPERTY_ID_MASTERFIELDS:
360 case PROPERTY_ID_DETAILFIELDS:
361 case PROPERTY_ID_PREVIEW_COUNT:
364 aControlValue = m_xTypeConverter->convertTo( _rPropertyValue, ControlValueType);
366 catch( const uno::Exception& )
368 OSL_ENSURE( sal_False, "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
370 break;
371 default:
372 aControlValue = m_xFormComponentHandler->convertToControlValue(_rPropertyName, _rPropertyValue, ControlValueType);
374 return aControlValue;
377 void SAL_CALL DataProviderHandler::addPropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & Listener) throw (uno::RuntimeException, lang::NullPointerException)
379 m_xFormComponentHandler->addPropertyChangeListener(Listener);
382 void SAL_CALL DataProviderHandler::removePropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) throw (uno::RuntimeException)
384 m_xFormComponentHandler->removePropertyChangeListener(_rxListener);
387 uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedProperties() throw (uno::RuntimeException)
389 ::std::vector< beans::Property > aNewProps;
390 if( m_xChartModel.is() )
392 m_pInfoService->getExcludeProperties( aNewProps, m_xFormComponentHandler );
393 beans::Property aValue;
394 static const ::rtl::OUString s_pProperties[] =
396 PROPERTY_CHARTTYPE
397 ,PROPERTY_MASTERFIELDS
398 ,PROPERTY_DETAILFIELDS
399 ,PROPERTY_PREVIEW_COUNT
400 //,PROPERTY_TITLE
403 for (size_t nPos = 0; nPos < sizeof(s_pProperties)/sizeof(s_pProperties[0]) ;++nPos )
405 aValue.Name = s_pProperties[nPos];
406 aNewProps.push_back(aValue);
409 return aNewProps.empty() ? uno::Sequence< beans::Property > () : uno::Sequence< beans::Property > (&(*aNewProps.begin()),aNewProps.size());
412 uno::Sequence< ::rtl::OUString > SAL_CALL DataProviderHandler::getSupersededProperties() throw (uno::RuntimeException)
414 uno::Sequence< ::rtl::OUString > aRet(1);
415 aRet[0] = PROPERTY_TITLE; // have a look at OPropertyInfoService::getExcludeProperties
416 return aRet;
419 uno::Sequence< ::rtl::OUString > SAL_CALL DataProviderHandler::getActuatingProperties() throw (uno::RuntimeException)
421 ::osl::MutexGuard aGuard( m_aMutex );
423 uno::Sequence< ::rtl::OUString > aSeq(1);
424 aSeq[0] = PROPERTY_TITLE;
425 return ::comphelper::concatSequences(m_xFormComponentHandler->getActuatingProperties(),aSeq);
428 ::sal_Bool SAL_CALL DataProviderHandler::isComposable( const ::rtl::OUString& _rPropertyName ) throw (uno::RuntimeException, beans::UnknownPropertyException)
430 return m_pInfoService->isComposable( _rPropertyName, m_xFormComponentHandler );
433 inspection::InteractiveSelectionResult SAL_CALL DataProviderHandler::onInteractivePropertySelection(const ::rtl::OUString & PropertyName, ::sal_Bool Primary, uno::Any & out_Data, const uno::Reference< inspection::XObjectInspectorUI > & _rxInspectorUI) throw (uno::RuntimeException, beans::UnknownPropertyException, lang::NullPointerException)
435 if ( !_rxInspectorUI.is() )
436 throw lang::NullPointerException();
438 inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled;
439 ::osl::ClearableMutexGuard aGuard( m_aMutex );
441 const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
442 switch(nId)
444 case PROPERTY_ID_CHARTTYPE:
445 if ( impl_dialogChartType_nothrow(aGuard) )
446 eResult = inspection::InteractiveSelectionResult_ObtainedValue;
447 break;
448 case PROPERTY_ID_MASTERFIELDS:
449 case PROPERTY_ID_DETAILFIELDS:
450 if ( impl_dialogLinkedFields_nothrow( aGuard ) )
451 eResult = inspection::InteractiveSelectionResult_Success;
452 break;
453 default:
454 eResult = m_xFormComponentHandler->onInteractivePropertySelection(PropertyName, Primary, out_Data, _rxInspectorUI);
457 return eResult;
460 void SAL_CALL DataProviderHandler::actuatingPropertyChanged(const ::rtl::OUString & ActuatingPropertyName, const uno::Any & NewValue, const uno::Any & OldValue, const uno::Reference< inspection::XObjectInspectorUI > & InspectorUI, ::sal_Bool FirstTimeInit) throw (uno::RuntimeException, lang::NullPointerException)
462 ::osl::ClearableMutexGuard aGuard( m_aMutex );
464 if ( ActuatingPropertyName == PROPERTY_COMMAND )
466 if ( NewValue != OldValue )
468 uno::Reference< report::XReportDefinition> xReport = m_xReportComponent->getSection()->getReportDefinition();
469 bool bDoEnableMasterDetailFields = xReport.is() && xReport->getCommand().getLength() && m_xDataProvider->getCommand().getLength();
470 InspectorUI->enablePropertyUIElements( PROPERTY_DETAILFIELDS, inspection::PropertyLineElement::PrimaryButton, bDoEnableMasterDetailFields );
471 InspectorUI->enablePropertyUIElements( PROPERTY_MASTERFIELDS, inspection::PropertyLineElement::PrimaryButton, bDoEnableMasterDetailFields );
473 sal_Bool bModified = xReport->isModified();
474 // this fills the chart again
475 uno::Sequence< beans::PropertyValue > aArgs( 4 );
476 aArgs[0] = beans::PropertyValue(
477 ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
478 uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ), beans::PropertyState_DIRECT_VALUE );
479 aArgs[1] = beans::PropertyValue(
480 ::rtl::OUString::createFromAscii("HasCategories"), -1,
481 uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
482 aArgs[2] = beans::PropertyValue(
483 ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
484 uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
485 aArgs[3] = beans::PropertyValue(
486 ::rtl::OUString::createFromAscii("DataRowSource"), -1,
487 uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
488 uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xChartModel,uno::UNO_QUERY_THROW);
489 xReceiver->setArguments( aArgs );
490 if ( !bModified )
491 xReport->setModified(sal_False);
492 } // if ( NewValue != OldValue )
493 m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, InspectorUI, FirstTimeInit);
494 } // if ( ActuatingPropertyName == PROPERTY_COMMAND )
495 else if ( ActuatingPropertyName == PROPERTY_TITLE )
497 if ( NewValue != OldValue )
498 impl_updateChartTitle_throw(NewValue);
500 else
502 const sal_Int32 nId = m_pInfoService->getPropertyId(ActuatingPropertyName);
503 switch(nId)
506 case PROPERTY_ID_MASTERFIELDS:
507 break;
508 case PROPERTY_ID_DETAILFIELDS:
509 break;
510 default:
511 m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, InspectorUI, FirstTimeInit);
516 ::sal_Bool SAL_CALL DataProviderHandler::suspend(::sal_Bool Suspend) throw (uno::RuntimeException)
518 return m_xFormComponentHandler->suspend(Suspend);
520 bool DataProviderHandler::impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
522 uno::Sequence<uno::Any> aSeq(6);
523 beans::PropertyValue aParam;
524 aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
525 aParam.Value <<= m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow")));
526 aSeq[0] <<= aParam;
527 aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Detail"));
528 aParam.Value <<= m_xDataProvider;
529 aSeq[1] <<= aParam;
530 aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Master"));
531 aParam.Value <<= m_xReportComponent->getSection()->getReportDefinition();
532 aSeq[2] <<= aParam;
534 aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Explanation"));
535 aParam.Value <<= ::rtl::OUString(String(ModuleRes(RID_STR_EXPLANATION)));
536 aSeq[3] <<= aParam;
537 aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DetailLabel"));
538 aParam.Value <<= ::rtl::OUString(String(ModuleRes(RID_STR_DETAILLABEL)));
539 aSeq[4] <<= aParam;
540 aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MasterLabel"));
541 aParam.Value <<= ::rtl::OUString(String(ModuleRes(RID_STR_MASTERLABEL)));
542 aSeq[5] <<= aParam;
544 uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
545 m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
546 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.form.ui.MasterDetailLinkDialog")),aSeq
547 , m_xContext), uno::UNO_QUERY);
549 _rClearBeforeDialog.clear();
550 return ( xDialog->execute() != 0 );
552 // -----------------------------------------------------------------------------
553 bool DataProviderHandler::impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
555 uno::Sequence<uno::Any> aSeq(2);
556 beans::PropertyValue aParam;
557 aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
558 aParam.Value <<= m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow")));
559 aSeq[0] <<= aParam;
560 aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ChartModel"));
561 aParam.Value <<= m_xChartModel;
562 aSeq[1] <<= aParam;
564 uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
565 m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
566 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.ChartTypeDialog")),aSeq
567 , m_xContext), uno::UNO_QUERY);
569 _rClearBeforeDialog.clear();
570 return ( xDialog->execute() != 0 );
572 //........................................................................
573 } // namespace rptui
574 //........................................................................