Tag: cws_src680_oj14 User: oj Date: 2007-05-18 12:18:47+0000 Modified: dba/reportdesign/source/core/api/Shape.cxx dba/reportdesign/source/core/inc/ReportHelperImpl.hxx dba/reportdesign/source/core/inc/Shape.hxx dba/reportdesign/source/ui/dlg/GroupsSorting.cxx dba/reportdesign/source/ui/misc/UITools.cxx
Log: #i77061# fill color can now be set File Changes: Directory: /dba/reportdesign/source/core/api/ ============================================= File [changed]: Shape.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/api/Shape.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +90 -13 --------------------- --- Shape.cxx 2007-05-09 13:51:34+0000 1.1.2.1 +++ Shape.cxx 2007-05-18 12:18:44+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: Shape.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/05/09 13:51:34 $ + * last change: $Author: oj $ $Date: 2007/05/18 12:18:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -76,12 +76,21 @@ // ============================================================================= using namespace com::sun::star; using namespace comphelper; -extern uno::Sequence< ::rtl::OUString > lcl_getFixedTextOptionals(); +uno::Sequence< ::rtl::OUString > lcl_getShapeOptionals() +{ + ::rtl::OUString pProps[] = { + PROPERTY_DATAFIELD + ,PROPERTY_CONTROLBACKGROUND + ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT + }; + return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0])); +} + DBG_NAME( rpt_OShape ) // ----------------------------------------------------------------------------- OShape::OShape(uno::Reference< uno::XComponentContext > const & _xContext) :ShapeBase(m_aMutex) -,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getFixedTextOptionals()) +,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getShapeOptionals()) ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext) ,m_nZOrder(0) { @@ -93,7 +102,7 @@ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory ,uno::Reference< drawing::XShape >& _xShape) :ShapeBase(m_aMutex) -,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getFixedTextOptionals()) +,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getShapeOptionals()) ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext) ,m_nZOrder(0) { @@ -182,40 +191,108 @@ // XReportComponent REPORTCOMPONENT_IMPL(OShape) REPORTCOMPONENT_IMPL2(OShape) -REPORTCONTROLFORMAT_IMPL(OShape,m_aProps.aFormatProperties) +REPORTCONTROLFORMAT_IMPL2(OShape,m_aProps.aFormatProperties) +// ----------------------------------------------------------------------------- +::sal_Int32 SAL_CALL OShape::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException) +{ + throw beans::UnknownPropertyException(); + return COL_TRANSPARENT; +} +// ----------------------------------------------------------------------------- +void SAL_CALL OShape::setControlBackground( ::sal_Int32 /*_backgroundcolor*/ ) throw (uno::RuntimeException,beans::UnknownPropertyException) +{ + throw beans::UnknownPropertyException(); +} +// ----------------------------------------------------------------------------- +::sal_Bool SAL_CALL OShape::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException) +{ + throw beans::UnknownPropertyException(); + return sal_False; +} +// ----------------------------------------------------------------------------- +void SAL_CALL OShape::setControlBackgroundTransparent( ::sal_Bool /*_controlbackgroundtransparent*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException) +{ + throw beans::UnknownPropertyException(); +} // ----------------------------------------------------------------------------- uno::Reference< beans::XPropertySetInfo > SAL_CALL OShape::getPropertySetInfo( ) throw(uno::RuntimeException) { - return ShapePropertySet::getPropertySetInfo(); + + //return ShapePropertySet::getPropertySetInfo(); + return cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() ); } // ----------------------------------------------------------------------------- +cppu::IPropertyArrayHelper& OShape::getInfoHelper() +{ + if ( !m_pAggHelper.get() ) + { + uno::Sequence<beans::Property> aAggSeq; + if ( m_aProps.aComponent.m_xProperty.is() ) + aAggSeq = m_aProps.aComponent.m_xProperty->getPropertySetInfo()->getProperties(); + m_pAggHelper.reset(new OPropertyArrayAggregationHelper(ShapePropertySet::getPropertySetInfo()->getProperties(),aAggSeq)); + } + return *(m_pAggHelper.get()); +} + +// ----------------------------------------------------------------------------- void SAL_CALL OShape::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { + getInfoHelper(); + if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY ) + m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue); + // can be in both + if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY ) ShapePropertySet::setPropertyValue( aPropertyName, aValue ); } // ----------------------------------------------------------------------------- uno::Any SAL_CALL OShape::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { + getInfoHelper(); + if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY ) + return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName); + // can be in both + if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY ) return ShapePropertySet::getPropertyValue( PropertyName); + return uno::Any(); } // ----------------------------------------------------------------------------- void SAL_CALL OShape::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { + getInfoHelper(); + if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY ) + m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener); + // can be in both + if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY ) ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener ); } // ----------------------------------------------------------------------------- void SAL_CALL OShape::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { + getInfoHelper(); + if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY ) + m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener ); + // can be in both + if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY ) ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener ); } // ----------------------------------------------------------------------------- void SAL_CALL OShape::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { + getInfoHelper(); + if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY ) + m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener ); + // can be in both + if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY ) ShapePropertySet::addVetoableChangeListener( PropertyName, aListener ); } // ----------------------------------------------------------------------------- void SAL_CALL OShape::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { + getInfoHelper(); + if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY ) + m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener ); + // can be in both + if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY ) ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener ); } // ----------------------------------------------------------------------------- Directory: /dba/reportdesign/source/core/inc/ ============================================= File [changed]: ReportHelperImpl.hxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/inc/ReportHelperImpl.hxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +34 -27 --------------------- --- ReportHelperImpl.hxx 2007-05-09 13:51:00+0000 1.1.2.1 +++ ReportHelperImpl.hxx 2007-05-18 12:18:44+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: ReportHelperImpl.hxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/05/09 13:51:00 $ + * last change: $Author: oj $ $Date: 2007/05/18 12:18:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -121,7 +121,31 @@ } \ // ::com::sun::star::report::XReportControlFormat: -#define REPORTCONTROLFORMAT_IMPL(clazz,varName) \ +#define REPORTCONTROLFORMAT_IMPL1(clazz,varName) \ +::sal_Int32 SAL_CALL clazz::getControlBackground() throw (::com::sun::star::beans::UnknownPropertyException, uno::RuntimeException) \ +{ \ + ::osl::MutexGuard aGuard(m_aMutex); \ + return varName.m_bBackgroundTransparent ? COL_TRANSPARENT : varName.nBackgroundColor; \ +} \ + \ +void SAL_CALL clazz::setControlBackground( ::sal_Int32 _backgroundcolor ) throw (uno::RuntimeException, beans::UnknownPropertyException)\ +{ \ + setControlBackgroundTransparent(_backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT)); \ + set(PROPERTY_CONTROLBACKGROUND,_backgroundcolor,varName.nBackgroundColor); \ +} \ + \ +::sal_Bool SAL_CALL clazz::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException) \ +{ \ + ::osl::MutexGuard aGuard(m_aMutex); \ + return varName.m_bBackgroundTransparent; \ +} \ + \ +void SAL_CALL clazz::setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent ) throw (beans::UnknownPropertyException, uno::RuntimeException) \ +{ \ + set(PROPERTY_CONTROLBACKGROUNDTRANSPARENT,_controlbackgroundtransparent,varName.m_bBackgroundTransparent); \ +} + +#define REPORTCONTROLFORMAT_IMPL2(clazz,varName) \ ::sal_Int16 SAL_CALL clazz::getCharStrikeout() throw (uno::RuntimeException, beans::UnknownPropertyException) \ { \ ::osl::MutexGuard aGuard(m_aMutex); \ @@ -178,29 +202,6 @@ set(PROPERTY_PARAADJUST,_align,varName.nAlign); \ } \ \ -::sal_Int32 SAL_CALL clazz::getControlBackground() throw (::com::sun::star::beans::UnknownPropertyException, uno::RuntimeException) \ -{ \ - ::osl::MutexGuard aGuard(m_aMutex); \ - return varName.m_bBackgroundTransparent ? COL_TRANSPARENT : varName.nBackgroundColor; \ -} \ - \ -void SAL_CALL clazz::setControlBackground( ::sal_Int32 _backgroundcolor ) throw (uno::RuntimeException, beans::UnknownPropertyException)\ -{ \ - setControlBackgroundTransparent(_backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT)); \ - set(PROPERTY_CONTROLBACKGROUND,_backgroundcolor,varName.nBackgroundColor); \ -} \ - \ -::sal_Bool SAL_CALL clazz::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException) \ -{ \ - ::osl::MutexGuard aGuard(m_aMutex); \ - return varName.m_bBackgroundTransparent; \ -} \ - \ -void SAL_CALL clazz::setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent ) throw (beans::UnknownPropertyException, uno::RuntimeException) \ -{ \ - set(PROPERTY_CONTROLBACKGROUNDTRANSPARENT,_controlbackgroundtransparent,varName.m_bBackgroundTransparent); \ -} \ - \ awt::FontDescriptor SAL_CALL clazz::getFontDescriptor() throw (beans::UnknownPropertyException,uno::RuntimeException) \ { \ ::osl::MutexGuard aGuard(m_aMutex); \ @@ -900,7 +901,13 @@ void SAL_CALL clazz::setCharPosture( awt::FontSlant /*_charposture*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\ {\ throw beans::UnknownPropertyException();\ -}\ +} + +// ::com::sun::star::report::XReportControlFormat: +#define REPORTCONTROLFORMAT_IMPL(clazz,varName) \ + REPORTCONTROLFORMAT_IMPL1(clazz,varName) \ + REPORTCONTROLFORMAT_IMPL2(clazz,varName) + #endif //INCLUDED_REPORTHELPERIMPL_HXX File [changed]: Shape.hxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/inc/Shape.hxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +14 -10 --------------------- --- Shape.hxx 2007-05-09 13:51:46+0000 1.1.2.1 +++ Shape.hxx 2007-05-18 12:18:44+0000 1.1.2.2 @@ -6,9 +6,9 @@ * * $RCSfile: Shape.hxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/05/09 13:51:46 $ + * last change: $Author: oj $ $Date: 2007/05/18 12:18:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -54,6 +54,8 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #endif #include "ReportHelperDefines.hxx" +#include <comphelper/propagg.hxx> +#include <memory> namespace reportdesign { @@ -70,6 +72,7 @@ public ShapePropertySet { friend class OShapeHelper; + ::std::auto_ptr< ::comphelper::OPropertyArrayAggregationHelper> m_pAggHelper; OReportControlModel m_aProps; com::sun::star::drawing::HomogenMatrix3 m_Transformation; ::sal_Int32 m_nZOrder; @@ -96,6 +99,7 @@ l.notify(); } void checkIndex(sal_Int32 _nIndex); + cppu::IPropertyArrayHelper& getInfoHelper(); protected: virtual ~OShape(); public: Directory: /dba/reportdesign/source/ui/dlg/ =========================================== File [changed]: GroupsSorting.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/dlg/GroupsSorting.cxx?r1=1.1.2.2&r2=1.1.2.3 Delta lines: +3 -2 ------------------- --- GroupsSorting.cxx 2007-05-15 13:34:11+0000 1.1.2.2 +++ GroupsSorting.cxx 2007-05-18 12:18:44+0000 1.1.2.3 @@ -4,9 +4,9 @@ * * $RCSfile: GroupsSorting.cxx,v $ * - * $Revision: 1.1.2.2 $ + * $Revision: 1.1.2.3 $ * - * last change: $Author: oj $ $Date: 2007/05/15 13:34:11 $ + * last change: $Author: oj $ $Date: 2007/05/18 12:18:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -478,6 +478,7 @@ String sUndoAction(String(ModuleRes(RID_STR_UNDO_APPEND_GROUP))); m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() ); xGroup = m_pParent->getGroups()->createGroup(); + xGroup->setHeaderOn(sal_True); uno::Sequence< beans::PropertyValue > aArgs(2); aArgs[0].Name = PROPERTY_GROUP; Directory: /dba/reportdesign/source/ui/misc/ ============================================ File [changed]: UITools.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/misc/UITools.cxx?r1=1.1.2.3&r2=1.1.2.4 Delta lines: +9 -4 ------------------- --- UITools.cxx 2007-05-16 17:45:49+0000 1.1.2.3 +++ UITools.cxx 2007-05-18 12:18:44+0000 1.1.2.4 @@ -4,9 +4,9 @@ * * $RCSfile: UITools.cxx,v $ * - * $Revision: 1.1.2.3 $ + * $Revision: 1.1.2.4 $ * - * last change: $Author: oj $ $Date: 2007/05/16 17:45:49 $ + * last change: $Author: oj $ $Date: 2007/05/18 12:18:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -144,6 +144,7 @@ #ifndef _REPORT_RPTUIDEF_HXX #include "RptDef.hxx" #endif +#include <com/sun/star/report/XShape.hpp> #ifndef _RPTUI_DLGRESID_HRC #include "RptResId.hrc" #endif @@ -332,10 +333,14 @@ pDescriptor->Put(SvxColorItem(::Color(_xReportControlFormat->getCharColor()))); pDescriptor->Put(SvxCharRotateItem(_xReportControlFormat->getCharRotation())); pDescriptor->Put(SvxCharScaleWidthItem(_xReportControlFormat->getCharScaleWidth())); + uno::Reference< report::XShape> xShape(_xReportControlFormat,uno::UNO_QUERY); + if ( !xShape.is() ) pDescriptor->Put(SvxBrushItem(::Color(_xReportControlFormat->getControlBackground()))); { // want the dialog to be destroyed before our set ORptPageDialog aDlg(pParent, pDescriptor.get(),RID_PAGEDIALOG_CHAR); + if ( xShape.is() ) + aDlg.RemoveTabPage(RID_PAGE_BACKGROUND); bRet = RET_OK == aDlg.Execute(); if (bRet) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
