Tag: cws_dev300_dba31a User: oj Date: 2008-07-10 06:59:52+0000 Modified: dba/reportdesign/source/ui/dlg/dlgpage.cxx dba/reportdesign/source/ui/inc/UITools.hxx dba/reportdesign/source/ui/inc/metadata.hxx dba/reportdesign/source/ui/inspection/GeometryHandler.cxx dba/reportdesign/source/ui/inspection/inspection.src dba/reportdesign/source/ui/inspection/metadata.cxx dba/reportdesign/source/ui/misc/UITools.cxx
Log: #i88727# new area prop for shapes and some model changes File Changes: Directory: /dba/reportdesign/source/ui/dlg/ =========================================== File [changed]: dlgpage.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/dlg/dlgpage.cxx?r1=1.3&r2=1.3.30.1 Delta lines: +7 -10 -------------------- --- dlgpage.cxx 2008-04-10 18:56:24+0000 1.3 +++ dlgpage.cxx 2008-07-10 06:59:49+0000 1.3.30.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dlgpage.cxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.3.30.1 $ * * This file is part of OpenOffice.org. * @@ -29,21 +29,18 @@ ************************************************************************/ #include "precompiled_reportdesign.hxx" -#include <svtools/intitem.hxx> //add CHINA001 -#ifndef _SVX_DIALOGS_HRC + #include <svx/dialogs.hrc> -#endif #include <svx/tabarea.hxx> +#include <svx/flagsdef.hxx> +#include <svx/svxdlg.hxx> +#include <svx/svxenum.hxx> #include "dlgpage.hxx" #include "ModuleHelper.hxx" -#ifndef _RPTUI_DLGRESID_HRC #include "RptResId.hrc" -#endif +#include <svtools/intitem.hxx> //add CHINA001 #include <svtools/cjkoptions.hxx> #include <svtools/aeitem.hxx> -#include <svx/flagsdef.hxx> -#include <svx/svxdlg.hxx> -#include <svx/svxenum.hxx> namespace rptui { Directory: /dba/reportdesign/source/ui/inc/ =========================================== File [changed]: UITools.hxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/UITools.hxx?r1=1.5.30.2&r2=1.5.30.3 Delta lines: +9 -1 ------------------- --- UITools.hxx 2008-06-26 14:26:32+0000 1.5.30.2 +++ UITools.hxx 2008-07-10 06:59:49+0000 1.5.30.3 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: UITools.hxx,v $ - * $Revision: 1.5.30.2 $ + * $Revision: 1.5.30.3 $ * * This file is part of OpenOffice.org. * @@ -32,6 +32,7 @@ #include <com/sun/star/report/XGroup.hpp> #include <com/sun/star/report/XReportControlFormat.hpp> +#include <com/sun/star/report/XShape.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -103,6 +104,13 @@ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _out_rNewValues ); + /** opens the area dialog for shapes + */ + bool openAreaDialog( + const ::com::sun::star::uno::Reference< ::com::sun::star::report::XShape >& _xShape + ,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& _xWindow + ); + /** applies the character settings previously obtained via openCharDialog */ void applyCharacterSettings( File [changed]: metadata.hxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/metadata.hxx?r1=1.7&r2=1.7.12.1 Delta lines: +3 -2 ------------------- --- metadata.hxx 2008-06-16 13:42:51+0000 1.7 +++ metadata.hxx 2008-07-10 06:59:49+0000 1.7.12.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: metadata.hxx,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.12.1 $ * * This file is part of OpenOffice.org. * @@ -146,6 +146,7 @@ #define PROPERTY_ID_MASTERFIELDS 35 #define PROPERTY_ID_DETAILFIELDS 36 #define PROPERTY_ID_PREVIEW_COUNT 37 + #define PROPERTY_ID_AREA 38 //............................................................................ } // namespace rptui Directory: /dba/reportdesign/source/ui/inspection/ ================================================== File [changed]: GeometryHandler.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inspection/GeometryHandler.cxx?r1=1.8&r2=1.8.12.1 Delta lines: +63 -26 --------------------- --- GeometryHandler.cxx 2008-06-16 13:44:03+0000 1.8 +++ GeometryHandler.cxx 2008-07-10 06:59:50+0000 1.8.12.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: GeometryHandler.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.12.1 $ * * This file is part of OpenOffice.org. * @@ -29,14 +29,16 @@ ************************************************************************/ #include "precompiled_reportdesign.hxx" #include "GeometryHandler.hxx" -#include <com/sun/star/report/Function.hpp> + #include <comphelper/sequence.hxx> -#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC +#include <comphelper/types.hxx> +#include <comphelper/property.hxx> + #include "uistrings.hrc" -#endif -#include <unotools/textsearch.hxx> #include "reportformula.hxx" -#include <comphelper/types.hxx> + +#include <unotools/textsearch.hxx> + #include <toolkit/helper/vclunohelper.hxx> #include <svtools/syslocale.hxx> #include <tools/diagnose_ex.h> @@ -45,39 +47,42 @@ #include <com/sun/star/inspection/PropertyLineElement.hpp> #include <com/sun/star/inspection/PropertyControlType.hpp> #include <com/sun/star/inspection/XStringListControl.hpp> +#include <com/sun/star/report/Function.hpp> #include <com/sun/star/report/XReportDefinition.hpp> #include <com/sun/star/report/XShape.hpp> -#include <com/sun/star/util/SearchOptions.hpp> -#include <com/sun/star/sdb/CommandType.hpp> -#include <vcl/waitobj.hxx> -#include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/report/XSection.hpp> #include <com/sun/star/report/XFormattedField.hpp> +#include <com/sun/star/report/XFixedLine.hpp> +#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> +#include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdb/SQLContext.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/util/SearchOptions.hpp> +#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> +#include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/inspection/XNumericControl.hpp> #include <com/sun/star/util/MeasureUnit.hpp> + +#include <vcl/msgbox.hxx> +#include <vcl/waitobj.hxx> #include <vcl/fldunit.hxx> +#include <vcl/stdtext.hxx> + #include "ModuleHelper.hxx" -#ifndef _RPTUI_DLGRESID_HRC #include "RptResId.hrc" -#endif #include "RptDef.hxx" #include "UITools.hxx" #include <connectivity/dbexception.hxx> #include <connectivity/dbconversion.hxx> -#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> -#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> -#include <com/sun/star/report/XFixedLine.hpp> -#include <com/sun/star/sdbc/XConnection.hpp> #include <connectivity/dbtools.hxx> -#include <vcl/stdtext.hxx> -#include <com/sun/star/sdb/SQLContext.hpp> -#include <comphelper/property.hxx> + + #include <boost/bind.hpp> #include <tools/string.hxx> #include "metadata.hxx" #include <svtools/itempool.hxx> #include <svtools/itemset.hxx> -#include <vcl/msgbox.hxx> + #define ITEMID_COLOR_TABLE SID_COLOR_TABLE #define ITEMID_DASH_LIST SID_DASH_LIST #define ITEMID_LINEEND_LIST SID_LINEEND_LIST @@ -96,10 +101,7 @@ #include <svx/xlnedcit.hxx> #include <svx/xlndsit.hxx> #include <svx/xlineit0.hxx> - -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif #define ITEMID_COLOR_TABLE SID_COLOR_TABLE #define ITEMID_DASH_LIST SID_DASH_LIST @@ -108,9 +110,7 @@ #define ITEMID_BRUSH SID_ATTR_BRUSH #include <svx/brshitem.hxx> #include "dlgpage.hxx" -#ifndef RTPUI_REPORTDESIGN_HELPID_HRC #include "helpids.hrc" -#endif #include <toolkit/helper/convert.hxx> #define DATA_OR_FORMULA 0 @@ -796,6 +796,11 @@ aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::TextField, sal_True ); aOut.HasPrimaryButton = sal_True; break; + case PROPERTY_ID_AREA: + aOut.PrimaryButtonId = UID_RPT_RPT_PROP_DLG_AREA; + aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::TextField, sal_True ); + aOut.HasPrimaryButton = sal_True; + break; default: { aOut = m_xFormComponentHandler->describePropertyLine(PropertyName, _xControlFactory); @@ -1020,6 +1025,7 @@ return m_xFormComponentHandler->convertToPropertyValue(PROPERTY_FONTNAME, _rControlValue); case PROPERTY_ID_SCOPE: case PROPERTY_ID_FORMULALIST: + case PROPERTY_ID_AREA: aPropertyValue = _rControlValue; break; case PROPERTY_ID_TYPE: @@ -1057,6 +1063,8 @@ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName); switch(nId) { + case PROPERTY_ID_AREA: + break; case PROPERTY_ID_FORCENEWPAGE: case PROPERTY_ID_NEWROWORCOL: aControlValue = getConstantValue(sal_True,RID_STR_FORCENEWPAGE_CONST,aPropertyValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ForceNewPage")),PropertyName); @@ -1241,6 +1249,14 @@ } aNewProps.push_back(*pFind); } + } // for (size_t i = 0; i < sizeof(pIncludeProperties)/sizeof(pIncludeProperties[0]) ;++i ) + + // special property for shapes + if ( uno::Reference< report::XShape>(m_xReportComponent,uno::UNO_QUERY).is() ) + { + beans::Property aValue; + aValue.Name = PROPERTY_AREA; + aNewProps.push_back(aValue); } return uno::Sequence< beans::Property > (&(*aNewProps.begin()),aNewProps.size()); @@ -1316,6 +1332,27 @@ } return eResult; } + else if ( PropertyName.equalsAscii(PROPERTY_AREA) ) + { + ::osl::ClearableMutexGuard aGuard( m_aMutex ); + + inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled; + const uno::Reference< awt::XWindow> xInspectorWindow(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow"))) ,uno::UNO_QUERY); + const uno::Reference< report::XShape> xShape(m_xReportComponent,uno::UNO_QUERY); + aGuard.clear(); + + if ( rptui::openAreaDialog( xShape, xInspectorWindow) ) + { + eResult = inspection::InteractiveSelectionResult_ObtainedValue; + beans::PropertyChangeEvent aScopeEvent; + aScopeEvent.PropertyName = PROPERTY_FILLCOLOR; + // aScopeEvent.OldValue <<= _nOldDataFieldType; + aScopeEvent.NewValue <<= xShape->getPropertyValue(PROPERTY_FILLCOLOR); + m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange ); + } + return eResult; + } + return m_xFormComponentHandler->onInteractivePropertySelection(PropertyName, Primary, _rData, _rxInspectorUI); } File [changed]: inspection.src Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inspection/inspection.src?r1=1.7&r2=1.7.30.1 Delta lines: +7 -3 ------------------- --- inspection.src 2008-04-10 19:09:50+0000 1.7 +++ inspection.src 2008-07-10 06:59:50+0000 1.7.30.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: inspection.src,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.30.1 $ * * This file is part of OpenOffice.org. * @@ -248,3 +248,7 @@ { Text [ en-US ] = "Preview Row(s)" ; }; \ No newline at end of file +String RID_STR_AREA +{ + Text [ en-US ] = "Area" ; +}; File [changed]: metadata.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inspection/metadata.cxx?r1=1.8&r2=1.8.12.1 Delta lines: +3 -2 ------------------- --- metadata.cxx 2008-06-16 13:44:20+0000 1.8 +++ metadata.cxx 2008-07-10 06:59:50+0000 1.8.12.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: metadata.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.12.1 $ * * This file is part of OpenOffice.org. * @@ -175,6 +175,7 @@ ,DEF_INFO_1( PREVIEW_COUNT, PREVIEW_COUNT, PREVIEW_COUNT, COMPOSEABLE ) ,DEF_INFO_2( MASTERFIELDS, MASTERFIELDS, MASTERFIELDS, COMPOSEABLE,DATA_PROPERTY ) ,DEF_INFO_2( DETAILFIELDS, DETAILFIELDS, DETAILFIELDS, COMPOSEABLE,DATA_PROPERTY) + ,DEF_INFO_1( AREA, AREA, AREA, COMPOSEABLE ) }; s_pPropertyInfos = aPropertyInfos; 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.6.28.3&r2=1.6.28.4 Delta lines: +128 -11 ---------------------- --- UITools.cxx 2008-06-26 14:26:33+0000 1.6.28.3 +++ UITools.cxx 2008-07-10 06:59:50+0000 1.6.28.4 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: UITools.cxx,v $ - * $Revision: 1.6.28.3 $ + * $Revision: 1.6.28.4 $ * * This file is part of OpenOffice.org. * @@ -29,20 +29,24 @@ ************************************************************************/ #include "precompiled_reportdesign.hxx" -#include <svx/charscaleitem.hxx> -#include <svx/algitem.hxx> -#include <svx/svdpagv.hxx> + #include <toolkit/helper/convert.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include "SectionView.hxx" #include "UITools.hxx" -#include <toolkit/helper/vclunohelper.hxx> -#include <svtools/pathoptions.hxx> + #include <tools/diagnose_ex.h> -#include <svtools/ctrltool.hxx> +#include <tools/string.hxx> + #include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <com/sun/star/lang/NullPointerException.hpp> #include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> + +#include <svx/charscaleitem.hxx> +#include <svx/algitem.hxx> +#include <svx/svdpagv.hxx> #include <svx/xtable.hxx> // XColorTable #include <svx/brshitem.hxx> #include <svx/fontitem.hxx> @@ -69,17 +73,23 @@ #include <svx/charreliefitem.hxx> #include <svx/charrotateitem.hxx> #include <svx/charhiddenitem.hxx> +#include <svx/xgrscit.hxx> #include <svx/svditer.hxx> #include <svx/xtable.hxx> -#include "RptObject.hxx" +#include <svx/dialogs.hrc> #include <svx/svdview.hxx> #include <svx/svdpage.hxx> +#include <svx/svxdlg.hxx> +#include <svx/unoprov.hxx> + +#include <svtools/pathoptions.hxx> +#include <svtools/ctrltool.hxx> #include <svtools/itempool.hxx> #include <svtools/itemset.hxx> -#include "rptui_slotid.hrc" -#include "uistrings.hrc" + #include <comphelper/propmultiplex.hxx> #include <comphelper/namedvaluecollection.hxx> + #include <com/sun/star/report/XGroups.hpp> #include <com/sun/star/awt/TextAlign.hpp> #include <com/sun/star/text/ParagraphVertAlign.hpp> @@ -88,10 +98,15 @@ #include <i18npool/mslangid.hxx> #include "dlgpage.hxx" #include <vcl/msgbox.hxx> +#include "rptui_slotid.hrc" +#include "uistrings.hrc" +#include "RptObject.hxx" #include "ModuleHelper.hxx" #include "RptDef.hxx" #include "RptResId.hrc" -#include <tools/string.hxx> +#include "ReportDefinition.hxx" +#include "RptModel.hxx" + #define ITEMID_FONT 10 #define ITEMID_FONTHEIGHT 11 #define ITEMID_LANGUAGE 12 @@ -336,6 +351,60 @@ _rItemSet.Put(SvxWeightItem(aFont.GetWeight(),_nWeight)); return aFont; } + + void lcl_fillShapeToItems( const uno::Reference<report::XShape >& _xShape,SfxItemSet& _rItemSet ) + { + uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo(); + SvxUnoPropertyMapProvider aMap; + SfxItemPropertyMap* pPropertyMap = aMap.GetMap(SVXMAP_CUSTOMSHAPE); + while ( pPropertyMap->pName ) + { + const ::rtl::OUString sPropertyName = ::rtl::OUString::createFromAscii(pPropertyMap->pName); + if ( xInfo->hasPropertyByName(sPropertyName) ) + { + const SfxPoolItem* pItem = _rItemSet.GetItem(pPropertyMap->nWID); + if ( pItem ) + { + ::std::auto_ptr<SfxPoolItem> pClone(pItem->Clone()); + pClone->PutValue(_xShape->getPropertyValue(sPropertyName),pPropertyMap->nMemberId); + _rItemSet.Put(*pClone,pPropertyMap->nWID); + } + } // if ( xInfo->hasPropertyByName(sPropertyName) ) + ++pPropertyMap; + } + } + + void lcl_fillItemsToShape( const uno::Reference<report::XShape >& _xShape,const SfxItemSet& _rItemSet ) + { + const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo(); + SvxUnoPropertyMapProvider aMap; + const SfxItemPropertyMap* pPropertyMap = aMap.GetMap(SVXMAP_CUSTOMSHAPE); + while ( pPropertyMap->pName ) + { + const ::rtl::OUString sPropertyName = ::rtl::OUString::createFromAscii(pPropertyMap->pName); + if ( SFX_ITEM_SET == _rItemSet.GetItemState(pPropertyMap->nWID) && xInfo->hasPropertyByName(sPropertyName) ) + { + const beans::Property aProp = xInfo->getPropertyByName( sPropertyName ); + if ( ( aProp.Attributes & beans::PropertyAttribute::READONLY ) != beans::PropertyAttribute::READONLY ) + { + const SfxPoolItem* pItem = _rItemSet.GetItem(pPropertyMap->nWID); + if ( pItem ) + { + uno::Any aValue; + pItem->QueryValue(aValue,pPropertyMap->nMemberId); + try + { + _xShape->setPropertyValue(sPropertyName,aValue); + } + catch(uno::Exception&) + { // shapes have a bug so we ignore this one. + } + } // if ( pItem ) + } + } + ++pPropertyMap; + } // while ( pPropertyMap->pName ) + } // ------------------------------------------------------------------------- void lcl_CharPropertiesToItems( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat, SfxItemSet& _rItemSet ) @@ -750,6 +819,54 @@ return bSuccess; } +// ----------------------------------------------------------------------------- +bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::Reference< awt::XWindow>& _rxParentWindow ) +{ + OSL_PRECOND( _xShape.is() && _rxParentWindow.is(), "openCharDialog: invalid parameters!" ); + if ( !_xShape.is() || !_rxParentWindow.is() ) + return false; + + ::boost::shared_ptr<rptui::OReportModel> pModel = ::reportdesign::OReportDefinition::getSdrModel(_xShape->getSection()->getReportDefinition()); + + Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); + + //static USHORT pRanges[] = + //{ + // XATTR_START,XATTR_END, + // 0 + //}; + + bool bSuccess = false; + try + { + SfxItemPool& rItemPool = pModel->GetItemPool(); + ::std::auto_ptr<SfxItemSet> pDescriptor( new SfxItemSet( rItemPool, rItemPool.GetFirstWhich(),rItemPool.GetLastWhich() ) ); + + lcl_fillShapeToItems(_xShape,*pDescriptor); + + { // want the dialog to be destroyed before our set + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); + ::std::auto_ptr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog( pParent,pDescriptor.get(),pModel.get(),RID_SVXDLG_AREA )); + // #i74099# by default, the dialog deletes the current color table if a different one is loaded + // (see SwDrawShell::ExecDrawDlg) + const SvxColorTableItem* pColorItem = static_cast<const SvxColorTableItem*>( pDescriptor->GetItem(SID_COLOR_TABLE) ); + if (pColorItem && pColorItem->GetColorTable() == XColorTable::GetStdColorTable()) + pDialog->DontDeleteColorTable(); + bSuccess = ( RET_OK == pDialog->Execute() ); + if ( bSuccess ) + { + lcl_fillItemsToShape(_xShape,*pDialog->GetOutputItemSet()); + } + } + } + catch(uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } + + return bSuccess; +} // ----------------------------------------------------------------------------- void applyCharacterSettings( const uno::Reference< report::XReportControlFormat >& _rxReportControlFormat, const uno::Sequence< beans::NamedValue >& _rSettings ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
