diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-06-03 11:26:39 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-06-03 11:26:39 +0000 |
commit | e8cad7c6d2daf5b2b4ec672dbf740737fba426fd (patch) | |
tree | a94374930a560bd30e01a00664dd113a745587b3 /sd/source/ui/unoidl | |
parent | 6c8a6d114da643b699e0e1395d319b3ad4e65503 (diff) |
CWS-TOOLING: integrate CWS os128
2009-04-22 12:58:26 +0200 b_michaelsen r271093 : #i101084# using the frames enumeration for other SwXFrames-queries; also added a complex test to ensure the behavior to be the same
2009-04-20 14:53:03 +0200 mav r270987 : #i101219# adjust the testcases to test memory cache and temporary file cache
2009-04-20 14:52:09 +0200 mav r270986 : #i101219#,#i99077# use memory to cache data; no precopying on commit
2009-04-20 14:39:21 +0200 mav r270984 : #i101219# use memory to cache data
2009-04-20 14:39:08 +0200 mav r270983 : #i101219# use memory to cache data
2009-04-20 14:38:45 +0200 mav r270982 : #i101219# use memory to cache data
2009-04-17 07:37:52 +0200 os r270912 : CWS-TOOLING: rebase CWS os128 to trunk@270723 (milestone: DEV300:m46)
2009-04-15 14:54:18 +0200 b_michaelsen r270845 : #i101084# using frame enumerations for paragraph export for better performance
2009-04-15 14:52:54 +0200 b_michaelsen r270843 : #i101084# implemented XEnumerationAccess interface on framesets
2009-04-03 17:08:10 +0200 mav r270504 : #i100722# do not compress streams of known compressed types per default
2009-04-03 13:49:50 +0200 os r270484 : resync error fixed
2009-04-03 12:55:32 +0200 mav r270470 : #i100722# do not compress streams of known compressed types per default
2009-04-03 10:00:58 +0200 os r270463 : resync error fixed
2009-04-03 09:52:53 +0200 os r270462 : resync error fixed
2009-04-03 09:10:14 +0200 os r270449 : #i99568# string compare operator of hash_map changed
2009-04-03 09:03:49 +0200 os r270446 : #i100683# normalize file URLs
2009-04-02 11:09:27 +0200 os r270381 : #i100683# making URLs relative without file access
2009-04-02 09:04:42 +0200 os r270366 : CWS-TOOLING: rebase CWS os128 to trunk@270033 (milestone: DEV300:m45)
2009-03-31 08:08:37 +0200 os r270258 : #i100683# reducing calls to URIHelper::simpleNormalizeMakeRelative()
2009-03-19 17:06:22 +0100 os r269756 : #i99568# XTolerantMultiPropertySet activated
2009-03-16 11:46:14 +0100 os r269517 : wrong commit to #i97471# removed
2009-03-16 11:36:50 +0100 os r269514 : #i97471# SwDrawTextShell::Init(): mouse double click and key input in group objects at the same time: prevent crash
2009-03-13 11:08:54 +0100 os r269464 : #i99568# static SfxItemPropertySet
2009-03-13 11:03:22 +0100 os r269463 : #i99568# static SfxItemPropertySet
2009-03-11 12:59:27 +0100 os r269320 : #i99568# WhichId of properties handled from ScDocOptionsObj added
2009-03-06 09:09:58 +0100 os r268972 : #i99568# SfxItemPropertySet improvements
2009-03-05 20:54:43 +0100 os r268942 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 20:19:52 +0100 os r268941 : #i99568# SfxItemPropertySet improvements
2009-03-05 20:05:03 +0100 os r268940 : #i99568# SfxItemPropertySet improvements
2009-03-05 18:54:47 +0100 os r268936 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 17:51:38 +0100 os r268931 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 17:33:03 +0100 os r268930 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 15:53:00 +0100 os r268920 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 15:52:50 +0100 os r268919 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 15:50:41 +0100 os r268918 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 15:41:04 +0100 os r268916 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 15:40:40 +0100 os r268915 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 10:16:20 +0100 os r268881 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-05 10:15:55 +0100 os r268880 : #i99568# Sfx/SvxItemPropertySet improvements
2009-03-03 08:40:09 +0100 os r268704 : ScTableSheetObj::GetItemPropertyMap fixed
2009-03-03 07:50:00 +0100 os r268703 : SfxItemProperty set as pointer
2009-03-03 07:49:46 +0100 os r268702 : SfxItemProperty set as pointer
2009-03-02 08:15:37 +0100 os r268631 : minor fix
2009-03-02 07:58:38 +0100 os r268630 : minor fix
2009-02-27 13:03:25 +0100 os r268584 : exports
2009-02-27 11:17:04 +0100 os r268567 : debug code removed
2009-02-27 11:04:07 +0100 os r268565 : duplicate return removed
2009-02-27 10:17:37 +0100 os r268558 : syntax fixed
2009-02-27 09:56:14 +0100 os r268554 : #i99568# type mix fixed
2009-02-27 09:40:56 +0100 os r268553 : #i99568# exports changes reverted
2009-02-25 12:50:54 +0100 os r268433 : #i99568# SfxItemPropertySet rework
2009-02-25 12:13:39 +0100 os r268432 : #i99568# SfxItemPropertySet rework
2009-02-25 12:12:47 +0100 os r268431 : #i99568# SfxItemPropertySet rework
2009-02-25 12:10:27 +0100 os r268430 : #i99568# SfxItemPropertySet rework
2009-02-25 12:09:36 +0100 os r268429 : #i99568# SfxItemPropertySet rework
2009-02-25 12:07:39 +0100 os r268428 : #i99568# SfxItemPropertySet rework
2009-02-25 11:59:35 +0100 os r268427 : #i99568# SfxItemPropertySet rework
2009-02-25 11:52:52 +0100 os r268425 : #i99568# SfxItemPropertySet rework
2009-02-25 11:49:17 +0100 os r268424 : #i99568# SfxItemPropertySet rework
2009-02-25 11:45:17 +0100 os r268423 : #i99568# SfxItemPropertySet rework
2009-02-11 11:39:04 +0100 os r267587 : #i57008# use registration of index marks at SwUnoCallback
Diffstat (limited to 'sd/source/ui/unoidl')
-rw-r--r-- | sd/source/ui/unoidl/unolayer.cxx | 20 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unolayer.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 22 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unoobj.cxx | 211 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unoobj.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 187 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.hxx | 6 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 115 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.hxx | 6 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unosrch.cxx | 12 |
10 files changed, 354 insertions, 231 deletions
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 7072b18fdc58..96dd05a01267 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -82,9 +82,9 @@ using namespace ::com::sun::star; #define WID_LAYER_TITLE 5 #define WID_LAYER_DESC 6 -const SfxItemPropertyMap* ImplGetSdLayerPropertyMap() +const SvxItemPropertySet* ImplGetSdLayerPropertySet() { - static const SfxItemPropertyMap aSdLayerPropertyMap_Impl[] = + static const SfxItemPropertyMapEntry aSdLayerPropertyMap_Impl[] = { { MAP_CHAR_LEN(UNO_NAME_LAYER_LOCKED), WID_LAYER_LOCKED, &::getBooleanCppuType(), 0, 0 }, { MAP_CHAR_LEN(UNO_NAME_LAYER_PRINTABLE), WID_LAYER_PRINTABLE,&::getBooleanCppuType(), 0, 0 }, @@ -94,8 +94,8 @@ const SfxItemPropertyMap* ImplGetSdLayerPropertyMap() { MAP_CHAR_LEN("Description"), WID_LAYER_DESC, &::getCppuType((const OUString*)0), 0, 0 }, { 0,0,0,0,0,0} }; - - return aSdLayerPropertyMap_Impl; + static SvxItemPropertySet aSDLayerPropertySet_Impl( aSdLayerPropertyMap_Impl ); + return &aSDLayerPropertySet_Impl; } String SdLayer::convertToInternalName( const OUString& rName ) @@ -160,7 +160,7 @@ SdLayer::SdLayer( SdLayerManager* pLayerManager_, SdrLayer* pSdrLayer_ ) throw() : pLayerManager(pLayerManager_) , mxLayerManager(pLayerManager_) , pLayer(pSdrLayer_) -, aPropSet(ImplGetSdLayerPropertyMap()) +, pPropSet(ImplGetSdLayerPropertySet()) { } @@ -198,7 +198,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL SdLayer::getPropertySetInfo( throw(uno::RuntimeException) { OGuard aGuard( Application::GetSolarMutex() ); - return aPropSet.getPropertySetInfo(); + return pPropSet->getPropertySetInfo(); } void SAL_CALL SdLayer::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) @@ -209,9 +209,9 @@ void SAL_CALL SdLayer::setPropertyValue( const OUString& aPropertyName, const un if(pLayer == NULL || pLayerManager == NULL) throw lang::DisposedException(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMapEntry(aPropertyName); + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMapEntry(aPropertyName); - switch( pMap ? pMap->nWID : -1 ) + switch( pEntry ? pEntry->nWID : -1 ) { case WID_LAYER_LOCKED: { @@ -286,11 +286,11 @@ uno::Any SAL_CALL SdLayer::getPropertyValue( const OUString& PropertyName ) if(pLayer == NULL || pLayerManager == NULL) throw lang::DisposedException(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMapEntry(PropertyName); + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMapEntry(PropertyName); uno::Any aValue; - switch( pMap ? pMap->nWID : -1 ) + switch( pEntry ? pEntry->nWID : -1 ) { case WID_LAYER_LOCKED: sd::bool2any( get( LOCKED ), aValue ); diff --git a/sd/source/ui/unoidl/unolayer.hxx b/sd/source/ui/unoidl/unolayer.hxx index e724a4ac6826..edf4a08d8413 100644 --- a/sd/source/ui/unoidl/unolayer.hxx +++ b/sd/source/ui/unoidl/unolayer.hxx @@ -106,7 +106,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayerManager > mxLayerManager; SdrLayer* pLayer; - SvxItemPropertySet aPropSet; + const SvxItemPropertySet* pPropSet; sal_Bool get( LayerAttribute what ) throw(); void set( LayerAttribute what, sal_Bool flag ) throw(); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index fadfb3ebbcdd..7855039b6c46 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -187,10 +187,10 @@ const sal_Int32 WID_MODEL_BUILDID = 10; const sal_Int32 WID_MODEL_HASVALIDSIGNATURES = 11; const sal_Int32 WID_MODEL_DIALOGLIBS = 12; -const SfxItemPropertyMap* ImplGetDrawModelPropertyMap() +const SvxItemPropertySet* ImplGetDrawModelPropertySet() { // Achtung: Der erste Parameter MUSS sortiert vorliegen !!! - const static SfxItemPropertyMap aDrawModelPropertyMap_Impl[] = + const static SfxItemPropertyMapEntry aDrawModelPropertyMap_Impl[] = { { MAP_CHAR_LEN("BuildId"), WID_MODEL_BUILDID, &::getCppuType(static_cast< const rtl::OUString * >(0)), 0, 0}, { MAP_CHAR_LEN(sUNO_Prop_CharLocale), WID_MODEL_LANGUAGE, &::getCppuType((const lang::Locale*)0), 0, 0}, @@ -206,8 +206,8 @@ const SfxItemPropertyMap* ImplGetDrawModelPropertyMap() { MAP_CHAR_LEN(sUNO_Prop_HasValidSignatures), WID_MODEL_HASVALIDSIGNATURES, &::getCppuType(static_cast< const sal_Bool * >(0)), beans::PropertyAttribute::READONLY, 0 }, { 0,0,0,0,0,0 } }; - - return aDrawModelPropertyMap_Impl; + static SvxItemPropertySet aDrawModelPropertySet_Impl( aDrawModelPropertyMap_Impl ); + return &aDrawModelPropertySet_Impl; } // this ctor is used from the DocShell @@ -218,7 +218,7 @@ SdXImpressDocument::SdXImpressDocument (::sd::DrawDocShell* pShell, bool bClipBo mbDisposed(false), mbImpressDoc( pShell && pShell->GetDoc() && pShell->GetDoc()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS ), mbClipBoard( bClipBoard ), - maPropSet( ImplGetDrawModelPropertyMap() ) + mpPropSet( ImplGetDrawModelPropertySet() ) { if( mpDoc ) { @@ -237,7 +237,7 @@ SdXImpressDocument::SdXImpressDocument( SdDrawDocument* pDoc, bool bClipBoard ) mbDisposed(false), mbImpressDoc( pDoc && pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS ), mbClipBoard( bClipBoard ), - maPropSet( ImplGetDrawModelPropertyMap() ) + mpPropSet( ImplGetDrawModelPropertySet() ) { if( mpDoc ) { @@ -1270,7 +1270,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL SdXImpressDocument::getProper throw(uno::RuntimeException) { OGuard aGuard( Application::GetSolarMutex() ); - return maPropSet.getPropertySetInfo(); + return mpPropSet->getPropertySetInfo(); } void SAL_CALL SdXImpressDocument::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) @@ -1281,9 +1281,9 @@ void SAL_CALL SdXImpressDocument::setPropertyValue( const OUString& aPropertyNam if( NULL == mpDoc ) throw lang::DisposedException(); - const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry(aPropertyName); + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); - switch( pMap ? pMap->nWID : -1 ) + switch( pEntry ? pEntry->nWID : -1 ) { case WID_MODEL_LANGUAGE: { @@ -1356,9 +1356,9 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property if( NULL == mpDoc ) throw lang::DisposedException(); - const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry(PropertyName); + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); - switch( pMap ? pMap->nWID : -1 ) + switch( pEntry ? pEntry->nWID : -1 ) { case WID_MODEL_LANGUAGE: { diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 8dbaa9a486ad..21b12f9913a6 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -148,57 +148,143 @@ static SdTypesCache gImplTypesCache; #define WID_THAT_NEED_ANIMINFO 19 -const SfxItemPropertyMap* ImplGetShapePropertyMap( sal_Bool bImpress, sal_Bool bGraphicObj ) -{ - // Achtung: Der erste Parameter MUSS sortiert vorliegen !!! - static const SfxItemPropertyMap aImpress_SdXShapePropertyMap_Impl[] = - { - { MAP_CHAR_LEN("ImageMap"), WID_IMAGEMAP, &::getCppuType((const uno::Reference< container::XIndexContainer >*)0), 0, 0 }, - { MAP_CHAR_LEN(UNO_NAME_OBJ_ANIMATIONPATH), WID_ANIMPATH, &ITYPE(drawing::XShape), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK), WID_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMCOLOR), WID_DIMCOLOR, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMHIDE), WID_DIMHIDE, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMPREV), WID_DIMPREV, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_EFFECT), WID_EFFECT, &::getCppuType((const presentation::AnimationEffect*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_ISEMPTYPRESOBJ),WID_ISEMPTYPRESOBJ, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_ISPRESOBJ), WID_ISPRESOBJ, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_MASTERDEPENDENT),WID_MASTERDEPEND, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_CLICKACTION), WID_CLICKACTION, &::getCppuType((const presentation::ClickAction*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_PLAYFULL), WID_PLAYFULL, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_PRESORDER), WID_PRESORDER, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_STYLE), WID_STYLE, &ITYPE( style::XStyle), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_SOUNDFILE), WID_SOUNDFILE, &::getCppuType((const OUString*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_SOUNDON), WID_SOUNDON, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_SPEED), WID_SPEED, &::getCppuType((const presentation::AnimationSpeed*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_TEXTEFFECT), WID_TEXTEFFECT, &::getCppuType((const presentation::AnimationEffect*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_BLUESCREEN), WID_BLUESCREEN, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_VERB), WID_VERB, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN("IsAnimation"), WID_ISANIMATION, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::getCppuType((const sal_Int32*)0), 0, 0}, + + + #define IMPRESS_MAP_ENTRIES \ + { MAP_CHAR_LEN(UNO_NAME_OBJ_ANIMATIONPATH), WID_ANIMPATH, &ITYPE(drawing::XShape), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK), WID_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMCOLOR), WID_DIMCOLOR, &::getCppuType((const sal_Int32*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMHIDE), WID_DIMHIDE, &::getBooleanCppuType(), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMPREV), WID_DIMPREV, &::getBooleanCppuType(), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_EFFECT), WID_EFFECT, &::getCppuType((const presentation::AnimationEffect*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_ISEMPTYPRESOBJ),WID_ISEMPTYPRESOBJ, &::getBooleanCppuType(), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_ISPRESOBJ), WID_ISPRESOBJ, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_MASTERDEPENDENT),WID_MASTERDEPEND, &::getBooleanCppuType(), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_CLICKACTION), WID_CLICKACTION, &::getCppuType((const presentation::ClickAction*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_PLAYFULL), WID_PLAYFULL, &::getBooleanCppuType(), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_PRESORDER), WID_PRESORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_STYLE), WID_STYLE, &ITYPE( style::XStyle), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_SOUNDFILE), WID_SOUNDFILE, &::getCppuType((const OUString*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_SOUNDON), WID_SOUNDON, &::getBooleanCppuType(), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_SPEED), WID_SPEED, &::getCppuType((const presentation::AnimationSpeed*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_TEXTEFFECT), WID_TEXTEFFECT, &::getCppuType((const presentation::AnimationEffect*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_BLUESCREEN), WID_BLUESCREEN, &::getCppuType((const sal_Int32*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_VERB), WID_VERB, &::getCppuType((const sal_Int32*)0), 0, 0},\ + { MAP_CHAR_LEN("IsAnimation"), WID_ISANIMATION, &::getBooleanCppuType(), 0, 0},\ + { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\ { 0,0,0,0,0,0} - }; - static const SfxItemPropertyMap aDraw_SdXShapePropertyMap_Impl[] = + + const SfxItemPropertyMapEntry* lcl_GetImpress_SdXShapePropertyGraphicMap_Impl() { - { MAP_CHAR_LEN("ImageMap"), WID_IMAGEMAP, &ITYPE(container::XIndexContainer), 0, 0 }, - { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK), WID_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_CLICKACTION), WID_CLICKACTION, &::getCppuType((const presentation::ClickAction*)0),0, 0}, - { MAP_CHAR_LEN(UNO_NAME_OBJ_STYLE), WID_STYLE, &ITYPE(style::XStyle), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::getCppuType((const sal_Int32*)0), 0, 0}, + + static const SfxItemPropertyMapEntry aImpress_SdXShapePropertyGraphicMap_Impl[] = + { + { MAP_CHAR_LEN("ImageMap"), WID_IMAGEMAP, &::getCppuType((const uno::Reference< container::XIndexContainer >*)0), 0, 0 }, + IMPRESS_MAP_ENTRIES + }; + return aImpress_SdXShapePropertyGraphicMap_Impl; + } + + const SfxItemPropertyMapEntry* lcl_GetImpress_SdXShapePropertySimpleMap_Impl() + { + + static const SfxItemPropertyMapEntry aImpress_SdXShapePropertySimpleMap_Impl[] = + { + IMPRESS_MAP_ENTRIES + }; + return aImpress_SdXShapePropertySimpleMap_Impl; + } + + #define DRAW_MAP_ENTRIES\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK), WID_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_CLICKACTION), WID_CLICKACTION, &::getCppuType((const presentation::ClickAction*)0),0, 0},\ + { MAP_CHAR_LEN(UNO_NAME_OBJ_STYLE), WID_STYLE, &ITYPE(style::XStyle), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},\ + { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\ { 0,0,0,0,0,0} - }; - if( bImpress ) - return &aImpress_SdXShapePropertyMap_Impl[ bGraphicObj ? 0 : 1 ]; - else - return &aDraw_SdXShapePropertyMap_Impl[ bGraphicObj ? 0 : 1 ]; -} + const SfxItemPropertyMapEntry* lcl_GetDraw_SdXShapePropertySimpleMap_Impl() + { + static const SfxItemPropertyMapEntry aDraw_SdXShapePropertyMap_Impl[] = + { + DRAW_MAP_ENTRIES + }; + return aDraw_SdXShapePropertyMap_Impl; + } + const SfxItemPropertyMapEntry* lcl_GetDraw_SdXShapePropertyGraphicMap_Impl() + { + static const SfxItemPropertyMapEntry aDraw_SdXShapePropertyGraphicMap_Impl[] = + { + { MAP_CHAR_LEN("ImageMap"), WID_IMAGEMAP, &::getCppuType((const uno::Reference< container::XIndexContainer >*)0), 0, 0 }, + DRAW_MAP_ENTRIES + }; + return aDraw_SdXShapePropertyGraphicMap_Impl; + } + const SfxItemPropertyMapEntry* lcl_ImplGetShapePropertyMap( sal_Bool bImpress, sal_Bool bGraphicObj ) + { + const SfxItemPropertyMapEntry* pRet = 0; + if( bImpress ) + { + if( bGraphicObj ) + pRet = lcl_GetImpress_SdXShapePropertyGraphicMap_Impl(); + else + pRet = lcl_GetImpress_SdXShapePropertySimpleMap_Impl(); + } + else + { + if( bGraphicObj ) + pRet = lcl_GetDraw_SdXShapePropertyGraphicMap_Impl(); + else + pRet = lcl_GetDraw_SdXShapePropertySimpleMap_Impl(); + } + return pRet; -SfxItemPropertyMap aEmpty_SdXShapePropertyMap_Impl[] = -{ - { 0,0,0,0,0,0} -}; + } + const SvxItemPropertySet* lcl_ImplGetShapePropertySet( sal_Bool bImpress, sal_Bool bGraphicObj ) + { + const SvxItemPropertySet* pRet = 0; + if( bImpress ) + { + if( bGraphicObj ) + { + static SvxItemPropertySet aImpress_SdXShapePropertyGraphicSet_Impl( lcl_GetImpress_SdXShapePropertyGraphicMap_Impl()); + pRet = &aImpress_SdXShapePropertyGraphicSet_Impl; + } + else + { + static SvxItemPropertySet aImpress_SdXShapePropertySet_Impl(lcl_GetImpress_SdXShapePropertySimpleMap_Impl()); + pRet = &aImpress_SdXShapePropertySet_Impl; + } + } + else + { + if( bGraphicObj ) + { + static SvxItemPropertySet aDraw_SdXShapePropertyGraphicSet_Impl(lcl_GetDraw_SdXShapePropertyGraphicMap_Impl()); + pRet = &aDraw_SdXShapePropertyGraphicSet_Impl; + } + else + { + static SvxItemPropertySet aDraw_SdXShapePropertySet_Impl( lcl_GetDraw_SdXShapePropertySimpleMap_Impl()); + pRet = &aDraw_SdXShapePropertySet_Impl; + } + } + return pRet; + } + const SfxItemPropertyMapEntry* lcl_GetEmpty_SdXShapePropertyMap_Impl() + { + static SfxItemPropertyMapEntry aEmpty_SdXShapePropertyMap_Impl[] = + { + { 0,0,0,0,0,0} + }; + return aEmpty_SdXShapePropertyMap_Impl; + } + static const SvxItemPropertySet* lcl_GetEmpty_SdXShapePropertySet_Impl() + { + static SvxItemPropertySet aEmptyPropSet( lcl_GetEmpty_SdXShapePropertyMap_Impl() ); + return &aEmptyPropSet; + } const SvEventDescription* ImplGetSupportedMacroItems() { static const SvEventDescription aMacroDescriptionsImpl[] = @@ -228,8 +314,8 @@ typedef SORT* PSORT; extern "C" int __LOADONCALLAPI SortFunc( const void* p1, const void* p2 ); SdXShape::SdXShape() throw() -: maPropSet(aEmpty_SdXShapePropertyMap_Impl), - mpMap(aEmpty_SdXShapePropertyMap_Impl), +: mpPropSet(lcl_GetEmpty_SdXShapePropertySet_Impl()), + mpMap(lcl_GetEmpty_SdXShapePropertyMap_Impl()), mpModel(NULL), mpImplementationId(NULL) { @@ -237,16 +323,17 @@ SdXShape::SdXShape() throw() SdXShape::SdXShape( SvxShape* pShape, SdXImpressDocument* pModel) throw() : mpShape( pShape ), - maPropSet( pModel? - ImplGetShapePropertyMap(pModel->IsImpressDocument(), pShape->getShapeKind() == OBJ_GRAF ) - : aEmpty_SdXShapePropertyMap_Impl ), + mpPropSet( pModel? + lcl_ImplGetShapePropertySet(pModel->IsImpressDocument(), pShape->getShapeKind() == OBJ_GRAF ) + : lcl_GetEmpty_SdXShapePropertySet_Impl() ), mpMap( pModel? - ImplGetShapePropertyMap(pModel->IsImpressDocument(), pShape->getShapeKind() == OBJ_GRAF ) - : aEmpty_SdXShapePropertyMap_Impl ), + lcl_ImplGetShapePropertyMap(pModel->IsImpressDocument(), pShape->getShapeKind() == OBJ_GRAF ) + : lcl_GetEmpty_SdXShapePropertyMap_Impl() ), mpModel(pModel), mpImplementationId( NULL ) { + pShape->setMaster( this ); } @@ -332,7 +419,7 @@ beans::PropertyState SAL_CALL SdXShape::getPropertyState( const OUString& Proper { OGuard aGuard( Application::GetSolarMutex() ); - if( maPropSet.getPropertyMapEntry(PropertyName) ) + if( mpPropSet->getPropertyMapEntry(PropertyName) ) { return beans::PropertyState_DIRECT_VALUE; } @@ -350,7 +437,7 @@ void SAL_CALL SdXShape::setPropertyToDefault( const OUString& PropertyName ) thr { OGuard aGuard( Application::GetSolarMutex() ); - if( maPropSet.getPropertyMapEntry(PropertyName) ) + if( mpPropSet->getPropertyMapEntry(PropertyName) ) { return; } @@ -364,7 +451,7 @@ uno::Any SAL_CALL SdXShape::getPropertyDefault( const OUString& aPropertyName ) { OGuard aGuard( Application::GetSolarMutex() ); - if( maPropSet.getPropertyMapEntry(aPropertyName) ) + if( mpPropSet->getPropertyMapEntry(aPropertyName) ) { return getPropertyValue( aPropertyName ); } @@ -389,7 +476,7 @@ uno::Any SAL_CALL SdXShape::getPropertyDefault( const OUString& aPropertyName ) ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL SdXShape::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException) { - sal_uIntPtr nObjId = (sal_uIntPtr)mpShape->getPropertyMap(); + sal_uIntPtr nObjId = (sal_uIntPtr)mpShape->getPropertyMapEntries(); SfxExtItemPropertySetInfo* pInfo = NULL; SdExtPropertySetInfoCache* pCache = (mpModel && mpModel->IsImpressDocument()) ? @@ -419,16 +506,16 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName, { OGuard aGuard( Application::GetSolarMutex() ); - const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry(aPropertyName); + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); - if( pMap ) + if( pEntry ) { SdrObject* pObj = mpShape->GetSdrObject(); if( pObj ) { - SdAnimationInfo* pInfo = GetAnimationInfo((pMap->nWID <= WID_THAT_NEED_ANIMINFO)?sal_True:sal_False); + SdAnimationInfo* pInfo = GetAnimationInfo((pEntry->nWID <= WID_THAT_NEED_ANIMINFO)?sal_True:sal_False); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_NAVORDER: { @@ -683,13 +770,13 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName, uno::Any aRet; - const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry(PropertyName); + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); - if( pMap && mpShape->GetSdrObject() ) + if( pEntry && mpShape->GetSdrObject() ) { SdAnimationInfo* pInfo = GetAnimationInfo(sal_False); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_NAVORDER: { diff --git a/sd/source/ui/unoidl/unoobj.hxx b/sd/source/ui/unoidl/unoobj.hxx index f8f5784d293f..417e13bbdb60 100644 --- a/sd/source/ui/unoidl/unoobj.hxx +++ b/sd/source/ui/unoidl/unoobj.hxx @@ -55,8 +55,8 @@ class SdXShape : public SvxShapeMaster, private: SvxShape* mpShape; - SvxItemPropertySet maPropSet; - const SfxItemPropertyMap* mpMap; + const SvxItemPropertySet* mpPropSet; + const SfxItemPropertyMapEntry* mpMap; SdXImpressDocument* mpModel; void SetStyleSheet( const ::com::sun::star::uno::Any& rAny ) throw( ::com::sun::star::lang::IllegalArgumentException ); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 1a1fa5f14bfc..6c3df06ddff3 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -133,9 +133,9 @@ enum WID_PAGE static sal_Char __FAR_DATA sEmptyPageName[sizeof("page")] = "page"; /** this function stores the property maps for draw pages in impress and draw */ -const SfxItemPropertyMap* ImplGetDrawPagePropertyMap( sal_Bool bImpress, PageKind ePageKind ) +const SvxItemPropertySet* ImplGetDrawPagePropertySet( sal_Bool bImpress, PageKind ePageKind ) { - static const SfxItemPropertyMap aDrawPagePropertyMap_Impl[] = + static const SfxItemPropertyMapEntry aDrawPagePropertyMap_Impl[] = { { MAP_CHAR_LEN(UNO_NAME_PAGE_BACKGROUND), WID_PAGE_BACK, &ITYPE( beans::XPropertySet ), beans::PropertyAttribute::MAYBEVOID,0}, { MAP_CHAR_LEN(UNO_NAME_PAGE_BOTTOM), WID_PAGE_BOTTOM, &::getCppuType((const sal_Int32*)0), 0, 0}, @@ -179,78 +179,117 @@ const SfxItemPropertyMap* ImplGetDrawPagePropertyMap( sal_Bool bImpress, PageKin {0,0,0,0,0,0} }; - static const SfxItemPropertyMap aDrawPageNotesHandoutPropertyMap_Impl[] = +#define DRAW_PAGE_NOTES_PROPERTIES \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_BOTTOM), WID_PAGE_BOTTOM, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_LEFT), WID_PAGE_LEFT, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_RIGHT), WID_PAGE_RIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_TOP), WID_PAGE_TOP, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_HEIGHT), WID_PAGE_HEIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_LAYOUT), WID_PAGE_LAYOUT, &::getCppuType((const sal_Int16*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYBITMAP), WID_PAGE_LDBITMAP, &ITYPE( awt::XBitmap), beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYNAME), WID_PAGE_LDNAME, &::getCppuType((const OUString*)0), beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_NUMBER), WID_PAGE_NUMBER, &::getCppuType((const sal_Int16*)0), beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_ORIENTATION), WID_PAGE_ORIENT, &::getCppuType((const view::PaperOrientation*)0),0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_WIDTH), WID_PAGE_WIDTH, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(sUNO_Prop_UserDefinedAttributes),WID_PAGE_USERATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0},\ + { MAP_CHAR_LEN("IsHeaderVisible"), WID_PAGE_HEADERVISIBLE, &::getBooleanCppuType(), 0, 0}, \ + { MAP_CHAR_LEN("HeaderText"), WID_PAGE_HEADERTEXT, &::getCppuType((const OUString*)0), 0, 0}, \ + { MAP_CHAR_LEN("IsBackgroundDark" ), WID_PAGE_ISDARK, &::getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN("IsFooterVisible"), WID_PAGE_FOOTERVISIBLE, &::getBooleanCppuType(), 0, 0}, \ + { MAP_CHAR_LEN("FooterText"), WID_PAGE_FOOTERTEXT, &::getCppuType((const OUString*)0), 0, 0}, \ + { MAP_CHAR_LEN("IsPageNumberVisible"), WID_PAGE_PAGENUMBERVISIBLE, &::getBooleanCppuType(), 0, 0}, \ + { MAP_CHAR_LEN("IsDateTimeVisible"), WID_PAGE_DATETIMEVISIBLE, &::getBooleanCppuType(), 0, 0}, \ + { MAP_CHAR_LEN("IsDateTimeFixed"), WID_PAGE_DATETIMEFIXED, &::getBooleanCppuType(), 0, 0}, \ + { MAP_CHAR_LEN("DateTimeText"), WID_PAGE_DATETIMETEXT, &::getCppuType((const OUString*)0), 0, 0}, \ + { MAP_CHAR_LEN("DateTimeFormat"), WID_PAGE_DATETIMEFORMAT, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::com::sun::star::container::XIndexAccess::static_type(),0, 0}, \ + {0,0,0,0,0,0} + + static const SfxItemPropertyMapEntry aDrawPageNotesHandoutPropertyMap_Impl[] = { // this must be the first two entries so they can be excluded for PK_STANDARD { MAP_CHAR_LEN(UNO_NAME_PAGE_BACKGROUND), WID_PAGE_BACK, &ITYPE( beans::XPropertySet ), beans::PropertyAttribute::MAYBEVOID,0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_BOTTOM), WID_PAGE_BOTTOM, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_LEFT), WID_PAGE_LEFT, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_RIGHT), WID_PAGE_RIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_TOP), WID_PAGE_TOP, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_HEIGHT), WID_PAGE_HEIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_LAYOUT), WID_PAGE_LAYOUT, &::getCppuType((const sal_Int16*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYBITMAP), WID_PAGE_LDBITMAP, &ITYPE( awt::XBitmap), beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYNAME), WID_PAGE_LDNAME, &::getCppuType((const OUString*)0), beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_NUMBER), WID_PAGE_NUMBER, &::getCppuType((const sal_Int16*)0), beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_ORIENTATION), WID_PAGE_ORIENT, &::getCppuType((const view::PaperOrientation*)0),0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_WIDTH), WID_PAGE_WIDTH, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(sUNO_Prop_UserDefinedAttributes),WID_PAGE_USERATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - { MAP_CHAR_LEN("IsHeaderVisible"), WID_PAGE_HEADERVISIBLE, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN("HeaderText"), WID_PAGE_HEADERTEXT, &::getCppuType((const OUString*)0), 0, 0}, - { MAP_CHAR_LEN("IsBackgroundDark" ), WID_PAGE_ISDARK, &::getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN("IsFooterVisible"), WID_PAGE_FOOTERVISIBLE, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN("FooterText"), WID_PAGE_FOOTERTEXT, &::getCppuType((const OUString*)0), 0, 0}, - { MAP_CHAR_LEN("IsPageNumberVisible"), WID_PAGE_PAGENUMBERVISIBLE, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN("IsDateTimeVisible"), WID_PAGE_DATETIMEVISIBLE, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN("IsDateTimeFixed"), WID_PAGE_DATETIMEFIXED, &::getBooleanCppuType(), 0, 0}, - { MAP_CHAR_LEN("DateTimeText"), WID_PAGE_DATETIMETEXT, &::getCppuType((const OUString*)0), 0, 0}, - { MAP_CHAR_LEN("DateTimeFormat"), WID_PAGE_DATETIMEFORMAT, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::com::sun::star::container::XIndexAccess::static_type(),0, 0}, + DRAW_PAGE_NOTES_PROPERTIES + }; + static const SfxItemPropertyMapEntry aDrawPageNotesHandoutPropertyNoBackMap_Impl[] = + { + DRAW_PAGE_NOTES_PROPERTIES + }; +#define GRAPHIC_PAGE_PROPERTIES \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_BOTTOM), WID_PAGE_BOTTOM, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_LEFT), WID_PAGE_LEFT, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_RIGHT), WID_PAGE_RIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_TOP), WID_PAGE_TOP, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_HEIGHT), WID_PAGE_HEIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYBITMAP), WID_PAGE_LDBITMAP, &ITYPE(awt::XBitmap), beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYNAME), WID_PAGE_LDNAME, &::getCppuType((const OUString*)0), beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_NUMBER), WID_PAGE_NUMBER, &::getCppuType((const sal_Int16*)0), beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_ORIENTATION), WID_PAGE_ORIENT, &::getCppuType((const view::PaperOrientation*)0),0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_WIDTH), WID_PAGE_WIDTH, &::getCppuType((const sal_Int32*)0), 0, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_PREVIEW), WID_PAGE_PREVIEW, SEQTYPE(::getCppuType((::com::sun::star::uno::Sequence<sal_Int8>*)0)), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN(UNO_NAME_PAGE_PREVIEWBITMAP), WID_PAGE_PREVIEWBITMAP, SEQTYPE(::getCppuType((::com::sun::star::uno::Sequence<sal_Int8>*)0)), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},\ + { MAP_CHAR_LEN(sUNO_Prop_UserDefinedAttributes),WID_PAGE_USERATTRIBS, &::getCppuType((const Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, \ + { MAP_CHAR_LEN(sUNO_Prop_BookmarkURL), WID_PAGE_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0}, \ + { MAP_CHAR_LEN("IsBackgroundDark" ), WID_PAGE_ISDARK, &::getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0}, \ + { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::com::sun::star::container::XIndexAccess::static_type(),0, 0}, \ {0,0,0,0,0,0} - }; - static const SfxItemPropertyMap aGraphicPagePropertyMap_Impl[] = + static const SfxItemPropertyMapEntry aGraphicPagePropertyMap_Impl[] = { { MAP_CHAR_LEN(UNO_NAME_PAGE_BACKGROUND), WID_PAGE_BACK, &ITYPE( beans::XPropertySet), beans::PropertyAttribute::MAYBEVOID,0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_BOTTOM), WID_PAGE_BOTTOM, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_LEFT), WID_PAGE_LEFT, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_RIGHT), WID_PAGE_RIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_TOP), WID_PAGE_TOP, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_HEIGHT), WID_PAGE_HEIGHT, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYBITMAP), WID_PAGE_LDBITMAP, &ITYPE(awt::XBitmap), beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYNAME), WID_PAGE_LDNAME, &::getCppuType((const OUString*)0), beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_NUMBER), WID_PAGE_NUMBER, &::getCppuType((const sal_Int16*)0), beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_ORIENTATION), WID_PAGE_ORIENT, &::getCppuType((const view::PaperOrientation*)0),0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_WIDTH), WID_PAGE_WIDTH, &::getCppuType((const sal_Int32*)0), 0, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_PREVIEW), WID_PAGE_PREVIEW, SEQTYPE(::getCppuType((::com::sun::star::uno::Sequence<sal_Int8>*)0)), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(UNO_NAME_PAGE_PREVIEWBITMAP), WID_PAGE_PREVIEWBITMAP, SEQTYPE(::getCppuType((::com::sun::star::uno::Sequence<sal_Int8>*)0)), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN(sUNO_Prop_UserDefinedAttributes),WID_PAGE_USERATTRIBS, &::getCppuType((const Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - { MAP_CHAR_LEN(sUNO_Prop_BookmarkURL), WID_PAGE_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0}, - { MAP_CHAR_LEN("IsBackgroundDark" ), WID_PAGE_ISDARK, &::getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0}, - { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::com::sun::star::container::XIndexAccess::static_type(),0, 0}, - {0,0,0,0,0,0} + GRAPHIC_PAGE_PROPERTIES + }; + static const SfxItemPropertyMapEntry aGraphicPagePropertyNoBackMap_Impl[] = + { + GRAPHIC_PAGE_PROPERTIES }; + // + bool bWithoutBackground = ePageKind != PK_STANDARD && ePageKind != PK_HANDOUT; + const SvxItemPropertySet* pRet = 0; if( bImpress ) { if( ePageKind == PK_STANDARD ) { - return aDrawPagePropertyMap_Impl; + //PK_STANDARD always has a background property + static SvxItemPropertySet aDrawPagePropertySet_Impl( aDrawPagePropertyMap_Impl ); + pRet = &aDrawPagePropertySet_Impl; } else { - return aDrawPageNotesHandoutPropertyMap_Impl; + if(bWithoutBackground) + { + static SvxItemPropertySet aDrawPageNotesHandoutPropertyNoBackSet_Impl( aDrawPageNotesHandoutPropertyNoBackMap_Impl ); + pRet = &aDrawPageNotesHandoutPropertyNoBackSet_Impl; + } + else + { + static SvxItemPropertySet aDrawPageNotesHandoutPropertySet_Impl( aDrawPageNotesHandoutPropertyMap_Impl ); + pRet = &aDrawPageNotesHandoutPropertySet_Impl; + } } } else - return aGraphicPagePropertyMap_Impl; + { + if(bWithoutBackground) + { + static SvxItemPropertySet aGraphicPagePropertyNoBackSet_Impl( aGraphicPagePropertyNoBackMap_Impl ); + pRet = &aGraphicPagePropertyNoBackSet_Impl; + } + else + { + static SvxItemPropertySet aGraphicPagePropertySet_Impl( aGraphicPagePropertyMap_Impl ); + pRet = &aGraphicPagePropertySet_Impl; + } + } + return pRet; } /** this function stores the property map for master pages in impress and draw */ -const SfxItemPropertyMap* ImplGetMasterPagePropertyMap( PageKind ePageKind ) +const SvxItemPropertySet* ImplGetMasterPagePropertySet( PageKind ePageKind ) { - static const SfxItemPropertyMap aMasterPagePropertyMap_Impl[] = + static const SfxItemPropertyMapEntry aMasterPagePropertyMap_Impl[] = { { MAP_CHAR_LEN(UNO_NAME_PAGE_BACKGROUND), WID_PAGE_BACK, &ITYPE(beans::XPropertySet), 0, 0}, { MAP_CHAR_LEN(UNO_NAME_PAGE_BOTTOM), WID_PAGE_BOTTOM, &::getCppuType((const sal_Int32*)0), 0, 0}, @@ -269,7 +308,7 @@ const SfxItemPropertyMap* ImplGetMasterPagePropertyMap( PageKind ePageKind ) {0,0,0,0,0,0} }; - static const SfxItemPropertyMap aHandoutMasterPagePropertyMap_Impl[] = + static const SfxItemPropertyMapEntry aHandoutMasterPagePropertyMap_Impl[] = { { MAP_CHAR_LEN(UNO_NAME_PAGE_BOTTOM), WID_PAGE_BOTTOM, &::getCppuType((const sal_Int32*)0), 0, 0}, { MAP_CHAR_LEN(UNO_NAME_PAGE_LEFT), WID_PAGE_LEFT, &::getCppuType((const sal_Int32*)0), 0, 0}, @@ -293,14 +332,18 @@ const SfxItemPropertyMap* ImplGetMasterPagePropertyMap( PageKind ePageKind ) {0,0,0,0,0,0} }; + const SvxItemPropertySet* pRet = 0; if( ePageKind == PK_HANDOUT ) { - return aHandoutMasterPagePropertyMap_Impl; + static SvxItemPropertySet aHandoutMasterPagePropertySet_Impl( aHandoutMasterPagePropertyMap_Impl ); + pRet = &aHandoutMasterPagePropertySet_Impl; } else { - return aMasterPagePropertyMap_Impl; + static SvxItemPropertySet aMasterPagePropertySet_Impl( aMasterPagePropertyMap_Impl ); + pRet = &aMasterPagePropertySet_Impl; } + return pRet; } UNO3_GETIMPLEMENTATION2_IMPL( SdGenericDrawPage, SvxFmDrawPage ); @@ -308,12 +351,12 @@ UNO3_GETIMPLEMENTATION2_IMPL( SdGenericDrawPage, SvxFmDrawPage ); /*********************************************************************** * * ***********************************************************************/ -SdGenericDrawPage::SdGenericDrawPage( SdXImpressDocument* _pModel, SdPage* pInPage, const SfxItemPropertyMap* pMap ) throw() +SdGenericDrawPage::SdGenericDrawPage( SdXImpressDocument* _pModel, SdPage* pInPage, const SvxItemPropertySet* _pSet ) throw() : SvxFmDrawPage( (SdrPage*) pInPage ), SdUnoSearchReplaceShape(this), mpModel ( _pModel ), mpSdrModel(0), - maPropSet ( (pInPage&& (pInPage->GetPageKind() != PK_STANDARD) && (pInPage->GetPageKind() != PK_HANDOUT) )?&pMap[1]:pMap ), + mpPropSet ( _pSet ), mbHasBackgroundObject(sal_False), mbIsImpressDocument(false) { @@ -489,7 +532,7 @@ Reference< beans::XPropertySetInfo > SAL_CALL SdGenericDrawPage::getPropertySetI { OGuard aGuard( Application::GetSolarMutex() ); throwIfDisposed(); - return maPropSet.getPropertySetInfo(); + return mpPropSet->getPropertySetInfo(); } void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) @@ -499,9 +542,9 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName throwIfDisposed(); - const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry(aPropertyName); + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); - switch( pMap ? pMap->nWID : -1 ) + switch( pEntry ? pEntry->nWID : -1 ) { case WID_NAVORDER: setNavigationOrder( aValue ); @@ -518,7 +561,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName if(!(aValue >>= nValue)) throw lang::IllegalArgumentException(); - switch( pMap->nWID ) + switch( pEntry->nWID ) { case WID_PAGE_LEFT: SetLftBorder(nValue); @@ -729,7 +772,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName { sd::HeaderFooterSettings aHeaderFooterSettings( GetPage()->getHeaderFooterSettings() ); - switch( pMap->nWID ) + switch( pEntry->nWID ) { case WID_PAGE_HEADERVISIBLE: { @@ -895,9 +938,9 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) uno::Any aAny; - const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry(PropertyName); + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); - switch( pMap ? pMap->nWID : -1 ) + switch( pEntry ? pEntry->nWID : -1 ) { case WID_NAVORDER: aAny = getNavigationOrder(); @@ -1926,7 +1969,7 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getSupportedServiceNames() //======================================================================== SdDrawPage::SdDrawPage( SdXImpressDocument* pModel, SdPage* pPage ) throw() -: SdGenericDrawPage( pModel, pPage, ImplGetDrawPagePropertyMap( pModel->IsImpressDocument(), pPage->GetPageKind() ) ) +: SdGenericDrawPage( pModel, pPage, ImplGetDrawPagePropertySet( pModel->IsImpressDocument(), pPage->GetPageKind() ) ) { } @@ -2585,7 +2628,7 @@ Any SdGenericDrawPage::getNavigationOrder() //======================================================================== SdMasterPage::SdMasterPage( SdXImpressDocument* pModel, SdPage* pPage ) throw() -: SdGenericDrawPage( pModel, pPage, ImplGetMasterPagePropertyMap( pPage ? pPage->GetPageKind() : PK_STANDARD ) ) +: SdGenericDrawPage( pModel, pPage, ImplGetMasterPagePropertySet( pPage ? pPage->GetPageKind() : PK_STANDARD ) ) { mbHasBackgroundObject = pPage && GetPage()->GetPageKind() == PK_STANDARD; } @@ -2794,19 +2837,19 @@ void SdMasterPage::setBackground( const Any& rValue ) Reference< beans::XPropertySetInfo > xSetInfo( xInputSet->getPropertySetInfo(), UNO_QUERY_THROW ); Reference< beans::XPropertyState > xSetStates( xInputSet, UNO_QUERY ); - const SfxItemPropertyMap* pMap = ImplGetPageBackgroundPropertyMap(); - while( pMap->pName ) + PropertyEntryVector_t aBackgroundProperties = ImplGetPageBackgroundPropertySet()->getPropertyMap()->getPropertyEntries(); + PropertyEntryVector_t::const_iterator aIt = aBackgroundProperties.begin(); + while( aIt != aBackgroundProperties.end() ) { - const OUString aPropName( OUString::createFromAscii(pMap->pName) ); - if( xSetInfo->hasPropertyByName( aPropName ) ) + if( xSetInfo->hasPropertyByName( aIt->sName ) ) { - if( !xSetStates.is() || xSetStates->getPropertyState( aPropName ) == beans::PropertyState_DIRECT_VALUE ) - xStyleSet->setPropertyValue( aPropName, xInputSet->getPropertyValue( aPropName ) ); + if( !xSetStates.is() || xSetStates->getPropertyState( aIt->sName ) == beans::PropertyState_DIRECT_VALUE ) + xStyleSet->setPropertyValue( aIt->sName, xInputSet->getPropertyValue( aIt->sName ) ); else - xSetStates->setPropertyToDefault( aPropName ); + xSetStates->setPropertyToDefault( aIt->sName ); } - ++pMap; + ++aIt; } } } diff --git a/sd/source/ui/unoidl/unopage.hxx b/sd/source/ui/unoidl/unopage.hxx index c8ef914f2071..161bba627bc1 100644 --- a/sd/source/ui/unoidl/unopage.hxx +++ b/sd/source/ui/unoidl/unopage.hxx @@ -52,7 +52,7 @@ class SdPage; class SvxShape; class SdrObject; -struct SfxItemPropertyMap; +struct SfxItemPropertySimpleEntry; #ifdef SVX_LIGHT #define SvxFmDrawPage SvxDrawPage @@ -78,7 +78,7 @@ private: protected: friend class SdXImpressDocument; - SvxItemPropertySet maPropSet; + const SvxItemPropertySet* mpPropSet; virtual void setBackground( const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::lang::IllegalArgumentException); virtual void getBackground( ::com::sun::star::uno::Any& rValue ) throw(); @@ -105,7 +105,7 @@ protected: void throwIfDisposed() const throw (::com::sun::star::uno::RuntimeException ); public: - SdGenericDrawPage( SdXImpressDocument* pModel, SdPage* pInPage, const SfxItemPropertyMap* pMap ) throw(); + SdGenericDrawPage( SdXImpressDocument* pModel, SdPage* pInPage, const SvxItemPropertySet* pSet ) throw(); virtual ~SdGenericDrawPage() throw(); // intern diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index ab7b725d8b23..8c1c8ac5e7e1 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -53,21 +53,22 @@ using namespace ::rtl; using namespace ::vos; using namespace ::com::sun::star; -const SfxItemPropertyMap* ImplGetPageBackgroundPropertyMap() +const SvxItemPropertySet* ImplGetPageBackgroundPropertySet() { - static const SfxItemPropertyMap aPageBackgroundPropertyMap_Impl[] = + static const SfxItemPropertyMapEntry aPageBackgroundPropertyMap_Impl[] = { FILL_PROPERTIES {0,0,0,0,0,0} }; - return aPageBackgroundPropertyMap_Impl; + static SvxItemPropertySet aPageBackgroundPropertySet_Impl( aPageBackgroundPropertyMap_Impl ); + return &aPageBackgroundPropertySet_Impl; } UNO3_GETIMPLEMENTATION_IMPL( SdUnoPageBackground ); SdUnoPageBackground::SdUnoPageBackground( SdDrawDocument* pDoc /* = NULL */, SdrObject* pObj /* = NULL */ ) throw() -: maPropSet( ImplGetPageBackgroundPropertyMap() ), mpSet( NULL ), mpDoc( pDoc ) +: mpPropSet( ImplGetPageBackgroundPropertySet() ), mpSet( NULL ), mpDoc( pDoc ) { if( pDoc ) { @@ -80,7 +81,7 @@ SdUnoPageBackground::SdUnoPageBackground( SdDrawDocument* pDoc /* = NULL */, Sdr } SdUnoPageBackground::SdUnoPageBackground( SdDrawDocument* pDoc, const SfxItemSet* pSet ) throw() -: maPropSet( ImplGetPageBackgroundPropertyMap() ), mpSet( NULL ), mpDoc( pDoc ) +: mpPropSet( ImplGetPageBackgroundPropertySet() ), mpSet( NULL ), mpDoc( pDoc ) { if( pDoc ) { @@ -130,34 +131,34 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) mpSet = new SfxItemSet( *rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST ); - if( maPropSet.AreThereOwnUsrAnys() ) + if( mpPropSet->AreThereOwnUsrAnys() ) { uno::Any* pAny; - const SfxItemPropertyMap* pMap = maPropSet.getPropertyMap(); - while( pMap->pName ) + PropertyEntryVector_t aProperties = mpPropSet->getPropertyMap()->getPropertyEntries(); + PropertyEntryVector_t::const_iterator aIt = aProperties.begin(); + while( aIt != aProperties.end() ) { - pAny = maPropSet.GetUsrAnyForID( pMap->nWID ); + pAny = mpPropSet->GetUsrAnyForID( aIt->nWID ); if( pAny ) { - OUString aPropertyName( OUString::createFromAscii(pMap->pName)); - if ( pMap->nWID == XATTR_FILLBITMAP ) + if ( aIt->nWID == XATTR_FILLBITMAP ) { if ( ( ( pAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >*)0) ) || ( pAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >*)0) ) ) && - ( pMap->nMemberId == MID_BITMAP ) ) + ( aIt->nMemberId == MID_BITMAP ) ) { - setPropertyValue( aPropertyName, *pAny ); + setPropertyValue( aIt->sName, *pAny ); } else if ( ( pAny->getValueType() == ::getCppuType((const ::rtl::OUString*)0) ) && - ( ( pMap->nMemberId == MID_NAME ) || ( pMap->nMemberId == MID_GRAFURL ) ) ) + ( ( aIt->nMemberId == MID_NAME ) || ( aIt->nMemberId == MID_GRAFURL ) ) ) { - setPropertyValue( aPropertyName, *pAny ); + setPropertyValue( aIt->sName, *pAny ); } } else - setPropertyValue( aPropertyName, *pAny ); + setPropertyValue( aIt->sName, *pAny ); } - pMap++; + ++aIt; } } } @@ -194,7 +195,7 @@ uno::Sequence< OUString > SAL_CALL SdUnoPageBackground::getSupportedServiceNames uno::Reference< beans::XPropertySetInfo > SAL_CALL SdUnoPageBackground::getPropertySetInfo() throw(uno::RuntimeException) { - return maPropSet.getPropertySetInfo(); + return mpPropSet->getPropertySetInfo(); } void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) @@ -202,9 +203,9 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa { OGuard aGuard( Application::GetSolarMutex() ); - const SfxItemPropertyMap* pMap = getPropertyMapEntry( aPropertyName ); + const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry( aPropertyName ); - if( pMap == NULL ) + if( pEntry == NULL ) { throw beans::UnknownPropertyException(); } @@ -212,7 +213,7 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa { if( mpSet ) { - if( pMap->nWID == OWN_ATTR_FILLBMP_MODE ) + if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { drawing::BitmapMode eMode; if( aValue >>= eMode ) @@ -225,31 +226,31 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa } SfxItemPool& rPool = *mpSet->GetPool(); - SfxItemSet aSet( rPool, pMap->nWID, pMap->nWID); + SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID); aSet.Put( *mpSet ); if( !aSet.Count() ) - aSet.Put( rPool.GetDefaultItem( pMap->nWID ) ); + aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) ); - if( pMap->nMemberId == MID_NAME && ( pMap->nWID == XATTR_FILLBITMAP || pMap->nWID == XATTR_FILLGRADIENT || pMap->nWID == XATTR_FILLHATCH || pMap->nWID == XATTR_FILLFLOATTRANSPARENCE ) ) + if( pEntry->nMemberId == MID_NAME && ( pEntry->nWID == XATTR_FILLBITMAP || pEntry->nWID == XATTR_FILLGRADIENT || pEntry->nWID == XATTR_FILLHATCH || pEntry->nWID == XATTR_FILLFLOATTRANSPARENCE ) ) { OUString aName; if(!(aValue >>= aName )) throw lang::IllegalArgumentException(); - SvxShape::SetFillAttribute( pMap->nWID, aName, aSet ); + SvxShape::SetFillAttribute( pEntry->nWID, aName, aSet ); } else { - maPropSet.setPropertyValue( pMap, aValue, aSet ); + mpPropSet->setPropertyValue( pEntry, aValue, aSet ); } mpSet->Put( aSet ); } else { - if(pMap && pMap->nWID) - maPropSet.setPropertyValue( pMap, aValue ); + if(pEntry && pEntry->nWID) + mpPropSet->setPropertyValue( pEntry, aValue ); } } } @@ -260,9 +261,9 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert OGuard aGuard( Application::GetSolarMutex() ); uno::Any aAny; - const SfxItemPropertyMap* pMap = getPropertyMapEntry(PropertyName); + const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry(PropertyName); - if( pMap == NULL ) + if( pEntry == NULL ) { throw beans::UnknownPropertyException(); } @@ -270,7 +271,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert { if( mpSet ) { - if( pMap->nWID == OWN_ATTR_FILLBMP_MODE ) + if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { XFillBmpStretchItem* pStretchItem = (XFillBmpStretchItem*)mpSet->GetItem(XATTR_FILLBMP_STRETCH); XFillBmpTileItem* pTileItem = (XFillBmpTileItem*)mpSet->GetItem(XATTR_FILLBMP_TILE); @@ -288,20 +289,20 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert else { SfxItemPool& rPool = *mpSet->GetPool(); - SfxItemSet aSet( rPool, pMap->nWID, pMap->nWID); + SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID); aSet.Put( *mpSet ); if( !aSet.Count() ) - aSet.Put( rPool.GetDefaultItem( pMap->nWID ) ); + aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) ); // Hole Wert aus ItemSet - aAny = maPropSet.getPropertyValue( pMap, aSet ); + aAny = mpPropSet->getPropertyValue( pEntry, aSet ); } } else { - if(pMap && pMap->nWID) - aAny = maPropSet.getPropertyValue( pMap ); + if(pEntry && pEntry->nWID) + aAny = mpPropSet->getPropertyValue( pEntry ); } } return aAny; @@ -318,14 +319,14 @@ beans::PropertyState SAL_CALL SdUnoPageBackground::getPropertyState( const OUStr { OGuard aGuard( Application::GetSolarMutex() ); - const SfxItemPropertyMap* pMap = getPropertyMapEntry(PropertyName); + const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry(PropertyName); - if( pMap == NULL ) + if( pEntry == NULL ) throw beans::UnknownPropertyException(); if( mpSet ) { - if( pMap->nWID == OWN_ATTR_FILLBMP_MODE ) + if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { if( mpSet->GetItemState( XATTR_FILLBMP_STRETCH, false ) == SFX_ITEM_SET || mpSet->GetItemState( XATTR_FILLBMP_TILE, false ) == SFX_ITEM_SET ) @@ -338,7 +339,7 @@ beans::PropertyState SAL_CALL SdUnoPageBackground::getPropertyState( const OUStr } } - switch( mpSet->GetItemState( pMap->nWID, sal_False ) ) + switch( mpSet->GetItemState( pEntry->nWID, sal_False ) ) { case SFX_ITEM_READONLY: case SFX_ITEM_SET: @@ -353,7 +354,7 @@ beans::PropertyState SAL_CALL SdUnoPageBackground::getPropertyState( const OUStr } else { - if( NULL == maPropSet.GetUsrAnyForID(pMap->nWID) ) + if( NULL == mpPropSet->GetUsrAnyForID(pEntry->nWID) ) return beans::PropertyState_DEFAULT_VALUE; else return beans::PropertyState_DIRECT_VALUE; @@ -382,21 +383,21 @@ void SAL_CALL SdUnoPageBackground::setPropertyToDefault( const OUString& Propert { OGuard aGuard( Application::GetSolarMutex() ); - const SfxItemPropertyMap* pMap = getPropertyMapEntry(PropertyName); + const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry(PropertyName); - if( pMap == NULL ) + if( pEntry == NULL ) throw beans::UnknownPropertyException(); if( mpSet ) { - if( pMap->nWID == OWN_ATTR_FILLBMP_MODE ) + if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { mpSet->ClearItem( XATTR_FILLBMP_STRETCH ); mpSet->ClearItem( XATTR_FILLBMP_TILE ); } else { - mpSet->ClearItem( pMap->nWID ); + mpSet->ClearItem( pEntry->nWID ); } } } @@ -406,40 +407,32 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyDefault( const OUString& aProp { OGuard aGuard( Application::GetSolarMutex() ); - const SfxItemPropertyMap* pMap = getPropertyMapEntry(aPropertyName); - if( pMap == NULL || mpSet == NULL ) + const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry(aPropertyName); + if( pEntry == NULL || mpSet == NULL ) throw beans::UnknownPropertyException(); uno::Any aAny; if( mpSet ) { - if( pMap->nWID == OWN_ATTR_FILLBMP_MODE ) + if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { aAny <<= drawing::BitmapMode_REPEAT; } else { SfxItemPool& rPool = *mpSet->GetPool(); - SfxItemSet aSet( rPool, pMap->nWID, pMap->nWID); - aSet.Put( rPool.GetDefaultItem( pMap->nWID ) ); + SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID); + aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) ); - aAny = maPropSet.getPropertyValue( pMap, aSet ); + aAny = mpPropSet->getPropertyValue( pEntry, aSet ); } } return aAny; } /** this is used because our property map is not sorted yet */ -const SfxItemPropertyMap* SdUnoPageBackground::getPropertyMapEntry( const OUString& rPropertyName ) const throw() +const SfxItemPropertySimpleEntry* SdUnoPageBackground::getPropertyMapEntry( const OUString& rPropertyName ) const throw() { - const SfxItemPropertyMap *pMap = maPropSet.getPropertyMap(); - while( pMap->pName ) - { - if( rPropertyName.compareToAscii( pMap->pName ) == 0 ) - return pMap; - ++pMap; - } - - return NULL; + return mpPropSet->getPropertyMap()->getByName(rPropertyName); } diff --git a/sd/source/ui/unoidl/unopback.hxx b/sd/source/ui/unoidl/unopback.hxx index bd06ee40021d..61e8f88b4b7e 100644 --- a/sd/source/ui/unoidl/unopback.hxx +++ b/sd/source/ui/unoidl/unopback.hxx @@ -42,7 +42,7 @@ #include <cppuhelper/implbase4.hxx> -const SfxItemPropertyMap* ImplGetPageBackgroundPropertyMap(); +const SvxItemPropertySet* ImplGetPageBackgroundPropertySet(); class SdrObject; class SdDrawDocument; @@ -56,11 +56,11 @@ class SdUnoPageBackground : public ::cppu::WeakImplHelper4< public SfxListener { protected: - SvxItemPropertySet maPropSet; + const SvxItemPropertySet* mpPropSet; SfxItemSet* mpSet; SdrModel* mpDoc; - const SfxItemPropertyMap* getPropertyMapEntry( const ::rtl::OUString& rPropertyName ) const throw(); + const SfxItemPropertySimpleEntry* getPropertyMapEntry( const ::rtl::OUString& rPropertyName ) const throw(); public: SdUnoPageBackground( SdDrawDocument* pDoc = NULL, SdrObject* pObj = NULL ) throw(); SdUnoPageBackground( SdDrawDocument* pDoc, const SfxItemSet* pSet ) throw(); diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index 269debd1a4a1..30be3b1f9682 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -55,9 +55,9 @@ using namespace ::com::sun::star; #define WID_SEARCH_CASE 1 #define WID_SEARCH_WORDS 2 -const SfxItemPropertyMap* ImplGetSearchPropertyMap() +const SfxItemPropertyMapEntry* ImplGetSearchPropertyMap() { - static const SfxItemPropertyMap aSearchPropertyMap_Impl[] = + static const SfxItemPropertyMapEntry aSearchPropertyMap_Impl[] = { { MAP_CHAR_LEN(UNO_NAME_SEARCH_BACKWARDS), WID_SEARCH_BACKWARDS, &::getBooleanCppuType(), 0, 0 }, { MAP_CHAR_LEN(UNO_NAME_SEARCH_CASE), WID_SEARCH_CASE, &::getBooleanCppuType(), 0, 0 }, @@ -785,11 +785,11 @@ void SAL_CALL SdUnoSearchReplaceDescriptor::setPropertyValue( const ::rtl::OUStr { OGuard aGuard( Application::GetSolarMutex() ); - const SfxItemPropertyMap* pMap = mpPropSet->getPropertyMapEntry(aPropertyName); + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); sal_Bool bOk = sal_False; - switch( pMap ? pMap->nWID : -1 ) + switch( pEntry ? pEntry->nWID : -1 ) { case WID_SEARCH_BACKWARDS: bOk = (aValue >>= mbBackwards); @@ -815,9 +815,9 @@ uno::Any SAL_CALL SdUnoSearchReplaceDescriptor::getPropertyValue( const ::rtl::O uno::Any aAny; - const SfxItemPropertyMap* pMap = mpPropSet->getPropertyMapEntry(PropertyName); + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); - switch( pMap ? pMap->nWID : -1 ) + switch( pEntry ? pEntry->nWID : -1 ) { case WID_SEARCH_BACKWARDS: aAny <<= (sal_Bool)mbBackwards; |