From 025ac02182d28bda568e9119f6a003a1931a9ed8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 20 Sep 2010 22:53:54 +0200 Subject: dba33j: #i114438# --- .../source/filter/xml/xmlImportDocumentHandler.cxx | 38 +++++++++------------- .../source/filter/xml/xmlImportDocumentHandler.hxx | 1 + 2 files changed, 16 insertions(+), 23 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index c92eecc1084d..f51cb61fac34 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -56,8 +57,9 @@ using namespace ::xmloff::token; ::rtl::OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,const xmloff::token::XMLTokenEnum& _eAttribute); -ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context) : - m_xContext(context) +ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context) + :m_xContext(context) + ,m_bImportedChart( false ) { } // ----------------------------------------------------------------------------- @@ -121,35 +123,24 @@ void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException, { m_xDelegatee->endDocument(); uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW); - if ( xReceiver.is() ) + if ( xReceiver.is() && m_bImportedChart ) { // this fills the chart again - uno::Sequence< beans::PropertyValue > aArgs( 4 ); - aArgs[0] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1, - uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ), beans::PropertyState_DIRECT_VALUE ); - aArgs[1] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("HasCategories"), -1, - uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE ); - aArgs[2] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1, - uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE ); - aArgs[3] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("DataRowSource"), -1, - uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE ); + ::comphelper::NamedValueCollection aArgs; + aArgs.put( "CellRangeRepresentation", ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ); + aArgs.put( "HasCategories", uno::makeAny( sal_True ) ); + aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) ); + aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) ); uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xModel->getDataProvider(),uno::UNO_QUERY); if ( xDataProvider.is() ) { - aArgs.realloc(5); - uno::Sequence< uno::Sequence< ::rtl::OUString > > aColumnNames = xDataProvider->getComplexColumnDescriptions(); - aArgs[4] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("ComplexColumnDescriptions"), -1, - uno::makeAny( aColumnNames ), beans::PropertyState_DIRECT_VALUE ); + const uno::Sequence< uno::Sequence< ::rtl::OUString > > aColumnNames = xDataProvider->getComplexColumnDescriptions(); + aArgs.put( "ComplexColumnDescriptions", uno::makeAny( aColumnNames ) ); } - xReceiver->attachDataProvider(m_xDatabaseDataProvider.get()); - xReceiver->setArguments( aArgs ); + xReceiver->attachDataProvider( m_xDatabaseDataProvider.get() ); + xReceiver->setArguments( aArgs.getPropertyValues() ); } } @@ -204,6 +195,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName } m_xDelegatee->startElement(lcl_createAttribute(XML_NP_OFFICE,XML_CHART),NULL); bExport = false; + m_bImportedChart = true; } else if ( _sName.equalsAscii("rpt:master-detail-field") ) { diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx index 3f0fdebfc111..579a1b79b231 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx @@ -85,6 +85,7 @@ private: virtual ~ImportDocumentHandler(); ::osl::Mutex m_aMutex; + bool m_bImportedChart; ::std::vector< ::rtl::OUString> m_aMasterFields; ::std::vector< ::rtl::OUString> m_aDetailFields; ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aArguments; -- cgit From 92d7b814a60064540ff096b63646cc776331404e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 21 Sep 2010 15:06:05 +0200 Subject: dba34a: WaE --- reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index f51cb61fac34..8d198eb493c6 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -58,8 +58,8 @@ using namespace ::xmloff::token; ::rtl::OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,const xmloff::token::XMLTokenEnum& _eAttribute); ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context) - :m_xContext(context) - ,m_bImportedChart( false ) + :m_bImportedChart( false ) + ,m_xContext(context) { } // ----------------------------------------------------------------------------- -- cgit From baf8bc67f0e2dd2c583b3759351ed94c1521f3e0 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 23 Sep 2010 13:02:51 +0200 Subject: dba34a: #i114671# --- reportdesign/source/ui/report/ReportController.cxx | 183 ++++++++++----------- 1 file changed, 86 insertions(+), 97 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 6d13804fe7fa..4ed0e3cd2842 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -984,37 +984,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); ::osl::MutexGuard aGuard( getMutex() ); - if ( !getView() ) - { - switch(_nId) - { - case SID_RULER: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bShowRuler; - break; - case SID_HELPLINES_MOVE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bHelplinesMove; - break; - case SID_GRID_VISIBLE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bGridVisible; - break; - case SID_SHOW_PROPERTYBROWSER: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bShowProperties; - break; - case SID_PROPERTYBROWSER_LAST_PAGE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_sLastActivePage; - break; - case SID_SPLIT_POSITION: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_nSplitPos; - break; - } - return; // return without execution - } + sal_Bool bForceBroadcast = sal_False; switch(_nId) { @@ -1686,6 +1656,7 @@ short OReportController::saveModified() { return RET_NO; } + // ----------------------------------------------------------------------------- void OReportController::impl_initialize( ) { @@ -1783,7 +1754,7 @@ void OReportController::impl_initialize( ) } catch(const SQLException&) { - OSL_ENSURE(sal_False, "OReportController::initialize: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } } // ----------------------------------------------------------------------------- @@ -2745,35 +2716,38 @@ void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference TStringIntPair; - const TStringIntPair pViewDataList[] = + + sal_Int32 nCommandIDs[] = { - TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridVisible")), SID_GRID_VISIBLE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridUse")), SID_GRID_USE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelplinesMove")), SID_HELPLINES_MOVE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowRuler")), SID_RULER) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlProperties")), SID_SHOW_PROPERTYBROWSER) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LastPropertyBrowserPage")),SID_PROPERTYBROWSER_LAST_PAGE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SplitPosition")), SID_SPLIT_POSITION) + SID_GRID_VISIBLE, + SID_GRID_USE, + SID_HELPLINES_MOVE, + SID_RULER, + SID_SHOW_PROPERTYBROWSER, + SID_PROPERTYBROWSER_LAST_PAGE, + SID_SPLIT_POSITION }; - uno::Sequence aCommandProps(sizeof(pViewDataList)/sizeof(pViewDataList[0])); - beans::PropertyValue* pIter = aCommandProps.getArray(); - beans::PropertyValue* pEnd = pIter + aCommandProps.getLength(); - for (sal_Int32 i = 0; pIter != pEnd; ++pIter,++i) + ::comphelper::NamedValueCollection aCommandProperties; + for ( size_t i=0; i < sizeof( nCommandIDs ) / sizeof( nCommandIDs[0] ); ++i ) { - FeatureState aFeatureState = GetState(pViewDataList[i].second); - pIter->Name = pViewDataList[i].first; + const FeatureState aFeatureState = GetState( nCommandIDs[i] ); + + ::rtl::OUString sCommandURL( getURLForId( nCommandIDs[i] ).Main ); + OSL_ENSURE( sCommandURL.indexOfAsciiL( ".uno:", 5 ) == 0, "OReportController::getViewData: illegal command URL!" ); + sCommandURL = sCommandURL.copy( 5 ); + + Any aCommandState; if ( !!aFeatureState.bChecked ) - pIter->Value <<= (*aFeatureState.bChecked) ? sal_True : sal_False; + aCommandState <<= (*aFeatureState.bChecked) ? sal_True : sal_False; else if ( aFeatureState.aValue.hasValue() ) - pIter->Value = aFeatureState.aValue; + aCommandState = aFeatureState.aValue; - } // for (; pIter != pEnd; ++pIter) + aCommandProperties.put( sCommandURL, aCommandState ); + } - uno::Sequence aProps(1); - aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandProperties")); - aProps[0].Value <<= aCommandProps; + ::comphelper::NamedValueCollection aViewData; + aViewData.put( "CommandProperties", aCommandProperties.getPropertyValues() ); if ( getDesignView() ) { @@ -2790,68 +2764,83 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept pCollapsedIter->Name = PROPERTY_SECTION + ::rtl::OUString::valueOf(i); pCollapsedIter->Value <<= static_cast(*aIter); } - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CollapsedSections")); - aProps[nCount].Value <<= aCollapsedSections; + + aViewData.put( "CollapsedSections", aCollapsedSections ); } ::boost::shared_ptr pSectionWindow = getDesignView()->getMarkedSection(); if ( pSectionWindow.get() ) { - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MarkedSection")); - aProps[nCount].Value <<= (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum(); + aViewData.put( "MarkedSection", (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum() ); } // if ( pSectionWindow.get() ) } // if ( getDesignView() ) - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomFactor")); - aProps[nCount].Value <<= m_nZoomValue; - return uno::makeAny(aProps); + + aViewData.put( "ZoomFactor", m_nZoomValue ); + return uno::makeAny( aViewData.getPropertyValues() ); } // ----------------------------------------------------------------------------- -void SAL_CALL OReportController::restoreViewData(const uno::Any& Data) throw( uno::RuntimeException ) +void SAL_CALL OReportController::restoreViewData(const uno::Any& i_data) throw( uno::RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); - uno::Sequence aProps; - if ( Data >>= aProps ) + + try { - const beans::PropertyValue* pPropsIter = aProps.getConstArray(); - const beans::PropertyValue* pPropsEnd = pPropsIter + aProps.getLength(); - for (sal_Int32 i = 0; pPropsIter != pPropsEnd; ++pPropsIter,++i) + const ::comphelper::NamedValueCollection aViewData( i_data ); + + m_aCollapsedSections = aViewData.getOrDefault( "CollapsedSections", m_aCollapsedSections ); + m_nPageNum = aViewData.getOrDefault( "MarkedSection", m_nPageNum ); + m_nZoomValue = aViewData.getOrDefault( "ZoomFactor", m_nZoomValue ); + // TODO: setting those 3 members is not enough - in theory, restoreViewData can be called when the + // view is fully alive, so we need to reflect those 3 values in the view. + // (At the moment, the method is called only during construction phase) + + + ::comphelper::NamedValueCollection aCommandProperties( aViewData.get( "CommandProperties" ) ); + const ::std::vector< ::rtl::OUString > aCommandNames( aCommandProperties.getNames() ); + + for ( ::std::vector< ::rtl::OUString >::const_iterator commandName = aCommandNames.begin(); + commandName != aCommandNames.end(); + ++commandName + ) { - if ( pPropsIter->Name.equalsAscii("CommandProperties") ) + const Any& rCommandValue = aCommandProperties.get( *commandName ); + if ( !rCommandValue.hasValue() ) + continue; + + if ( getView() ) { util::URL aCommand; - uno::Sequence< beans::PropertyValue> aArgs(1); - beans::PropertyValue* pArg = aArgs.getArray(); - pArg->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); - uno::Sequence< beans::PropertyValue> aCommandProps; - if ( pPropsIter->Value >>= aCommandProps ) - { - const beans::PropertyValue* pIter = aCommandProps.getConstArray(); - const beans::PropertyValue* pEnd = pIter + aCommandProps.getLength(); - for (; pIter != pEnd; ++pIter) - { - pArg->Value = pIter->Value; - if ( pArg->Value.hasValue() ) - { - aCommand.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:")) + pIter->Name; - executeUnChecked(aCommand,aArgs); - } - } - } + aCommand.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ) ) + *commandName; + + Sequence< PropertyValue > aCommandArgs(1); + aCommandArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) ); + aCommandArgs[0].Value = rCommandValue; + + executeUnChecked( aCommand, aCommandArgs ); + } + else + { + if ( commandName->equalsAscii( "ShowRuler" ) ) + OSL_VERIFY( rCommandValue >>= m_bShowRuler ); + else if ( commandName->equalsAscii( "HelplinesMove" ) ) + OSL_VERIFY( rCommandValue >>= m_bHelplinesMove ); + else if ( commandName->equalsAscii( "GridVisible" ) ) + OSL_VERIFY( rCommandValue >>= m_bGridVisible ); + else if ( commandName->equalsAscii( "GridUse" ) ) + OSL_VERIFY( rCommandValue >>= m_bGridUse ); + else if ( commandName->equalsAscii( "ControlProperties" ) ) + OSL_VERIFY( rCommandValue >>= m_bShowProperties ); + else if ( commandName->equalsAscii( "LastPropertyBrowserPage" ) ) + OSL_VERIFY( rCommandValue >>= m_sLastActivePage ); + else if ( commandName->equalsAscii( "SplitPosition" ) ) + OSL_VERIFY( rCommandValue >>= m_nSplitPos ); } - else if ( pPropsIter->Name.equalsAscii("CollapsedSections") ) - pPropsIter->Value >>= m_aCollapsedSections; - else if ( pPropsIter->Name.equalsAscii("MarkedSection") ) - pPropsIter->Value >>= m_nPageNum; - else if ( pPropsIter->Name.equalsAscii("ZoomFactor") ) - pPropsIter->Value >>= m_nZoomValue; } } + catch ( const IllegalArgumentException& e ) + { + DBG_UNHANDLED_EXCEPTION(); + } } // ----------------------------------------------------------------------------- void OReportController::updateFloater() -- cgit From ff043badc9a6254e70677f9266309deae4aa3780 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 24 Sep 2010 09:36:58 +0200 Subject: dba34a: #i114698# allow for property change notifications for properties which do not exist as real property, but as attribute only --- reportdesign/source/core/sdr/UndoEnv.cxx | 110 ++++++++++++++++++++++++++----- 1 file changed, 93 insertions(+), 17 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx index 911279ed6f71..f4dd0a7f8645 100644 --- a/reportdesign/source/core/sdr/UndoEnv.cxx +++ b/reportdesign/source/core/sdr/UndoEnv.cxx @@ -44,12 +44,15 @@ #include #include #include +#include +#include /** === end UNO includes === **/ #include #include #include #include +#include #include #include #include @@ -69,8 +72,36 @@ namespace rptui //---------------------------------------------------------------------------- -DECLARE_STL_USTRINGACCESS_MAP(bool, AllProperties); -DECLARE_STL_STDKEY_MAP(uno::Reference< beans::XPropertySet >, AllProperties, PropertySetInfoCache); +struct PropertyInfo +{ + bool bIsReadonlyOrTransient; + + PropertyInfo() + :bIsReadonlyOrTransient( false ) + { + } + + PropertyInfo( const bool i_bIsTransientOrReadOnly ) + :bIsReadonlyOrTransient( i_bIsTransientOrReadOnly ) + { + } +}; + +typedef ::std::hash_map< ::rtl::OUString, PropertyInfo, ::rtl::OUStringHash > PropertiesInfo; + +struct ObjectInfo +{ + PropertiesInfo aProperties; + Reference< XPropertySet > xPropertyIntrospection; + + ObjectInfo() + :aProperties() + ,xPropertyIntrospection() + { + } +}; + +typedef ::std::map< Reference< XPropertySet >, ObjectInfo, ::comphelper::OInterfaceCompare< XPropertySet > > PropertySetInfoCache; // ----------------------------------------------------------------------------- @@ -85,6 +116,7 @@ public: ConditionUpdater m_aConditionUpdater; ::osl::Mutex m_aMutex; ::std::vector< uno::Reference< container::XChild> > m_aSections; + Reference< XIntrospection > m_xIntrospection; oslInterlockedCount m_nLocks; sal_Bool m_bReadOnly; sal_Bool m_bIsUndo; @@ -154,7 +186,7 @@ void OXUndoEnvironment::Clear(const Accessor& /*_r*/) { uno::Reference xProp(aIter->first,uno::UNO_QUERY); xProp->getPropertySetInfo(); - int nlen = aIter->second.size(); + int nlen = aIter->second.aProperties.size(); nlen = nlen; } #endif @@ -240,29 +272,73 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv int nlen = m_pImpl->m_aPropertySetCache.size(); nlen = nlen; #endif - PropertySetInfoCache::iterator aSetPos = m_pImpl->m_aPropertySetCache.find(xSet); - if (aSetPos == m_pImpl->m_aPropertySetCache.end()) + PropertySetInfoCache::iterator objectPos = m_pImpl->m_aPropertySetCache.find(xSet); + if (objectPos == m_pImpl->m_aPropertySetCache.end()) { - AllProperties aNewEntry; - aSetPos = m_pImpl->m_aPropertySetCache.insert(PropertySetInfoCache::value_type(xSet,aNewEntry)).first; - DBG_ASSERT(aSetPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); + objectPos = m_pImpl->m_aPropertySetCache.insert( PropertySetInfoCache::value_type( + xSet, ObjectInfo() + ) ).first; + DBG_ASSERT(objectPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); } - if ( aSetPos == m_pImpl->m_aPropertySetCache.end() ) + if ( objectPos == m_pImpl->m_aPropertySetCache.end() ) return; // now we have access to the cached info about the set // let's see what we know about the property - AllProperties& rPropInfos = aSetPos->second; - AllPropertiesIterator aPropertyPos = rPropInfos.find( _rEvent.PropertyName ); - if (aPropertyPos == rPropInfos.end()) + ObjectInfo& rObjectInfo = objectPos->second; + PropertiesInfo::iterator aPropertyPos = rObjectInfo.aProperties.find( _rEvent.PropertyName ); + if ( aPropertyPos == rObjectInfo.aProperties.end() ) { // nothing 'til now ... have to change this .... // the attributes - INT32 nAttributes = xSet->getPropertySetInfo()->getPropertyByName( _rEvent.PropertyName ).Attributes; - bool bTransReadOnly = ((nAttributes & PropertyAttribute::READONLY) != 0) || ((nAttributes & PropertyAttribute::TRANSIENT) != 0); + Reference< XPropertySetInfo > xPSI( xSet->getPropertySetInfo(), UNO_SET_THROW ); + INT32 nPropertyAttributes = 0; + try + { + if ( xPSI->hasPropertyByName( _rEvent.PropertyName ) ) + { + nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes; + } + else + { + // it's perfectly valid for a component to notify a change in a property which it doesn't have - as long + // as it has an attribute with this name + if ( !rObjectInfo.xPropertyIntrospection.is() ) + { + if ( !m_pImpl->m_xIntrospection.is() ) + { + ::comphelper::ComponentContext aContext( m_pImpl->m_rModel.getController()->getORB() ); + OSL_VERIFY( aContext.createComponent( "com.sun.star.beans.Introspection", m_pImpl->m_xIntrospection ) ); + } + if ( m_pImpl->m_xIntrospection.is() ) + { + Reference< XIntrospectionAccess > xIntrospection( + m_pImpl->m_xIntrospection->inspect( makeAny( _rEvent.Source ) ), + UNO_SET_THROW + ); + rObjectInfo.xPropertyIntrospection.set( xIntrospection->queryAdapter( XPropertySet::static_type() ), UNO_QUERY_THROW ); + } + } + if ( rObjectInfo.xPropertyIntrospection.is() ) + { + xPSI.set( rObjectInfo.xPropertyIntrospection->getPropertySetInfo(), UNO_SET_THROW ); + nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes; + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + const bool bTransReadOnly = + ( ( nPropertyAttributes & PropertyAttribute::READONLY ) != 0 ) + || ( ( nPropertyAttributes & PropertyAttribute::TRANSIENT ) != 0 ); // insert the new entry - aPropertyPos = rPropInfos.insert( AllProperties::value_type( _rEvent.PropertyName, bTransReadOnly ) ).first; - DBG_ASSERT(aPropertyPos != rPropInfos.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); + aPropertyPos = rObjectInfo.aProperties.insert( PropertiesInfo::value_type( + _rEvent.PropertyName, + PropertyInfo( bTransReadOnly ) + ) ).first; + DBG_ASSERT(aPropertyPos != rObjectInfo.aProperties.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); } implSetModified(); @@ -271,7 +347,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv // and are able to decide wether or not we need an undo action // no UNDO for transient/readonly properties - if ( aPropertyPos->second ) + if ( aPropertyPos->second.bIsReadonlyOrTransient ) return; // give components with sub responsibilities a chance -- cgit ue='libreoffice-24-8'>libreoffice-24-8 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2015-04-30Get rid of the initial :: for the vcl namespaceTor Lillqvist
2015-04-10toolkit: more VclPtr pieces.Michael Meeks
2015-04-01Replace remaining getCppuType et al with cppu::UnoTypeStephan Bergmann
2015-03-04V813: Decreased performanceCaolán McNamara
2015-02-16tdf#78174: toolkit: work around GCC 4.9 -Os link failureMichael Stahl
2015-01-08brute-force find-and-remove of unused #define constants.Noel Grandin
2014-12-12toolkit: Use appropriate OUString functions on string constantsStephan Bergmann
2014-12-08fdo#38835 strip out OUString globalsNoel Grandin
2014-09-30fdo#82577: Handle RegionNoel Grandin
2014-09-29toolkit: std::auto_ptr -> std::unique_ptrStephan Bergmann
2014-09-23fdo#82577: Handle WindowNoel Grandin
2014-09-18fdo#82577: Handle FontNoel Grandin
2014-09-12toolkit: sal_Bool -> boolStephan Bergmann
2014-08-07toolkit: export some ListenerMultiplexer typesMichael Stahl
2014-07-08use SimpleReferenceObject in svtools moduleNoel Grandin
2014-07-08use SimpleReferenceObject in accessibilityNoel Grandin
2014-06-05toolkit: remove SAL_THROW macroNoel Grandin
2014-06-04coverity#705388 Mixing enum typesCaolán McNamara
2014-04-19Move headers that are private to toolkit there, thenTor Lillqvist
2014-04-19If it has been "not recommended currently" since 2007, it can go awayTor Lillqvist
2014-03-26First batch of adding SAL_OVERRRIDE to overriding function declarationsStephan Bergmann
2014-03-10toolkit: simplify deprecated XTypeProvider.getImplementationIdStephan Bergmann
2014-03-01Remove visual noise from includeAlexander Wilms
2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann
2014-02-24toolkit: sal_Bool -> boolStephan Bergmann
2014-01-29bool improvementsStephan Bergmann
2014-01-23fdo#63154 Removed unused solar.h referenceAlexandre Vicenzi
2013-12-08Drop duplicate #includeTakeshi Abe
2013-11-15Remove unused parts of TkResMgrStephan Bergmann
2013-11-09fdo#65108 inter-module includes <> include/toolkitNorbert Thiebaud
2013-10-23fixincludeguards.sh: include/{toolkit,tools}Thomas Arnhold
2013-08-10callcatcher: update unused codeCaolán McNamara
2013-08-04fdo#67235 adapt form control code to time nanosecond API change, step 3Lionel Elie Mamane
2013-08-02fdo#67235 adapt form control code to time nanosecond API changeLionel Elie Mamane
2013-07-05Related: #i121514# Remove deprecated UnoControlSimpleAnimationAriel Constenla-Haile
2013-07-05Related: #i121513# Remove deprecated UnoControlThrobberModelAriel Constenla-Haile
2013-06-23Resolves: #i121542# Unify the Menu APIAriel Constenla-Haile
2013-06-04include: convert <type> here tooMichael Stahl
2013-05-15These functions can throw RuntimeExceptionStephan Bergmann
2013-04-23execute move of global headersBjoern Michaelsen