1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DataProviderHandler.cxx,v $
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 //........................................................................
67 //........................................................................
68 using namespace ::com::sun::star
;
70 DataProviderHandler::DataProviderHandler(uno::Reference
< uno::XComponentContext
> const & context
)
71 :DataProviderHandler_Base(m_aMutex
)
73 ,m_pInfoService( new OPropertyInfoService() )
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"));
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 TPropertyNamePair aPropertyMediation
;
167 aPropertyMediation
.insert( TPropertyNamePair::value_type( PROPERTY_MASTERFIELDS
, PROPERTY_MASTERFIELDS
) );
168 aPropertyMediation
.insert( TPropertyNamePair::value_type( PROPERTY_DETAILFIELDS
, PROPERTY_DETAILFIELDS
) );
170 m_xMasterDetails
= new OPropertyMediator( m_xDataProvider
.get(), m_xReportComponent
.get(), aPropertyMediation
,sal_True
);
173 //const ::rtl::OUString sRowSet(RTL_CONSTASCII_USTRINGPARAM("RowSet"));
174 //if ( xNameCont->hasByName(sRowSet) )
176 // uno::Reference<beans::XPropertySet> xProp(m_xFormComponentHandler,uno::UNO_QUERY);
177 // xProp->setPropertyValue(sRowSet,xNameCont->getByName(sRowSet));
180 catch(uno::Exception
)
182 throw lang::NullPointerException();
184 if ( m_xFormComponent
.is() )
186 m_xFormComponentHandler
->inspect(m_xFormComponent
);
190 uno::Any SAL_CALL
DataProviderHandler::getPropertyValue(const ::rtl::OUString
& PropertyName
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
192 ::osl::MutexGuard
aGuard( m_aMutex
);
193 uno::Any aPropertyValue
;
194 const sal_Int32 nId
= m_pInfoService
->getPropertyId(PropertyName
);
197 case PROPERTY_ID_CHARTTYPE
:
198 // TODO: We need a possiblity to get the UI of the selected chart type
199 //if( m_xChartModel.is() )
201 // uno::Reference< chart2::XDiagram > xDiagram( m_xChartModel->getFirstDiagram() );
202 // if( xDiagram.is() )
204 // ::rtl::OUString sChartTypes;
205 // uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
206 // const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
207 // const uno::Reference< chart2::XCoordinateSystem >* pIter = aCooSysSeq.getConstArray();
208 // const uno::Reference< chart2::XCoordinateSystem >* pEnd = pIter + aCooSysSeq.getLength();
209 // for(;pIter != pEnd;++pIter)
211 // const uno::Reference< chart2::XChartTypeContainer > xCTCnt( *pIter, uno::UNO_QUERY_THROW );
212 // const uno::Sequence< uno::Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes());
213 // const uno::Reference< chart2::XChartType >* pChartTypeIter = aCTSeq.getConstArray();
214 // const uno::Reference< chart2::XChartType >* pChartTypeEnd = pChartTypeIter + aCTSeq.getLength();
215 // for(;pChartTypeIter != pChartTypeEnd;++pChartTypeIter)
217 // sChartTypes += (*pChartTypeIter)->getChartType();
218 // sChartTypes += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
221 // aPropertyValue;// <<= sChartTypes;
225 case PROPERTY_ID_PREVIEW_COUNT
:
226 aPropertyValue
<<= m_xDataProvider
->getRowLimit();
229 aPropertyValue
= m_xFormComponentHandler
->getPropertyValue( PropertyName
);
232 return aPropertyValue
;
235 void SAL_CALL
DataProviderHandler::setPropertyValue(const ::rtl::OUString
& PropertyName
, const uno::Any
& Value
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
237 ::osl::MutexGuard
aGuard( m_aMutex
);
238 uno::Any aPropertyValue
;
239 const sal_Int32 nId
= m_pInfoService
->getPropertyId(PropertyName
);
242 case PROPERTY_ID_CHARTTYPE
:
244 case PROPERTY_ID_PREVIEW_COUNT
:
245 m_xDataProvider
->setPropertyValue(PropertyName
,Value
);
248 m_xFormComponentHandler
->setPropertyValue(PropertyName
, Value
);
252 // -----------------------------------------------------------------------------
253 void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any
& _aValue
)
255 uno::Reference
<chart2::XTitled
> xTitled(m_xChartModel
,uno::UNO_QUERY
);
258 uno::Reference
<chart2::XTitle
> xTitle
= xTitled
->getTitleObject();
261 xTitle
.set(m_xContext
->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.Title")),m_xContext
),uno::UNO_QUERY
);
262 xTitled
->setTitleObject(xTitle
);
266 uno::Reference
< chart2::XFormattedString
> xFormatted(m_xContext
->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.FormattedString")),m_xContext
),uno::UNO_QUERY
);
267 ::rtl::OUString sStr
;
269 xFormatted
->setString(sStr
);
270 uno::Sequence
< uno::Reference
< chart2::XFormattedString
> > aArgs(1);
271 aArgs
[0] = xFormatted
;
272 xTitle
->setText(aArgs
);
274 } // if ( xTitled.is() )
277 beans::PropertyState SAL_CALL
DataProviderHandler::getPropertyState(const ::rtl::OUString
& PropertyName
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
279 return m_xFormComponentHandler
->getPropertyState(PropertyName
);
282 inspection::LineDescriptor SAL_CALL
DataProviderHandler::describePropertyLine(const ::rtl::OUString
& PropertyName
, const uno::Reference
< inspection::XPropertyControlFactory
> & _xControlFactory
) throw (beans::UnknownPropertyException
, lang::NullPointerException
,uno::RuntimeException
)
284 inspection::LineDescriptor aOut
;
285 const sal_Int32 nId
= m_pInfoService
->getPropertyId(PropertyName
);
288 case PROPERTY_ID_CHARTTYPE
:
289 aOut
.PrimaryButtonId
= UID_RPT_PROP_CHARTTYPE_DLG
;
290 aOut
.Control
= _xControlFactory
->createPropertyControl(inspection::PropertyControlType::TextField
, sal_True
);
291 aOut
.HasPrimaryButton
= sal_True
;
293 case PROPERTY_ID_PREVIEW_COUNT
:
294 aOut
.Control
= _xControlFactory
->createPropertyControl(inspection::PropertyControlType::NumericField
, sal_False
);
296 case PROPERTY_ID_MASTERFIELDS
:
297 case PROPERTY_ID_DETAILFIELDS
:
298 aOut
.Control
= _xControlFactory
->createPropertyControl(inspection::PropertyControlType::StringListField
, sal_False
);
299 aOut
.PrimaryButtonId
= UID_RPT_PROP_DLG_LINKFIELDS
;
300 aOut
.HasPrimaryButton
= sal_True
;
303 aOut
= m_xFormComponentHandler
->describePropertyLine(PropertyName
, _xControlFactory
);
307 aOut
.Category
= ((m_pInfoService
->getPropertyUIFlags(nId
) & PROP_FLAG_DATA_PROPERTY
) != 0) ?
308 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"))
310 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("General"));
311 aOut
.HelpURL
= HelpIdUrl::getHelpURL( m_pInfoService
->getPropertyHelpId( nId
) );
312 aOut
.DisplayName
= m_pInfoService
->getPropertyTranslation(nId
);
317 uno::Any SAL_CALL
DataProviderHandler::convertToPropertyValue(const ::rtl::OUString
& _rPropertyValue
, const uno::Any
& _rControlValue
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
319 ::osl::MutexGuard
aGuard( m_aMutex
);
320 uno::Any
aPropertyValue( _rControlValue
);
321 const sal_Int32 nId
= m_pInfoService
->getPropertyId(_rPropertyValue
);
324 case PROPERTY_ID_CHARTTYPE
:
326 case PROPERTY_ID_PREVIEW_COUNT
:
329 aPropertyValue
= m_xTypeConverter
->convertTo( _rControlValue
, ::getCppuType((const sal_Int32
*)0));
331 catch( const uno::Exception
& )
333 OSL_ENSURE( sal_False
, "DataProviderHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
336 case PROPERTY_ID_MASTERFIELDS
:
337 case PROPERTY_ID_DETAILFIELDS
:
340 aPropertyValue
= m_xFormComponentHandler
->convertToPropertyValue(_rPropertyValue
, _rControlValue
);
342 return aPropertyValue
;
345 uno::Any SAL_CALL
DataProviderHandler::convertToControlValue(const ::rtl::OUString
& _rPropertyName
, const uno::Any
& _rPropertyValue
, const uno::Type
& ControlValueType
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
347 uno::Any
aControlValue( _rPropertyValue
);
348 if ( !aControlValue
.hasValue() )
349 // NULL is converted to NULL
350 return aControlValue
;
352 ::osl::MutexGuard
aGuard( m_aMutex
);
353 const sal_Int32 nId
= m_pInfoService
->getPropertyId(_rPropertyName
);
356 case PROPERTY_ID_CHARTTYPE
:
358 case PROPERTY_ID_MASTERFIELDS
:
359 case PROPERTY_ID_DETAILFIELDS
:
360 case PROPERTY_ID_PREVIEW_COUNT
:
363 aControlValue
= m_xTypeConverter
->convertTo( _rPropertyValue
, ControlValueType
);
365 catch( const uno::Exception
& )
367 OSL_ENSURE( sal_False
, "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
371 aControlValue
= m_xFormComponentHandler
->convertToControlValue(_rPropertyName
, _rPropertyValue
, ControlValueType
);
373 return aControlValue
;
376 void SAL_CALL
DataProviderHandler::addPropertyChangeListener(const uno::Reference
< beans::XPropertyChangeListener
> & Listener
) throw (uno::RuntimeException
, lang::NullPointerException
)
378 m_xFormComponentHandler
->addPropertyChangeListener(Listener
);
381 void SAL_CALL
DataProviderHandler::removePropertyChangeListener(const uno::Reference
< beans::XPropertyChangeListener
> & _rxListener
) throw (uno::RuntimeException
)
383 m_xFormComponentHandler
->removePropertyChangeListener(_rxListener
);
386 uno::Sequence
< beans::Property
> SAL_CALL
DataProviderHandler::getSupportedProperties() throw (uno::RuntimeException
)
388 ::std::vector
< beans::Property
> aNewProps
;
389 if( m_xChartModel
.is() )
391 m_pInfoService
->getExcludeProperties( aNewProps
, m_xFormComponentHandler
);
392 beans::Property aValue
;
393 static const ::rtl::OUString s_pProperties
[] =
396 ,PROPERTY_MASTERFIELDS
397 ,PROPERTY_DETAILFIELDS
398 ,PROPERTY_PREVIEW_COUNT
402 for (size_t nPos
= 0; nPos
< sizeof(s_pProperties
)/sizeof(s_pProperties
[0]) ;++nPos
)
404 aValue
.Name
= s_pProperties
[nPos
];
405 aNewProps
.push_back(aValue
);
408 return aNewProps
.empty() ? uno::Sequence
< beans::Property
> () : uno::Sequence
< beans::Property
> (&(*aNewProps
.begin()),aNewProps
.size());
411 uno::Sequence
< ::rtl::OUString
> SAL_CALL
DataProviderHandler::getSupersededProperties() throw (uno::RuntimeException
)
413 uno::Sequence
< ::rtl::OUString
> aRet(1);
414 aRet
[0] = PROPERTY_TITLE
; // have a look at OPropertyInfoService::getExcludeProperties
418 uno::Sequence
< ::rtl::OUString
> SAL_CALL
DataProviderHandler::getActuatingProperties() throw (uno::RuntimeException
)
420 ::osl::MutexGuard
aGuard( m_aMutex
);
422 uno::Sequence
< ::rtl::OUString
> aSeq(1);
423 aSeq
[0] = PROPERTY_TITLE
;
424 return ::comphelper::concatSequences(m_xFormComponentHandler
->getActuatingProperties(),aSeq
);
427 ::sal_Bool SAL_CALL
DataProviderHandler::isComposable( const ::rtl::OUString
& _rPropertyName
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
429 return m_pInfoService
->isComposable( _rPropertyName
, m_xFormComponentHandler
);
432 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
)
434 if ( !_rxInspectorUI
.is() )
435 throw lang::NullPointerException();
437 inspection::InteractiveSelectionResult eResult
= inspection::InteractiveSelectionResult_Cancelled
;
438 ::osl::ClearableMutexGuard
aGuard( m_aMutex
);
440 const sal_Int32 nId
= m_pInfoService
->getPropertyId(PropertyName
);
443 case PROPERTY_ID_CHARTTYPE
:
444 if ( impl_dialogChartType_nothrow(aGuard
) )
445 eResult
= inspection::InteractiveSelectionResult_ObtainedValue
;
447 case PROPERTY_ID_MASTERFIELDS
:
448 case PROPERTY_ID_DETAILFIELDS
:
449 if ( impl_dialogLinkedFields_nothrow( aGuard
) )
450 eResult
= inspection::InteractiveSelectionResult_Success
;
453 eResult
= m_xFormComponentHandler
->onInteractivePropertySelection(PropertyName
, Primary
, out_Data
, _rxInspectorUI
);
459 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
)
461 ::osl::ClearableMutexGuard
aGuard( m_aMutex
);
463 if ( ActuatingPropertyName
== PROPERTY_COMMAND
)
465 if ( NewValue
!= OldValue
)
467 uno::Reference
< report::XReportDefinition
> xReport
= m_xReportComponent
->getSection()->getReportDefinition();
468 bool bDoEnableMasterDetailFields
= xReport
.is() && xReport
->getCommand().getLength() && m_xDataProvider
->getCommand().getLength();
469 InspectorUI
->enablePropertyUIElements( PROPERTY_DETAILFIELDS
, inspection::PropertyLineElement::PrimaryButton
, bDoEnableMasterDetailFields
);
470 InspectorUI
->enablePropertyUIElements( PROPERTY_MASTERFIELDS
, inspection::PropertyLineElement::PrimaryButton
, bDoEnableMasterDetailFields
);
472 sal_Bool bModified
= xReport
->isModified();
473 // this fills the chart again
474 uno::Sequence
< beans::PropertyValue
> aArgs( 4 );
475 aArgs
[0] = beans::PropertyValue(
476 ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
477 uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ), beans::PropertyState_DIRECT_VALUE
);
478 aArgs
[1] = beans::PropertyValue(
479 ::rtl::OUString::createFromAscii("HasCategories"), -1,
480 uno::makeAny( sal_True
), beans::PropertyState_DIRECT_VALUE
);
481 aArgs
[2] = beans::PropertyValue(
482 ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
483 uno::makeAny( sal_True
), beans::PropertyState_DIRECT_VALUE
);
484 aArgs
[3] = beans::PropertyValue(
485 ::rtl::OUString::createFromAscii("DataRowSource"), -1,
486 uno::makeAny( chart::ChartDataRowSource_COLUMNS
), beans::PropertyState_DIRECT_VALUE
);
487 uno::Reference
< chart2::data::XDataReceiver
> xReceiver(m_xChartModel
,uno::UNO_QUERY_THROW
);
488 xReceiver
->setArguments( aArgs
);
490 xReport
->setModified(sal_False
);
492 } // if ( ActuatingPropertyName == PROPERTY_COMMAND )
493 else if ( ActuatingPropertyName
== PROPERTY_TITLE
)
495 if ( NewValue
!= OldValue
)
496 impl_updateChartTitle_throw(NewValue
);
500 const sal_Int32 nId
= m_pInfoService
->getPropertyId(ActuatingPropertyName
);
504 case PROPERTY_ID_MASTERFIELDS
:
506 case PROPERTY_ID_DETAILFIELDS
:
509 m_xFormComponentHandler
->actuatingPropertyChanged(ActuatingPropertyName
, NewValue
, OldValue
, InspectorUI
, FirstTimeInit
);
514 ::sal_Bool SAL_CALL
DataProviderHandler::suspend(::sal_Bool Suspend
) throw (uno::RuntimeException
)
516 return m_xFormComponentHandler
->suspend(Suspend
);
518 bool DataProviderHandler::impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
520 uno::Sequence
<uno::Any
> aSeq(6);
521 beans::PropertyValue aParam
;
522 aParam
.Name
= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
523 aParam
.Value
<<= m_xContext
->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow")));
525 aParam
.Name
= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Detail"));
526 aParam
.Value
<<= m_xDataProvider
;
528 aParam
.Name
= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Master"));
529 aParam
.Value
<<= m_xReportComponent
->getSection()->getReportDefinition();
532 aParam
.Name
= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Explanation"));
533 aParam
.Value
<<= ::rtl::OUString(String(ModuleRes(RID_STR_EXPLANATION
)));
535 aParam
.Name
= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DetailLabel"));
536 aParam
.Value
<<= ::rtl::OUString(String(ModuleRes(RID_STR_DETAILLABEL
)));
538 aParam
.Name
= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MasterLabel"));
539 aParam
.Value
<<= ::rtl::OUString(String(ModuleRes(RID_STR_MASTERLABEL
)));
542 uno::Reference
< ui::dialogs::XExecutableDialog
> xDialog(
543 m_xContext
->getServiceManager()->createInstanceWithArgumentsAndContext(
544 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.form.ui.MasterDetailLinkDialog")),aSeq
545 , m_xContext
), uno::UNO_QUERY
);
547 _rClearBeforeDialog
.clear();
548 return ( xDialog
->execute() != 0 );
550 // -----------------------------------------------------------------------------
551 bool DataProviderHandler::impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
553 uno::Sequence
<uno::Any
> aSeq(2);
554 beans::PropertyValue aParam
;
555 aParam
.Name
= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
556 aParam
.Value
<<= m_xContext
->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow")));
558 aParam
.Name
= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ChartModel"));
559 aParam
.Value
<<= m_xChartModel
;
562 uno::Reference
< ui::dialogs::XExecutableDialog
> xDialog(
563 m_xContext
->getServiceManager()->createInstanceWithArgumentsAndContext(
564 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.ChartTypeDialog")),aSeq
565 , m_xContext
), uno::UNO_QUERY
);
567 _rClearBeforeDialog
.clear();
568 return ( xDialog
->execute() != 0 );
570 //........................................................................
572 //........................................................................