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 | c9892b87710ca8ec68bc1d7d5c9e70bc94ec1217 (patch) | |
tree | 3cdb0bfb328337da87a2712b53fc747356d21386 | |
parent | a353310cf73251cf418189a361132d57263a59e3 (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
57 files changed, 3147 insertions, 2473 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 86e53dc2e6..08baf50b71 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -911,6 +911,7 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr #define FN_UNO_PARA_CONT_PREV_SUBTREE (FN_EXTRA2 + 109) #define FN_UNO_PARA_NUM_STRING (FN_EXTRA2 + 110) +#define FN_UNO_TABLE_NAME (FN_EXTRA2 + 111) /*-------------------------------------------------------------------- Bereich: Hilfe diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 1be468eca6..0069d3920f 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1403,7 +1403,7 @@ public: // Methoden fuer die Verzeichnisse: // - Verzeichnismarke einfuegen loeschen travel sal_uInt16 GetCurTOXMark( const SwPosition& rPos, SwTOXMarks& ) const; - void Delete( SwTOXMark* pTOXMark ); + void Delete( const SwTOXMark* pTOXMark ); const SwTOXMark& GotoTOXMark( const SwTOXMark& rCurTOXMark, SwTOXSearch eDir, sal_Bool bInReadOnly ); diff --git a/sw/inc/unoatxt.hxx b/sw/inc/unoatxt.hxx index e54d4b0863..281abb76db 100644 --- a/sw/inc/unoatxt.hxx +++ b/sw/inc/unoatxt.hxx @@ -120,7 +120,7 @@ class SwXAutoTextGroup : public cppu::WeakImplHelper6 ::com::sun::star::lang::XUnoTunnel > { - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* pPropSet; SwGlossaries* pGlossaries; rtl::OUString sName; String m_sGroupName; // prefix m_ to disambiguate from some local vars in the implementation diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx index 7d76bd4663..870b107bb6 100644 --- a/sw/inc/unochart.hxx +++ b/sw/inc/unochart.hxx @@ -281,7 +281,7 @@ class SwChartDataSequence : SwUnoCrsr* pTblCrsr; // cursor spanned over cells to use SwDepend aCursorDepend; //the cursor is removed after the doc has been removed - const SfxItemPropertyMap* pMap; + const SfxItemPropertySet* _pPropSet; sal_Bool bDisposed; diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx index 2553500f5f..7ed15fd403 100644 --- a/sw/inc/unocoll.hxx +++ b/sw/inc/unocoll.hxx @@ -33,6 +33,7 @@ #include <flyenum.hxx> #include <vcl/timer.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <tools/string.hxx> @@ -41,6 +42,7 @@ #include <cppuhelper/implbase3.hxx> // helper for implementations #include <cppuhelper/implbase4.hxx> // helper for implementations #include <IMark.hxx> +#include <unobaseclass.hxx> /*************************************************** *************************************************** * @@ -304,17 +306,23 @@ public: virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); +virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::text::XTextTable* GetObject( SwFrmFmt& rFmt ); }; -/*-----------------11.12.97 10:14------------------- +typedef +cppu::WeakImplHelper4 +< + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::container::XNameAccess, + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::lang::XServiceInfo +> SwXFramesBaseClass; ---------------------------------------------------*/ -class SwXFrames : public SwCollectionBaseClass, +class SwXFrames : public SwXFramesBaseClass, public SwUnoCollection { const FlyCntType eType; @@ -323,6 +331,9 @@ protected: public: SwXFrames(SwDoc* pDoc, FlyCntType eSet); + //XEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + //XIndexAccess virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx index f8122978ee..490934a0a3 100644 --- a/sw/inc/unocrsrhelper.hxx +++ b/sw/inc/unocrsrhelper.hxx @@ -32,9 +32,9 @@ #include <com/sun/star/beans/XPropertyState.hpp> #include <unocrsr.hxx> +#include <map> - -struct SfxItemPropertyMap; +struct SfxItemPropertySimpleEntry; class SwPaM; class SwDoc; @@ -46,12 +46,23 @@ namespace com{ namespace sun{ namespace star{ struct PropertyValue; } }}} + /* -----------------------------14.12.00 15:06-------------------------------- ---------------------------------------------------------------------------*/ namespace SwUnoCursorHelper { - sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap + // keep Any's mapped by (WhichId << 16 ) + (MemberId) + typedef std::map< sal_uInt32, com::sun::star::uno::Any *> AnyMapHelper_t; + class SwAnyMapHelper : public AnyMapHelper_t + { + public: + ~SwAnyMapHelper(); + + void SetValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any& rAny ); + bool FillValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any*& pAny ); + }; + sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry , SwPaM& rPam , com::sun::star::uno::Any *pAny , com::sun::star::beans::PropertyState& eState @@ -65,7 +76,7 @@ namespace SwUnoCursorHelper { return rUnoCrsr.GetCntntNode() && rUnoCrsr.GetPoint()->nContent == rUnoCrsr.GetCntntNode()->Len();} - void resetCrsrPropertyValue(const SfxItemPropertyMap* pMap, SwPaM& rPam); + void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPam); void InsertFile(SwUnoCrsr* pUnoCrsr, const String& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rOptions diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx index c80624ea11..782afb3f8f 100644 --- a/sw/inc/unodraw.hxx +++ b/sw/inc/unodraw.hxx @@ -42,8 +42,10 @@ #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/drawing/XShapes.hpp> #include <cppuhelper/implbase3.hxx> // helper for implementations +#include <cppuhelper/implbase4.hxx> // helper for implementations // --> OD 2004-07-22 #i31698# #include <cppuhelper/implbase6.hxx> // helper for implementations +#include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/drawing/HomogenMatrix3.hpp> // <-- #include <svtools/itemprop.hxx> @@ -83,11 +85,9 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw (); }; -/* -----------------09.12.98 08:57------------------- - * - * --------------------------------------------------*/ -typedef cppu::WeakAggImplHelper3 +typedef cppu::WeakAggImplHelper4 < + ::com::sun::star::container::XEnumerationAccess, ::com::sun::star::drawing::XDrawPage, ::com::sun::star::lang::XServiceInfo, ::com::sun::star::drawing::XShapeGrouper @@ -102,6 +102,9 @@ public: SwXDrawPage(SwDoc* pDoc); ~SwXDrawPage(); + //XEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); @@ -162,8 +165,8 @@ class SwXShape : public SwXShapeBaseClass, ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape; // <-- - SfxItemPropertySet aPropSet; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropSet; + const SfxItemPropertyMapEntry* m_pPropertyMapEntries; com::sun::star::uno::Sequence< sal_Int8 >* pImplementationId; SwShapeDescriptor_Impl* pImpl; diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index b919b605ce..2775db8690 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -43,6 +43,7 @@ */ class SwDoc; +class SfxItemPropertSet; /*-----------------12.02.98 11:21------------------- --------------------------------------------------*/ @@ -59,9 +60,8 @@ class SwXFrame : public cppu::WeakImplHelper6 public SwClient { SwEventListenerContainer aLstnrCntnr; - SfxItemPropertySet aPropSet; - const SfxItemPropertyMap* _pMap; - SwDoc* mpDoc; + const SfxItemPropertySet* m_pPropSet; + SwDoc* m_pDoc; const FlyCntType eType; @@ -79,10 +79,10 @@ protected: virtual ~SwXFrame(); public: SwXFrame(FlyCntType eSet, - const SfxItemPropertyMap* pMap, + const SfxItemPropertySet* pPropSet, SwDoc *pDoc ); //Descriptor-If SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, - const SfxItemPropertyMap* pMap); + const SfxItemPropertySet* pPropSet); static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); @@ -166,7 +166,7 @@ class SwXTextFrame : public SwXTextFrameBaseClass, public SwXText, public SwXFrame { - const SfxItemPropertyMap* _pMap; + const SfxItemPropertSet* _pPropSet; protected: virtual const SwStartNode *GetStartNode() const; diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index 9080d7b0f9..544399d544 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -60,7 +60,7 @@ class SwXDocumentIndex : public cppu::WeakImplHelper5 friend class SwXIndexTokenAccess_Impl; SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropSet; SwDoc* m_pDoc; const SwTOXBaseSection* pBase; TOXTypes eTOXType; @@ -153,7 +153,7 @@ class SwXDocumentIndexMark : public cppu::WeakImplHelper4 SwDepend aTypeDepend; SwDoc* m_pDoc; const SwTOXMark* m_pTOXMark; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropSet; sal_Bool bIsDescriptor; sal_Bool bMainEntry; diff --git a/sw/inc/unomailmerge.hxx b/sw/inc/unomailmerge.hxx index 8562133797..a9710a2e32 100644 --- a/sw/inc/unomailmerge.hxx +++ b/sw/inc/unomailmerge.hxx @@ -109,7 +109,7 @@ class SwXMailMerge : OPropertyListenerContainerHelper aPropListeners; //SfxItemPropertySet aPropSet; - const SfxItemPropertyMap* pMap; + const SfxItemPropertySet* pPropSet; SfxObjectShellRef xDocSh; // the document diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx index c910019122..11244fe940 100644 --- a/sw/inc/unomap.hxx +++ b/sw/inc/unomap.hxx @@ -134,18 +134,6 @@ #define PROPERTY_MAP_END 98 -#define PROPERTY_SET_CHAR_STYLE 1 -#define PROPERTY_SET_PARA_STYLE 2 -#define PROPERTY_SET_FRAME_STYLE 3 -#define PROPERTY_SET_PAGE_STYLE 4 -#define PROPERTY_SET_NUM_STYLE 5 -// basically the same as PROPERTY_SET_PARA_STYLE with additional property -// that is only available for conditional para styles -#define PROPERTY_SET_CONDITIONAL_PARA_STYLE 6 -#define PROPERTY_SET_CHAR_AUTO_STYLE 7 -#define PROPERTY_SET_RUBY_AUTO_STYLE 8 -#define PROPERTY_SET_PARA_AUTO_STYLE 9 - //S&E #define WID_WORDS 0 #define WID_BACKWARDS 1 @@ -337,7 +325,7 @@ class SwItemPropertySet : public SfxItemPropertySet protected: virtual sal_Bool FillItem(SfxItemSet& rSet, sal_uInt16 nWhich, sal_Bool bGetProperty) const; public: - SwItemPropertySet( const SfxItemPropertyMap *pMap ) : + SwItemPropertySet( const SfxItemPropertyMapEntry *pMap ) : SfxItemPropertySet( pMap ){} }; /* -----------------04.07.98 11:41------------------- @@ -345,26 +333,16 @@ public: * --------------------------------------------------*/ class SwUnoPropertyMapProvider { - SfxItemPropertyMap* aMapArr[PROPERTY_MAP_END]; - - SfxItemPropertySet* pCharStyleMap; - SfxItemPropertySet* pParaStyleMap; - SfxItemPropertySet* pFrameStyleMap; - SfxItemPropertySet* pPageStyleMap; - SfxItemPropertySet* pNumStyleMap; - SfxItemPropertySet* pConditionalParaStyleMap; - SfxItemPropertySet* pCharAutoStyleMap; - SfxItemPropertySet* pParaAutoStyleMap; - SfxItemPropertySet* pRubyAutoStyleMap; + SfxItemPropertyMapEntry* aMapEntriesArr[PROPERTY_MAP_END]; + SfxItemPropertySet* aPropertySetArr[PROPERTY_MAP_END]; - void Sort(sal_uInt16 nId); public: SwUnoPropertyMapProvider(); ~SwUnoPropertyMapProvider(); - const SfxItemPropertyMap* GetPropertyMap(sal_uInt16 PropertyId); + const SfxItemPropertyMapEntry* GetPropertyMapEntries(sal_uInt16 PropertyId); + const SfxItemPropertySet* GetPropertySet( sal_uInt16 PropertyId ); - SfxItemPropertySet& GetPropertySet(sal_Int8 nPropSetId); }; extern SwUnoPropertyMapProvider aSwMapProvider; diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index f2ee4a6f9d..61d5aff684 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -59,9 +59,7 @@ #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> -//#ifndef _COM_SUN_STAR_BEANS_XTOLERANTMULTIPROPERTYSET_HPP_ -//#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> -//#endif +#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/beans/XMultiPropertyStates.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -216,7 +214,7 @@ class SwXText : public ::com::sun::star::lang::XTypeProvider, SwDoc* pDoc; BOOL bObjectValid; CursorType eCrsrType; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropSet; virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishOrAppendParagraph( bool bFinish, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) @@ -317,7 +315,8 @@ enum SwGetPropertyStatesCaller { SW_PROPERTY_STATE_CALLER_DEFAULT, SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, - SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY + SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT }; #define CRSR_ATTR_MODE_TABLE 1 //attributes should be applied to a table selection #define CRSR_ATTR_MODE_DONTREPLACE 2 //attributes should be added, not replaced @@ -341,7 +340,7 @@ class SwXTextCursor : public SwXTextCursor_Base, public OTextCursorHelper { SwEventListenerContainer aLstnrCntnr; - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* m_pPropSet; ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; SwSortOptions* pLastSortOptions; @@ -438,7 +437,6 @@ public: const SfxItemPropertySet& rPropSet, const rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue, - const SfxItemPropertyMap* pMap = 0, USHORT nAttrMode = 0) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, @@ -446,8 +444,8 @@ public: ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); static ::com::sun::star::uno::Any GetPropertyValue( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > GetPropertyStates( SwPaM& rPaM, SfxItemPropertySet& rPropSet, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames, SwGetPropertyStatesCaller eCaller = SW_PROPERTY_STATE_CALLER_DEFAULT) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::beans::PropertyState GetPropertyState( SwPaM& rPaM, SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > GetPropertyStates( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames, SwGetPropertyStatesCaller eCaller = SW_PROPERTY_STATE_CALLER_DEFAULT) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::beans::PropertyState GetPropertyState( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); static void SetPropertyToDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); static ::com::sun::star::uno::Any GetPropertyDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); @@ -739,13 +737,13 @@ class SW_DLLPUBLIC SwXTextRange : public cppu::WeakImplHelper8 RANGE_INVALID // von NewInstance erzeugt } eRangePosition; - SwDoc* pDoc; - SwTableBox* pBox; - const SwStartNode* pBoxStartNode; - SwDepend aObjectDepend; //Format der Tabelle oder des Rahmens anmelden - SfxItemPropertySet aPropSet; - //SwDepend aFrameDepend; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + SwDoc* pDoc; + SwTableBox* pBox; + const SwStartNode* pBoxStartNode; + SwDepend aObjectDepend; //Format der Tabelle oder des Rahmens anmelden + const SfxItemPropertySet* m_pPropSet; + //SwDepend aFrameDepend; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; ::sw::mark::IMark* pMark; void _CreateNewBookmark(SwPaM& rPam); @@ -922,7 +920,7 @@ class SwXTextSection : public cppu::WeakImplHelper7 { friend class SwXTextSectionClient; SwEventListenerContainer aLstnrCntnr; - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* m_pPropSet; BOOL m_bIsDescriptor; BOOL m_bIndexHeader; @@ -1148,9 +1146,9 @@ public: /*-----------------07.04.98 08:15------------------- --------------------------------------------------*/ -class SwXParagraph : public cppu::WeakImplHelper9 +class SwXParagraph : public cppu::WeakImplHelper10 < -// ::com::sun::star::beans::XTolerantMultiPropertySet, + ::com::sun::star::beans::XTolerantMultiPropertySet, ::com::sun::star::beans::XMultiPropertySet, ::com::sun::star::text::XTextRange, ::com::sun::star::beans::XPropertySet, @@ -1165,7 +1163,7 @@ class SwXParagraph : public cppu::WeakImplHelper9 { ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; SwEventListenerContainer aLstnrCntnr; - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* m_pPropSet; rtl::OUString m_sText; sal_Int32 nSelectionStartPos; sal_Int32 nSelectionEndPos; @@ -1176,9 +1174,9 @@ protected: void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); -// ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl( -// const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, -// sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl( + const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, + sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException); virtual ~SwXParagraph(); public: @@ -1192,9 +1190,9 @@ public: virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); //XTolerantMultiPropertySet -// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); -// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); -// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); //XMultiPropertySet // virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx index ebbd657a76..46a84c6c0d 100644 --- a/sw/inc/unoport.hxx +++ b/sw/inc/unoport.hxx @@ -38,9 +38,7 @@ #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> -//#ifndef _COM_SUN_STAR_BEANS_XTOLERANTMULTIPROPERTYSET_HPP_ -//#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> -//#endif +#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> #include <com/sun/star/text/XTextField.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -80,9 +78,9 @@ enum SwTextPortionType class SwXRubyPortion; -class SwXTextPortion : public cppu::WeakImplHelper8 +class SwXTextPortion : public cppu::WeakImplHelper9 < -// ::com::sun::star::beans::XTolerantMultiPropertySet, + ::com::sun::star::beans::XTolerantMultiPropertySet, ::com::sun::star::beans::XMultiPropertySet, ::com::sun::star::beans::XPropertySet, ::com::sun::star::text::XTextRange, @@ -96,7 +94,7 @@ class SwXTextPortion : public cppu::WeakImplHelper8 { friend class SwXRubyPortion; SwEventListenerContainer aLstnrCntnr; - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* m_pPropSet; ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xRefMark; ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xTOXMark; @@ -117,10 +115,15 @@ class SwXTextPortion : public cppu::WeakImplHelper8 SwFmtFld* GetFldFmt(BOOL bInit = sal_False); protected: - SfxItemPropertySet& GetPropSet() { return aPropSet; } + //SfxItemPropertySet& GetPropSet() { return aPropSet; } - void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + void SAL_CALL SetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // ::com::sun::star::uno::Any GetPropertyValue( const SfxItemPropertyMap *pEntry, // SwUnoCrsr *pUnoCrsr, @@ -130,11 +133,11 @@ protected: sal_Int32 nLength ); void GetPropertyValue( ::com::sun::star::uno::Any &rVal, - const SfxItemPropertyMap *pEntry, SwUnoCrsr *pUnoCrsr, SfxItemSet *&pSet ); + const SfxItemPropertySimpleEntry& rEntry, SwUnoCrsr *pUnoCrsr, SfxItemSet *&pSet ); -// ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl( -// const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, -// sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl( + const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, + sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException); virtual ~SwXTextPortion(); public: @@ -150,9 +153,9 @@ public: virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); //XTolerantMultiPropertySet -// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); -// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); -// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); //XMultiPropertySet // virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx index d96d5c0a5d..f0b9c6c1c2 100644 --- a/sw/inc/unosett.hxx +++ b/sw/inc/unosett.hxx @@ -44,13 +44,12 @@ #include <cppuhelper/implbase4.hxx> #include <cppuhelper/implbase5.hxx> #include <tools/string.hxx> +#include <svtools/itemprop.hxx> class SwDoc; class SwFmtCol; class SwDocShell; class SwNumRule; -struct SfxItemPropertyMap; - /****************************************************************************** * ******************************************************************************/ @@ -64,7 +63,7 @@ class SwXFootnoteProperties : public cppu::WeakAggImplHelper2 > { SwDoc* pDoc; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropertySet; protected: virtual ~SwXFootnoteProperties(); public: @@ -98,7 +97,7 @@ class SwXEndnoteProperties : public cppu::WeakAggImplHelper2 > { SwDoc* pDoc; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropertySet; protected: virtual ~SwXEndnoteProperties(); public: @@ -132,7 +131,7 @@ class SwXLineNumberingProperties : public cppu::WeakAggImplHelper2 > { SwDoc* pDoc; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropertySet; protected: virtual ~SwXLineNumberingProperties(); public: @@ -175,7 +174,7 @@ class SwXNumberingRules : public cppu::WeakAggImplHelper5 SwDoc* pDoc; // wird nur fuers anmelden gebraucht SwDocShell* pDocShell; //nur, wenn als ChapterNumbering verwendet SwNumRule* pNumRule; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropertySet; sal_Bool bOwnNumRuleCreated; static String sInvalidStyle; protected: @@ -275,7 +274,7 @@ class SwXTextColumns : public cppu::WeakAggImplHelper4 sal_Bool bIsAutomaticWidth; sal_Int32 nAutoDistance; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropSet; //separator line sal_Int32 nSepLineWidth; diff --git a/sw/inc/unosrch.hxx b/sw/inc/unosrch.hxx index 481e447e76..29d7333ccc 100644 --- a/sw/inc/unosrch.hxx +++ b/sw/inc/unosrch.hxx @@ -39,7 +39,7 @@ /****************************************************************************** * ******************************************************************************/ -struct SfxItemPropertyMap; +class SfxItemPropertySet; class SwXTextDocument; class SwSearchProperties_Impl; class SfxItemSet; @@ -68,7 +68,7 @@ class SwXTextSearch : public cppu::WeakImplHelper3 SwSearchProperties_Impl* pReplaceProperties; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropSet; sal_Bool bAll : 1; sal_Bool bWord : 1; sal_Bool bBack : 1; diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index f58d6d0adf..dc0fdc382d 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -55,7 +55,7 @@ #include <istyleaccess.hxx> class SwDocShell; -struct SfxItemPropertyMap; +class SfxItemPropertySet; class SwXStyle; class SwStyleProperties_Impl; class SwAutoStylesEnumImpl; diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index 55bd2d8062..9c45836143 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -84,8 +84,8 @@ class SwXCell : public SwXCellBaseClass, friend void lcl_setValue( SwXCell &rCell, double nVal ); - SfxItemPropertySet aPropSet; - SwTableBox* pBox; // only set in non-XML import + const SfxItemPropertySet* m_pPropSet; + SwTableBox* pBox; // only set in non-XML import const SwStartNode* pStartNode; // only set in XML import // table position where pBox was found last @@ -174,7 +174,7 @@ class SwXTextTableRow : public cppu::WeakImplHelper2 >, public SwClient { - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* m_pPropSet; SwTableLine* pLine; SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } @@ -219,7 +219,7 @@ class SwXTextTableCursor : public SwXTextTableCursor_Base ,public OTextCursorHelper { SwDepend aCrsrDepend; - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* m_pPropSet; SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } // SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); } @@ -304,8 +304,7 @@ class SwXTextTable : public cppu::WeakImplHelper10 { SwEventListenerContainer aLstnrCntnr; SwChartEventListenerContainer aChartLstnrCntnr; - SfxItemPropertySet aPropSet; - const SfxItemPropertyMap* _pMap; + const SfxItemPropertySet* m_pPropSet; // Descriptor-interface SwTableProperties_Impl* pTableProps; @@ -431,10 +430,9 @@ class SwXCellRange : public cppu::WeakImplHelper7 SwChartEventListenerContainer aChartLstnrCntnr; SwRangeDescriptor aRgDesc; - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* m_pPropSet; SwUnoCrsr* pTblCrsr; - const SfxItemPropertyMap* _pMap; sal_Bool bFirstRowAsLabel :1; sal_Bool bFirstColumnAsLabel :1; diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index ad0780ce87..f4e3fe7efb 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -175,7 +175,7 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, ActionContextArr aActionArr; SwRefreshListenerContainer aRefreshCont; - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* pPropSet; SwDocShell* pDocShell; sal_Bool bObjectValid; @@ -474,7 +474,7 @@ class SwXLinkNameAccessWrapper : public cppu::WeakImplHelper4 > { ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xRealAccess; - SfxItemPropertySet aPropSet; + const SfxItemPropertySet* pPropSet; const String sLinkSuffix; const String sLinkDisplayName; ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > xDoc; @@ -524,8 +524,8 @@ class SwXOutlineTarget : public cppu::WeakImplHelper2 ::com::sun::star::lang::XServiceInfo > { - SfxItemPropertySet aPropSet; - String sOutlineText; + const SfxItemPropertySet* pPropSet; + String sOutlineText; public: SwXOutlineTarget(const String& rOutlineText); diff --git a/sw/qa/complex/writer/CheckFlies.java b/sw/qa/complex/writer/CheckFlies.java new file mode 100644 index 0000000000..a54b02a3b5 --- /dev/null +++ b/sw/qa/complex/writer/CheckFlies.java @@ -0,0 +1,236 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.writer; + +import com.sun.star.beans.PropertyValue; +import com.sun.star.container.XNamed; +import com.sun.star.container.XNameAccess; +import com.sun.star.container.XIndexAccess; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.text.XTextDocument; +import com.sun.star.uno.UnoRuntime; +import complexlib.ComplexTestCase; +import java.math.BigInteger; +import java.util.Collection; +import java.util.ArrayList; + +public class CheckFlies extends ComplexTestCase { + private XMultiServiceFactory m_xMsf = null; + private XTextDocument m_xDoc = null; + + public String[] getTestMethodNames() { + return new String[]{"checkFlies"}; + } + + public void checkFlies() + throws com.sun.star.uno.Exception, + com.sun.star.io.IOException + { + try { + m_xMsf = (XMultiServiceFactory)param.getMSF(); + m_xDoc = util.WriterTools.loadTextDoc(m_xMsf, util.utils.getFullTestURL("CheckFlies.odt")); + com.sun.star.text.XTextFramesSupplier xTFS = (com.sun.star.text.XTextFramesSupplier)UnoRuntime.queryInterface( + com.sun.star.text.XTextFramesSupplier.class, + m_xDoc); + checkTextFrames(xTFS); + com.sun.star.text.XTextGraphicObjectsSupplier xTGOS = (com.sun.star.text.XTextGraphicObjectsSupplier)UnoRuntime.queryInterface( + com.sun.star.text.XTextGraphicObjectsSupplier.class, + m_xDoc); + checkGraphicFrames(xTGOS); + com.sun.star.text.XTextEmbeddedObjectsSupplier xTEOS = (com.sun.star.text.XTextEmbeddedObjectsSupplier)UnoRuntime.queryInterface( + com.sun.star.text.XTextEmbeddedObjectsSupplier.class, + m_xDoc); + checkEmbeddedFrames(xTEOS); + } finally { + // closing test document + if(m_xDoc != null) + util.DesktopTools.closeDoc(m_xDoc); + } + } + + private void checkEmbeddedFrames(com.sun.star.text.XTextEmbeddedObjectsSupplier xTGOS) + throws com.sun.star.lang.WrappedTargetException + { + Collection<String> vExpectedEmbeddedFrames = new ArrayList<String>(); + vExpectedEmbeddedFrames.add("Object1"); + int nEmbeddedFrames = vExpectedEmbeddedFrames.size(); + com.sun.star.container.XNameAccess xEmbeddedFrames = xTGOS.getEmbeddedObjects(); + for(String sFrameName : xEmbeddedFrames.getElementNames()) + { + if(!vExpectedEmbeddedFrames.remove(sFrameName)) + failed("Unexpected frame name"); + try + { + xEmbeddedFrames.getByName(sFrameName); + } + catch(com.sun.star.container.NoSuchElementException e) + { + failed("Could not get embedded frame by name."); + } + if(!xEmbeddedFrames.hasByName(sFrameName)) + failed("Could not find embedded frame by name."); + } + if(!vExpectedEmbeddedFrames.isEmpty()) + failed("Missing expected embedded frames."); + try + { + xEmbeddedFrames.getByName("Nonexisting embedded frame"); + failed("Got nonexisting embedded frame"); + } + catch(com.sun.star.container.NoSuchElementException e) + {} + if(xEmbeddedFrames.hasByName("Nonexisting embedded frame")) + failed("Has nonexisting embedded frame"); + + com.sun.star.container.XIndexAccess xEmbeddedFramesIdx = (com.sun.star.container.XIndexAccess)UnoRuntime.queryInterface( + com.sun.star.container.XIndexAccess.class, + xEmbeddedFrames); + if(xEmbeddedFramesIdx.getCount() != nEmbeddedFrames) + failed("Unexpected number of embedded frames reported."); + for(int nCurrentFrameIdx = 0; nCurrentFrameIdx < xEmbeddedFramesIdx.getCount(); nCurrentFrameIdx++) + { + try + { + xEmbeddedFramesIdx.getByIndex(nCurrentFrameIdx); + } + catch(com.sun.star.lang.IndexOutOfBoundsException e) + { + failed("Could not get embedded frame by index."); + } + } + } + + private void checkGraphicFrames(com.sun.star.text.XTextGraphicObjectsSupplier xTGOS) + throws com.sun.star.lang.WrappedTargetException + { + Collection<String> vExpectedGraphicFrames = new ArrayList<String>(); + vExpectedGraphicFrames.add("graphics1"); + int nGraphicFrames = vExpectedGraphicFrames.size(); + com.sun.star.container.XNameAccess xGraphicFrames = xTGOS.getGraphicObjects(); + for(String sFrameName : xGraphicFrames.getElementNames()) + { + if(!vExpectedGraphicFrames.remove(sFrameName)) + failed("Unexpected frame name"); + try + { + xGraphicFrames.getByName(sFrameName); + } + catch(com.sun.star.container.NoSuchElementException e) + { + failed("Could not get graphics frame by name."); + } + if(!xGraphicFrames.hasByName(sFrameName)) + failed("Could not find graphics frame by name."); + } + if(!vExpectedGraphicFrames.isEmpty()) + failed("Missing expected graphics frames."); + try + { + xGraphicFrames.getByName("Nonexisting graphics frame"); + failed("Got nonexisting graphics frame"); + } + catch(com.sun.star.container.NoSuchElementException e) + {} + if(xGraphicFrames.hasByName("Nonexisting graphics frame")) + failed("Has nonexisting graphics frame"); + + com.sun.star.container.XIndexAccess xGraphicFramesIdx = (com.sun.star.container.XIndexAccess)UnoRuntime.queryInterface( + com.sun.star.container.XIndexAccess.class, + xGraphicFrames); + if(xGraphicFramesIdx.getCount() != nGraphicFrames) + failed("Unexpected number of graphics frames reported."); + for(int nCurrentFrameIdx = 0; nCurrentFrameIdx < xGraphicFramesIdx.getCount(); nCurrentFrameIdx++) + { + try + { + xGraphicFramesIdx.getByIndex(nCurrentFrameIdx); + } + catch(com.sun.star.lang.IndexOutOfBoundsException e) + { + failed("Could not get graphics frame by index."); + } + } + } + + private void checkTextFrames(com.sun.star.text.XTextFramesSupplier xTFS) + throws com.sun.star.lang.WrappedTargetException + { + Collection<String> vExpectedTextFrames = new ArrayList<String>(); + vExpectedTextFrames.add("Frame1"); + vExpectedTextFrames.add("Frame2"); + + int nTextFrames = vExpectedTextFrames.size(); + com.sun.star.container.XNameAccess xTextFrames = xTFS.getTextFrames(); + for(String sFrameName : xTextFrames.getElementNames()) + { + if(!vExpectedTextFrames.remove(sFrameName)) + failed("Unexpected frame name"); + try + { + xTextFrames.getByName(sFrameName); + } + catch(com.sun.star.container.NoSuchElementException e) + { + failed("Could not get text frame by name."); + } + if(!xTextFrames.hasByName(sFrameName)) + failed("Could not find text frame by name."); + } + if(!vExpectedTextFrames.isEmpty()) + failed("Missing expected text frames."); + try + { + xTextFrames.getByName("Nonexisting Textframe"); + failed("Got nonexisting text frame."); + } + catch(com.sun.star.container.NoSuchElementException e) + {} + if(xTextFrames.hasByName("Nonexisting text frame")) + failed("Has nonexisting text frame."); + + com.sun.star.container.XIndexAccess xTextFramesIdx = (com.sun.star.container.XIndexAccess)UnoRuntime.queryInterface( + com.sun.star.container.XIndexAccess.class, + xTextFrames); + if(xTextFramesIdx.getCount() != nTextFrames) + failed("Unexpected number of text frames reported."); + for(int nCurrentFrameIdx = 0; nCurrentFrameIdx < xTextFramesIdx.getCount(); nCurrentFrameIdx++) + { + try + { + xTextFramesIdx.getByIndex(nCurrentFrameIdx); + } + catch(com.sun.star.lang.IndexOutOfBoundsException e) + { + failed("Could not get text frame by index."); + } + } + } +} diff --git a/sw/qa/complex/writer/makefile.mk b/sw/qa/complex/writer/makefile.mk index 88ceec08dc..7bcc7fe934 100755 --- a/sw/qa/complex/writer/makefile.mk +++ b/sw/qa/complex/writer/makefile.mk @@ -41,7 +41,7 @@ PACKAGE = complex$/writer #----- compile .java files ----------------------------------------- JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = CheckIndexedPropertyValues.java CheckNamedPropertyValues.java CheckCrossReferences.java CheckBookmarks.java +JAVAFILES = CheckIndexedPropertyValues.java CheckNamedPropertyValues.java CheckCrossReferences.java CheckBookmarks.java CheckFlies.java JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) #----- make a jar from compiled files ------------------------------ @@ -85,6 +85,7 @@ run: \ CheckCrossReferences \ CheckIndexedPropertyValues \ CheckNamedPropertyValues \ + CheckFlies RUN: run @@ -101,3 +102,6 @@ CheckCrossReferences: CheckBookmarks: +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) -tdoc $(PWD)$/testdocuments $(CT_PACKAGE).CheckBookmarks +CheckFlies: + +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) -tdoc $(PWD)$/testdocuments $(CT_PACKAGE).CheckFlies + diff --git a/sw/qa/complex/writer/testdocuments/CheckFlies.odt b/sw/qa/complex/writer/testdocuments/CheckFlies.odt Binary files differnew file mode 100644 index 0000000000..8f42989b3a --- /dev/null +++ b/sw/qa/complex/writer/testdocuments/CheckFlies.odt diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 1bbd98c684..5d786e50bc 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1347,27 +1347,27 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl( // build-up sequence containing the run attributes <rDefAttrSeq> tAccParaPropValMap aDefAttrSeq; { - const SfxItemPropertySet& rPropSet = - aSwMapProvider.GetPropertyMap( PROPERTY_MAP_TEXT_CURSOR ); - const SfxItemPropertyMap* pPropMap( rPropSet.getPropertyMap() ); - while ( pPropMap->pName ) + const SfxItemPropertyMap* pPropMap = + aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap(); + PropertyEntryVector_t aPropertyEntries = pPropMap->getPropertyEntries(); + PropertyEntryVector_t::const_iterator aPropIt = aPropertyEntries.begin(); + while ( aPropIt != aPropertyEntries.end() ) { - const SfxPoolItem* pItem = pSet->GetItem( pPropMap->nWID ); + const SfxPoolItem* pItem = pSet->GetItem( aPropIt->nWID ); if ( pItem ) { Any aVal; - pItem->QueryValue( aVal, pPropMap->nMemberId ); + pItem->QueryValue( aVal, aPropIt->nMemberId ); PropertyValue rPropVal; - rPropVal.Name = OUString::createFromAscii( pPropMap->pName ); + rPropVal.Name = aPropIt->sName; rPropVal.Value = aVal; rPropVal.Handle = -1; rPropVal.State = beans::PropertyState_DEFAULT_VALUE; aDefAttrSeq[rPropVal.Name] = rPropVal; } - - ++pPropMap; + ++aPropIt; } // --> OD 2007-01-15 #i72800# @@ -1546,22 +1546,24 @@ void SwAccessibleParagraph::_getRunAttributesImpl( uno::Sequence< ::rtl::OUString > aDummy; _getDefaultAttributesImpl( aDummy, aDefAttrSeq, true ); // <-- - const SfxItemPropertySet& rPropSet = - aSwMapProvider.GetPropertyMap( PROPERTY_MAP_TEXT_CURSOR ); - const SfxItemPropertyMap* pPropMap( rPropSet.getPropertyMap() ); - while ( pPropMap->pName ) + + const SfxItemPropertyMap* pPropMap = + aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap(); + PropertyEntryVector_t aPropertyEntries = pPropMap->getPropertyEntries(); + PropertyEntryVector_t::const_iterator aPropIt = aPropertyEntries.begin(); + while ( aPropIt != aPropertyEntries.end() ) { const SfxPoolItem* pItem( 0 ); // --> OD 2007-11-12 #i82637# // Found character attributes, whose value equals the value of // the corresponding default character attributes, are excluded. - if ( aSet.GetItemState( pPropMap->nWID, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( aSet.GetItemState( aPropIt->nWID, TRUE, &pItem ) == SFX_ITEM_SET ) { Any aVal; - pItem->QueryValue( aVal, pPropMap->nMemberId ); + pItem->QueryValue( aVal, aPropIt->nMemberId ); PropertyValue rPropVal; - rPropVal.Name = OUString::createFromAscii( pPropMap->pName ); + rPropVal.Name = aPropIt->sName; rPropVal.Value = aVal; rPropVal.Handle = -1; rPropVal.State = PropertyState_DIRECT_VALUE; @@ -1575,7 +1577,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl( } } - ++pPropMap; + ++aPropIt; } } diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index bb0448f86b..ac85b216f9 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -120,6 +120,7 @@ USHORT SwDoc::GetFlyCount( FlyCntType eType ) const /*-----------------17.02.98 08:35------------------- --------------------------------------------------*/ +// If you change this, also update SwXFrameEnumeration in unocoll. SwFrmFmt* SwDoc::GetFlyNum( USHORT nIdx, FlyCntType eType ) { SwSpzFrmFmts& rFmts = *GetSpzFrmFmts(); diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 293fa81158..a16f333f3a 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -182,13 +182,13 @@ USHORT SwDoc::GetCurTOXMark( const SwPosition& rPos, Beschreibung: Marke loeschen --------------------------------------------------------------------*/ -void SwDoc::Delete( SwTOXMark* pTOXMark ) +void SwDoc::Delete( const SwTOXMark* pTOXMark ) { // hole den TextNode und - SwTxtTOXMark* pTxtTOXMark = pTOXMark->GetTxtTOXMark(); + const SwTxtTOXMark* pTxtTOXMark = pTOXMark->GetTxtTOXMark(); ASSERT( pTxtTOXMark, "Kein TxtTOXMark, kann nicht geloescht werden" ); - SwTxtNode& rTxtNd = (SwTxtNode&)pTxtTOXMark->GetTxtNode(); + SwTxtNode& rTxtNd = const_cast<SwTxtNode&>(pTxtTOXMark->GetTxtNode()); ASSERT( rTxtNd.GetpSwpHints(), "kann nicht geloescht werden" ); if( DoesUndo() ) @@ -202,12 +202,12 @@ void SwDoc::Delete( SwTOXMark* pTOXMark ) SwRegHistory aRHst( rTxtNd, pUndo->GetHistory() ); rTxtNd.GetpSwpHints()->Register( &aRHst ); - rTxtNd.Delete( pTxtTOXMark, TRUE ); + rTxtNd.Delete( const_cast<SwTxtTOXMark*>( pTxtTOXMark ), TRUE ); if( rTxtNd.GetpSwpHints() ) rTxtNd.GetpSwpHints()->DeRegister(); } else - rTxtNd.Delete( pTxtTOXMark, TRUE ); + rTxtNd.Delete( const_cast<SwTxtTOXMark*>( pTxtTOXMark ), TRUE ); SetModified(); } diff --git a/sw/source/core/fields/textapi.cxx b/sw/source/core/fields/textapi.cxx index c21c5776d9..ff794a0b6b 100755 --- a/sw/source/core/fields/textapi.cxx +++ b/sw/source/core/fields/textapi.cxx @@ -43,9 +43,9 @@ using namespace com::sun::star; -const SfxItemPropertyMap* ImplGetSvxTextPortionPropertyMap() +static const SvxItemPropertySet* ImplGetSvxTextPortionPropertySet() { - static const SfxItemPropertyMap aSvxTextPortionPropertyMap[] = + static const SfxItemPropertyMapEntry aSvxTextPortionPropertyMap[] = { SVX_UNOEDIT_CHAR_PROPERTIES, SVX_UNOEDIT_FONT_PROPERTIES, @@ -57,12 +57,12 @@ const SfxItemPropertyMap* ImplGetSvxTextPortionPropertyMap() {MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, {0,0,0,0,0,0} }; - - return aSvxTextPortionPropertyMap; + static SvxItemPropertySet aSvxTextPortionPropertySet( aSvxTextPortionPropertyMap ); + return &aSvxTextPortionPropertySet; } SwTextAPIObject::SwTextAPIObject( SwTextAPIEditSource* p ) -: SvxUnoText( p, ImplGetSvxTextPortionPropertyMap(), uno::Reference < text::XText >() ) +: SvxUnoText( p, ImplGetSvxTextPortionPropertySet(), uno::Reference < text::XText >() ) , pSource(p) { } diff --git a/sw/source/core/inc/SwXTextDefaults.hxx b/sw/source/core/inc/SwXTextDefaults.hxx index 329fc4fd48..58d4567510 100644 --- a/sw/source/core/inc/SwXTextDefaults.hxx +++ b/sw/source/core/inc/SwXTextDefaults.hxx @@ -47,8 +47,8 @@ class SwXTextDefaults : public cppu::WeakImplHelper3 com::sun::star::lang::XServiceInfo > { - SfxItemPropertySet aPropSet; - SwDoc * pDoc; + const SfxItemPropertySet* m_pPropSet; + SwDoc * m_pDoc; public: SwXTextDefaults ( SwDoc * pNewDoc ); ~SwXTextDefaults (); diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 01d20c7aaf..9e61c7ca70 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -184,7 +184,7 @@ BOOL SwFmtAutoFmt::QueryValue( uno::Any& rVal, BYTE ) const BOOL SwFmtAutoFmt::PutValue( const uno::Any& , BYTE ) { - DBG_ERROR("ToDo!"); + //the format is not renameable via API
return FALSE; } diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index 2bff727c86..2218129443 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -61,8 +61,8 @@ void lcl_setPageDesc(SwDoc*, const uno::Any&, SfxItemSet& ); // from unoobj.cxx SwXTextDefaults::SwXTextDefaults ( SwDoc * pNewDoc ) : - aPropSet( aSwMapProvider.GetPropertyMap ( PROPERTY_MAP_TEXT_DEFAULT ) ), - pDoc ( pNewDoc ) + m_pPropSet( aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_DEFAULT ) ), + m_pDoc ( pNewDoc ) { } @@ -75,7 +75,7 @@ SwXTextDefaults::~SwXTextDefaults () uno::Reference< XPropertySetInfo > SAL_CALL SwXTextDefaults::getPropertySetInfo( ) throw(RuntimeException) { - static uno::Reference < XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference < XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } @@ -84,21 +84,21 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex()); - if (!pDoc) + if (!m_pDoc) throw RuntimeException(); - const SfxItemPropertyMap *pMap = SfxItemPropertyMap::GetByName( aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pMap) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); if ( pMap->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - const SfxPoolItem& rItem = pDoc->GetDefault(pMap->nWID); + const SfxPoolItem& rItem = m_pDoc->GetDefault(pMap->nWID); if (RES_PAGEDESC == pMap->nWID && MID_PAGEDESC_PAGEDESCNAME == pMap->nMemberId) { - SfxItemSet aSet( pDoc->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC ); + SfxItemSet aSet( m_pDoc->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC ); aSet.Put(rItem); - lcl_setPageDesc( pDoc, aValue, aSet ); - pDoc->SetDefault(aSet.Get(RES_PAGEDESC)); + lcl_setPageDesc( m_pDoc, aValue, aSet ); + m_pDoc->SetDefault(aSet.Get(RES_PAGEDESC)); } else if ((RES_PARATR_DROP == pMap->nWID && MID_DROPCAP_CHAR_STYLE_NAME == pMap->nMemberId) || (RES_TXTATR_CHARFMT == pMap->nWID)) @@ -109,7 +109,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, String sStyle; SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True ); SwDocStyleSheet* pStyle = - (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR); + (SwDocStyleSheet*)m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR); SwFmtDrop* pDrop = 0; SwFmtCharFmt *pCharFmt = 0; if(pStyle) @@ -119,13 +119,13 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, { pDrop = (SwFmtDrop*)rItem.Clone(); // because rItem ist const... pDrop->SetCharFmt(xStyle->GetCharFmt()); - pDoc->SetDefault(*pDrop); + m_pDoc->SetDefault(*pDrop); } else // RES_TXTATR_CHARFMT == pMap->nWID { pCharFmt = (SwFmtCharFmt*)rItem.Clone(); // because rItem ist const... pCharFmt->SetCharFmt(xStyle->GetCharFmt()); - pDoc->SetDefault(*pCharFmt); + m_pDoc->SetDefault(*pCharFmt); } } else @@ -140,7 +140,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, { SfxPoolItem * pNewItem = rItem.Clone(); pNewItem->PutValue( aValue, pMap->nMemberId); - pDoc->SetDefault(*pNewItem); + m_pDoc->SetDefault(*pNewItem); delete pNewItem; } } @@ -150,13 +150,13 @@ Any SAL_CALL SwXTextDefaults::getPropertyValue( const OUString& rPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex()); - if (!pDoc) + if (!m_pDoc) throw RuntimeException(); - const SfxItemPropertyMap *pMap = SfxItemPropertyMap::GetByName( aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pMap) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); Any aRet; - const SfxPoolItem& rItem = pDoc->GetDefault(pMap->nWID); + const SfxPoolItem& rItem = m_pDoc->GetDefault(pMap->nWID); rItem.QueryValue( aRet, pMap->nMemberId ); return aRet; } @@ -196,13 +196,13 @@ PropertyState SAL_CALL SwXTextDefaults::getPropertyState( const OUString& rPrope { vos::OGuard aGuard( Application::GetSolarMutex()); PropertyState eRet = PropertyState_DIRECT_VALUE; - if (!pDoc) + if (!m_pDoc) throw RuntimeException(); - const SfxItemPropertyMap *pMap = SfxItemPropertyMap::GetByName( aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pMap) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - const SfxPoolItem& rItem = pDoc->GetDefault(pMap->nWID); + const SfxPoolItem& rItem = m_pDoc->GetDefault(pMap->nWID); if (IsStaticDefaultItem ( &rItem ) ) eRet = PropertyState_DEFAULT_VALUE; return eRet; @@ -227,14 +227,14 @@ Sequence< PropertyState > SAL_CALL SwXTextDefaults::getPropertyStates( const Seq void SAL_CALL SwXTextDefaults::setPropertyToDefault( const OUString& rPropertyName ) throw(UnknownPropertyException, RuntimeException) { - if (!pDoc) + if (!m_pDoc) throw RuntimeException(); - const SfxItemPropertyMap *pMap = SfxItemPropertyMap::GetByName( aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pMap) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); if ( pMap->nFlags & PropertyAttribute::READONLY) throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - SfxItemPool& rSet (pDoc->GetAttrPool()); + SfxItemPool& rSet (m_pDoc->GetAttrPool()); rSet.ResetPoolDefaultItem ( pMap->nWID ); } @@ -242,13 +242,13 @@ void SAL_CALL SwXTextDefaults::setPropertyToDefault( const OUString& rPropertyNa Any SAL_CALL SwXTextDefaults::getPropertyDefault( const OUString& rPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { - if (!pDoc) + if (!m_pDoc) throw RuntimeException(); - const SfxItemPropertyMap *pMap = SfxItemPropertyMap::GetByName( aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pMap) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); Any aRet; - SfxItemPool& rSet (pDoc->GetAttrPool()); + SfxItemPool& rSet (m_pDoc->GetAttrPool()); const SfxPoolItem *pItem = rSet.GetPoolDefaultItem ( pMap->nWID ); pItem->QueryValue( aRet, pMap->nMemberId ); return aRet; diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 03688eb860..34bb61b1ad 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -286,13 +286,7 @@ uno::Reference< beans::XPropertySetInfo > SwXBookmark::getPropertySetInfo(void) static uno::Reference< beans::XPropertySetInfo > aRef; if(!aRef.is()) { - const SfxItemPropertyMap* pMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_BOOKMARK); - uno::Reference< beans::XPropertySetInfo > xInfo = new SfxItemPropertySetInfo(pMap); - // extend PropertySetInfo! - const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties(); - aRef = new SfxExtItemPropertySetInfo( - aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARAGRAPH_EXTENSIONS), - aPropSeq ); + uno::Reference< beans::XPropertySetInfo > xInfo = aSwMapProvider.GetPropertySet(PROPERTY_MAP_BOOKMARK)->getPropertySetInfo(); } return aRef; } diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 71ecf5ebb2..f9c6808478 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -2032,7 +2032,7 @@ SwChartDataSequence::SwChartDataSequence( pDataProvider( &rProvider ), pTblCrsr( pTableCursor ), aCursorDepend( this, pTableCursor ), - pMap( aSwMapProvider.GetPropertyMap( PROPERTY_MAP_CHART2_DATA_SEQUENCE ) ) + _pPropSet( aSwMapProvider.GetPropertySet( PROPERTY_MAP_CHART2_DATA_SEQUENCE ) ) { bDisposed = sal_False; @@ -2083,7 +2083,7 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) : pDataProvider( rObj.pDataProvider ), pTblCrsr( rObj.pTblCrsr->Clone() ), aCursorDepend( this, pTblCrsr ), - pMap( rObj.pMap ) + _pPropSet( rObj._pPropSet ) { bDisposed = sal_False; @@ -2398,7 +2398,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL SwChartDataSequence::getPrope if (bDisposed) throw lang::DisposedException(); - static uno::Reference< beans::XPropertySetInfo > xRes = new SfxItemPropertySetInfo( pMap ); + static uno::Reference< beans::XPropertySetInfo > xRes = _pPropSet->getPropertySetInfo(); return xRes; } diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index e619946798..7143b7f163 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -71,7 +71,10 @@ #include <authfld.hxx> #include <SwXTextDefaults.hxx> #include <unochart.hxx> -#include <bookmrk.hxx> +#include <comphelper/makesequence.hxx> +#include <comphelper/sequence.hxx> +#include <slist> +#include <iterator> #include "docsh.hxx" @@ -796,268 +799,289 @@ XTextTable* SwXTextTables::GetObject( SwFrmFmt& rFmt ) pTbl = new SwXTextTable(rFmt); return pTbl ; } + + /****************************************************************** - * SwXFrames + * SwXFrameEnumeration ******************************************************************/ -/* -----------------------------06.04.00 12:41-------------------------------- +namespace +{ + template<FlyCntType T> struct SwXFrameEnumeration_traits {}; - ---------------------------------------------------------------------------*/ + template<> + struct SwXFrameEnumeration_traits<FLYCNTTYPE_FRM> + { + typedef SwXTextFrame core_frame_t; + typedef XTextFrame uno_frame_t; + static inline bool filter(const SwNode* const pNode) { return !pNode->IsNoTxtNode(); }; + }; + + template<> + struct SwXFrameEnumeration_traits<FLYCNTTYPE_GRF> + { + typedef SwXTextGraphicObject core_frame_t; + typedef XTextContent uno_frame_t; + static inline bool filter(const SwNode* const pNode) { return pNode->IsGrfNode(); }; + }; + + template<> + struct SwXFrameEnumeration_traits<FLYCNTTYPE_OLE> + { + typedef SwXTextEmbeddedObject core_frame_t; + typedef XEmbeddedObjectSupplier uno_frame_t; + static inline bool filter(const SwNode* const pNode) { return pNode->IsOLENode(); }; + }; + + template<FlyCntType T> + class SwXFrameEnumeration : public SwSimpleEnumerationBaseClass + { + private: + typedef ::std::slist< Any > frmcontainer_t; + frmcontainer_t m_aFrames; + protected: + virtual ~SwXFrameEnumeration() {}; + public: + SwXFrameEnumeration(const SwDoc* const pDoc); + + //XEnumeration + virtual BOOL SAL_CALL hasMoreElements(void) throw( RuntimeException ); + virtual Any SAL_CALL nextElement(void) throw( NoSuchElementException, WrappedTargetException, RuntimeException ); + + //XServiceInfo + virtual OUString SAL_CALL getImplementationName(void) throw( RuntimeException ); + virtual BOOL SAL_CALL supportsService(const OUString& ServiceName) throw( RuntimeException ); + virtual Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw( RuntimeException ); + }; +} + +template<FlyCntType T> +SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc) + : m_aFrames() +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + const SwSpzFrmFmts* const pFmts = pDoc->GetSpzFrmFmts(); + const USHORT nSize = pFmts->Count(); + ::std::insert_iterator<frmcontainer_t> pInserter = ::std::insert_iterator<frmcontainer_t>(m_aFrames, m_aFrames.begin()); + for( USHORT i=0; i < nSize; ++i ) + { + SwFrmFmt* pFmt = (*pFmts)[i]; + if(pFmt->Which() != RES_FLYFRMFMT) + continue; + const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); + if(!pIdx || !pIdx->GetNodes().IsDocNodes()) + continue; + const SwNode* pNd = pDoc->GetNodes()[ pIdx->GetIndex() + 1 ]; + if(SwXFrameEnumeration_traits<T>::filter(pNd)) + { + SwXFrame* pFrm = (SwXFrame*)SwClientIter( *pFmt ).First( TYPE( SwXFrame )); + if( !pFrm ) + pFrm = new typename SwXFrameEnumeration_traits<T>::core_frame_t(*pFmt); + Reference< typename SwXFrameEnumeration_traits<T>::uno_frame_t > xFrm = + static_cast< typename SwXFrameEnumeration_traits<T>::core_frame_t* >(pFrm); + *pInserter++ = uno::makeAny(xFrm); + } + } +} + +template<FlyCntType T> +BOOL SwXFrameEnumeration<T>::hasMoreElements(void) throw( RuntimeException ) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + return !m_aFrames.empty(); +} + +template<FlyCntType T> +Any SwXFrameEnumeration<T>::nextElement(void) throw( NoSuchElementException, WrappedTargetException, RuntimeException ) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + if(m_aFrames.empty()) + throw NoSuchElementException(); + Any aResult = *m_aFrames.begin(); + m_aFrames.pop_front(); + return aResult; +} + +template<FlyCntType T> +OUString SwXFrameEnumeration<T>::getImplementationName(void) throw( RuntimeException ) +{ + return C2U("SwXFrameEnumeration"); +} + +template<FlyCntType T> +BOOL SwXFrameEnumeration<T>::supportsService(const OUString& ServiceName) throw( RuntimeException ) +{ + return C2U("com.sun.star.container.XEnumeration") == ServiceName; +} + +template<FlyCntType T> +Sequence< OUString > SwXFrameEnumeration<T>::getSupportedServiceNames(void) throw( RuntimeException ) +{ + return ::comphelper::makeSequence(C2U("com.sun.star.container.XEnumeration")); +} + +/****************************************************************** + * SwXFrames + ******************************************************************/ OUString SwXFrames::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXFrames"); } -/* -----------------------------06.04.00 12:41-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXFrames::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return C2U("com.sun.star.text.TextFrames") == rServiceName; } -/* -----------------------------06.04.00 12:41-------------------------------- - ---------------------------------------------------------------------------*/ -Sequence< OUString > SwXFrames::getSupportedServiceNames(void) throw( RuntimeException ) +Sequence<OUString> SwXFrames::getSupportedServiceNames(void) throw( RuntimeException ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.TextFrames"); - return aRet; + return ::comphelper::makeSequence(C2U("com.sun.star.text.TextFrames")); } -/*-- 14.01.99 08:20:18--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXFrames::SwXFrames(SwDoc* _pDoc, FlyCntType eSet) : SwUnoCollection(_pDoc), eType(eSet) -{ -} - -/*-- 14.01.99 08:20:18--------------------------------------------------- +{} - -----------------------------------------------------------------------*/ SwXFrames::~SwXFrames() +{} + +uno::Reference<container::XEnumeration> SwXFrames::createEnumeration(void) throw(uno::RuntimeException) { + vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) + throw uno::RuntimeException(); + switch(eType) + { + case FLYCNTTYPE_FRM: + return uno::Reference< container::XEnumeration >( + new SwXFrameEnumeration<FLYCNTTYPE_FRM>(GetDoc())); + case FLYCNTTYPE_GRF: + return uno::Reference< container::XEnumeration >( + new SwXFrameEnumeration<FLYCNTTYPE_GRF>(GetDoc())); + case FLYCNTTYPE_OLE: + return uno::Reference< container::XEnumeration >( + new SwXFrameEnumeration<FLYCNTTYPE_OLE>(GetDoc())); + default: + throw uno::RuntimeException(); + } } -/*-- 14.01.99 08:25:47--------------------------------------------------- - - -----------------------------------------------------------------------*/ -sal_Int32 SwXFrames::getCount(void) throw( uno::RuntimeException ) +sal_Int32 SwXFrames::getCount(void) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Int32 nRet = 0; - if(IsValid()) - nRet = GetDoc()->GetFlyCount(eType); - else + if(!IsValid()) throw uno::RuntimeException(); - return nRet; + const Reference<XEnumeration> xEnum = createEnumeration(); + sal_Int32 nCount = 0; + while(xEnum->hasMoreElements()) + { + xEnum->nextElement(); + ++nCount; + } + return nCount; } -/*-- 14.01.99 08:25:47--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXFrames::getByIndex(sal_Int32 nIndex) - throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException ) + throw(IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Any aRet; - if(IsValid()) + if(!IsValid()) throw uno::RuntimeException(); + if(nIndex < 0 || nIndex >= USHRT_MAX) throw IndexOutOfBoundsException(); + const Reference<XEnumeration> xEnum = createEnumeration(); + while(xEnum->hasMoreElements()) { - sal_uInt16 nCount = GetDoc()->GetFlyCount(eType); - if( 0 <= nIndex && nIndex < USHRT_MAX && nCount > nIndex) - { - SwFrmFmt* pFmt = GetDoc()->GetFlyNum((sal_uInt16) nIndex, eType); - SwXFrame* pFrm = SwXFrames::GetObject(*pFmt, eType); - switch(eType) - { - case FLYCNTTYPE_FRM: - { - uno::Reference< XTextFrame > xRef = (SwXTextFrame*)pFrm; - aRet.setValue(&xRef, ::getCppuType((uno::Reference<XTextFrame>*)0)); - } - break; - case FLYCNTTYPE_GRF: - { - Reference< XTextContent > xRef = (SwXTextGraphicObject*)pFrm; - aRet.setValue(&xRef, ::getCppuType((uno::Reference<XTextContent>*)0)); - } - break; - case FLYCNTTYPE_OLE: - { - Reference< XEmbeddedObjectSupplier > xRef = (SwXTextEmbeddedObject*)pFrm; - aRet.setValue(&xRef, ::getCppuType((Reference<XEmbeddedObjectSupplier>*)0)); - } - break; - - default: - ; - } - } - else - throw IndexOutOfBoundsException(); + uno::Any aCurrent = xEnum->nextElement(); + if(nIndex-- == 0) + return aCurrent; } - else - throw uno::RuntimeException(); - return aRet; + throw IndexOutOfBoundsException(); } -/*-- 14.01.99 08:25:47--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Any SwXFrames::getByName(const OUString& rName) - throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException ) + throw(NoSuchElementException, WrappedTargetException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwXFrame* pFrm = 0; - if(IsValid()) + if(!IsValid()) throw uno::RuntimeException(); + const Reference<XEnumeration> xEnum = createEnumeration(); + while(xEnum->hasMoreElements()) { - sal_uInt16 nCount = GetDoc()->GetFlyCount(eType); - for( sal_uInt16 i = 0; i < nCount; i++) - { - String aName(rName); - SwFrmFmt* pFmt = GetDoc()->GetFlyNum(i, eType); - if(aName == pFmt->GetName() ) - { - pFrm = SwXFrames::GetObject(*pFmt, eType); - break; - } - } + uno::Any aCurrent = xEnum->nextElement(); + Reference<container::XNamed> xNamed; + aCurrent >>= xNamed; + if(xNamed.is() && xNamed->getName() == rName) + return aCurrent; } - else - throw uno::RuntimeException(); - if(!pFrm) - throw NoSuchElementException(); - uno::Any aRet; - switch(eType) - { - case FLYCNTTYPE_FRM: - { - uno::Reference< XTextFrame > xRef = (SwXTextFrame*)pFrm; - aRet.setValue(&xRef, ::getCppuType((uno::Reference<XTextFrame>*)0)); - } - break; - case FLYCNTTYPE_GRF: - { - uno::Reference< XTextContent > xRef = (SwXTextGraphicObject*)pFrm; - aRet.setValue(&xRef, ::getCppuType((uno::Reference<XTextContent>*)0)); - } - break; - case FLYCNTTYPE_OLE: - { - Reference< XEmbeddedObjectSupplier > xRef = (SwXTextEmbeddedObject*)pFrm; - aRet.setValue(&xRef, ::getCppuType((Reference<XEmbeddedObjectSupplier>*)0)); - } - break; - - default: - ; - } - return aRet; + throw NoSuchElementException(); } -/*-- 14.01.99 08:25:48--------------------------------------------------- - -----------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXFrames::getElementNames(void) throw( uno::RuntimeException ) +uno::Sequence<OUString> SwXFrames::getElementNames(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid()) - throw uno::RuntimeException(); - sal_uInt16 nCount = IsValid() ? GetDoc()->GetFlyCount(eType) : 0; - uno::Sequence<OUString> aSeq(nCount); - if(nCount) + if(!IsValid()) throw uno::RuntimeException(); + const Reference<XEnumeration> xEnum = createEnumeration(); + ::std::vector<OUString> vNames; + while(xEnum->hasMoreElements()) { - OUString* pArray = aSeq.getArray(); - for( sal_uInt16 i = 0; i < nCount; i++) - { - SwFrmFmt* pFmt = GetDoc()->GetFlyNum(i, eType); - pArray[i] = pFmt->GetName(); - } + Reference<container::XNamed> xNamed; + xEnum->nextElement() >>= xNamed; + if(xNamed.is()) + vNames.push_back(xNamed->getName()); } - return aSeq; + return ::comphelper::containerToSequence(vNames); } -/*-- 14.01.99 08:25:48--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXFrames::hasByName(const OUString& rName) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid()) - throw uno::RuntimeException(); - - BYTE nNodeType = ND_TEXTNODE; - switch( eType ) + if(!IsValid()) throw uno::RuntimeException(); + const Reference<XEnumeration> xEnum = createEnumeration(); + while(xEnum->hasMoreElements()) { - case FLYCNTTYPE_GRF: nNodeType = ND_GRFNODE; break; - case FLYCNTTYPE_OLE: nNodeType = ND_OLENODE; break; - default: - ; + Reference<XNamed> xNamed; + xEnum->nextElement() >>= xNamed; + if(xNamed.is() && xNamed->getName() == rName) + return true; } - - return 0 != GetDoc()->FindFlyByName( rName, nNodeType ); + return false; } -/*-- 14.01.99 08:25:48--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXFrames::getElementType() throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Type aRet; switch(eType) { case FLYCNTTYPE_FRM: - aRet = ::getCppuType((uno::Reference<XTextFrame>*)0); - - break; + return ::getCppuType((uno::Reference<XTextFrame>*)0); case FLYCNTTYPE_GRF: - aRet = ::getCppuType((uno::Reference<XTextContent>*)0); - - break; + return ::getCppuType((uno::Reference<XTextContent>*)0); case FLYCNTTYPE_OLE: - aRet = ::getCppuType((uno::Reference<XEmbeddedObjectSupplier>*)0); - break; + return ::getCppuType((uno::Reference<XEmbeddedObjectSupplier>*)0); default: - ; + return uno::Type(); } - return aRet; } -/*-- 14.01.99 08:25:48--------------------------------------------------- - -----------------------------------------------------------------------*/ -sal_Bool SwXFrames::hasElements(void) throw( uno::RuntimeException ) +sal_Bool SwXFrames::hasElements(void) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_uInt16 nRet = 0; - if(IsValid()) - nRet = GetDoc()->GetFlyCount(eType); - else - throw uno::RuntimeException(); - return nRet != 0; + if(IsValid()) throw uno::RuntimeException(); + return createEnumeration()->hasMoreElements(); } -/*-- 14.01.99 08:25:48--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXFrame* SwXFrames::GetObject( SwFrmFmt& rFmt, FlyCntType eType ) +SwXFrame* SwXFrames::GetObject(SwFrmFmt& rFmt, FlyCntType eType) { - SwXFrame* pFrm = (SwXFrame*)SwClientIter( rFmt ). - First( TYPE( SwXFrame )); - if( !pFrm ) + SwXFrame* pFrm = (SwXFrame*)SwClientIter(rFmt).First(TYPE(SwXFrame)); + if(pFrm) return pFrm; + switch(eType) { - switch(eType) - { - case FLYCNTTYPE_FRM: - pFrm = new SwXTextFrame(rFmt); - break; - case FLYCNTTYPE_GRF: - pFrm = new SwXTextGraphicObject(rFmt); - break; - case FLYCNTTYPE_OLE: - pFrm = new SwXTextEmbeddedObject(rFmt); - break; - default: - ; - } + case FLYCNTTYPE_FRM: + return new SwXTextFrame(rFmt); + case FLYCNTTYPE_GRF: + return new SwXTextGraphicObject(rFmt); + case FLYCNTTYPE_OLE: + return new SwXTextEmbeddedObject(rFmt); + default: + return NULL; } - return pFrm; } /****************************************************************** diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index ba9f7fe6bb..2aacded41e 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -103,7 +103,7 @@ namespace SwUnoCursorHelper /* -----------------16.09.98 12:27------------------- * Lesen spezieller Properties am Cursor * --------------------------------------------------*/ -sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap +sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry , SwPaM& rPam , Any *pAny , PropertyState& eState @@ -113,7 +113,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap // PropertyState_DEFAULT_VALUE // PropertyState_AMBIGUOUS_VALUE sal_Bool bDone = sal_True; - switch(pMap->nWID) + switch(rEntry.nWID) { // --> OD 2008-11-26 #158694# case FN_UNO_PARA_CONT_PREV_SUBTREE: @@ -190,10 +190,10 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap { SwFmtColl* pFmt = 0; if(pNode) - pFmt = FN_UNO_PARA_CONDITIONAL_STYLE_NAME == pMap->nWID + pFmt = FN_UNO_PARA_CONDITIONAL_STYLE_NAME == rEntry.nWID ? pNode->GetFmtColl() : &pNode->GetAnyFmtColl(); else - pFmt = SwXTextCursor::GetCurTxtFmtColl(rPam, FN_UNO_PARA_CONDITIONAL_STYLE_NAME == pMap->nWID); + pFmt = SwXTextCursor::GetCurTxtFmtColl(rPam, FN_UNO_PARA_CONDITIONAL_STYLE_NAME == rEntry.nWID); if(pFmt) { if( pAny ) @@ -241,21 +241,21 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap { if( pAny ) { - if(pMap->nWID == FN_UNO_NUM_LEVEL) + if(rEntry.nWID == FN_UNO_NUM_LEVEL) *pAny <<= (sal_Int16)(pTxtNd->GetActualListLevel()); - else if(pMap->nWID == FN_UNO_IS_NUMBER) + else if(rEntry.nWID == FN_UNO_IS_NUMBER) { BOOL bIsNumber = pTxtNd->IsCountedInList(); pAny->setValue(&bIsNumber, ::getBooleanCppuType()); } // --> OD 2008-07-14 #i91601# - else if ( pMap->nWID == FN_UNO_LIST_ID ) + else if ( rEntry.nWID == FN_UNO_LIST_ID ) { const String sListId = pTxtNd->GetListId(); *pAny <<= OUString(sListId); } // <-- - else /*if(pMap->nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/ + else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/ { BOOL bIsRestart = pTxtNd->IsListRestart(); pAny->setValue(&bIsRestart, ::getBooleanCppuType()); @@ -269,17 +269,17 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap if( pAny ) { // #i30838# set default values for default properties - if(pMap->nWID == FN_UNO_NUM_LEVEL) + if(rEntry.nWID == FN_UNO_NUM_LEVEL) *pAny <<= static_cast<sal_Int16>( 0 ); - else if(pMap->nWID == FN_UNO_IS_NUMBER) + else if(rEntry.nWID == FN_UNO_IS_NUMBER) *pAny <<= false; // --> OD 2008-07-14 #i91601# - else if ( pMap->nWID == FN_UNO_LIST_ID ) + else if ( rEntry.nWID == FN_UNO_LIST_ID ) { *pAny <<= OUString(); } // <-- - else /*if(pMap->nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/ + else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/ *pAny <<= false; } } @@ -385,7 +385,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap const SwTableNode* pTblNode = pSttNode->FindTableNode(); SwFrmFmt* pTableFmt = (SwFrmFmt*)pTblNode->GetTable().GetFrmFmt(); //SwTable& rTable = ((SwTableNode*)pSttNode)->GetTable(); - if(FN_UNO_TEXT_TABLE == pMap->nWID) + if(FN_UNO_TEXT_TABLE == rEntry.nWID) { uno::Reference< XTextTable > xTable = SwXTextTables::GetObject(*pTableFmt); pAny->setValue(&xTable, ::getCppuType((uno::Reference<XTextTable>*)0)); @@ -443,7 +443,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap if(pTxtAttr) { const SwFmtFtn& rFtn = pTxtAttr->GetFtn(); - if(rFtn.IsEndNote() == (FN_UNO_ENDNOTE == pMap->nWID)) + if(rFtn.IsEndNote() == (FN_UNO_ENDNOTE == rEntry.nWID)) { if( pAny ) { @@ -527,8 +527,9 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap } } - if(aCharStyles.getLength()) - eNewState = PropertyState_DIRECT_VALUE; + eNewState = + aCharStyles.getLength() ? + PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE;;
if(pAny) (*pAny) <<= aCharStyles; } @@ -726,10 +727,10 @@ void GetCurPageStyle(SwPaM& rPaM, String &rString) /* -----------------30.03.99 10:52------------------- * spezielle Properties am Cursor zuruecksetzen * --------------------------------------------------*/ -void resetCrsrPropertyValue(const SfxItemPropertyMap* pMap, SwPaM& rPam) +void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPam) { SwDoc* pDoc = rPam.GetDoc(); - switch(pMap->nWID) + switch(rEntry.nWID) { case FN_UNO_PARA_STYLE : // lcl_SetTxtFmtColl(aValue, pUnoCrsr); @@ -1026,5 +1027,47 @@ void makeRedline( SwPaM& rPaM, throw lang::IllegalArgumentException(); } +/*-- 19.02.2009 09:27:26--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwAnyMapHelper::~SwAnyMapHelper() +{ + AnyMapHelper_t::iterator aIt = begin(); + while( aIt != end() ) + { + delete ( aIt->second ); + ++aIt; + } +} +/*-- 19.02.2009 09:27:26--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwAnyMapHelper::SetValue( USHORT nWhichId, USHORT nMemberId, const uno::Any& rAny ) +{ + sal_uInt32 nKey = (nWhichId << 16) + nMemberId; + AnyMapHelper_t::iterator aIt = find( nKey ); + if( aIt != end() ) + { + *(aIt->second) = rAny; + } + else + insert( value_type(nKey, new uno::Any( rAny )) ); +} +/*-- 19.02.2009 09:27:26--------------------------------------------------- + + -----------------------------------------------------------------------*/ +bool SwAnyMapHelper::FillValue( USHORT nWhichId, USHORT nMemberId, const uno::Any*& pAny ) +{ + bool bRet = false; + sal_uInt32 nKey = (nWhichId << 16) + nMemberId; + AnyMapHelper_t::iterator aIt = find( nKey ); + if( aIt != end() ) + { + pAny = aIt->second; + bRet = true; + } + return bRet; +} + }//namespace SwUnoCursorHelper diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 9a418b4f1a..afa556e584 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -67,6 +67,7 @@ #include <vos/mutex.hxx> #include <comphelper/extract.hxx> #include <comphelper/stl_types.hxx> +#include <comphelper/makesequence.hxx> #include <svx/scene3d.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> @@ -87,7 +88,10 @@ // <-- #include <vcl/svapp.hxx> +#include <slist> +#include <iterator> +using ::rtl::OUString; using namespace ::com::sun::star; DECLARE_STL_USTRINGACCESS_MAP( uno::Sequence< sal_Int8 > *, SwShapeImplementationIdMap ); @@ -423,8 +427,83 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) } /**************************************************************************** + class SwXShapesEnumeration +****************************************************************************/ +namespace +{ + class SwXShapesEnumeration : public SwSimpleEnumerationBaseClass + { + private: + typedef ::std::slist< ::com::sun::star::uno::Any > shapescontainer_t; + shapescontainer_t m_aShapes; + protected: + virtual ~SwXShapesEnumeration() {}; + public: + SwXShapesEnumeration(SwXDrawPage* const pDrawPage); + + //XEnumeration + virtual BOOL SAL_CALL hasMoreElements(void) throw(uno::RuntimeException); + virtual uno::Any SAL_CALL nextElement(void) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException); + + //XServiceInfo + virtual OUString SAL_CALL getImplementationName(void) throw(uno::RuntimeException); + virtual BOOL SAL_CALL supportsService(const OUString& ServiceName) throw(uno::RuntimeException); + virtual uno::Sequence<OUString> SAL_CALL getSupportedServiceNames(void) throw(uno::RuntimeException); + }; +} + +SwXShapesEnumeration::SwXShapesEnumeration(SwXDrawPage* const pDrawPage) + : m_aShapes() +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + ::std::insert_iterator<shapescontainer_t> pInserter = ::std::insert_iterator<shapescontainer_t>(m_aShapes, m_aShapes.begin()); + sal_Int32 nCount = pDrawPage->getCount(); + for(sal_Int32 nIdx = 0; nIdx < nCount; nIdx++) + { + uno::Reference<drawing::XShape> xShape = uno::Reference<drawing::XShape>(pDrawPage->getByIndex(nIdx), uno::UNO_QUERY); + *pInserter++ = uno::makeAny(xShape); + } +} + +BOOL SwXShapesEnumeration::hasMoreElements(void) throw(uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + return !m_aShapes.empty(); +} + +uno::Any SwXShapesEnumeration::nextElement(void) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + if(m_aShapes.empty()) + throw container::NoSuchElementException(); + uno::Any aResult = *m_aShapes.begin(); + m_aShapes.pop_front(); + return aResult; +} + +OUString SwXShapesEnumeration::getImplementationName(void) throw(uno::RuntimeException) +{ + return C2U("SwXShapeEnumeration"); +} + +BOOL SwXShapesEnumeration::supportsService(const OUString& ServiceName) throw(uno::RuntimeException) +{ + return C2U("com.sun.star.container.XEnumeration") == ServiceName; +} + +uno::Sequence< OUString > SwXShapesEnumeration::getSupportedServiceNames(void) throw(uno::RuntimeException) +{ + return ::comphelper::makeSequence(C2U("com.sun.star.container.XEnumeration")); +} +/**************************************************************************** class SwXDrawPage ****************************************************************************/ +uno::Reference< container::XEnumeration > SwXDrawPage::createEnumeration(void) throw( uno::RuntimeException ) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + return uno::Reference< container::XEnumeration >( + new SwXShapesEnumeration(this)); +} /* -----------------------------06.04.00 13:14-------------------------------- ---------------------------------------------------------------------------*/ @@ -899,8 +978,8 @@ sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId * * --------------------------------------------------*/ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) : - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_SHAPE)), - _pMap(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_SHAPE)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SHAPE)), + m_pPropertyMapEntries(aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_TEXT_SHAPE)), pImplementationId(0), pImpl(new SwShapeDescriptor_Impl), m_bDescriptor(sal_True) @@ -1063,11 +1142,11 @@ uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) th uno::Reference< beans::XPropertySetInfo > xInfo = xPrSet->getPropertySetInfo(); // PropertySetInfo verlaengern! const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties(); - aRet = new SfxExtItemPropertySetInfo( _pMap, aPropSeq ); + aRet = new SfxExtItemPropertySetInfo( m_pPropertyMapEntries, aPropSeq ); } } if(!aRet.is()) - aRet = new SfxItemPropertySetInfo( _pMap ); + aRet = m_pPropSet->getPropertySetInfo(); return aRet; } /*-- 22.01.99 11:42:27--------------------------------------------------- @@ -1080,20 +1159,19 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A { vos::OGuard aGuard(Application::GetSolarMutex()); SwFrmFmt* pFmt = GetFrmFmt(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); if(xShapeAgg.is()) { - if(pMap) + if(pEntry) { - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); //mit Layout kann der Anker umgesetzt werden, ohne dass sich die Position aendert if(pFmt) { SwAttrSet aSet(pFmt->GetAttrSet()); SwDoc* pDoc = pFmt->GetDoc(); - if(RES_ANCHOR == pMap->nWID && MID_ANCHOR_ANCHORFRAME == pMap->nMemberId) + if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORFRAME == pEntry->nMemberId) { sal_Bool bDone = sal_True; uno::Reference<text::XTextFrame> xFrame; @@ -1111,7 +1189,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); aItemSet.SetParent(&pFmt->GetAttrSet()); - SwFmtAnchor aAnchor = (const SwFmtAnchor&)aItemSet.Get(pMap->nWID); + SwFmtAnchor aAnchor = (const SwFmtAnchor&)aItemSet.Get(pEntry->nWID); SwPosition aPos(*pFrame->GetFrmFmt()->GetCntnt().GetCntntIdx()); aAnchor.SetAnchor(&aPos); aAnchor.SetType(FLY_AT_FLY); @@ -1123,7 +1201,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A if(!bDone) throw lang::IllegalArgumentException(); } - else if(RES_OPAQUE == pMap->nWID) + else if(RES_OPAQUE == pEntry->nWID) { SvxShape* pSvxShape = GetSvxShape(); DBG_ASSERT(pSvxShape, "No SvxShape found!"); @@ -1148,7 +1226,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A } // OD 2004-04-22 #i26791# - special handling for property FN_TEXT_RANGE - else if ( FN_TEXT_RANGE == pMap->nWID ) + else if ( FN_TEXT_RANGE == pEntry->nWID ) { SwFmtAnchor aAnchor( static_cast<const SwFmtAnchor&>(aSet.Get( RES_ANCHOR )) ); if ( aAnchor.GetAnchorId() == FLY_PAGE ) @@ -1204,7 +1282,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A } } // --> OD 2004-08-06 #i28749# - else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pMap->nWID ) + else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pEntry->nWID ) { sal_Int16 nPositionLayoutDir = 0; aValue >>= nPositionLayoutDir; @@ -1214,7 +1292,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A else if( pDoc->GetRootFrm() ) { UnoActionContext aCtx(pDoc); - if(RES_ANCHOR == pMap->nWID && MID_ANCHOR_ANCHORTYPE == pMap->nMemberId) + if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId) { SdrObject* pObj = pFmt->FindSdrObject(); SdrMarkList aList; @@ -1227,15 +1305,15 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A } else { - aPropSet.setPropertyValue(*pMap, aValue, aSet); + m_pPropSet->setPropertyValue(*pEntry, aValue, aSet); pFmt->SetFmtAttr(aSet); } } else { - aPropSet.setPropertyValue(*pMap, aValue, aSet); + m_pPropSet->setPropertyValue( *pEntry, aValue, aSet ); - if(RES_ANCHOR == pMap->nWID && MID_ANCHOR_ANCHORTYPE == pMap->nMemberId) + if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId) { bool bSetAttr = true; sal_Int32 eNewAnchor = SWUnoHelper::GetEnumAsInt32( aValue ); @@ -1311,7 +1389,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A else { SfxPoolItem* pItem = 0; - switch(pMap->nWID) + switch(pEntry->nWID) { case RES_ANCHOR: pItem = pImpl->GetAnchor(sal_True); @@ -1368,7 +1446,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A // <-- } if(pItem) - ((SfxPoolItem*)pItem)->PutValue(aValue, pMap->nMemberId); + ((SfxPoolItem*)pItem)->PutValue(aValue, pEntry->nMemberId); } } else @@ -1438,13 +1516,12 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) SwFrmFmt* pFmt = GetFrmFmt(); if(xShapeAgg.is()) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { if(pFmt) { - if(RES_OPAQUE == pMap->nWID) + if(RES_OPAQUE == pEntry->nWID) { SvxShape* pSvxShape = GetSvxShape(); DBG_ASSERT(pSvxShape, "No SvxShape found!"); @@ -1458,7 +1535,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) aRet.setValue(&bOpaque, ::getBooleanCppuType()); } } - else if(FN_ANCHOR_POSITION == pMap->nWID) + else if(FN_ANCHOR_POSITION == pEntry->nWID) { SvxShape* pSvxShape = GetSvxShape(); DBG_ASSERT(pSvxShape, "No SvxShape found!"); @@ -1472,7 +1549,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) } } // OD 2004-04-22 #i26791# - special handling for FN_TEXT_RANGE - else if ( FN_TEXT_RANGE == pMap->nWID ) + else if ( FN_TEXT_RANGE == pEntry->nWID ) { const SwFmtAnchor aAnchor = pFmt->GetAnchor(); if ( aAnchor.GetAnchorId() == FLY_PAGE ) @@ -1502,25 +1579,25 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) } } // --> OD 2004-08-06 #i28749# - else if ( FN_SHAPE_TRANSFORMATION_IN_HORI_L2R == pMap->nWID ) + else if ( FN_SHAPE_TRANSFORMATION_IN_HORI_L2R == pEntry->nWID ) { // get property <::drawing::Shape::Transformation> // without conversion to layout direction as below aRet = _getPropAtAggrObj( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")) ); } - else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pMap->nWID ) + else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pEntry->nWID ) { aRet <<= pFmt->GetPositionLayoutDir(); } // <-- // --> OD 2004-10-28 #i36248# - else if ( FN_SHAPE_STARTPOSITION_IN_HORI_L2R == pMap->nWID ) + else if ( FN_SHAPE_STARTPOSITION_IN_HORI_L2R == pEntry->nWID ) { // get property <::drawing::Shape::StartPosition> // without conversion to layout direction as below aRet = _getPropAtAggrObj( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartPosition")) ); } - else if ( FN_SHAPE_ENDPOSITION_IN_HORI_L2R == pMap->nWID ) + else if ( FN_SHAPE_ENDPOSITION_IN_HORI_L2R == pEntry->nWID ) { // get property <::drawing::Shape::EndPosition> // without conversion to layout direction as below @@ -1530,13 +1607,13 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) else { const SwAttrSet& rSet = pFmt->GetAttrSet(); - aRet = aPropSet.getPropertyValue(*pMap, rSet); + m_pPropSet->getPropertyValue(*pEntry, rSet, aRet); } } else { SfxPoolItem* pItem = 0; - switch(pMap->nWID) + switch(pEntry->nWID) { case RES_ANCHOR: pItem = pImpl->GetAnchor(); @@ -1612,7 +1689,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) // <-- } if(pItem) - pItem->QueryValue(aRet, pMap->nMemberId); + pItem->QueryValue(aRet, pEntry->nMemberId); } } else @@ -1725,23 +1802,22 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates( uno::Reference< XPropertyState > xShapePrState; for(sal_Int32 nProperty = 0; nProperty < aPropertyNames.getLength(); nProperty++) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, pNames[nProperty]); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( pNames[nProperty] ); + if(pEntry) { - if(RES_OPAQUE == pMap->nWID) + if(RES_OPAQUE == pEntry->nWID) pRet[nProperty] = bFormControl ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE; - else if(FN_ANCHOR_POSITION == pMap->nWID) + else if(FN_ANCHOR_POSITION == pEntry->nWID) pRet[nProperty] = beans::PropertyState_DIRECT_VALUE; - else if(FN_TEXT_RANGE == pMap->nWID) + else if(FN_TEXT_RANGE == pEntry->nWID) pRet[nProperty] = beans::PropertyState_DIRECT_VALUE; else if(bGroupMember) pRet[nProperty] = beans::PropertyState_DEFAULT_VALUE; else if(pFmt) { const SwAttrSet& rSet = pFmt->GetAttrSet(); - SfxItemState eItemState = rSet.GetItemState(pMap->nWID, FALSE); + SfxItemState eItemState = rSet.GetItemState(pEntry->nWID, FALSE); if(SFX_ITEM_SET == eItemState) pRet[nProperty] = beans::PropertyState_DIRECT_VALUE; @@ -1753,7 +1829,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates( else { SfxPoolItem* pItem = 0; - switch(pMap->nWID) + switch(pEntry->nWID) { case RES_ANCHOR: pItem = pImpl->GetAnchor(); @@ -1814,23 +1890,22 @@ void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName ) SwFrmFmt* pFmt = GetFrmFmt(); if(xShapeAgg.is()) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw uno::RuntimeException( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); if(pFmt) { const SfxItemSet& rSet = pFmt->GetAttrSet(); - SfxItemSet aSet(pFmt->GetDoc()->GetAttrPool(), pMap->nWID, pMap->nWID); + SfxItemSet aSet(pFmt->GetDoc()->GetAttrPool(), pEntry->nWID, pEntry->nWID); aSet.SetParent(&rSet); - aSet.ClearItem(pMap->nWID); + aSet.ClearItem(pEntry->nWID); pFmt->GetDoc()->SetAttr(aSet, *pFmt); } else { - switch(pMap->nWID) + switch(pEntry->nWID) { case RES_ANCHOR: pImpl->RemoveAnchor(); break; case RES_HORI_ORIENT: pImpl->RemoveHOrient(); break; @@ -1881,15 +1956,14 @@ uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName ) uno::Any aRet; if(xShapeAgg.is()) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { - if(pMap->nWID < RES_FRMATR_END && pFmt) + if(pEntry->nWID < RES_FRMATR_END && pFmt) { const SfxPoolItem& rDefItem = - pFmt->GetDoc()->GetAttrPool().GetDefaultItem(pMap->nWID); - rDefItem.QueryValue(aRet, pMap->nMemberId); + pFmt->GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(aRet, pEntry->nMemberId); } else throw uno::RuntimeException(); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index e84cc6b5c2..29ce23c129 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -75,9 +75,7 @@ #include <chpfld.hxx> #include <flddropdown.hxx> #include <poolfmt.hxx> -#ifndef _POOLFMT_HRC #include <poolfmt.hrc> -#endif #include <pagedesc.hxx> #include <docary.hxx> #include <reffld.hxx> @@ -297,23 +295,18 @@ sal_uInt16 lcl_GetPropMapIdForFieldType( USHORT nWhich ) } -BYTE GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp ) +USHORT GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp ) { USHORT nId = lcl_GetPropMapIdForFieldType( rTyp.Which() ); - const SfxItemPropertyMap* pMap = aSwMapProvider.GetPropertyMap( nId ); - if( !pMap ) + const SfxItemPropertySet* pSet = aSwMapProvider.GetPropertySet( nId ); + if( !pSet ) nId = USHRT_MAX; else { - nId = USHRT_MAX; // in case of property not found - for( ; pMap->pName; ++pMap ) - if( rProperty.equalsAsciiL( pMap->pName, pMap->nNameLen ) ) - { - nId = pMap->nWID; - break; - } + const SfxItemPropertySimpleEntry* pEntry = pSet->getPropertyMap()->getByName(rProperty); + nId = pEntry ? pEntry->nWID : USHRT_MAX; } - return (BYTE)nId; + return nId; } USHORT lcl_GetPropertyMapOfService( USHORT nServiceId ) @@ -531,9 +524,9 @@ uno::Reference< beans::XPropertySetInfo > SwXFieldMaster::getPropertySetInfo(vo throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< beans::XPropertySetInfo > aRef = new SfxItemPropertySetInfo( - aSwMapProvider.GetPropertyMap( - lcl_GetPropMapIdForFieldType( nResTypeId ) )); + uno::Reference< beans::XPropertySetInfo > aRef = + aSwMapProvider.GetPropertySet( + lcl_GetPropMapIdForFieldType( nResTypeId ) )->getPropertySetInfo(); return aRef; } /*-- 14.12.98 11:08:35--------------------------------------------------- @@ -577,8 +570,8 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName, // We just call PutValue (empty string is allowed). // Thus the last property set will be used as Data Source. - BYTE nMId = GetFieldTypeMId( rPropertyName, *pType ); - if( UCHAR_MAX != nMId ) + USHORT nMId = GetFieldTypeMId( rPropertyName, *pType ); + if( USHRT_MAX != nMId ) pType->PutValue( rValue, nMId ); else throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); @@ -815,8 +808,8 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName) else if(pType) { //TODO: Properties fuer die uebrigen Feldtypen einbauen - BYTE nMId = GetFieldTypeMId( rPropertyName, *pType ); - if( UCHAR_MAX != nMId ) + USHORT nMId = GetFieldTypeMId( rPropertyName, *pType ); + if( USHRT_MAX != nMId ) { pType->QueryValue( aRet, nMId ); @@ -1926,13 +1919,13 @@ uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void uno::Reference< beans::XPropertySetInfo > aRef; if(m_nServiceId != USHRT_MAX) { - const SfxItemPropertyMap* pMap = aSwMapProvider.GetPropertyMap( + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet( lcl_GetPropertyMapOfService( m_nServiceId )); - uno::Reference< beans::XPropertySetInfo > xInfo = new SfxItemPropertySetInfo(pMap); + uno::Reference< beans::XPropertySetInfo > xInfo = pPropSet->getPropertySetInfo(); // extend PropertySetInfo! const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties(); aRef = new SfxExtItemPropertySetInfo( - aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARAGRAPH_EXTENSIONS), + aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_PARAGRAPH_EXTENSIONS), aPropSeq ); } else @@ -1948,13 +1941,13 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An { vos::OGuard aGuard(Application::GetSolarMutex()); SwField* pField = (SwField*)GetField(); - const SfxItemPropertyMap* _pMap = aSwMapProvider.GetPropertyMap( + const SfxItemPropertySet* _pPropSet = aSwMapProvider.GetPropertySet( lcl_GetPropertyMapOfService( m_nServiceId)); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = _pPropSet->getPropertyMap()->getByName(rPropertyName); - if (!pMap) + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); if(pField) @@ -1981,13 +1974,13 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An SwPosition * pPos = GetPosition(); ASSERT(pPos, "no position"); - pDoc->PutValueToField( *pPos, rValue, pMap->nWID); + pDoc->PutValueToField( *pPos, rValue, pEntry->nWID); delete pPos; } // <- #111840# } - pField->PutValue( rValue, pMap->nWID ); + pField->PutValue( rValue, pEntry->nWID ); //#i100374# notify SwPostIt about new field content if (RES_POSTITFLD== nWhich && pFmtFld) @@ -2012,7 +2005,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An { String* pStr = 0; BOOL* pBool = 0; - switch(pMap->nWID) + switch(pEntry->nWID) { case FIELD_PROP_PAR1: pStr = &m_pProps->sPar1; @@ -2062,7 +2055,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An { sal_Int16 nVal = 0; rValue >>= nVal; - if( FIELD_PROP_USHORT1 == pMap->nWID) + if( FIELD_PROP_USHORT1 == pEntry->nWID) m_pProps->nUSHORT1 = nVal; else m_pProps->nUSHORT2 = nVal; @@ -2111,18 +2104,18 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName) vos::OGuard aGuard(Application::GetSolarMutex()); uno::Any aRet; const SwField* pField = GetField(); - const SfxItemPropertyMap* _pMap = aSwMapProvider.GetPropertyMap( + const SfxItemPropertySet* _pPropSet = aSwMapProvider.GetPropertySet( lcl_GetPropertyMapOfService( m_nServiceId)); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); - if(!pMap ) + const SfxItemPropertySimpleEntry* pEntry = _pPropSet->getPropertyMap()->getByName(rPropertyName); + if(!pEntry ) { - _pMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARAGRAPH_EXTENSIONS); - pMap = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); + const SfxItemPropertySet* _pParaPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH_EXTENSIONS); + pEntry = _pParaPropSet->getPropertyMap()->getByName(rPropertyName); } - if (!pMap) + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - switch( pMap->nWID ) + switch( pEntry->nWID ) { case FN_UNO_TEXT_WRAP: aRet <<= text::WrapTextMode_NONE; @@ -2142,8 +2135,8 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName) default: if( pField ) { - if (FIELD_PROP_IS_FIELD_USED == pMap->nWID || - FIELD_PROP_IS_FIELD_DISPLAYED == pMap->nWID) + if (FIELD_PROP_IS_FIELD_USED == pEntry->nWID || + FIELD_PROP_IS_FIELD_DISPLAYED == pEntry->nWID) { sal_Bool bIsFieldUsed = sal_False; sal_Bool bIsFieldDisplayed = sal_False; @@ -2198,16 +2191,16 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName) bIsFieldUsed = bFrame || bHidden; bIsFieldDisplayed = bIsFieldUsed && !bHidden; } - sal_Bool bRetVal = (FIELD_PROP_IS_FIELD_USED == pMap->nWID) ? + sal_Bool bRetVal = (FIELD_PROP_IS_FIELD_USED == pEntry->nWID) ? bIsFieldUsed : bIsFieldDisplayed; aRet.setValue( &bRetVal, ::getCppuBooleanType() ); } else - pField->QueryValue( aRet, pMap->nWID ); + pField->QueryValue( aRet, pEntry->nWID ); } else if( m_pProps ) // currently just a descriptor... { - switch(pMap->nWID) + switch(pEntry->nWID) { case FIELD_PROP_TEXT: { diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index fd7e68499f..18fb7cafee 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -55,6 +55,7 @@ #include <ndnotxt.hxx> #include <svx/unomid.hxx> #include <unocrsr.hxx> +#include <unocrsrhelper.hxx> #include <docstyle.hxx> #include <dcontact.hxx> #include <fmtcnct.hxx> @@ -134,23 +135,18 @@ const sal_Char __FAR_DATA sGraphicObjectProtocol[] = "vnd.sun.star.GraphicObject /**************************************************************************** Rahmenbeschreibung ****************************************************************************/ -DECLARE_TABLE(SwFrameAnyTable_Impl, uno::Any*) class BaseFrameProperties_Impl { - const SfxItemPropertyMap* _pMap; - SwFrameAnyTable_Impl aAnyTbl; + SwUnoCursorHelper::SwAnyMapHelper aAnyMap; public: - - BaseFrameProperties_Impl ( const SfxItemPropertyMap* pMap ) : - _pMap(pMap) {} virtual ~BaseFrameProperties_Impl(); - void SetProperty(USHORT nWID, BYTE nMemberId, uno::Any aVal); - sal_Bool GetProperty(USHORT nWID, BYTE nMemberId, uno::Any*& pAny ); - void GetProperty(const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny ); + void SetProperty(USHORT nWID, BYTE nMemberId, const uno::Any& rVal); + sal_Bool GetProperty(USHORT nWID, BYTE nMemberId, const uno::Any*& pAny ); +// void GetProperty(const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny ); - const SfxItemPropertyMap* GetMap() const {return _pMap;} +// const SfxItemPropertyMap* GetMap() const {return _pMap;} sal_Bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, sal_Bool& rSizeFound); virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) = 0; @@ -161,41 +157,25 @@ public: ---------------------------------------------------------------------------*/ BaseFrameProperties_Impl::~BaseFrameProperties_Impl() { - uno::Any* pVal = aAnyTbl.First(); - while(pVal) - { - delete pVal; - pVal = aAnyTbl.Next(); - } } /* -----------------------------12.06.01 15:43-------------------------------- ---------------------------------------------------------------------------*/ -void BaseFrameProperties_Impl::SetProperty(USHORT nWID, BYTE nMemberId, uno::Any aVal) +void BaseFrameProperties_Impl::SetProperty(USHORT nWID, BYTE nMemberId, const uno::Any& rVal) { - ULONG nKey = (nWID << 16) + nMemberId; - uno::Any* pCurAny = aAnyTbl.Get(nKey); - if(!pCurAny) - { - pCurAny = new uno::Any; - aAnyTbl.Insert(nKey, pCurAny); - } - *pCurAny = aVal; + aAnyMap.SetValue( nWID, nMemberId, rVal ); } /* -----------------------------12.06.01 15:43-------------------------------- ---------------------------------------------------------------------------*/ -sal_Bool BaseFrameProperties_Impl::GetProperty(USHORT nWID, BYTE nMemberId, uno::Any*& pAny) -{ - ULONG nKey = (nWID << 16) + nMemberId; - uno::Any *pCurAny = aAnyTbl.Get(nKey); - pAny = pCurAny; - return pCurAny != 0; -} -void BaseFrameProperties_Impl::GetProperty( const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any & rAny ) +sal_Bool BaseFrameProperties_Impl::GetProperty(USHORT nWID, BYTE nMemberId, const uno::Any*& rpAny) { - rAny = rxPropertySet->getPropertyValue( rPropertyName ); + return aAnyMap.FillValue( nWID, nMemberId, rpAny ); } +//void BaseFrameProperties_Impl::GetProperty( const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any & rAny ) +//{ +// rAny = rxPropertySet->getPropertyValue( rPropertyName ); +//} /* -----------------29.06.98 09:55------------------- * * --------------------------------------------------*/ @@ -205,36 +185,36 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const //Anker kommt auf jeden Fall in den Set SwFmtAnchor aAnchor ( static_cast < const SwFmtAnchor & > ( rFromSet.Get ( RES_ANCHOR ) ) ); { - uno::Any* pAnchorPgNo; + const ::uno::Any* pAnchorPgNo; if(GetProperty(RES_ANCHOR, MID_ANCHOR_PAGENUM, pAnchorPgNo)) bRet &= ((SfxPoolItem&)aAnchor).PutValue(*pAnchorPgNo, MID_ANCHOR_PAGENUM); - uno::Any* pAnchorType; + const ::uno::Any* pAnchorType; if(GetProperty(RES_ANCHOR, MID_ANCHOR_ANCHORTYPE, pAnchorType)) bRet &= ((SfxPoolItem&)aAnchor).PutValue(*pAnchorType, MID_ANCHOR_ANCHORTYPE); } rToSet.Put(aAnchor); { - uno::Any* pCol = 0; + const ::uno::Any* pCol = 0; GetProperty(RES_BACKGROUND, MID_BACK_COLOR, pCol ); - uno::Any* pRGBCol = 0; + const ::uno::Any* pRGBCol = 0; GetProperty(RES_BACKGROUND, MID_BACK_COLOR_R_G_B, pRGBCol ); - uno::Any* pColTrans = 0; + const ::uno::Any* pColTrans = 0; GetProperty(RES_BACKGROUND, MID_BACK_COLOR_TRANSPARENCY, pColTrans); - uno::Any* pTrans = 0; + const ::uno::Any* pTrans = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENT, pTrans ); - uno::Any* pGrLoc = 0; + const ::uno::Any* pGrLoc = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_POSITION, pGrLoc ); - uno::Any* pGrURL = 0; + const ::uno::Any* pGrURL = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_URL, pGrURL ); - uno::Any* pGrFilter = 0; + const ::uno::Any* pGrFilter = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_FILTER, pGrFilter ); - uno::Any* pGrTranparency = 0; + const ::uno::Any* pGrTranparency = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENCY, pGrTranparency ); if(pCol || pTrans || pGrURL || pGrFilter || pGrLoc || pGrTranparency || pColTrans || pRGBCol) { - SvxBrushItem aBrush ( static_cast < const SvxBrushItem & > ( rFromSet.Get ( RES_BACKGROUND ) ) ); + SvxBrushItem aBrush ( static_cast < const :: SvxBrushItem & > ( rFromSet.Get ( RES_BACKGROUND ) ) ); if(pCol ) bRet &= ((SfxPoolItem&)aBrush).PutValue(*pCol,MID_BACK_COLOR ); if(pColTrans) @@ -260,15 +240,15 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const } } { - uno::Any* pCont = 0; + const ::uno::Any* pCont = 0; GetProperty(RES_PROTECT, MID_PROTECT_CONTENT, pCont ); - uno::Any* pPos = 0; + const ::uno::Any* pPos = 0; GetProperty(RES_PROTECT,MID_PROTECT_POSITION, pPos ); - uno::Any* pName = 0; + const ::uno::Any* pName = 0; GetProperty(RES_PROTECT, MID_PROTECT_SIZE, pName ); if(pCont||pPos||pName) { - SvxProtectItem aProt ( static_cast < const SvxProtectItem & > ( rFromSet.Get ( RES_PROTECT ) ) ); + SvxProtectItem aProt ( static_cast < const :: SvxProtectItem & > ( rFromSet.Get ( RES_PROTECT ) ) ); if(pCont) bRet &= ((SfxPoolItem&)aProt).PutValue(*pCont, MID_PROTECT_CONTENT); if(pPos ) @@ -279,17 +259,17 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const } } { - uno::Any* pHori = 0; + const ::uno::Any* pHori = 0; GetProperty(RES_HORI_ORIENT, MID_HORIORIENT_ORIENT, pHori ); - uno::Any* pHoriP = 0; + const ::uno::Any* pHoriP = 0; GetProperty(RES_HORI_ORIENT, MID_HORIORIENT_POSITION|CONVERT_TWIPS, pHoriP ); - uno::Any* pHoriR = 0; + const ::uno::Any* pHoriR = 0; GetProperty(RES_HORI_ORIENT, MID_HORIORIENT_RELATION, pHoriR ); - uno::Any* pPageT = 0; + const ::uno::Any* pPageT = 0; GetProperty(RES_HORI_ORIENT, MID_HORIORIENT_PAGETOGGLE, pPageT); if(pHori||pHoriP||pHoriR||pPageT) { - SwFmtHoriOrient aOrient ( static_cast < const SwFmtHoriOrient & > ( rFromSet.Get ( RES_HORI_ORIENT ) ) ); + SwFmtHoriOrient aOrient ( static_cast < const :: SwFmtHoriOrient & > ( rFromSet.Get ( RES_HORI_ORIENT ) ) ); if(pHori ) bRet &= ((SfxPoolItem&)aOrient).PutValue(*pHori, MID_HORIORIENT_ORIENT); if(pHoriP) @@ -303,15 +283,15 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const } { - uno::Any* pVert = 0; + const ::uno::Any* pVert = 0; GetProperty(RES_VERT_ORIENT, MID_VERTORIENT_ORIENT, pVert); - uno::Any* pVertP = 0; + const ::uno::Any* pVertP = 0; GetProperty(RES_VERT_ORIENT, MID_VERTORIENT_POSITION|CONVERT_TWIPS, pVertP ); - uno::Any* pVertR = 0; + const ::uno::Any* pVertR = 0; GetProperty(RES_VERT_ORIENT, MID_VERTORIENT_RELATION, pVertR ); if(pVert||pVertP||pVertR) { - SwFmtVertOrient aOrient ( static_cast < const SwFmtVertOrient & > ( rFromSet.Get ( RES_VERT_ORIENT ) ) ); + SwFmtVertOrient aOrient ( static_cast < const :: SwFmtVertOrient & > ( rFromSet.Get ( RES_VERT_ORIENT ) ) ); if(pVert ) bRet &= ((SfxPoolItem&)aOrient).PutValue(*pVert, MID_VERTORIENT_ORIENT); if(pVertP) @@ -322,17 +302,17 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const } } { - uno::Any* pURL = 0; + const ::uno::Any* pURL = 0; GetProperty(RES_URL, MID_URL_URL, pURL ); - uno::Any* pTarget = 0; + const ::uno::Any* pTarget = 0; GetProperty(RES_URL, MID_URL_TARGET, pTarget ); - uno::Any* pHyLNm = 0; + const ::uno::Any* pHyLNm = 0; GetProperty(RES_URL, MID_URL_HYPERLINKNAME, pHyLNm ); - uno::Any* pHySMp = 0; + const ::uno::Any* pHySMp = 0; GetProperty(RES_URL, MID_URL_SERVERMAP, pHySMp ); if(pURL||pTarget||pHyLNm||pHySMp) { - SwFmtURL aURL ( static_cast < const SwFmtURL & > ( rFromSet.Get ( RES_URL ) ) ); + SwFmtURL aURL ( static_cast < const :: SwFmtURL & > ( rFromSet.Get ( RES_URL ) ) ); if(pURL) bRet &= ((SfxPoolItem&)aURL).PutValue(*pURL, MID_URL_URL); if(pTarget) @@ -344,88 +324,88 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const rToSet.Put(aURL); } } - uno::Any* pL = 0; + const ::uno::Any* pL = 0; GetProperty(RES_LR_SPACE, MID_L_MARGIN|CONVERT_TWIPS, pL ); - uno::Any* pR = 0; + const ::uno::Any* pR = 0; GetProperty(RES_LR_SPACE, MID_R_MARGIN|CONVERT_TWIPS, pR ); if(pL||pR) { - SvxLRSpaceItem aLR ( static_cast < const SvxLRSpaceItem & > ( rFromSet.Get ( RES_LR_SPACE ) ) ); + SvxLRSpaceItem aLR ( static_cast < const :: SvxLRSpaceItem & > ( rFromSet.Get ( RES_LR_SPACE ) ) ); if(pL) bRet &= ((SfxPoolItem&)aLR).PutValue(*pL, MID_L_MARGIN|CONVERT_TWIPS); if(pR) bRet &= ((SfxPoolItem&)aLR).PutValue(*pR, MID_R_MARGIN|CONVERT_TWIPS); rToSet.Put(aLR); } - uno::Any* pT = 0; + const ::uno::Any* pT = 0; GetProperty(RES_UL_SPACE, MID_UP_MARGIN|CONVERT_TWIPS, pT ); - uno::Any* pB = 0; + const ::uno::Any* pB = 0; GetProperty(RES_UL_SPACE, MID_LO_MARGIN|CONVERT_TWIPS, pB ); if(pT||pB) { - SvxULSpaceItem aTB ( static_cast < const SvxULSpaceItem &> ( rFromSet.Get ( RES_UL_SPACE ) ) ); + SvxULSpaceItem aTB ( static_cast < const :: SvxULSpaceItem &> ( rFromSet.Get ( RES_UL_SPACE ) ) ); if(pT) bRet &= ((SfxPoolItem&)aTB).PutValue(*pT, MID_UP_MARGIN|CONVERT_TWIPS); if(pB) bRet &= ((SfxPoolItem&)aTB).PutValue(*pB, MID_LO_MARGIN|CONVERT_TWIPS); rToSet.Put(aTB); } - uno::Any* pOp; + const ::uno::Any* pOp; if(GetProperty(RES_OPAQUE, 0, pOp)) { - SvxOpaqueItem aOp ( static_cast < const SvxOpaqueItem& > ( rFromSet.Get ( RES_OPAQUE ) ) ); + SvxOpaqueItem aOp ( static_cast < const :: SvxOpaqueItem& > ( rFromSet.Get ( RES_OPAQUE ) ) ); bRet &= ((SfxPoolItem&)aOp).PutValue(*pOp, 0); rToSet.Put(aOp); } - uno::Any* pPrt; + const ::uno::Any* pPrt; if(GetProperty(RES_PRINT, 0, pPrt)) { - SvxPrintItem aPrt ( static_cast < const SvxPrintItem & > ( rFromSet.Get ( RES_PRINT ) ) ); + SvxPrintItem aPrt ( static_cast < const :: SvxPrintItem & > ( rFromSet.Get ( RES_PRINT ) ) ); bRet &= ((SfxPoolItem&)aPrt).PutValue(*pPrt, 0); rToSet.Put(aPrt); } - uno::Any* pSh; + const ::uno::Any* pSh; if(GetProperty(RES_SHADOW, CONVERT_TWIPS, pSh)) { - SvxShadowItem aSh ( static_cast < const SvxShadowItem& > ( rFromSet.Get ( RES_SHADOW ) ) ); + SvxShadowItem aSh ( static_cast < const :: SvxShadowItem& > ( rFromSet.Get ( RES_SHADOW ) ) ); bRet &= ((SfxPoolItem&)aSh).PutValue(*pSh, CONVERT_TWIPS); rToSet.Put(aSh); } - uno::Any* pSur = 0; + const ::uno::Any* pSur = 0; GetProperty(RES_SURROUND, MID_SURROUND_SURROUNDTYPE, pSur); - uno::Any* pSurAnch = 0; + const ::uno::Any* pSurAnch = 0; GetProperty(RES_SURROUND, MID_SURROUND_ANCHORONLY, pSurAnch); if(pSur || pSurAnch) { - SwFmtSurround aSrnd ( static_cast < const SwFmtSurround & > ( rFromSet.Get ( RES_SURROUND ) ) ); + SwFmtSurround aSrnd ( static_cast < const :: SwFmtSurround & > ( rFromSet.Get ( RES_SURROUND ) ) ); if(pSur) bRet &= ((SfxPoolItem&)aSrnd).PutValue(*pSur, MID_SURROUND_SURROUNDTYPE ); if(pSurAnch) bRet &= ((SfxPoolItem&)aSrnd).PutValue(*pSurAnch, MID_SURROUND_ANCHORONLY); rToSet.Put(aSrnd); } - uno::Any* pLeft = 0; + const ::uno::Any* pLeft = 0; GetProperty(RES_BOX, LEFT_BORDER |CONVERT_TWIPS, pLeft ); - uno::Any* pRight = 0; + const ::uno::Any* pRight = 0; GetProperty(RES_BOX, CONVERT_TWIPS|RIGHT_BORDER , pRight ); - uno::Any* pTop = 0; + const ::uno::Any* pTop = 0; GetProperty(RES_BOX, CONVERT_TWIPS|TOP_BORDER , pTop ); - uno::Any* pBottom = 0; + const ::uno::Any* pBottom = 0; GetProperty(RES_BOX, CONVERT_TWIPS|BOTTOM_BORDER, pBottom); - uno::Any* pDistance = 0; + const ::uno::Any* pDistance = 0; GetProperty(RES_BOX, CONVERT_TWIPS|BORDER_DISTANCE, pDistance); - uno::Any* pLeftDistance = 0; + const ::uno::Any* pLeftDistance = 0; GetProperty(RES_BOX, CONVERT_TWIPS|LEFT_BORDER_DISTANCE, pLeftDistance); - uno::Any* pRightDistance = 0; + const ::uno::Any* pRightDistance = 0; GetProperty(RES_BOX, CONVERT_TWIPS|RIGHT_BORDER_DISTANCE, pRightDistance); - uno::Any* pTopDistance = 0; + const ::uno::Any* pTopDistance = 0; GetProperty(RES_BOX, CONVERT_TWIPS|TOP_BORDER_DISTANCE, pTopDistance); - uno::Any* pBottomDistance = 0; + const ::uno::Any* pBottomDistance = 0; GetProperty(RES_BOX, CONVERT_TWIPS|BOTTOM_BORDER_DISTANCE, pBottomDistance); if( pLeft || pRight || pTop || pBottom || pDistance || pLeftDistance || pRightDistance || pTopDistance || pBottomDistance ) { - SvxBoxItem aBox ( static_cast < const SvxBoxItem & > ( rFromSet.Get ( RES_BOX ) ) ); + SvxBoxItem aBox ( static_cast < const :: SvxBoxItem & > ( rFromSet.Get ( RES_BOX ) ) ); if( pLeft ) bRet &= ((SfxPoolItem&)aBox).PutValue(*pLeft, CONVERT_TWIPS|LEFT_BORDER ); if( pRight ) @@ -447,29 +427,29 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const rToSet.Put(aBox); } { - uno::Any* pRelH = 0; + const ::uno::Any* pRelH = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_REL_HEIGHT, pRelH); - uno::Any* pRelW = 0; + const ::uno::Any* pRelW = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_REL_WIDTH, pRelW); - uno::Any* pSyncWidth = 0; + const ::uno::Any* pSyncWidth = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT, pSyncWidth); - uno::Any* pSyncHeight = 0; + const ::uno::Any* pSyncHeight = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH, pSyncHeight); - uno::Any* pWidth = 0; + const ::uno::Any* pWidth = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_WIDTH|CONVERT_TWIPS, pWidth); - uno::Any* pHeight = 0; + const ::uno::Any* pHeight = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_HEIGHT|CONVERT_TWIPS, pHeight); - uno::Any* pSize = 0; + const ::uno::Any* pSize = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_SIZE|CONVERT_TWIPS, pSize); - uno::Any* pSizeType = 0; + const ::uno::Any* pSizeType = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_SIZE_TYPE, pSizeType); - uno::Any* pWidthType = 0; + const ::uno::Any* pWidthType = 0; GetProperty(RES_FRM_SIZE, MID_FRMSIZE_WIDTH_TYPE, pWidthType); if( pWidth || pHeight ||pRelH || pRelW || pSize ||pSizeType || pWidthType ||pSyncWidth || pSyncHeight ) { rSizeFound = sal_True; - SwFmtFrmSize aFrmSz ( static_cast < const SwFmtFrmSize& > ( rFromSet.Get ( RES_FRM_SIZE ) ) ); + SwFmtFrmSize aFrmSz ( static_cast < const :: SwFmtFrmSize& > ( rFromSet.Get ( RES_FRM_SIZE ) ) ); if(pWidth) bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pWidth, MID_FRMSIZE_WIDTH|CONVERT_TWIPS); if(pHeight) @@ -501,13 +481,13 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const awt::Size aSize; aSize.Width = 2 * MM50; aSize.Height = 2 * MM50; - uno::Any aSizeVal; + ::uno::Any aSizeVal; aSizeVal <<= aSize; ((SfxPoolItem&)aFrmSz).PutValue(aSizeVal, MID_FRMSIZE_SIZE|CONVERT_TWIPS); rToSet.Put(aFrmSz); } } - uno::Any* pFrameDirection = 0; + const ::uno::Any* pFrameDirection = 0; GetProperty(RES_FRAMEDIR, 0, pFrameDirection); if(pFrameDirection) { @@ -515,7 +495,7 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const aAttr.PutValue(*pFrameDirection, 0); rToSet.Put(aAttr); } - uno::Any* pUnknown = 0; + const ::uno::Any* pUnknown = 0; GetProperty(RES_UNKNOWNATR_CONTAINER, 0, pUnknown); if(pUnknown) { @@ -525,7 +505,7 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const } // DVO, OD 01.10.2003 #i18732# - uno::Any* pFollowTextFlow = 0; + const ::uno::Any* pFollowTextFlow = 0; GetProperty(RES_FOLLOW_TEXT_FLOW, 0, pFollowTextFlow); if ( pFollowTextFlow ) { @@ -535,7 +515,7 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const } // OD 2004-05-04 #i28701# - RES_WRAP_INFLUENCE_ON_OBJPOS - uno::Any* pWrapInfluenceOnObjPos = 0; + const ::uno::Any* pWrapInfluenceOnObjPos = 0; GetProperty(RES_WRAP_INFLUENCE_ON_OBJPOS, MID_WRAP_INFLUENCE, pWrapInfluenceOnObjPos); if ( pWrapInfluenceOnObjPos ) { @@ -553,8 +533,8 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const class SwFrameProperties_Impl : public BaseFrameProperties_Impl { protected: - SwFrameProperties_Impl(const SfxItemPropertyMap* pMap) : - BaseFrameProperties_Impl(pMap){} +// SwFrameProperties_Impl(/*const :: SfxItemPropertyMap* pMap*/) : +// BaseFrameProperties_Impl(/*pMap*/){} public: SwFrameProperties_Impl(); virtual ~SwFrameProperties_Impl(){} @@ -565,17 +545,17 @@ public: * * --------------------------------------------------*/ SwFrameProperties_Impl::SwFrameProperties_Impl(): - BaseFrameProperties_Impl(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME) ) + BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME)*/ ) { } /* -----------------22.06.98 11:27------------------- * * --------------------------------------------------*/ -inline void lcl_FillCol ( SfxItemSet &rToSet, const SfxItemSet &rFromSet, uno::Any *pAny) +inline void lcl_FillCol ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const :: uno::Any *pAny) { if ( pAny ) { - SwFmtCol aCol ( static_cast < const SwFmtCol & > ( rFromSet.Get ( RES_COL ) ) ); + SwFmtCol aCol ( static_cast < const :: SwFmtCol & > ( rFromSet.Get ( RES_COL ) ) ); ((SfxPoolItem&)aCol).PutValue( *pAny, MID_COLUMNS); rToSet.Put(aCol); } @@ -583,7 +563,7 @@ inline void lcl_FillCol ( SfxItemSet &rToSet, const SfxItemSet &rFromSet, uno::A sal_Bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItemSet&, sal_Bool& rSizeFound) { //Properties fuer alle Frames - uno::Any *pStyleName; + const ::uno::Any *pStyleName; SwDocStyleSheet* pStyle = NULL; sal_Bool bRet; @@ -595,22 +575,22 @@ sal_Bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SFX_STYLE_FAMILY_FRAME); } - uno::Any* pColumns = NULL; + const ::uno::Any* pColumns = NULL; GetProperty (RES_COL, MID_COLUMNS, pColumns); if ( pStyle ) { rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *pStyle ) ); - const SfxItemSet *pItemSet = &xStyle->GetItemSet(); + const :: SfxItemSet *pItemSet = &xStyle->GetItemSet(); bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound ); lcl_FillCol ( rSet, *pItemSet, pColumns ); } else { - const SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_FRAME )->GetAttrSet(); + const :: SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_FRAME )->GetAttrSet(); bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound ); lcl_FillCol ( rSet, *pItemSet, pColumns ); } - uno::Any* pEdit; + const ::uno::Any* pEdit; if(GetProperty(RES_EDIT_IN_READONLY, 0, pEdit)) { SfxBoolItem aBool(RES_EDIT_IN_READONLY); @@ -634,18 +614,18 @@ public: * * --------------------------------------------------*/ SwGraphicProperties_Impl::SwGraphicProperties_Impl( ) : - BaseFrameProperties_Impl(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC) ) + BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC)*/ ) { } /* -----------------27.06.98 14:40------------------- * * --------------------------------------------------*/ -inline void lcl_FillMirror ( SfxItemSet &rToSet, const SfxItemSet &rFromSet, uno::Any *pHEvenMirror, uno::Any *pHOddMirror, uno::Any *pVMirror, sal_Bool &rRet ) +inline void lcl_FillMirror ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const ::uno::Any *pHEvenMirror, const ::uno::Any *pHOddMirror, const ::uno::Any *pVMirror, sal_Bool &rRet ) { if(pHEvenMirror || pHOddMirror || pVMirror ) { - SwMirrorGrf aMirror ( static_cast < const SwMirrorGrf& > ( rFromSet.Get ( RES_GRFATR_MIRRORGRF ) ) ); + SwMirrorGrf aMirror ( static_cast < const :: SwMirrorGrf& > ( rFromSet.Get ( RES_GRFATR_MIRRORGRF ) ) ); if(pHEvenMirror) rRet &= ((SfxPoolItem&)aMirror).PutValue(*pHEvenMirror, MID_MIRROR_HORZ_EVEN_PAGES); if(pHOddMirror) @@ -664,7 +644,7 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet( { //Properties fuer alle Frames sal_Bool bRet; - uno::Any *pStyleName; + const ::uno::Any *pStyleName; SwDocStyleSheet* pStyle = NULL; if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) ) @@ -675,9 +655,9 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet( SFX_STYLE_FAMILY_FRAME); } - uno::Any* pHEvenMirror = 0; - uno::Any* pHOddMirror = 0; - uno::Any* pVMirror = 0; + const ::uno::Any* pHEvenMirror = 0; + const ::uno::Any* pHOddMirror = 0; + const ::uno::Any* pVMirror = 0; GetProperty(RES_GRFATR_MIRRORGRF, MID_MIRROR_HORZ_EVEN_PAGES, pHEvenMirror); GetProperty(RES_GRFATR_MIRRORGRF, MID_MIRROR_HORZ_ODD_PAGES, pHOddMirror); GetProperty(RES_GRFATR_MIRRORGRF, MID_MIRROR_VERT, pVMirror); @@ -685,19 +665,19 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet( if ( pStyle ) { rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle) ); - const SfxItemSet *pItemSet = &xStyle->GetItemSet(); + const :: SfxItemSet *pItemSet = &xStyle->GetItemSet(); bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound); lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet ); } else { - const SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC )->GetAttrSet(); + const :: SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC )->GetAttrSet(); bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound); lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet ); } - static const USHORT nIDs[] = + static const :: USHORT nIDs[] = { RES_GRFATR_CROPGRF, RES_GRFATR_ROTATION, @@ -712,7 +692,7 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet( RES_GRFATR_DRAWMODE, 0 }; - uno::Any* pAny; + const ::uno::Any* pAny; for(sal_Int16 nIndex = 0; nIDs[nIndex]; nIndex++) { BYTE nMId = RES_GRFATR_CROPGRF == nIDs[nIndex] ? CONVERT_TWIPS : 0; @@ -735,7 +715,7 @@ class SwOLEProperties_Impl : public SwFrameProperties_Impl { public: SwOLEProperties_Impl() : - SwFrameProperties_Impl(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_EMBEDDED_OBJECT) ){} + SwFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_EMBEDDED_OBJECT)*/ ){} virtual ~SwOLEProperties_Impl(){} virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound); @@ -747,7 +727,7 @@ public: sal_Bool SwOLEProperties_Impl::AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) { - uno::Any* pTemp; + const ::uno::Any* pTemp; if(!GetProperty(FN_UNO_CLSID, 0, pTemp) && !GetProperty(FN_UNO_STREAM_NAME, 0, pTemp) ) return FALSE; SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrmSet, rSet, rSizeFound); @@ -761,7 +741,7 @@ sal_Bool SwOLEProperties_Impl::AnyToItemSet( /* -----------------------------10.03.00 18:02-------------------------------- ---------------------------------------------------------------------------*/ -const uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId() +const :: uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; @@ -769,7 +749,7 @@ const uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId() /* -----------------------------10.03.00 18:04-------------------------------- ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXFrame::getSomething( const uno::Sequence< sal_Int8 >& rId ) +sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { if( rId.getLength() == 16 @@ -795,7 +775,7 @@ OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException ) /* -----------------------------06.04.00 14:20-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwXFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) +BOOL SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException ) { return !rServiceName.compareToAscii("com.sun.star.text.BaseFrame")|| !rServiceName.compareToAscii("com.sun.star.text.TextContent") || @@ -818,11 +798,10 @@ uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::R /*-- 14.01.99 11:31:52--------------------------------------------------- Dieser CTor legt den Frame als Descriptor an -----------------------------------------------------------------------*/ -SwXFrame::SwXFrame(FlyCntType eSet, const SfxItemPropertyMap* pMap, SwDoc *pDoc) : +SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pDoc) : aLstnrCntnr( (container::XNamed*)this), - aPropSet(pMap), - _pMap(pMap), - mpDoc ( pDoc ), + m_pPropSet(pSet), + m_pDoc ( pDoc ), eType(eSet), bIsDescriptor(sal_True), m_pCopySource( 0 ) @@ -837,7 +816,7 @@ SwXFrame::SwXFrame(FlyCntType eSet, const SfxItemPropertyMap* pMap, SwDoc *pDoc) // Get the style families uno::Reference < XNameAccess > xFamilies = xFamilySupplier->getStyleFamilies(); // Get the Frame family (and keep it for later) - uno::Any aAny = xFamilies->getByName ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "FrameStyles" ) ) ); + const ::uno::Any aAny = xFamilies->getByName ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "FrameStyles" ) ) ); aAny >>= mxStyleFamily; // In the derived class, we'll ask mxStyleFamily for the relevant default style // mxStyleFamily is initialised in the SwXFrame constructor @@ -873,12 +852,11 @@ SwXFrame::SwXFrame(FlyCntType eSet, const SfxItemPropertyMap* pMap, SwDoc *pDoc) /*-- 11.12.98 15:05:01--------------------------------------------------- -----------------------------------------------------------------------*/ -SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const SfxItemPropertyMap* pMap) : +SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertySet* pSet) : SwClient( &rFrmFmt ), aLstnrCntnr( (container::XNamed*)this), - aPropSet(pMap), - _pMap(pMap), - mpDoc( 0 ), + m_pPropSet(pSet), + m_pDoc( 0 ), eType(eSet), pProps(0), bIsDescriptor(sal_False), @@ -916,7 +894,7 @@ OUString SwXFrame::getName(void) throw( uno::RuntimeException ) /*-- 11.12.98 15:05:03--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXFrame::setName(const OUString& rName) throw( uno::RuntimeException ) +void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); SwFrmFmt* pFmt = GetFrmFmt(); @@ -947,17 +925,17 @@ uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) th { case FLYCNTTYPE_FRM: if( !xFrmRef.is() ) - xFrmRef = aPropSet.getPropertySetInfo(); + xFrmRef = m_pPropSet->getPropertySetInfo(); xRef = xFrmRef; break; case FLYCNTTYPE_GRF: if( !xGrfRef.is() ) - xGrfRef = aPropSet.getPropertySetInfo(); + xGrfRef = m_pPropSet->getPropertySetInfo(); xRef = xGrfRef; break; case FLYCNTTYPE_OLE: if( !xOLERef.is() ) - xOLERef = aPropSet.getPropertySetInfo(); + xOLERef = m_pPropSet->getPropertySetInfo(); xRef = xOLERef; break; default: @@ -993,7 +971,7 @@ SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt ) = new SwFlyDrawContact( pFmt, pDrawModel ); pObject = pContactObject->GetMaster(); - const SwFmtSurround& rSurround = pFmt->GetSurround(); + const :: SwFmtSurround& rSurround = pFmt->GetSurround(); pObject->SetLayer( ( SURROUND_THROUGHT == rSurround.GetSurround() && !pFmt->GetOpaque().GetValue() ) ? pDoc->GetHellId() @@ -1005,7 +983,7 @@ SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt ) return pObject; } -SwFrmFmt *lcl_GetFrmFmt( const uno::Any& rValue, SwDoc *pDoc ) +SwFrmFmt *lcl_GetFrmFmt( const :: uno::Any& rValue, SwDoc *pDoc ) { SwFrmFmt *pRet = 0; SwDocShell* pDocSh = pDoc->GetDocShell(); @@ -1025,36 +1003,36 @@ SwFrmFmt *lcl_GetFrmFmt( const uno::Any& rValue, SwDoc *pDoc ) return pRet; } -void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) +void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::Any& aValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); SwFrmFmt* pFmt = GetFrmFmt(); - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); + const :: SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); - if (!pCur) + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); if(pFmt) { sal_Bool bNextFrame = sal_False; - if ( pCur->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SwDoc* pDoc = pFmt->GetDoc(); if( eType == FLYCNTTYPE_GRF && - (pCur->nWID >= RES_GRFATR_BEGIN && - pCur->nWID < RES_GRFATR_END)|| - pCur->nWID == FN_PARAM_COUNTOUR_PP || - pCur->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR || - pCur->nWID == FN_UNO_IS_PIXEL_CONTOUR ) + (pEntry->nWID >= RES_GRFATR_BEGIN && + pEntry->nWID < RES_GRFATR_END)|| + pEntry->nWID == FN_PARAM_COUNTOUR_PP || + pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR || + pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR ) { - const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); + const :: SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) { SwNodeIndex aIdx(*pIdx, 1); SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); - if(pCur->nWID == FN_PARAM_COUNTOUR_PP) + if(pEntry->nWID == FN_PARAM_COUNTOUR_PP) { drawing::PointSequenceSequence aParam; if(!aValue.hasValue()) @@ -1064,9 +1042,9 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a PolyPolygon aPoly((USHORT)aParam.getLength()); for(sal_Int32 i = 0; i < aParam.getLength(); i++) { - const drawing::PointSequence* pPointSeq = aParam.getConstArray(); + const :: drawing::PointSequence* pPointSeq = aParam.getConstArray(); sal_Int32 nPoints = pPointSeq[i].getLength(); - const awt::Point* pPoints = pPointSeq[i].getConstArray(); + const :: awt::Point* pPoints = pPointSeq[i].getConstArray(); Polygon aSet( (USHORT)nPoints ); for(sal_Int32 j = 0; j < nPoints; j++) { @@ -1082,11 +1060,11 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a else throw lang::IllegalArgumentException(); } - else if(pCur->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR ) + else if(pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR ) { pNoTxt->SetAutomaticContour( *(sal_Bool *)aValue.getValue() ); } - else if(pCur->nWID == FN_UNO_IS_PIXEL_CONTOUR ) + else if(pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR ) { // The IsPixelContour property can only be set if there // is no contour, or if the contour has been set by the @@ -1101,14 +1079,14 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a else { SfxItemSet aSet(pNoTxt->GetSwAttrSet()); - aPropSet.setPropertyValue(*pCur, aValue, aSet); + m_pPropSet->setPropertyValue(*pEntry, aValue, aSet); pNoTxt->SetAttr(aSet); } } } - else if( FN_UNO_ALTERNATIVE_TEXT == pCur->nWID && eType != FLYCNTTYPE_FRM ) + else if( FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID && eType != FLYCNTTYPE_FRM ) { - const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); + const :: SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) { SwNodeIndex aIdx(*pIdx, 1); @@ -1118,7 +1096,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a pNoTxt->SetAlternateText(uTemp); } } - else if(FN_UNO_FRAME_STYLE_NAME == pCur->nWID) + else if(FN_UNO_FRAME_STYLE_NAME == pEntry->nWID) { SwFrmFmt *pFrmFmt = lcl_GetFrmFmt( aValue, pFmt->GetDoc() ); if( pFrmFmt ) @@ -1134,13 +1112,13 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a // see SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocPos ) SwFlyFrm *pFly = 0; { - const SwFrmFmt* pFmtXX = pFmt; + const :: SwFrmFmt* pFmtXX = pFmt; if (PTR_CAST(SwFlyFrmFmt, pFmtXX)) pFly = ((SwFlyFrmFmt*)pFmtXX)->GetFrm(); } if ( pFly ) { - const SfxPoolItem* pItem; + const :: SfxPoolItem* pItem; if( SFX_ITEM_SET == pFrmFmt->GetItemState( RES_ANCHOR, sal_False, &pItem )) { pSet = new SfxItemSet( pDoc->GetAttrPool(), aFrmFmtSetRange ); @@ -1158,8 +1136,8 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a else throw lang::IllegalArgumentException(); } - else if( FN_UNO_GRAPHIC_U_R_L == pCur->nWID || - FN_UNO_GRAPHIC_FILTER == pCur->nWID) + else if( FN_UNO_GRAPHIC_U_R_L == pEntry->nWID || + FN_UNO_GRAPHIC_FILTER == pEntry->nWID) { String sGrfName, sFltName; GraphicObject *pGrfObj = 0; @@ -1168,7 +1146,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a aValue >>= uTemp; String sTmp(uTemp); UnoActionContext aAction(pFmt->GetDoc()); - if(FN_UNO_GRAPHIC_U_R_L == pCur->nWID) + if(FN_UNO_GRAPHIC_U_R_L == pEntry->nWID) { if( sTmp.EqualsAscii( sPackageProtocol, 0, sizeof( sPackageProtocol )-1 ) ) @@ -1196,7 +1174,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a sFltName = sTmp; } - const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); + const :: SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) { SwNodeIndex aIdx(*pIdx, 1); @@ -1213,13 +1191,13 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a } delete pGrfObj; } - else if( FN_UNO_GRAPHIC == pCur->nWID ) + else if( FN_UNO_GRAPHIC == pEntry->nWID ) { uno::Reference< graphic::XGraphic > xGraphic; aValue >>= xGraphic; if(xGraphic.is()) { - const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); + const :: SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) { SwNodeIndex aIdx(*pIdx, 1); @@ -1234,9 +1212,9 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a } } } - else if( FN_UNO_REPLACEMENT_GRAPHIC_URL == pCur->nWID || FN_UNO_REPLACEMENT_GRAPHIC == pCur->nWID ) + else if( FN_UNO_REPLACEMENT_GRAPHIC_URL == pEntry->nWID || FN_UNO_REPLACEMENT_GRAPHIC == pEntry->nWID ) { - bool bURL = FN_UNO_REPLACEMENT_GRAPHIC_URL == pCur->nWID; + bool bURL = FN_UNO_REPLACEMENT_GRAPHIC_URL == pEntry->nWID; bool bApply = false; Graphic aGraphic; if( bURL ) @@ -1269,7 +1247,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a if ( bApply ) { - const SwFmtCntnt* pCnt = &pFmt->GetCntnt(); + const :: SwFmtCntnt* pCnt = &pFmt->GetCntnt(); if ( pCnt->GetCntntIdx() && pDoc->GetNodes()[ pCnt->GetCntntIdx()->GetIndex() + 1 ] ) { SwOLENode* pOleNode = pDoc->GetNodes()[ pCnt->GetCntntIdx()->GetIndex() + 1 ]->GetOLENode(); @@ -1324,7 +1302,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a } } } - else if(FN_UNO_Z_ORDER == pCur->nWID) + else if(FN_UNO_Z_ORDER == pEntry->nWID) { sal_Int32 nZOrder = - 1; aValue >>= nZOrder; @@ -1337,7 +1315,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SetObjectOrdNum(pObject->GetOrdNum(), nZOrder); } } - else if(RES_ANCHOR == pCur->nWID && MID_ANCHOR_ANCHORFRAME == pCur->nMemberId) + else if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORFRAME == pEntry->nMemberId) { sal_Bool bDone = sal_False; uno::Reference<text::XTextFrame> xFrame; @@ -1352,7 +1330,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SfxItemSet aSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); aSet.SetParent(&pFmt->GetAttrSet()); - SwFmtAnchor aAnchor = (const SwFmtAnchor&)aSet.Get(pCur->nWID); + SwFmtAnchor aAnchor = (const :: SwFmtAnchor&)aSet.Get(pEntry->nWID); SwPosition aPos(*pFrame->GetFrmFmt()->GetCntnt().GetCntntIdx()); @@ -1374,13 +1352,13 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a 0L); aSet.SetParent(&pFmt->GetAttrSet()); - aPropSet.setPropertyValue(*pCur, aValue, aSet); - if(RES_ANCHOR == pCur->nWID && MID_ANCHOR_ANCHORTYPE == pCur->nMemberId) + m_pPropSet->setPropertyValue(*pEntry, aValue, aSet); + if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId) { - SwFmtAnchor aAnchor = (const SwFmtAnchor&)aSet.Get(pCur->nWID); + SwFmtAnchor aAnchor = (const :: SwFmtAnchor&)aSet.Get(pEntry->nWID); if(aAnchor.GetAnchorId() == FLY_AT_FLY) { - const SwPosition* pPosition = aAnchor.GetCntntAnchor(); + const :: SwPosition* pPosition = aAnchor.GetCntntAnchor(); SwFrmFmt* pFlyFmt = pPosition ? pPosition->nNode.GetNode().GetFlyFmt() : 0; if(!pFlyFmt || pFlyFmt->Which() == RES_DRAWFRMFMT) { @@ -1416,7 +1394,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a pFly = ((SwFlyFrmFmt*)pFmt)->GetFrm(); if (pFly) { - const SfxPoolItem* pItem; + const :: SfxPoolItem* pItem; if( SFX_ITEM_SET == aSet.GetItemState( RES_ANCHOR, sal_False, &pItem )) { aSet.Put( *pItem ); @@ -1428,7 +1406,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a pFmt->GetDoc()->SetFlyFrmAttr( *pFmt, aSet ); } - else if(FN_UNO_CLSID == pCur->nWID || FN_UNO_STREAM_NAME == pCur->nWID) + else if(FN_UNO_CLSID == pEntry->nWID || FN_UNO_STREAM_NAME == pEntry->nWID) { throw lang::IllegalArgumentException(); } @@ -1438,8 +1416,8 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a } else if(IsDescriptor()) { - pProps->SetProperty(pCur->nWID, pCur->nMemberId, aValue); - if( FN_UNO_FRAME_STYLE_NAME == pCur->nWID ) + pProps->SetProperty(pEntry->nWID, pEntry->nMemberId, aValue); + if( FN_UNO_FRAME_STYLE_NAME == pEntry->nWID ) { OUString sStyleName; aValue >>= sStyleName; @@ -1451,7 +1429,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a catch ( container::NoSuchElementException const & ) { } - catch ( lang::WrappedTargetException const & ) + catch ( lang::WrappedTargetException const & ) { } catch ( uno::RuntimeException const & ) @@ -1471,11 +1449,11 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) vos::OGuard aGuard(Application::GetSolarMutex()); uno::Any aAny; SwFrmFmt* pFmt = GetFrmFmt(); - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); - if (!pCur) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if(FN_UNO_ANCHOR_TYPES == pCur->nWID) + if(FN_UNO_ANCHOR_TYPES == pEntry->nWID) { uno::Sequence<text::TextContentAnchorType> aTypes(5); text::TextContentAnchorType* pArray = aTypes.getArray(); @@ -1489,19 +1467,19 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else if(pFmt) { if( ((eType == FLYCNTTYPE_GRF) || (eType == FLYCNTTYPE_OLE)) && - pCur && - ((pCur->nWID >= RES_GRFATR_BEGIN && - pCur->nWID < RES_GRFATR_END )|| - pCur->nWID == FN_PARAM_COUNTOUR_PP || - pCur->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR || - pCur->nWID == FN_UNO_IS_PIXEL_CONTOUR )) + pEntry && + ((pEntry->nWID >= RES_GRFATR_BEGIN && + pEntry->nWID < RES_GRFATR_END )|| + pEntry->nWID == FN_PARAM_COUNTOUR_PP || + pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR || + pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR )) { const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) { SwNodeIndex aIdx(*pIdx, 1); SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); - if(pCur->nWID == FN_PARAM_COUNTOUR_PP) + if(pEntry->nWID == FN_PARAM_COUNTOUR_PP) { PolyPolygon aContour; if( pNoTxt->GetContourAPI( aContour ) ) @@ -1523,12 +1501,12 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) aAny <<= aPtSeq; } } - else if(pCur->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR ) + else if(pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR ) { BOOL bValue = pNoTxt->HasAutomaticContour(); aAny.setValue( &bValue, ::getBooleanCppuType() ); } - else if(pCur->nWID == FN_UNO_IS_PIXEL_CONTOUR ) + else if(pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR ) { BOOL bValue = pNoTxt->IsPixelContour(); aAny.setValue( &bValue, ::getBooleanCppuType() ); @@ -1536,11 +1514,11 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else { SfxItemSet aSet(pNoTxt->GetSwAttrSet()); - aAny = aPropSet.getPropertyValue(*pCur, aSet); + m_pPropSet->getPropertyValue(*pEntry, aSet, aAny); } } } - else if( FN_UNO_GRAPHIC_U_R_L == pCur->nWID) + else if( FN_UNO_GRAPHIC_U_R_L == pEntry->nWID) { String sGrfName; const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); @@ -1565,13 +1543,13 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) } aAny <<= OUString(sGrfName); } - else if( FN_UNO_GRAPHIC_FILTER == pCur->nWID ) + else if( FN_UNO_GRAPHIC_FILTER == pEntry->nWID ) { String sFltName; pFmt->GetDoc()->GetGrfNms( *(SwFlyFrmFmt*)pFmt, 0, &sFltName ); aAny <<= OUString(sFltName); } - else if( FN_UNO_GRAPHIC == pCur->nWID ) + else if( FN_UNO_GRAPHIC == pEntry->nWID ) { const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) @@ -1583,12 +1561,12 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) aAny <<= pGrfNode->GetGrf().GetXGraphic(); } } - else if(FN_UNO_FRAME_STYLE_NAME == pCur->nWID) + else if(FN_UNO_FRAME_STYLE_NAME == pEntry->nWID) { aAny <<= OUString(SwStyleNameMapper::GetProgName(pFmt->DerivedFrom()->GetName(), nsSwGetPoolIdFromName::GET_POOLID_FRMFMT ) ); } else if(eType != FLYCNTTYPE_FRM && - FN_UNO_ALTERNATIVE_TEXT == pCur->nWID) + FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID) { const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) @@ -1613,11 +1591,11 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) aAny.setValue(&aTmp, ::getCppuType(static_cast<const awt::Size*>(0))); } } - else if(FN_PARAM_LINK_DISPLAY_NAME == pCur->nWID) + else if(FN_PARAM_LINK_DISPLAY_NAME == pEntry->nWID) { aAny <<= OUString(pFmt->GetName()); } - else if(FN_UNO_Z_ORDER == pCur->nWID) + else if(FN_UNO_Z_ORDER == pEntry->nWID) { const SdrObject* pObj = pFmt->FindRealSdrObject(); if( pObj ) @@ -1625,8 +1603,8 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) aAny <<= (sal_Int32)pObj->GetOrdNum(); } } - else if(FN_UNO_CLSID == pCur->nWID || FN_UNO_MODEL == pCur->nWID|| - FN_UNO_COMPONENT == pCur->nWID ||FN_UNO_STREAM_NAME == pCur->nWID) + else if(FN_UNO_CLSID == pEntry->nWID || FN_UNO_MODEL == pEntry->nWID|| + FN_UNO_COMPONENT == pEntry->nWID ||FN_UNO_STREAM_NAME == pEntry->nWID) { SwDoc* pDoc = pFmt->GetDoc(); const SwFmtCntnt* pCnt = &pFmt->GetCntnt(); @@ -1641,7 +1619,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) { SvGlobalName aClassName( xIP->getClassID() ); aHexCLSID = aClassName.GetHexName(); - if(FN_UNO_CLSID != pCur->nWID) + if(FN_UNO_CLSID != pEntry->nWID) { if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) { @@ -1649,20 +1627,20 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) uno::Reference < frame::XModel > xModel( xComp, uno::UNO_QUERY ); if ( xModel.is() ) aAny <<= xModel; - else if ( FN_UNO_COMPONENT == pCur->nWID ) + else if ( FN_UNO_COMPONENT == pEntry->nWID ) aAny <<= xComp; } } } - if(FN_UNO_CLSID == pCur->nWID) + if(FN_UNO_CLSID == pEntry->nWID) aAny <<= aHexCLSID; - else if(FN_UNO_STREAM_NAME == pCur->nWID) + else if(FN_UNO_STREAM_NAME == pEntry->nWID) { aAny <<= ::rtl::OUString(pOleNode->GetOLEObj().GetCurrentPersistName()); } } - else if(WID_LAYOUT_SIZE == pCur->nWID) + else if(WID_LAYOUT_SIZE == pEntry->nWID) { // format document completely in order to get correct value pFmt->GetDoc()->GetEditShell()->CalcLayout(); @@ -1683,18 +1661,18 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else { const SwAttrSet& rSet = pFmt->GetAttrSet(); - aAny = aPropSet.getPropertyValue(*pCur, rSet); + m_pPropSet->getPropertyValue(*pEntry, rSet, aAny); } } else if(IsDescriptor()) { - if ( ! mpDoc ) + if ( ! m_pDoc ) throw uno::RuntimeException(); - if(WID_LAYOUT_SIZE != pCur->nWID) // there is no LayoutSize in a descriptor + if(WID_LAYOUT_SIZE != pEntry->nWID) // there is no LayoutSize in a descriptor { - uno::Any* pAny = 0; - if( !pProps->GetProperty( pCur->nWID, pCur->nMemberId, pAny ) ) - pProps->GetProperty( rPropertyName, mxStyleData, aAny ); + const uno::Any* pAny = 0; + if( !pProps->GetProperty( pEntry->nWID, pEntry->nMemberId, pAny ) ) + aAny = mxStyleData->getPropertyValue( rPropertyName ); else if ( pAny ) aAny = *pAny; } @@ -1769,24 +1747,24 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates( const SwAttrSet& rFmtSet = pFmt->GetAttrSet(); for(int i = 0; i < aPropertyNames.getLength(); i++) { - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName(_pMap, pNames[i]); - if (!pCur) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(pNames[i]); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( this ) ); - if(pCur->nWID == FN_UNO_ANCHOR_TYPES|| - pCur->nWID == FN_PARAM_LINK_DISPLAY_NAME|| - FN_UNO_FRAME_STYLE_NAME == pCur->nWID|| - FN_UNO_GRAPHIC_U_R_L == pCur->nWID|| - FN_UNO_GRAPHIC_FILTER == pCur->nWID|| - FN_UNO_ACTUAL_SIZE == pCur->nWID|| - FN_UNO_ALTERNATIVE_TEXT == pCur->nWID) + if(pEntry->nWID == FN_UNO_ANCHOR_TYPES|| + pEntry->nWID == FN_PARAM_LINK_DISPLAY_NAME|| + FN_UNO_FRAME_STYLE_NAME == pEntry->nWID|| + FN_UNO_GRAPHIC_U_R_L == pEntry->nWID|| + FN_UNO_GRAPHIC_FILTER == pEntry->nWID|| + FN_UNO_ACTUAL_SIZE == pEntry->nWID|| + FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID) pStates[i] = beans::PropertyState_DIRECT_VALUE; else { if(eType == FLYCNTTYPE_GRF && - pCur && - (pCur->nWID >= RES_GRFATR_BEGIN && - pCur->nWID <= RES_GRFATR_END)) + pEntry && + (pEntry->nWID >= RES_GRFATR_BEGIN && + pEntry->nWID <= RES_GRFATR_END)) { const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) @@ -1794,14 +1772,14 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates( SwNodeIndex aIdx(*pIdx, 1); SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); SfxItemSet aSet(pNoTxt->GetSwAttrSet()); - aSet.GetItemState(pCur->nWID); - if(SFX_ITEM_SET == aSet.GetItemState( pCur->nWID, FALSE )) + aSet.GetItemState(pEntry->nWID); + if(SFX_ITEM_SET == aSet.GetItemState( pEntry->nWID, FALSE )) pStates[i] = beans::PropertyState_DIRECT_VALUE; } } else { - if(SFX_ITEM_SET == rFmtSet.GetItemState( pCur->nWID, FALSE )) + if(SFX_ITEM_SET == rFmtSet.GetItemState( pEntry->nWID, FALSE )) pStates[i] = beans::PropertyState_DIRECT_VALUE; else pStates[i] = beans::PropertyState_DEFAULT_VALUE; @@ -1828,20 +1806,20 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) SwFrmFmt* pFmt = GetFrmFmt(); if(pFmt) { - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); - if (!pCur) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pCur->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); BOOL bNextFrame; - if( pCur->nWID && - pCur->nWID != FN_UNO_ANCHOR_TYPES && - pCur->nWID != FN_PARAM_LINK_DISPLAY_NAME) + if( pEntry->nWID && + pEntry->nWID != FN_UNO_ANCHOR_TYPES && + pEntry->nWID != FN_PARAM_LINK_DISPLAY_NAME) { if( eType == FLYCNTTYPE_GRF && - (pCur->nWID >= RES_GRFATR_BEGIN && - pCur->nWID < RES_GRFATR_END)) + (pEntry->nWID >= RES_GRFATR_BEGIN && + pEntry->nWID < RES_GRFATR_END)) { const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) @@ -1850,12 +1828,12 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); { SfxItemSet aSet(pNoTxt->GetSwAttrSet()); - aSet.ClearItem(pCur->nWID); + aSet.ClearItem(pEntry->nWID); pNoTxt->SetAttr(aSet); } } } - else if( eType != FLYCNTTYPE_FRM && FN_UNO_ALTERNATIVE_TEXT == pCur->nWID ) + else if( eType != FLYCNTTYPE_FRM && FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID ) { const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(pIdx) @@ -1871,7 +1849,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) SfxItemSet aSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); aSet.SetParent(&pFmt->GetAttrSet()); - aSet.ClearItem(pCur->nWID); + aSet.ClearItem(pEntry->nWID); if(!rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_ANCHOR_TYPE))) pFmt->SetFmtAttr(aSet); } @@ -1906,14 +1884,14 @@ uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName ) SwFrmFmt* pFmt = GetFrmFmt(); if(pFmt) { - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); - if(pCur) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if(pEntry) { - if ( pCur->nWID < RES_FRMATR_END ) + if ( pEntry->nWID < RES_FRMATR_END ) { const SfxPoolItem& rDefItem = - pFmt->GetDoc()->GetAttrPool().GetDefaultItem(pCur->nWID); - rDefItem.QueryValue(aRet, pCur->nMemberId); + pFmt->GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(aRet, pEntry->nMemberId); } } else @@ -1950,7 +1928,7 @@ void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) { mxStyleData.clear(); mxStyleFamily.clear(); - mpDoc = 0; + m_pDoc = 0; aLstnrCntnr.Disposing(); } } @@ -2098,7 +2076,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } } - uno::Any* pStyle; + const ::uno::Any* pStyle; SwFrmFmt *pParentFrmFmt = 0; if(pProps->GetProperty(FN_UNO_FRAME_STYLE_NAME, 0, pStyle)) pParentFrmFmt = lcl_GetFrmFmt( *pStyle, pDoc ); @@ -2142,12 +2120,12 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan pDoc->SetFlyName((SwFlyFrmFmt&)*pFmt, sName); } //den SwXText wecken - ((SwXTextFrame*)this)->SetDoc( bIsDescriptor ? mpDoc : GetFrmFmt()->GetDoc() ); + ((SwXTextFrame*)this)->SetDoc( bIsDescriptor ? m_pDoc : GetFrmFmt()->GetDoc() ); } else if( eType == FLYCNTTYPE_GRF) { UnoActionContext aCont(pDoc); - uno::Any* pGraphicURL; + const ::uno::Any* pGraphicURL; String sGraphicURL; GraphicObject *pGrfObj = 0; if(pProps->GetProperty(FN_UNO_GRAPHIC_U_R_L, 0, pGraphicURL)) @@ -2173,7 +2151,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } } Graphic aGraphic; - uno::Any* pGraphic; + const ::uno::Any* pGraphic; if( pProps->GetProperty( FN_UNO_GRAPHIC, 0, pGraphic )) { uno::Reference< graphic::XGraphic > xGraphic; @@ -2182,7 +2160,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } String sFltName; - uno::Any* pFilter; + const ::uno::Any* pFilter; if(pProps->GetProperty(FN_UNO_GRAPHIC_FILTER, 0, pFilter)) { OUString uTemp; @@ -2206,29 +2184,29 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan pDoc->SetFlyName((SwFlyFrmFmt&)*pFmt, sName); } - uno::Any* pSurroundContour; + const ::uno::Any* pSurroundContour; if(pProps->GetProperty(RES_SURROUND, MID_SURROUND_CONTOUR, pSurroundContour)) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SURROUND_CONTOUR)), *pSurroundContour); - uno::Any* pContourOutside; + const ::uno::Any* pContourOutside; if(pProps->GetProperty(RES_SURROUND, MID_SURROUND_CONTOUROUTSIDE, pContourOutside)) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_CONTOUR_OUTSIDE)), *pContourOutside); - uno::Any* pContourPoly; + const ::uno::Any* pContourPoly; if(pProps->GetProperty(FN_PARAM_COUNTOUR_PP, 0, pContourPoly)) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_CONTOUR_POLY_POLYGON)), *pContourPoly); - uno::Any* pPixelContour; + const ::uno::Any* pPixelContour; if(pProps->GetProperty(FN_UNO_IS_PIXEL_CONTOUR, 0, pPixelContour)) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_IS_PIXEL_CONTOUR)), *pPixelContour); - uno::Any* pAutoContour; + const ::uno::Any* pAutoContour; if(pProps->GetProperty(FN_UNO_IS_AUTOMATIC_CONTOUR, 0, pAutoContour)) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_IS_AUTOMATIC_CONTOUR)), *pAutoContour); - uno::Any* pAltText; + const ::uno::Any* pAltText; if(pProps->GetProperty(FN_UNO_ALTERNATIVE_TEXT, 0, pAltText)) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ALTERNATIVE_TEXT)), *pAltText); } else { - uno::Any* pCLSID = 0; - uno::Any* pStreamName = 0; + const ::uno::Any* pCLSID = 0; + const ::uno::Any* pStreamName = 0; if(!pProps->GetProperty(FN_UNO_CLSID, 0, pCLSID) && !pProps->GetProperty( FN_UNO_STREAM_NAME, 0, pStreamName )) throw uno::RuntimeException(); if(pCLSID) @@ -2326,10 +2304,10 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } if( pFmt && pDoc->GetDrawModel() ) GetOrCreateSdrObject( pFmt ); - uno::Any* pOrder; + const ::uno::Any* pOrder; if( pProps->GetProperty(FN_UNO_Z_ORDER, 0, pOrder) ) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_Z_ORDER)), *pOrder); - uno::Any* pReplacement; + const ::uno::Any* pReplacement; if( pProps->GetProperty(FN_UNO_REPLACEMENT_GRAPHIC, 0, pReplacement) ) setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_GRAPHIC)), *pReplacement); } @@ -2400,7 +2378,7 @@ void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeE -----------------------------------------------------------------------*/ awt::Size SwXFrame::getSize(void) throw( uno::RuntimeException ) { - uno::Any aVal = getPropertyValue(C2U("Size")); + const ::uno::Any aVal = getPropertyValue(C2U("Size")); awt::Size* pRet = (awt::Size*)aVal.getValue(); return *pRet; } @@ -2410,7 +2388,7 @@ awt::Size SwXFrame::getSize(void) throw( uno::RuntimeException ) void SwXFrame::setSize(const awt::Size& aSize) throw( beans::PropertyVetoException, uno::RuntimeException ) { - uno::Any aVal(&aSize, ::getCppuType(static_cast<const awt::Size*>(0))); + const ::uno::Any aVal(&aSize, ::getCppuType(static_cast<const awt::Size*>(0))); setPropertyValue(C2U("Size"), aVal); } /*-- 22.04.99 08:03:21--------------------------------------------------- @@ -2430,7 +2408,7 @@ OUString SwXFrame::getShapeType(void) throw( uno::RuntimeException ) -----------------------------------------------------------------------*/ SwXTextFrame::SwXTextFrame( SwDoc *_pDoc ) : SwXText(0, CURSOR_FRAME), - SwXFrame(FLYCNTTYPE_FRM, aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME), _pDoc ) + SwXFrame(FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME), _pDoc ) { } /*-- 11.12.98 15:23:01--------------------------------------------------- @@ -2438,7 +2416,7 @@ SwXTextFrame::SwXTextFrame( SwDoc *_pDoc ) : -----------------------------------------------------------------------*/ SwXTextFrame::SwXTextFrame(SwFrmFmt& rFmt) : SwXText(rFmt.GetDoc(), CURSOR_FRAME), - SwXFrame(rFmt, FLYCNTTYPE_FRM, aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME)) + SwXFrame(rFmt, FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME)) { } @@ -2465,10 +2443,10 @@ void SAL_CALL SwXTextFrame::release( )throw() /* -----------------------------15.03.00 16:30-------------------------------- ---------------------------------------------------------------------------*/ -uno::Any SAL_CALL SwXTextFrame::queryInterface( const uno::Type& aType ) +::uno::Any SAL_CALL SwXTextFrame::queryInterface( const uno::Type& aType ) throw (uno::RuntimeException) { - uno::Any aRet = SwXFrame::queryInterface(aType); + ::uno::Any aRet = SwXFrame::queryInterface(aType); if(aRet.getValueType() == ::getCppuVoidType()) aRet = SwXText::queryInterface(aType); if(aRet.getValueType() == ::getCppuVoidType()) @@ -2757,11 +2735,11 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& /* -----------------------------19.03.2002 16:43------------------------------ ---------------------------------------------------------------------------*/ -uno::Any SwXTextFrame::getPropertyValue(const OUString& rPropertyName) +::uno::Any SwXTextFrame::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Any aRet; + ::uno::Any aRet; if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_START_REDLINE))|| rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_END_REDLINE))) { @@ -2780,14 +2758,14 @@ uno::Any SwXTextFrame::getPropertyValue(const OUString& rPropertyName) -----------------------------------------------------------------------*/ SwXTextGraphicObject::SwXTextGraphicObject( SwDoc *pDoc ) : - SwXFrame(FLYCNTTYPE_GRF, aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC), pDoc) + SwXFrame(FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC), pDoc) { } /*-- 11.12.98 16:02:25--------------------------------------------------- -----------------------------------------------------------------------*/ SwXTextGraphicObject::SwXTextGraphicObject(SwFrmFmt& rFmt) : - SwXFrame(rFmt, FLYCNTTYPE_GRF, aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC)) + SwXFrame(rFmt, FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC)) { } @@ -2815,10 +2793,10 @@ void SAL_CALL SwXTextGraphicObject::release( )throw() /* -----------------------------15.03.00 16:30-------------------------------- ---------------------------------------------------------------------------*/ -uno::Any SAL_CALL SwXTextGraphicObject::queryInterface( const uno::Type& aType ) +::uno::Any SAL_CALL SwXTextGraphicObject::queryInterface( const uno::Type& aType ) throw(uno::RuntimeException) { - uno::Any aRet = SwXFrame::queryInterface(aType); + ::uno::Any aRet = SwXFrame::queryInterface(aType); if(aRet.getValueType() == ::getCppuVoidType()) aRet = SwXTextGraphicObjectBaseClass::queryInterface(aType); return aRet; @@ -2957,14 +2935,14 @@ uno::Reference<container::XNameReplace> SAL_CALL -----------------------------------------------------------------------*/ SwXTextEmbeddedObject::SwXTextEmbeddedObject( SwDoc *pDoc ) : - SwXFrame(FLYCNTTYPE_OLE, aSwMapProvider.GetPropertyMap(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc) + SwXFrame(FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc) { } /*-- 11.12.98 16:16:53--------------------------------------------------- -----------------------------------------------------------------------*/ SwXTextEmbeddedObject::SwXTextEmbeddedObject(SwFrmFmt& rFmt) : - SwXFrame(rFmt, FLYCNTTYPE_OLE, aSwMapProvider.GetPropertyMap(PROPERTY_MAP_EMBEDDED_OBJECT)) + SwXFrame(rFmt, FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT)) { } @@ -2995,10 +2973,10 @@ void SAL_CALL SwXTextEmbeddedObject::release()throw() /* -----------------------------15.03.00 16:32-------------------------------- ---------------------------------------------------------------------------*/ -uno::Any SAL_CALL SwXTextEmbeddedObject::queryInterface( const uno::Type& aType ) +::uno::Any SAL_CALL SwXTextEmbeddedObject::queryInterface( const uno::Type& aType ) throw( uno::RuntimeException) { - uno::Any aRet = SwXFrame::queryInterface(aType);; + ::uno::Any aRet = SwXFrame::queryInterface(aType);; if(aRet.getValueType() == ::getCppuVoidType()) aRet = SwXTextEmbeddedObjectBaseClass::queryInterface(aType); return aRet; diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index c624efbc80..11b004dd36 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -490,8 +490,7 @@ void SwXFootnote::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) uno::Reference< beans::XPropertySetInfo > SwXFootnote::getPropertySetInfo( ) throw(uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xRef = - new SfxItemPropertySetInfo(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_FOOTNOTE)); + static uno::Reference< beans::XPropertySetInfo > xRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_FOOTNOTE)->getPropertySetInfo(); return xRef; } /*-- 11.09.00 13:12:04--------------------------------------------------- diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index d1d12268a2..e2d0612eaa 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -100,19 +100,6 @@ sal_Bool lcl_AnyToBool(uno::Any rVal) throw(lang::IllegalArgumentException) /****************************************************************************** * ******************************************************************************/ -SwTOXMark* lcl_GetMark(SwTOXType* pType, const SwTOXMark* pOwnMark) -{ - SwClientIter aIter(*pType); - SwTOXMark* pMark = (SwTOXMark*)aIter.First(TYPE(SwTOXMark)); - while( pMark ) - { - if(pMark == pOwnMark) - return pMark; - else - pMark = (SwTOXMark*)aIter.Next(); - } - return 0; -} //----------------------------------------------------------------------------- void lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName) { @@ -271,7 +258,7 @@ uno::Sequence< OUString > SwXDocumentIndex::getSupportedServiceNames(void) throw TYPEINIT1(SwXDocumentIndex, SwClient) SwXDocumentIndex::SwXDocumentIndex(const SwTOXBaseSection* pB, SwDoc* pDc) : aLstnrCntnr( (text::XTextContent*)this), - _pMap(0), + m_pPropSet(0), m_pDoc(pDc), pBase(pB), eTOXType(TOX_USER), @@ -297,7 +284,7 @@ SwXDocumentIndex::SwXDocumentIndex(const SwTOXBaseSection* pB, SwDoc* pDc) : default: PropertyId = PROPERTY_MAP_INDEX_USER; } - _pMap = aSwMapProvider.GetPropertyMap(PropertyId); + m_pPropSet = aSwMapProvider.GetPropertySet(PropertyId); } } /* -----------------15.01.99 14:59------------------- @@ -326,7 +313,7 @@ SwXDocumentIndex::SwXDocumentIndex(TOXTypes eType, SwDoc& rDoc) : default: PropertyId = PROPERTY_MAP_INDEX_USER; } - _pMap = aSwMapProvider.GetPropertyMap(PropertyId); + m_pPropSet = aSwMapProvider.GetPropertySet(PropertyId); } /*-- 14.12.98 09:35:04--------------------------------------------------- @@ -375,7 +362,7 @@ void SwXDocumentIndex::update(void) throw( uno::RuntimeException ) -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXDocumentIndex::getPropertySetInfo(void) throw( uno::RuntimeException ) { - uno::Reference< beans::XPropertySetInfo > aRef = new SfxItemPropertySetInfo( _pMap ); + uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); return aRef; } /*-- 14.12.98 09:35:05--------------------------------------------------- @@ -387,11 +374,10 @@ void SwXDocumentIndex::setPropertyValue(const OUString& rPropertyName, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SwTOXBase* pTOXBase = 0; @@ -410,7 +396,7 @@ void SwXDocumentIndex::setPropertyValue(const OUString& rPropertyName, SwForm aForm(pTOXBase->GetTOXForm()); sal_Bool bForm = sal_False; SfxItemSet* pAttrSet = 0; - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_IDX_TITLE : { @@ -628,17 +614,16 @@ void SwXDocumentIndex::setPropertyValue(const OUString& rPropertyName, sal_uInt16 nLPos = pTOXBase->GetType() == TOX_INDEX ? 2 : 1; String aString; SwStyleNameMapper::FillUIName( lcl_AnyToString(aValue), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); - aForm.SetTemplate(nLPos + pMap->nWID - WID_PARA_LEV1, aString ); + aForm.SetTemplate(nLPos + pEntry->nWID - WID_PARA_LEV1, aString ); } break; default: //this is for items only - if(WID_PRIMARY_KEY > pMap->nWID) + if(WID_PRIMARY_KEY > pEntry->nWID) { - SfxItemPropertySet aPropSet(_pMap); const SwAttrSet& rSet = m_pDoc->GetTOXBaseAttrSet(*pTOXBase); pAttrSet = new SfxItemSet(rSet); - aPropSet.setPropertyValue(*pMap, aValue, *pAttrSet); + m_pPropSet->setPropertyValue(rPropertyName, aValue, *pAttrSet); const SwSectionFmts& rSects = m_pDoc->GetSections(); const SwSectionFmt* pOwnFmt = GetFmt(); @@ -673,9 +658,8 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) { vos::OGuard aGuard(Application::GetSolarMutex()); uno::Any aRet; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SwTOXBase* pTOXBase = 0; if(GetFmt()) @@ -692,12 +676,12 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) const SwForm& rForm = pTOXBase->GetTOXForm(); sal_Bool bBOOL = sal_True; sal_Bool bRet = sal_False; - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_IDX_CONTENT_SECTION: case WID_IDX_HEADER_SECTION : bBOOL = sal_False; - if(WID_IDX_CONTENT_SECTION == pMap->nWID) + if(WID_IDX_CONTENT_SECTION == pEntry->nWID) { uno::Reference <text::XTextSection> xContentSect = SwXTextSections::GetObject( *GetFmt() ); aRet <<= xContentSect; @@ -921,7 +905,7 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) sal_uInt16 nLPos = pTOXBase->GetType() == TOX_INDEX ? 2 : 1; String aString; SwStyleNameMapper::FillProgName( - rForm.GetTemplate(nLPos + pMap->nWID - WID_PARA_LEV1), + rForm.GetTemplate(nLPos + pEntry->nWID - WID_PARA_LEV1), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); @@ -958,11 +942,10 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) default: //this is for items only bBOOL = sal_False; - if(WID_PRIMARY_KEY > pMap->nWID) + if(WID_PRIMARY_KEY > pEntry->nWID) { - SfxItemPropertySet aPropSet(_pMap); const SwAttrSet& rSet = m_pDoc->GetTOXBaseAttrSet(*pTOXBase); - aRet = aPropSet.getPropertyValue(*pMap, rSet); + aRet = m_pPropSet->getPropertyValue(rPropertyName, rSet); } } if(bBOOL) @@ -1344,7 +1327,7 @@ void SwXDocumentIndexMark::InitMap(TOXTypes eToxType) default: ; } - _pMap = aSwMapProvider.GetPropertyMap(nMapId); + m_pPropSet = aSwMapProvider.GetPropertySet(nMapId); } /*-- 14.12.98 10:25:45--------------------------------------------------- @@ -1354,11 +1337,9 @@ OUString SwXDocumentIndexMark::getMarkEntry(void) throw( uno::RuntimeException ) vos::OGuard aGuard(Application::GetSolarMutex()); SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); OUString sRet; - if(pType) + if(pType && m_pTOXMark) { - SwTOXMark* pCurMark = lcl_GetMark(pType, GetTOXMark()); - SwTOXMark aMark(*pCurMark); - sRet = OUString(aMark.GetAlternativeText()); + sRet = OUString(m_pTOXMark->GetAlternativeText()); } else if(bIsDescriptor) sRet = sAltText; @@ -1373,12 +1354,11 @@ void SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry) throw( uno: { vos::OGuard aGuard(Application::GetSolarMutex()); SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - if(pType) + if(pType && m_pTOXMark) { - SwTOXMark* pCurMark = lcl_GetMark(pType, GetTOXMark()); - SwTOXMark aMark(*pCurMark); + SwTOXMark aMark(*m_pTOXMark); aMark.SetAlternativeText(rIndexEntry); - SwTxtTOXMark* pTxtMark = pCurMark->GetTxtTOXMark(); + const SwTxtTOXMark* pTxtMark = m_pTOXMark->GetTxtTOXMark(); SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart()); aPam.SetMark(); if(pTxtMark->GetEnd()) @@ -1389,8 +1369,8 @@ void SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry) throw( uno: aPam.GetPoint()->nContent++; //die alte Marke loeschen - m_pDoc->Delete(pCurMark); - m_pTOXMark = pCurMark = 0; + m_pDoc->Delete(m_pTOXMark); + m_pTOXMark = 0; SwTxtAttr* pTxtAttr = 0; sal_Bool bInsAtPos = aMark.IsAlternativeText(); @@ -1560,12 +1540,11 @@ uno::Reference< text::XTextRange > SwXDocumentIndexMark::getAnchor(void) throw( vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< text::XTextRange > aRet; SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - if(pType) + if(pType && m_pTOXMark) { - SwTOXMark* pCurMark = lcl_GetMark(pType, GetTOXMark()); - if(pCurMark && pCurMark->GetTxtTOXMark()) + if( m_pTOXMark->GetTxtTOXMark() ) { - SwTxtTOXMark* pTxtMark = pCurMark->GetTxtTOXMark(); + const SwTxtTOXMark* pTxtMark = m_pTOXMark->GetTxtTOXMark(); SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart()); aPam.SetMark(); if(pTxtMark->GetEnd()) @@ -1590,10 +1569,9 @@ void SwXDocumentIndexMark::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - if(pType) + if(pType && m_pTOXMark) { - SwTOXMark* pTMark = lcl_GetMark(pType, GetTOXMark()); - m_pDoc->Delete(pTMark); + m_pDoc->Delete(m_pTOXMark); } else throw uno::RuntimeException(); @@ -1635,11 +1613,11 @@ uno::Reference< beans::XPropertySetInfo > SwXDocumentIndexMark::getPropertySetI } if(!xInfos[nPos].is()) { - uno::Reference< beans::XPropertySetInfo > xInfo = new SfxItemPropertySetInfo(_pMap); + uno::Reference< beans::XPropertySetInfo > xInfo = m_pPropSet->getPropertySetInfo(); // extend PropertySetInfo! const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties(); xInfos[nPos] = new SfxExtItemPropertySetInfo( - aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARAGRAPH_EXTENSIONS), + aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_PARAGRAPH_EXTENSIONS), aPropSeq ); } return xInfos[nPos]; @@ -1654,94 +1632,88 @@ void SwXDocumentIndexMark::setPropertyValue(const OUString& rPropertyName, { vos::OGuard aGuard(Application::GetSolarMutex()); SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if(pType) + if(pType && m_pTOXMark) { SwDoc* pLocalDoc = m_pDoc; - SwTOXMark* pCurMark = lcl_GetMark(pType, GetTOXMark()); - if(pCurMark) - { - SwTOXMark aMark(*pCurMark); - switch(pMap->nWID) - { - case WID_ALT_TEXT: - aMark.SetAlternativeText(lcl_AnyToString(aValue)); - break; - case WID_LEVEL: - aMark.SetLevel(Min( (sal_Int8) ( MAXLEVEL ), - (sal_Int8)(lcl_AnyToInt16(aValue)+1))); - break; - case WID_PRIMARY_KEY : - aMark.SetPrimaryKey(lcl_AnyToString(aValue)); - break; - case WID_SECONDARY_KEY: - aMark.SetSecondaryKey(lcl_AnyToString(aValue)); - break; - case WID_MAIN_ENTRY: - aMark.SetMainEntry(lcl_AnyToBool(aValue)); - break; - case WID_TEXT_READING: - aMark.SetTextReading(lcl_AnyToString(aValue)); - break; - case WID_PRIMARY_KEY_READING: - aMark.SetPrimaryKeyReading(lcl_AnyToString(aValue)); - break; - case WID_SECONDARY_KEY_READING: - aMark.SetSecondaryKeyReading(lcl_AnyToString(aValue)); - break; - } - SwTxtTOXMark* pTxtMark = pCurMark->GetTxtTOXMark(); - SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart()); - aPam.SetMark(); - if(pTxtMark->GetEnd()) - { - aPam.GetPoint()->nContent = *pTxtMark->GetEnd(); - } - else - aPam.GetPoint()->nContent++; + SwTOXMark aMark(*m_pTOXMark); + switch(pEntry->nWID) + { + case WID_ALT_TEXT: + aMark.SetAlternativeText(lcl_AnyToString(aValue)); + break; + case WID_LEVEL: + aMark.SetLevel(Min( (sal_Int8) ( MAXLEVEL ), + (sal_Int8)(lcl_AnyToInt16(aValue)+1))); + break; + case WID_PRIMARY_KEY : + aMark.SetPrimaryKey(lcl_AnyToString(aValue)); + break; + case WID_SECONDARY_KEY: + aMark.SetSecondaryKey(lcl_AnyToString(aValue)); + break; + case WID_MAIN_ENTRY: + aMark.SetMainEntry(lcl_AnyToBool(aValue)); + break; + case WID_TEXT_READING: + aMark.SetTextReading(lcl_AnyToString(aValue)); + break; + case WID_PRIMARY_KEY_READING: + aMark.SetPrimaryKeyReading(lcl_AnyToString(aValue)); + break; + case WID_SECONDARY_KEY_READING: + aMark.SetSecondaryKeyReading(lcl_AnyToString(aValue)); + break; + } + const SwTxtTOXMark* pTxtMark = m_pTOXMark->GetTxtTOXMark(); + SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart()); + aPam.SetMark(); + if(pTxtMark->GetEnd()) + { + aPam.GetPoint()->nContent = *pTxtMark->GetEnd(); + } + else + aPam.GetPoint()->nContent++; - //die alte Marke loeschen - pLocalDoc->Delete(pCurMark); - m_pTOXMark = pCurMark = 0; + //delete the old mark + pLocalDoc->Delete(m_pTOXMark); + m_pTOXMark = 0; - sal_Bool bInsAtPos = aMark.IsAlternativeText(); - const SwPosition *pStt = aPam.Start(), - *pEnd = aPam.End(); + sal_Bool bInsAtPos = aMark.IsAlternativeText(); + const SwPosition *pStt = aPam.Start(), + *pEnd = aPam.End(); - SwTxtAttr* pTxtAttr = 0; - if( bInsAtPos ) - { - SwPaM aTmp( *pStt ); - pLocalDoc->Insert( aTmp, aMark, 0 ); - pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttr( - pStt->nContent.GetIndex()-1, RES_TXTATR_TOXMARK ); - } - else if( *pEnd != *pStt ) - { - pLocalDoc->Insert( aPam, aMark, nsSetAttrMode::SETATTR_DONTEXPAND ); - pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttr( - pStt->nContent, RES_TXTATR_TOXMARK ); - } - m_pDoc = pLocalDoc; - //und sonst - Marke geloescht? + SwTxtAttr* pTxtAttr = 0; + if( bInsAtPos ) + { + SwPaM aTmp( *pStt ); + pLocalDoc->Insert( aTmp, aMark, 0 ); + pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttr( + pStt->nContent.GetIndex()-1, RES_TXTATR_TOXMARK ); + } + else if( *pEnd != *pStt ) + { + pLocalDoc->Insert( aPam, aMark, nsSetAttrMode::SETATTR_DONTEXPAND ); + pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttr( + pStt->nContent, RES_TXTATR_TOXMARK ); + } + m_pDoc = pLocalDoc; - if(pTxtAttr) - { - m_pTOXMark = &pTxtAttr->GetTOXMark(); - m_pDoc->GetUnoCallBack()->Add(this); - pType->Add(&aTypeDepend); - } + if(pTxtAttr) + { + m_pTOXMark = &pTxtAttr->GetTOXMark(); + m_pDoc->GetUnoCallBack()->Add(this); + pType->Add(&aTypeDepend); } } else if(bIsDescriptor) { - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_ALT_TEXT: sAltText = lcl_AnyToString(aValue); @@ -1794,60 +1766,54 @@ uno::Any SwXDocumentIndexMark::getPropertyValue(const OUString& rPropertyName) vos::OGuard aGuard(Application::GetSolarMutex()); uno::Any aRet; SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if(SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName, pMap->nWID)) + if(SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName, pEntry->nWID)) return aRet; - if(pType) + if(pType && m_pTOXMark) { - SwTOXMark* pCurMark = lcl_GetMark(pType, GetTOXMark()); - if(pCurMark) + switch(pEntry->nWID) { - switch(pMap->nWID) + case WID_ALT_TEXT: + aRet <<= OUString(m_pTOXMark->GetAlternativeText()); + break; + case WID_LEVEL: + aRet <<= (sal_Int16)(m_pTOXMark->GetLevel() - 1); + break; + case WID_PRIMARY_KEY : + aRet <<= OUString(m_pTOXMark->GetPrimaryKey()); + break; + case WID_SECONDARY_KEY: + aRet <<= OUString(m_pTOXMark->GetSecondaryKey()); + break; + case WID_TEXT_READING: + aRet <<= OUString(m_pTOXMark->GetTextReading()); + break; + case WID_PRIMARY_KEY_READING: + aRet <<= OUString(m_pTOXMark->GetPrimaryKeyReading()); + break; + case WID_SECONDARY_KEY_READING: + aRet <<= OUString(m_pTOXMark->GetSecondaryKeyReading()); + break; + case WID_USER_IDX_NAME : { - case WID_ALT_TEXT: - aRet <<= OUString(pCurMark->GetAlternativeText()); - break; - case WID_LEVEL: - aRet <<= (sal_Int16)(pCurMark->GetLevel() - 1); - break; - case WID_PRIMARY_KEY : - aRet <<= OUString(pCurMark->GetPrimaryKey()); - break; - case WID_SECONDARY_KEY: - aRet <<= OUString(pCurMark->GetSecondaryKey()); - break; - case WID_TEXT_READING: - aRet <<= OUString(pCurMark->GetTextReading()); - break; - case WID_PRIMARY_KEY_READING: - aRet <<= OUString(pCurMark->GetPrimaryKeyReading()); - break; - case WID_SECONDARY_KEY_READING: - aRet <<= OUString(pCurMark->GetSecondaryKeyReading()); - break; - case WID_USER_IDX_NAME : - { - OUString sTmp(pType->GetTypeName()); - lcl_ConvertTOUNameToProgrammaticName(sTmp); - aRet <<= sTmp; - } - break; - case WID_MAIN_ENTRY: - { - sal_Bool bTemp = pCurMark->IsMainEntry(); - aRet.setValue(&bTemp, ::getBooleanCppuType()); - } - break; + OUString sTmp(pType->GetTypeName()); + lcl_ConvertTOUNameToProgrammaticName(sTmp); + aRet <<= sTmp; } + break; + case WID_MAIN_ENTRY: + { + sal_Bool bTemp = m_pTOXMark->IsMainEntry(); + aRet.setValue(&bTemp, ::getBooleanCppuType()); + } + break; } } else if(bIsDescriptor) { - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_ALT_TEXT: aRet <<= OUString(sAltText); @@ -1923,7 +1889,7 @@ SwXDocumentIndexMark* SwXDocumentIndexMark::GetObject(SwTOXType* pType, aIter.First(TYPE(SwXDocumentIndexMark)); while( pxMark ) { - if(pxMark->GetTOXMark() == pMark) + if(pxMark->m_pTOXMark == pMark) return pxMark; pxMark = (SwXDocumentIndexMark*)aIter.Next(); } diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 53a5a3acc9..7088f7e5b2 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -83,11 +83,9 @@ SwUnoPropertyMapProvider::SwUnoPropertyMapProvider() { for( sal_uInt16 i = 0; i < PROPERTY_MAP_END; i++ ) { - aMapArr[i] = 0; + aMapEntriesArr[i] = 0; + aPropertySetArr[i] = 0; } - pCharStyleMap = pParaStyleMap = pFrameStyleMap = - pPageStyleMap = pNumStyleMap = pConditionalParaStyleMap = - pCharAutoStyleMap = pRubyAutoStyleMap = pParaAutoStyleMap = 0; } /* -----------------19.02.99 08:31------------------- @@ -95,117 +93,7 @@ SwUnoPropertyMapProvider::SwUnoPropertyMapProvider() * --------------------------------------------------*/ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { - delete pCharStyleMap; - delete pParaStyleMap; - delete pFrameStyleMap; - delete pPageStyleMap; - delete pNumStyleMap; - delete pConditionalParaStyleMap; - delete pCharAutoStyleMap; - delete pRubyAutoStyleMap; - delete pParaAutoStyleMap; } -/* -----------------19.02.99 08:31------------------- - * - * --------------------------------------------------*/ -SfxItemPropertySet& SwUnoPropertyMapProvider::GetPropertySet(sal_Int8 nPropSetId) -{ - SfxItemPropertySet** ppMap = 0; - sal_uInt16 nPropertyId = 0xFFFF; - switch(nPropSetId) - { - case PROPERTY_SET_CHAR_STYLE: - ppMap = &pCharStyleMap; - nPropertyId = PROPERTY_MAP_CHAR_STYLE; - break; - case PROPERTY_SET_PARA_STYLE: - ppMap = &pParaStyleMap; - nPropertyId = PROPERTY_MAP_PARA_STYLE; - break; - case PROPERTY_SET_FRAME_STYLE: - ppMap = &pFrameStyleMap; - nPropertyId = PROPERTY_MAP_FRAME_STYLE; - break; - case PROPERTY_SET_PAGE_STYLE: - ppMap = &pPageStyleMap; - nPropertyId = PROPERTY_MAP_PAGE_STYLE; - break; - case PROPERTY_SET_NUM_STYLE: - ppMap = &pNumStyleMap; - nPropertyId = PROPERTY_MAP_NUM_STYLE; - break; - case PROPERTY_SET_CONDITIONAL_PARA_STYLE: - ppMap = &pConditionalParaStyleMap; - nPropertyId = PROPERTY_MAP_CONDITIONAL_PARA_STYLE; - break; - case PROPERTY_SET_CHAR_AUTO_STYLE: - ppMap = &pCharAutoStyleMap; - nPropertyId = PROPERTY_MAP_CHAR_AUTO_STYLE; - break; - case PROPERTY_SET_RUBY_AUTO_STYLE: - ppMap = &pRubyAutoStyleMap; - nPropertyId = PROPERTY_MAP_RUBY_AUTO_STYLE; - break; - case PROPERTY_SET_PARA_AUTO_STYLE: - ppMap = &pParaAutoStyleMap; - nPropertyId = PROPERTY_MAP_PARA_AUTO_STYLE; - break; - default: - DBG_ERROR( "unexpected property set id" ); - } - - SfxItemPropertySet* pRet; - if( ppMap ) - { - if( !*ppMap ) - *ppMap = new SwItemPropertySet( GetPropertyMap( nPropertyId )); - pRet = *ppMap; - } - else - pRet = 0; - return *pRet; -} -/* -----------------25.06.98 07:19------------------- - * - * --------------------------------------------------*/ -EXTERN_C -#if defined( PM2 ) && (!defined( CSET ) && !defined ( MTW ) && !defined( WTC )) -int _stdcall -#else -#ifdef WNT -int _cdecl -#else -int -#endif -#endif -lcl_CompareMap(const void* pSmaller, const void* pBigger ) -{ - int nDiff = strcmp( ((const SfxItemPropertyMap*)pSmaller)->pName, - ((const SfxItemPropertyMap*)pBigger)->pName ); - return nDiff; - -} -/* -----------------24.06.98 18:12------------------- - * - * --------------------------------------------------*/ -void SwUnoPropertyMapProvider::Sort( sal_uInt16 nId ) -{ - SfxItemPropertyMap* p = aMapArr[nId]; - sal_uInt16 i = 0; - for( ; p->pName; ++p, ++i ) - { - // set the name - const SwPropNameLen& rPropNm = GetPropName( (USHORT)(long)p->pName ); - p->pName = rPropNm.pName; - p->nNameLen = rPropNm.nNameLen; - // get the cppu type from the comphelper - CppuTypes nTyp = (CppuTypes) (long) p->pType; - GenerateCppuType( nTyp, p->pType ); - DBG_ASSERT( nTyp != (CppuTypes) (long) p->pType, "unknown type" ); - } - qsort( aMapArr[nId], i, sizeof(SfxItemPropertyMap), lcl_CompareMap ); -} - #define _STANDARD_FONT_PROPERTIES \ { SW_PROP_NMID(UNO_NAME_CHAR_HEIGHT), RES_CHRATR_FONTSIZE , CPPU_E2T(CPPUTYPE_FLOAT), PropertyAttribute::MAYBEVOID, MID_FONTHEIGHT|CONVERT_TWIPS}, \ @@ -607,26 +495,26 @@ void SwUnoPropertyMapProvider::Sort( sal_uInt16 nId ) { SW_PROP_NMID(UNO_NAME_IS_FIELD_DISPLAYED), FIELD_PROP_IS_FIELD_DISPLAYED, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::READONLY, 0},\ -const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nPropertyId) +const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(sal_uInt16 nPropertyId) { DBG_ASSERT(nPropertyId < PROPERTY_MAP_END, "Id ?" ); - if( !aMapArr[ nPropertyId ] ) + if( !aMapEntriesArr[ nPropertyId ] ) { switch(nPropertyId) { case PROPERTY_MAP_TEXT_CURSOR: { - static SfxItemPropertyMap aCharAndParaMap_Impl[] = + static SfxItemPropertyMapEntry aCharAndParaMap_Impl[] = { COMPLETE_TEXT_CURSOR_MAP {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aCharAndParaMap_Impl; + aMapEntriesArr[nPropertyId] = aCharAndParaMap_Impl; } break; case PROPERTY_MAP_PARAGRAPH: { - static SfxItemPropertyMap aParagraphMap_Impl[] = + static SfxItemPropertyMapEntry aParagraphMap_Impl[] = { COMMON_CRSR_PARA_PROPERTIES_2 TABSTOPS_MAP_ENTRY @@ -635,12 +523,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_CHAR_STYLE_NAMES), FN_UNO_CHARFMT_SEQUENCE, CPPU_E2T(CPPUTYPE_OUSTRINGS), PropertyAttribute::MAYBEVOID, 0},\ {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aParagraphMap_Impl; + aMapEntriesArr[nPropertyId] = aParagraphMap_Impl; } break; case PROPERTY_MAP_PARA_AUTO_STYLE : { - static SfxItemPropertyMap aAutoParaStyleMap [] = + static SfxItemPropertyMapEntry aAutoParaStyleMap [] = { { SW_PROP_NMID(UNO_NAME_PARA_STYLE_NAME), RES_FRMATR_STYLE_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0}, \ { SW_PROP_NMID(UNO_NAME_PAGE_STYLE_NAME), FN_UNO_PAGE_STYLE, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, \ @@ -662,12 +550,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_PARA_AUTO_STYLE_NAME), RES_AUTO_STYLE, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aAutoParaStyleMap; + aMapEntriesArr[nPropertyId] = aAutoParaStyleMap; } break; case PROPERTY_MAP_CHAR_STYLE : { - static SfxItemPropertyMap aCharStyleMap [] = + static SfxItemPropertyMapEntry aCharStyleMap [] = { { SW_PROP_NMID(UNO_NAME_CHAR_AUTO_KERNING), RES_CHRATR_AUTOKERN , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_CHAR_BACK_TRANSPARENT), RES_CHRATR_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT }, @@ -708,13 +596,13 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_CHAR_RELIEF), RES_CHRATR_RELIEF, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_RELIEF }, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aCharStyleMap; + aMapEntriesArr[nPropertyId] = aCharStyleMap; } break; case PROPERTY_MAP_CHAR_AUTO_STYLE : { // same as PROPERTY_MAP_TEXTPORTION_EXTENSIONS - static SfxItemPropertyMap aAutoCharStyleMap [] = + static SfxItemPropertyMapEntry aAutoCharStyleMap [] = { { SW_PROP_NMID(UNO_NAME_CHAR_AUTO_KERNING), RES_CHRATR_AUTOKERN , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_CHAR_BACK_TRANSPARENT), RES_CHRATR_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT }, @@ -756,44 +644,44 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_CHAR_AUTO_STYLE_NAME), RES_TXTATR_AUTOFMT, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aAutoCharStyleMap; + aMapEntriesArr[nPropertyId] = aAutoCharStyleMap; } break; case PROPERTY_MAP_RUBY_AUTO_STYLE : { - static SfxItemPropertyMap aAutoRubyStyleMap [] = + static SfxItemPropertyMapEntry aAutoRubyStyleMap [] = { { SW_PROP_NMID(UNO_NAME_RUBY_ADJUST), RES_TXTATR_CJK_RUBY, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, MID_RUBY_ADJUST }, { SW_PROP_NMID(UNO_NAME_RUBY_IS_ABOVE), RES_TXTATR_CJK_RUBY, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, MID_RUBY_ABOVE }, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aAutoRubyStyleMap; + aMapEntriesArr[nPropertyId] = aAutoRubyStyleMap; } break; case PROPERTY_MAP_PARA_STYLE : { - static SfxItemPropertyMap aParaStyleMap [] = + static SfxItemPropertyMapEntry aParaStyleMap [] = { COMMON_PARA_STYLE_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aParaStyleMap; + aMapEntriesArr[nPropertyId] = aParaStyleMap; } break; case PROPERTY_MAP_CONDITIONAL_PARA_STYLE : { - static SfxItemPropertyMap aParaStyleMap [] = + static SfxItemPropertyMapEntry aParaStyleMap [] = { COMMON_PARA_STYLE_PROPERTIES { SW_PROP_NMID(UNO_NAME_PARA_STYLE_CONDITIONS), FN_UNO_PARA_STYLE_CONDITIONS, CPPU_E2T(CPPUTYPE_SEQNAMEDVALUE), PropertyAttribute::MAYBEVOID, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aParaStyleMap; + aMapEntriesArr[nPropertyId] = aParaStyleMap; } break; case PROPERTY_MAP_FRAME_STYLE: { - static SfxItemPropertyMap aFrameStyleMap [] = + static SfxItemPropertyMapEntry aFrameStyleMap [] = { { SW_PROP_NMID(UNO_NAME_ANCHOR_PAGE_NO), RES_ANCHOR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_ANCHOR_PAGENUM }, { SW_PROP_NMID(UNO_NAME_ANCHOR_TYPE), RES_ANCHOR, CPPU_E2T(CPPUTYPE_TXTCNTANCHOR), PROPERTY_NONE, MID_ANCHOR_ANCHORTYPE}, @@ -870,12 +758,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 }, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aFrameStyleMap; + aMapEntriesArr[nPropertyId] = aFrameStyleMap; } break; case PROPERTY_MAP_PAGE_STYLE : { - static SfxItemPropertyMap aPageStyleMap [] = + static SfxItemPropertyMapEntry aPageStyleMap [] = { { SW_PROP_NMID(UNO_NAME_BACK_COLOR), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR }, // { SW_PROP_NMID(UNO_NAME_GRAPHIC), RES_BACKGROUND, &, PROPERTY_NONE, MID_GRAPHIC @@ -991,24 +879,24 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_GRID_STANDARD_PAGE_MODE), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_GRID_STANDARD_MODE}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aPageStyleMap; + aMapEntriesArr[nPropertyId] = aPageStyleMap; } break; case PROPERTY_MAP_NUM_STYLE : { - static SfxItemPropertyMap aNumStyleMap [] = + static SfxItemPropertyMapEntry aNumStyleMap [] = { { SW_PROP_NMID(UNO_NAME_NUMBERING_RULES), FN_UNO_NUM_RULES, CPPU_E2T(CPPUTYPE_REFIDXREPL), PROPERTY_NONE, CONVERT_TWIPS}, { SW_PROP_NMID(UNO_NAME_IS_PHYSICAL), FN_UNO_IS_PHYSICAL, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0}, { SW_PROP_NMID(UNO_NAME_DISPLAY_NAME), FN_UNO_DISPLAY_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aNumStyleMap; + aMapEntriesArr[nPropertyId] = aNumStyleMap; } break; case PROPERTY_MAP_TEXT_TABLE : { - static SfxItemPropertyMap aTablePropertyMap_Impl[] = + static SfxItemPropertyMapEntry aTablePropertyMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_BACK_COLOR), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE,MID_BACK_COLOR }, { SW_PROP_NMID(UNO_NAME_BREAK_TYPE), RES_BREAK, CPPU_E2T(CPPUTYPE_BREAK), PROPERTY_NONE, 0}, @@ -1042,6 +930,8 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_USER_DEFINED_ATTRIBUTES), RES_UNKNOWNATR_CONTAINER, CPPU_E2T(CPPUTYPE_REFNAMECNT), PropertyAttribute::MAYBEVOID, 0 }, { SW_PROP_NMID(UNO_NAME_TEXT_SECTION), FN_UNO_TEXT_SECTION, CPPU_E2T(CPPUTYPE_REFTEXTSECTION), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 }, { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 }, + { SW_PROP_NMID(UNO_NAME_TABLE_NAME), FN_UNO_TABLE_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0 }, + { SW_PROP_NMID(UNO_NAME_PAGE_STYLE_NAME), RES_PAGEDESC, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, // --> collapsing borders DVO, FME 2005-05-27 #i29550# { SW_PROP_NMID(UNO_NAME_COLLAPSING_BORDERS), RES_COLLAPSING_BORDERS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, // <-- collapsing @@ -1049,12 +939,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTablePropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aTablePropertyMap_Impl; } break; case PROPERTY_MAP_TABLE_CELL : { - static SfxItemPropertyMap aCellMap_Impl[] = + static SfxItemPropertyMapEntry aCellMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_BACK_COLOR), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE , MID_BACK_COLOR }, { SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL }, @@ -1081,12 +971,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP _REDLINE_NODE_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aCellMap_Impl; + aMapEntriesArr[nPropertyId] = aCellMap_Impl; } break; case PROPERTY_MAP_TABLE_RANGE: { - static SfxItemPropertyMap aRangePropertyMap_Impl[] = + static SfxItemPropertyMapEntry aRangePropertyMap_Impl[] = { COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN_01 TABSTOPS_MAP_ENTRY @@ -1113,12 +1003,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aRangePropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aRangePropertyMap_Impl; } break; case PROPERTY_MAP_SECTION: { - static SfxItemPropertyMap aSectionPropertyMap_Impl[] = + static SfxItemPropertyMapEntry aSectionPropertyMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_CONDITION), WID_SECT_CONDITION, CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_DDE_COMMAND_FILE), WID_SECT_DDE_TYPE, CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0}, @@ -1168,12 +1058,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP /* <- #1097001# */ {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aSectionPropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aSectionPropertyMap_Impl; } break; case PROPERTY_MAP_TEXT_SEARCH: { - static SfxItemPropertyMap aSearchPropertyMap_Impl[] = + static SfxItemPropertyMapEntry aSearchPropertyMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_SEARCH_ALL), WID_SEARCH_ALL, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_SEARCH_BACKWARDS), WID_BACKWARDS, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, @@ -1189,12 +1079,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_SEARCH_WORDS), WID_WORDS, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aSearchPropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aSearchPropertyMap_Impl; } break; case PROPERTY_MAP_TEXT_FRAME: { - static SfxItemPropertyMap aFramePropertyMap_Impl[] = + static SfxItemPropertyMapEntry aFramePropertyMap_Impl[] = { COMMON_FRAME_PROPERTIES _REDLINE_NODE_PROPERTIES @@ -1215,12 +1105,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 }, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aFramePropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aFramePropertyMap_Impl; } break; case PROPERTY_MAP_TEXT_GRAPHIC: { - static SfxItemPropertyMap aGraphicPropertyMap_Impl[] = + static SfxItemPropertyMapEntry aGraphicPropertyMap_Impl[] = { COMMON_FRAME_PROPERTIES { SW_PROP_NMID(UNO_NAME_SURROUND_CONTOUR), RES_SURROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_SURROUND_CONTOUR }, @@ -1249,12 +1139,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_GRAPHIC_COLOR_MODE), RES_GRFATR_DRAWMODE, CPPU_E2T(CPPUTYPE_COLORMODE), 0, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aGraphicPropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aGraphicPropertyMap_Impl; } break; case PROPERTY_MAP_EMBEDDED_OBJECT: { - static SfxItemPropertyMap aEmbeddedPropertyMap_Impl[] = + static SfxItemPropertyMapEntry aEmbeddedPropertyMap_Impl[] = { COMMON_FRAME_PROPERTIES { SW_PROP_NMID(UNO_NAME_SURROUND_CONTOUR), RES_SURROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_SURROUND_CONTOUR }, @@ -1271,12 +1161,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 }, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aEmbeddedPropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aEmbeddedPropertyMap_Impl; } break; case PROPERTY_MAP_TEXT_SHAPE: { - static SfxItemPropertyMap aShapeMap_Impl[] = + static SfxItemPropertyMapEntry aShapeMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_ANCHOR_PAGE_NO), RES_ANCHOR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE|PropertyAttribute::MAYBEVOID, MID_ANCHOR_PAGENUM }, { SW_PROP_NMID(UNO_NAME_ANCHOR_TYPE), RES_ANCHOR, CPPU_E2T(CPPUTYPE_TXTCNTANCHOR), PROPERTY_NONE|PropertyAttribute::MAYBEVOID, MID_ANCHOR_ANCHORTYPE}, @@ -1329,12 +1219,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP // <-- {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aShapeMap_Impl; + aMapEntriesArr[nPropertyId] = aShapeMap_Impl; } break; case PROPERTY_MAP_INDEX_MARK: { - static SfxItemPropertyMap aIdxMarkMap_Impl[] = + static SfxItemPropertyMapEntry aIdxMarkMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), WID_ALT_TEXT, CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_PRIMARY_KEY), WID_PRIMARY_KEY, CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0}, @@ -1346,24 +1236,24 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_TEXT_CONTENT_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aIdxMarkMap_Impl; + aMapEntriesArr[nPropertyId] = aIdxMarkMap_Impl; } break; case PROPERTY_MAP_CNTIDX_MARK: { - static SfxItemPropertyMap aCntntMarkMap_Impl[] = + static SfxItemPropertyMapEntry aCntntMarkMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), WID_ALT_TEXT, CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_LEVEL), WID_LEVEL , CPPU_E2T(CPPUTYPE_INT16) , PROPERTY_NONE, 0}, COMMON_TEXT_CONTENT_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aCntntMarkMap_Impl; + aMapEntriesArr[nPropertyId] = aCntntMarkMap_Impl; } break; case PROPERTY_MAP_USER_MARK: { - static SfxItemPropertyMap aUserMarkMap_Impl[] = + static SfxItemPropertyMapEntry aUserMarkMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), WID_ALT_TEXT, CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_LEVEL ), WID_LEVEL , CPPU_E2T(CPPUTYPE_INT16) , PROPERTY_NONE, 0}, @@ -1371,12 +1261,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_TEXT_CONTENT_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aUserMarkMap_Impl; + aMapEntriesArr[nPropertyId] = aUserMarkMap_Impl; } break; case PROPERTY_MAP_INDEX_IDX: { - static SfxItemPropertyMap aTOXIndexMap_Impl[] = + static SfxItemPropertyMapEntry aTOXIndexMap_Impl[] = { _BASE_INDEX_PROPERTIES_ { SW_PROP_NMID(UNO_NAME_CREATE_FROM_CHAPTER), WID_CREATE_FROM_CHAPTER , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, @@ -1409,12 +1299,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_SORT_ALGORITHM), WID_IDX_SORT_ALGORITHM, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},\ {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTOXIndexMap_Impl; + aMapEntriesArr[nPropertyId] = aTOXIndexMap_Impl; } break; case PROPERTY_MAP_INDEX_CNTNT: { - static SfxItemPropertyMap aTOXContentMap_Impl[] = + static SfxItemPropertyMapEntry aTOXContentMap_Impl[] = { _BASE_INDEX_PROPERTIES_ { SW_PROP_NMID(UNO_NAME_LEVEL), WID_LEVEL , CPPU_E2T(CPPUTYPE_INT16) , PROPERTY_NONE, 0}, @@ -1449,12 +1339,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_DOCUMENT_INDEX_MARKS), WID_INDEX_MARKS, CPPU_E2T(CPPUTYPE_DOCIDXMRK), PropertyAttribute::READONLY ,0 }, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTOXContentMap_Impl; + aMapEntriesArr[nPropertyId] = aTOXContentMap_Impl; } break; case PROPERTY_MAP_INDEX_USER: { - static SfxItemPropertyMap aTOXUserMap_Impl[] = + static SfxItemPropertyMapEntry aTOXUserMap_Impl[] = { _BASE_INDEX_PROPERTIES_ { SW_PROP_NMID(UNO_NAME_CREATE_FROM_MARKS), WID_CREATE_FROM_MARKS , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, @@ -1491,12 +1381,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_USER_INDEX_NAME), WID_USER_IDX_NAME, CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTOXUserMap_Impl; + aMapEntriesArr[nPropertyId] = aTOXUserMap_Impl; } break; case PROPERTY_MAP_INDEX_TABLES: { - static SfxItemPropertyMap aTOXTablesMap_Impl[] = + static SfxItemPropertyMapEntry aTOXTablesMap_Impl[] = { _BASE_INDEX_PROPERTIES_ { SW_PROP_NMID(UNO_NAME_CREATE_FROM_CHAPTER), WID_CREATE_FROM_CHAPTER , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, @@ -1516,12 +1406,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_IS_RELATIVE_TABSTOPS), WID_IS_RELATIVE_TABSTOPS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTOXTablesMap_Impl; + aMapEntriesArr[nPropertyId] = aTOXTablesMap_Impl; } break; case PROPERTY_MAP_INDEX_OBJECTS: { - static SfxItemPropertyMap aTOXObjectsMap_Impl[] = + static SfxItemPropertyMapEntry aTOXObjectsMap_Impl[] = { _BASE_INDEX_PROPERTIES_ { SW_PROP_NMID(UNO_NAME_CREATE_FROM_CHAPTER), WID_CREATE_FROM_CHAPTER , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, @@ -1544,12 +1434,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_IS_RELATIVE_TABSTOPS), WID_IS_RELATIVE_TABSTOPS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTOXObjectsMap_Impl; + aMapEntriesArr[nPropertyId] = aTOXObjectsMap_Impl; } break; case PROPERTY_MAP_INDEX_ILLUSTRATIONS: { - static SfxItemPropertyMap aTOXIllustrationsMap_Impl[] = + static SfxItemPropertyMapEntry aTOXIllustrationsMap_Impl[] = { _BASE_INDEX_PROPERTIES_ { SW_PROP_NMID(UNO_NAME_CREATE_FROM_CHAPTER), WID_CREATE_FROM_CHAPTER , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, @@ -1570,12 +1460,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_IS_RELATIVE_TABSTOPS), WID_IS_RELATIVE_TABSTOPS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTOXIllustrationsMap_Impl; + aMapEntriesArr[nPropertyId] = aTOXIllustrationsMap_Impl; } break; case PROPERTY_MAP_TEXT_TABLE_ROW: { - static SfxItemPropertyMap aTableRowPropertyMap_Impl[] = + static SfxItemPropertyMapEntry aTableRowPropertyMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_BACK_COLOR), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR }, { SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL }, @@ -1593,13 +1483,13 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = (SfxItemPropertyMap*)aTableRowPropertyMap_Impl; + aMapEntriesArr[nPropertyId] = (SfxItemPropertyMapEntry*)aTableRowPropertyMap_Impl; } break; case PROPERTY_MAP_TEXT_TABLE_CURSOR: { // das PropertySet entspricht dem Range ohne Chart-Properties - static SfxItemPropertyMap aTableCursorPropertyMap_Impl [] = + static SfxItemPropertyMapEntry aTableCursorPropertyMap_Impl [] = { COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN_01 TABSTOPS_MAP_ENTRY @@ -1628,34 +1518,34 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_VERT_ORIENT), RES_VERT_ORIENT, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE ,MID_VERTORIENT_ORIENT }, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTableCursorPropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aTableCursorPropertyMap_Impl; } break; case PROPERTY_MAP_BOOKMARK: { - static SfxItemPropertyMap aBookmarkPropertyMap_Impl [] = + static SfxItemPropertyMapEntry aBookmarkPropertyMap_Impl [] = { { SW_PROP_NMID(UNO_LINK_DISPLAY_NAME), FN_PARAM_LINK_DISPLAY_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0xff}, COMMON_TEXT_CONTENT_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aBookmarkPropertyMap_Impl; + aMapEntriesArr[nPropertyId] = aBookmarkPropertyMap_Impl; } break; case PROPERTY_MAP_PARAGRAPH_EXTENSIONS: { - static SfxItemPropertyMap aParagraphExtensionsMap_Impl[] = + static SfxItemPropertyMapEntry aParagraphExtensionsMap_Impl[] = { COMMON_TEXT_CONTENT_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aParagraphExtensionsMap_Impl; + aMapEntriesArr[nPropertyId] = aParagraphExtensionsMap_Impl; } break; case PROPERTY_MAP_BIBLIOGRAPHY : { - static SfxItemPropertyMap aBibliographyMap_Impl[] = + static SfxItemPropertyMapEntry aBibliographyMap_Impl[] = { _BASE_INDEX_PROPERTIES_ { SW_PROP_NMID(UNO_NAME_IS_PROTECTED), WID_PROTECTED , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, @@ -1672,12 +1562,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_SORT_ALGORITHM), WID_IDX_SORT_ALGORITHM, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},\ {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aBibliographyMap_Impl; + aMapEntriesArr[nPropertyId] = aBibliographyMap_Impl; } break; case PROPERTY_MAP_TEXT_DOCUMENT: { - static SfxItemPropertyMap aDocMap_Impl[] = + static SfxItemPropertyMapEntry aDocMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_BASIC_LIBRARIES), WID_DOC_BASIC_LIBRARIES, CPPU_E2T(CPPUTYPE_REFLIBCONTAINER), PropertyAttribute::READONLY, 0}, { SW_PROP_NMID(UNO_NAME_CHAR_FONT_NAME), RES_CHRATR_FONT, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, MID_FONT_FAMILY_NAME }, @@ -1720,34 +1610,34 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP // <-- {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocMap_Impl; + aMapEntriesArr[nPropertyId] = aDocMap_Impl; } break; case PROPERTY_MAP_LINK_TARGET: { - static SfxItemPropertyMap aLinkTargetMap_Impl[] = + static SfxItemPropertyMapEntry aLinkTargetMap_Impl[] = { { SW_PROP_NMID(UNO_LINK_DISPLAY_BITMAP), 0, CPPU_E2T(CPPUTYPE_REFBITMAP), PropertyAttribute::READONLY, 0xff}, { SW_PROP_NMID(UNO_LINK_DISPLAY_NAME), 0, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0xff}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aLinkTargetMap_Impl; + aMapEntriesArr[nPropertyId] = aLinkTargetMap_Impl; } break; case PROPERTY_MAP_AUTO_TEXT_GROUP : { - static SfxItemPropertyMap aAutoTextGroupMap_Impl[] = + static SfxItemPropertyMapEntry aAutoTextGroupMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_FILE_PATH), WID_GROUP_PATH, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, PropertyAttribute::READONLY}, { SW_PROP_NMID(UNO_NAME_TITLE), WID_GROUP_TITLE, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aAutoTextGroupMap_Impl; + aMapEntriesArr[nPropertyId] = aAutoTextGroupMap_Impl; } break; case PROPERTY_MAP_TEXTPORTION_EXTENSIONS: { - static SfxItemPropertyMap aTextPortionExtensionMap_Impl[] = + static SfxItemPropertyMapEntry aTextPortionExtensionMap_Impl[] = { COMPLETE_TEXT_CURSOR_MAP {SW_PROP_NMID(UNO_NAME_BOOKMARK), FN_UNO_BOOKMARK, CPPU_E2T(CPPUTYPE_REFTEXTCNTNT), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 }, @@ -1758,24 +1648,24 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_TEXT_PORTION_TYPE), FN_UNO_TEXT_PORTION_TYPE, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTextPortionExtensionMap_Impl; + aMapEntriesArr[nPropertyId] = aTextPortionExtensionMap_Impl; } break; case PROPERTY_MAP_FOOTNOTE: { - static SfxItemPropertyMap aFootnoteMap_Impl[] = + static SfxItemPropertyMapEntry aFootnoteMap_Impl[] = { {SW_PROP_NMID(UNO_NAME_REFERENCE_ID), 0, CPPU_E2T(CPPUTYPE_INT16),PropertyAttribute::READONLY|PropertyAttribute::MAYBEVOID, 0}, COMMON_TEXT_CONTENT_PROPERTIES _REDLINE_NODE_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aFootnoteMap_Impl; + aMapEntriesArr[nPropertyId] = aFootnoteMap_Impl; } break; case PROPERTY_MAP_TEXT_COLUMS : { - static SfxItemPropertyMap aTextColumns_Impl[] = + static SfxItemPropertyMapEntry aTextColumns_Impl[] = { {SW_PROP_NMID(UNO_NAME_IS_AUTOMATIC), WID_TXTCOL_IS_AUTOMATIC, CPPU_E2T(CPPUTYPE_BOOLEAN),PropertyAttribute::READONLY, 0}, {SW_PROP_NMID(UNO_NAME_AUTOMATIC_DISTANCE), WID_TXTCOL_AUTO_DISTANCE, CPPU_E2T(CPPUTYPE_INT32),PROPERTY_NONE, 0}, @@ -1786,12 +1676,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_IS_ON), WID_TXTCOL_LINE_IS_ON, CPPU_E2T(CPPUTYPE_BOOLEAN),PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTextColumns_Impl; + aMapEntriesArr[nPropertyId] = aTextColumns_Impl; } break; case PROPERTY_MAP_REDLINE : { - static SfxItemPropertyMap aRedlineMap_Impl[] = + static SfxItemPropertyMapEntry aRedlineMap_Impl[] = { _REDLINE_PROPERTIES _REDLINE_NODE_PROPERTIES @@ -1799,12 +1689,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_REDLINE_END), 0, CPPU_E2T(CPPUTYPE_REFINTERFACE), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aRedlineMap_Impl; + aMapEntriesArr[nPropertyId] = aRedlineMap_Impl; } break; case PROPERTY_MAP_TEXT_DEFAULT : { - static SfxItemPropertyMap aTextDefaultMap_Impl[] = + static SfxItemPropertyMapEntry aTextDefaultMap_Impl[] = { { SW_PROP_NMID(UNO_NAME_TAB_STOP_DISTANCE), RES_PARATR_TABSTOP, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_STD_TAB | CONVERT_TWIPS}, COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN @@ -1820,8 +1710,8 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_GRID_STANDARD_PAGE_MODE), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_GRID_STANDARD_MODE}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTextDefaultMap_Impl; - for( SfxItemPropertyMap * pMap = aTextDefaultMap_Impl; + aMapEntriesArr[nPropertyId] = aTextDefaultMap_Impl; + for( SfxItemPropertyMapEntry * pMap = aTextDefaultMap_Impl; pMap->pName; ++pMap ) { // UNO_NAME_PAGE_DESC_NAME should keep its MAYBEVOID flag @@ -1832,7 +1722,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP break; case PROPERTY_MAP_REDLINE_PORTION : { - static SfxItemPropertyMap aRedlinePortionMap_Impl[] = + static SfxItemPropertyMapEntry aRedlinePortionMap_Impl[] = { COMPLETE_TEXT_CURSOR_MAP {SW_PROP_NMID(UNO_NAME_BOOKMARK), FN_UNO_BOOKMARK, CPPU_E2T(CPPUTYPE_REFTEXTCNTNT), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 }, @@ -1843,12 +1733,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_TEXT_PORTION_TYPE), FN_UNO_TEXT_PORTION_TYPE, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aRedlinePortionMap_Impl; + aMapEntriesArr[nPropertyId] = aRedlinePortionMap_Impl; } break; case PROPERTY_MAP_FLDTYP_DATETIME: { - static SfxItemPropertyMap aDateTimeFieldPropMap[] = + static SfxItemPropertyMapEntry aDateTimeFieldPropMap[] = { {SW_PROP_NMID(UNO_NAME_ADJUST), FIELD_PROP_SUBTYPE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_DATE_TIME_VALUE), FIELD_PROP_DATE_TIME, CPPU_E2T(CPPUTYPE_DATETIME), PROPERTY_NONE, 0}, @@ -1859,12 +1749,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDateTimeFieldPropMap; + aMapEntriesArr[nPropertyId] = aDateTimeFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_USER : { - static SfxItemPropertyMap aUserFieldPropMap[] = + static SfxItemPropertyMapEntry aUserFieldPropMap[] = { {SW_PROP_NMID(UNO_NAME_IS_SHOW_FORMULA), FIELD_PROP_BOOL2, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_IS_VISIBLE), FIELD_PROP_BOOL1, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, @@ -1874,12 +1764,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aUserFieldPropMap; + aMapEntriesArr[nPropertyId] = aUserFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_SET_EXP : { - static SfxItemPropertyMap aSetExpFieldPropMap [] = + static SfxItemPropertyMapEntry aSetExpFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR4, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -1900,12 +1790,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aSetExpFieldPropMap; + aMapEntriesArr[nPropertyId] = aSetExpFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_GET_EXP : { - static SfxItemPropertyMap aGetExpFieldPropMap [] = + static SfxItemPropertyMapEntry aGetExpFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR4, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -1918,12 +1808,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aGetExpFieldPropMap; + aMapEntriesArr[nPropertyId] = aGetExpFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_FILE_NAME: { - static SfxItemPropertyMap aFileNameFieldPropMap [] = + static SfxItemPropertyMapEntry aFileNameFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_FILE_FORMAT), FIELD_PROP_FORMAT, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, @@ -1931,12 +1821,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aFileNameFieldPropMap; + aMapEntriesArr[nPropertyId] = aFileNameFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_PAGE_NUM : { - static SfxItemPropertyMap aPageNumFieldPropMap [] = + static SfxItemPropertyMapEntry aPageNumFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_NUMBERING_TYPE), FIELD_PROP_FORMAT, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_OFFSET), FIELD_PROP_USHORT1, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, @@ -1945,12 +1835,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aPageNumFieldPropMap; + aMapEntriesArr[nPropertyId] = aPageNumFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_AUTHOR : { - static SfxItemPropertyMap aAuthorFieldPropMap [] = + static SfxItemPropertyMapEntry aAuthorFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -1959,24 +1849,24 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aAuthorFieldPropMap; + aMapEntriesArr[nPropertyId] = aAuthorFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_CHAPTER : { - static SfxItemPropertyMap aChapterFieldPropMap [] = + static SfxItemPropertyMapEntry aChapterFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CHAPTER_FORMAT),FIELD_PROP_USHORT1, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_LEVEL ),FIELD_PROP_BYTE1, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aChapterFieldPropMap; + aMapEntriesArr[nPropertyId] = aChapterFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_GET_REFERENCE : { - static SfxItemPropertyMap aGetRefFieldPropMap [] = + static SfxItemPropertyMapEntry aGetRefFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_REFERENCE_FIELD_PART),FIELD_PROP_USHORT1, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, @@ -1986,12 +1876,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aGetRefFieldPropMap; + aMapEntriesArr[nPropertyId] = aGetRefFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_CONDITIONED_TEXT : { - static SfxItemPropertyMap aConditionedTxtFieldPropMap [] = + static SfxItemPropertyMapEntry aConditionedTxtFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONDITION), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_FALSE_CONTENT), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2001,12 +1891,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aConditionedTxtFieldPropMap; + aMapEntriesArr[nPropertyId] = aConditionedTxtFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_HIDDEN_TEXT : { - static SfxItemPropertyMap aHiddenTxtFieldPropMap [] = + static SfxItemPropertyMapEntry aHiddenTxtFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONDITION), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CONTENT) , FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2015,12 +1905,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aHiddenTxtFieldPropMap; + aMapEntriesArr[nPropertyId] = aHiddenTxtFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_ANNOTATION : { - static SfxItemPropertyMap aAnnotationFieldPropMap [] = + static SfxItemPropertyMapEntry aAnnotationFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_AUTHOR), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2030,12 +1920,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aAnnotationFieldPropMap; + aMapEntriesArr[nPropertyId] = aAnnotationFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_INPUT: { - static SfxItemPropertyMap aInputFieldPropMap [] = + static SfxItemPropertyMapEntry aInputFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_HINT), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2044,12 +1934,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aInputFieldPropMap; + aMapEntriesArr[nPropertyId] = aInputFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_MACRO : { - static SfxItemPropertyMap aMacroFieldPropMap [] = + static SfxItemPropertyMapEntry aMacroFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_HINT), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_MACRO_NAME),FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2058,22 +1948,22 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aMacroFieldPropMap; + aMapEntriesArr[nPropertyId] = aMacroFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DDE : { - static SfxItemPropertyMap aDDEFieldPropMap [] = + static SfxItemPropertyMapEntry aDDEFieldPropMap [] = { COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDDEFieldPropMap; + aMapEntriesArr[nPropertyId] = aDDEFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DROPDOWN : { - static SfxItemPropertyMap aDropDownMap [] = + static SfxItemPropertyMapEntry aDropDownMap [] = { {SW_PROP_NMID(UNO_NAME_ITEMS), FIELD_PROP_STRINGS, CPPU_E2T(CPPUTYPE_OUSTRINGS), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_SELITEM), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2083,24 +1973,24 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDropDownMap; + aMapEntriesArr[nPropertyId] = aDropDownMap; } break; case PROPERTY_MAP_FLDTYP_HIDDEN_PARA : { - static SfxItemPropertyMap aHiddenParaFieldPropMap [] = + static SfxItemPropertyMapEntry aHiddenParaFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONDITION),FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_IS_HIDDEN) , FIELD_PROP_BOOL1, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aHiddenParaFieldPropMap; + aMapEntriesArr[nPropertyId] = aHiddenParaFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DOC_INFO : { - static SfxItemPropertyMap aDocInfoFieldPropMap [] = + static SfxItemPropertyMapEntry aDocInfoFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_IS_FIXED), FIELD_PROP_BOOL1, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_INFO_FORMAT), FIELD_PROP_USHORT2, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, @@ -2108,23 +1998,23 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocInfoFieldPropMap; + aMapEntriesArr[nPropertyId] = aDocInfoFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_TEMPLATE_NAME : { - static SfxItemPropertyMap aTmplNameFieldPropMap [] = + static SfxItemPropertyMapEntry aTmplNameFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_FILE_FORMAT), FIELD_PROP_FORMAT, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTmplNameFieldPropMap; + aMapEntriesArr[nPropertyId] = aTmplNameFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_USER_EXT : { - static SfxItemPropertyMap aUsrExtFieldPropMap [] = + static SfxItemPropertyMapEntry aUsrExtFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2133,36 +2023,36 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId]= aUsrExtFieldPropMap; + aMapEntriesArr[nPropertyId]= aUsrExtFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_REF_PAGE_SET : { - static SfxItemPropertyMap aRefPgSetFieldPropMap [] = + static SfxItemPropertyMapEntry aRefPgSetFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_OFFSET), FIELD_PROP_USHORT1, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_ON), FIELD_PROP_BOOL1, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aRefPgSetFieldPropMap; + aMapEntriesArr[nPropertyId] = aRefPgSetFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_REF_PAGE_GET : { - static SfxItemPropertyMap aRefPgGetFieldPropMap [] = + static SfxItemPropertyMapEntry aRefPgGetFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_NUMBERING_TYPE), FIELD_PROP_USHORT1, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aRefPgGetFieldPropMap; + aMapEntriesArr[nPropertyId] = aRefPgGetFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_JUMP_EDIT : { - static SfxItemPropertyMap aJumpEdtFieldPropMap [] = + static SfxItemPropertyMapEntry aJumpEdtFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_HINT), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_PLACEHOLDER), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2170,12 +2060,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aJumpEdtFieldPropMap; + aMapEntriesArr[nPropertyId] = aJumpEdtFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_SCRIPT : { - static SfxItemPropertyMap aScriptFieldPropMap [] = + static SfxItemPropertyMapEntry aScriptFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_SCRIPT_TYPE), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2183,12 +2073,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aScriptFieldPropMap; + aMapEntriesArr[nPropertyId] = aScriptFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DATABASE_NEXT_SET : { - static SfxItemPropertyMap aDBNextSetFieldPropMap [] = + static SfxItemPropertyMapEntry aDBNextSetFieldPropMap [] = { // Note: DATA_BASE_NAME and DATA_BASE_URL // are mapped to the same nMId, because internally we only use @@ -2202,12 +2092,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDBNextSetFieldPropMap; + aMapEntriesArr[nPropertyId] = aDBNextSetFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DATABASE_NUM_SET : { - static SfxItemPropertyMap aDBNumSetFieldPropMap [] = + static SfxItemPropertyMapEntry aDBNumSetFieldPropMap [] = { // Note: DATA_BASE_NAME and DATA_BASE_URL // are mapped to the same nMId, because internally we only use @@ -2222,12 +2112,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDBNumSetFieldPropMap; + aMapEntriesArr[nPropertyId] = aDBNumSetFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DATABASE_SET_NUM : { - static SfxItemPropertyMap aDBSetNumFieldPropMap [] = + static SfxItemPropertyMapEntry aDBSetNumFieldPropMap [] = { // Note: DATA_BASE_NAME and DATA_BASE_URL // are mapped to the same nMId, because internally we only use @@ -2243,12 +2133,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDBSetNumFieldPropMap; + aMapEntriesArr[nPropertyId] = aDBSetNumFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DATABASE : { - static SfxItemPropertyMap aDBFieldPropMap [] = + static SfxItemPropertyMapEntry aDBFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2259,12 +2149,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDBFieldPropMap; + aMapEntriesArr[nPropertyId] = aDBFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DATABASE_NAME : { - static SfxItemPropertyMap aDBNameFieldPropMap [] = + static SfxItemPropertyMapEntry aDBNameFieldPropMap [] = { // Note: DATA_BASE_NAME and DATA_BASE_URL // are mapped to the same nMId, because internally we only use @@ -2278,24 +2168,24 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDBNameFieldPropMap; + aMapEntriesArr[nPropertyId] = aDBNameFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DOCSTAT: { - static SfxItemPropertyMap aDocstatFieldPropMap [] = + static SfxItemPropertyMapEntry aDocstatFieldPropMap [] = { {SW_PROP_NMID(UNO_NAME_NUMBERING_TYPE), FIELD_PROP_USHORT2, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, // {UNO_NAME_STATISTIC_TYPE_ID,FIELD_PROP_USHORT1, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocstatFieldPropMap; + aMapEntriesArr[nPropertyId] = aDocstatFieldPropMap; } break; case PROPERTY_MAP_FLDTYP_DOCINFO_AUTHOR: { - static SfxItemPropertyMap aDocInfoAuthorPropMap [] = + static SfxItemPropertyMapEntry aDocInfoAuthorPropMap [] = { {SW_PROP_NMID(UNO_NAME_AUTHOR), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2303,12 +2193,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocInfoAuthorPropMap; + aMapEntriesArr[nPropertyId] = aDocInfoAuthorPropMap; } break; case PROPERTY_MAP_FLDTYP_DOCINFO_DATE_TIME: { - static SfxItemPropertyMap aDocInfoDateTimePropMap [] = + static SfxItemPropertyMapEntry aDocInfoDateTimePropMap [] = { {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_DATE_TIME_VALUE), FIELD_PROP_DOUBLE, CPPU_E2T(CPPUTYPE_DOUBLE), PropertyAttribute::READONLY, 0}, @@ -2318,12 +2208,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_IS_FIXED_LANGUAGE), FIELD_PROP_BOOL4, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocInfoDateTimePropMap; + aMapEntriesArr[nPropertyId] = aDocInfoDateTimePropMap; } break; case PROPERTY_MAP_FLDTYP_DOCINFO_EDIT_TIME : { - static SfxItemPropertyMap aDocInfoEditTimePropMap [] = + static SfxItemPropertyMapEntry aDocInfoEditTimePropMap [] = { {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_DATE_TIME_VALUE), FIELD_PROP_DOUBLE, CPPU_E2T(CPPUTYPE_DOUBLE), PropertyAttribute::READONLY, 0}, @@ -2333,12 +2223,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocInfoEditTimePropMap; + aMapEntriesArr[nPropertyId] = aDocInfoEditTimePropMap; } break; case PROPERTY_MAP_FLDTYP_DOCINFO_MISC: { - static SfxItemPropertyMap aDocInfoStringContentPropMap [] = + static SfxItemPropertyMapEntry aDocInfoStringContentPropMap [] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2346,12 +2236,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocInfoStringContentPropMap; + aMapEntriesArr[nPropertyId] = aDocInfoStringContentPropMap; } break; case PROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM: { - static SfxItemPropertyMap aDocInfoCustomPropMap [] = + static SfxItemPropertyMapEntry aDocInfoCustomPropMap [] = { {SW_PROP_NMID(UNO_NAME_NAME), FIELD_PROP_PAR4, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2359,12 +2249,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocInfoCustomPropMap; + aMapEntriesArr[nPropertyId] = aDocInfoCustomPropMap; } break; case PROPERTY_MAP_FLDTYP_DOCINFO_REVISION : { - static SfxItemPropertyMap aDocInfoRevisionPropMap [] = + static SfxItemPropertyMapEntry aDocInfoRevisionPropMap [] = { {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_REVISION), FIELD_PROP_USHORT1, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0}, @@ -2372,23 +2262,23 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDocInfoRevisionPropMap; + aMapEntriesArr[nPropertyId] = aDocInfoRevisionPropMap; } break; case PROPERTY_MAP_FLDTYP_COMBINED_CHARACTERS: { - static SfxItemPropertyMap aCombinedCharactersPropMap[] = + static SfxItemPropertyMapEntry aCombinedCharactersPropMap[] = { {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aCombinedCharactersPropMap; + aMapEntriesArr[nPropertyId] = aCombinedCharactersPropMap; } break; case PROPERTY_MAP_FLDTYP_TABLE_FORMULA: { - static SfxItemPropertyMap aTableFormulaPropMap[] = + static SfxItemPropertyMapEntry aTableFormulaPropMap[] = { {SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2397,22 +2287,22 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTableFormulaPropMap; + aMapEntriesArr[nPropertyId] = aTableFormulaPropMap; } break; case PROPERTY_MAP_FLDTYP_DUMMY_0: { - static SfxItemPropertyMap aEmptyPropMap [] = + static SfxItemPropertyMapEntry aEmptyPropMap [] = { COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aEmptyPropMap; + aMapEntriesArr[nPropertyId] = aEmptyPropMap; } break; case PROPERTY_MAP_FLDMSTR_USER : { - static SfxItemPropertyMap aUserFieldTypePropMap[] = + static SfxItemPropertyMapEntry aUserFieldTypePropMap[] = { {SW_PROP_NMID(UNO_NAME_DEPENDENT_TEXT_FIELDS), FIELD_PROP_PROP_SEQ, CPPU_E2T(CPPUTYPE_SEQDEPTXTFLD), PropertyAttribute::READONLY, 0}, {SW_PROP_NMID(UNO_NAME_IS_EXPRESSION), FIELD_PROP_BOOL1, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, @@ -2422,12 +2312,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_INSTANCE_NAME), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aUserFieldTypePropMap; + aMapEntriesArr[nPropertyId] = aUserFieldTypePropMap; } break; case PROPERTY_MAP_FLDMSTR_DDE : { - static SfxItemPropertyMap aDDEFieldTypePropMap[] = + static SfxItemPropertyMapEntry aDDEFieldTypePropMap[] = { {SW_PROP_NMID(UNO_NAME_DDE_COMMAND_ELEMENT ), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_DDE_COMMAND_FILE ), FIELD_PROP_PAR4, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2439,12 +2329,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR5, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDDEFieldTypePropMap; + aMapEntriesArr[nPropertyId] = aDDEFieldTypePropMap; } break; case PROPERTY_MAP_FLDMSTR_SET_EXP : { - static SfxItemPropertyMap aSetExpFieldTypePropMap[] = + static SfxItemPropertyMapEntry aSetExpFieldTypePropMap[] = { {SW_PROP_NMID(UNO_NAME_CHAPTER_NUMBERING_LEVEL),FIELD_PROP_SHORT1, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_DEPENDENT_TEXT_FIELDS), FIELD_PROP_PROP_SEQ, CPPU_E2T(CPPUTYPE_SEQDEPTXTFLD), PropertyAttribute::READONLY, 0}, @@ -2454,12 +2344,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_INSTANCE_NAME), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aSetExpFieldTypePropMap; + aMapEntriesArr[nPropertyId] = aSetExpFieldTypePropMap; } break; case PROPERTY_MAP_FLDMSTR_DATABASE : { - static SfxItemPropertyMap aDBFieldTypePropMap [] = + static SfxItemPropertyMapEntry aDBFieldTypePropMap [] = { // Note: DATA_BASE_NAME and DATA_BASE_URL // are mapped to the same nMId, because internally we only use @@ -2475,35 +2365,35 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_DEPENDENT_TEXT_FIELDS), FIELD_PROP_PROP_SEQ, CPPU_E2T(CPPUTYPE_SEQDEPTXTFLD), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aDBFieldTypePropMap; + aMapEntriesArr[nPropertyId] = aDBFieldTypePropMap; } break; case PROPERTY_MAP_FLDMSTR_DUMMY0 : { - static SfxItemPropertyMap aStandardFieldMasterMap[] = + static SfxItemPropertyMapEntry aStandardFieldMasterMap[] = { {SW_PROP_NMID(UNO_NAME_DEPENDENT_TEXT_FIELDS), 0, CPPU_E2T(CPPUTYPE_SEQDEPTXTFLD), PropertyAttribute::READONLY, 0}, {SW_PROP_NMID(UNO_NAME_NAME), 0, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_INSTANCE_NAME), 0, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aStandardFieldMasterMap; + aMapEntriesArr[nPropertyId] = aStandardFieldMasterMap; } break; case PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY: { - static SfxItemPropertyMap aBibliographyFieldMap[] = + static SfxItemPropertyMapEntry aBibliographyFieldMap[] = { {SW_PROP_NMID(UNO_NAME_FIELDS ) , FIELD_PROP_PROP_SEQ, CPPU_E2T(CPPUTYPE_PROPERTYVALUE),PROPERTY_NONE, 0}, COMMON_FLDTYP_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aBibliographyFieldMap; + aMapEntriesArr[nPropertyId] = aBibliographyFieldMap; } break; case PROPERTY_MAP_FLDMSTR_BIBLIOGRAPHY: { - static SfxItemPropertyMap aBibliographyFieldMasterMap[] = + static SfxItemPropertyMapEntry aBibliographyFieldMasterMap[] = { {SW_PROP_NMID(UNO_NAME_BRACKET_BEFORE ) , FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {SW_PROP_NMID(UNO_NAME_BRACKET_AFTER ) , FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, @@ -2515,22 +2405,22 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_INSTANCE_NAME), FIELD_PROP_PAR4, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aBibliographyFieldMasterMap; + aMapEntriesArr[nPropertyId] = aBibliographyFieldMasterMap; } break; case PROPERTY_MAP_TEXT : { - static SfxItemPropertyMap aTextMap[] = + static SfxItemPropertyMapEntry aTextMap[] = { _REDLINE_NODE_PROPERTIES {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aTextMap; + aMapEntriesArr[nPropertyId] = aTextMap; } break; case PROPERTY_MAP_MAILMERGE : { - static SfxItemPropertyMap aMailMergeMap[] = + static SfxItemPropertyMapEntry aMailMergeMap[] = { { SW_PROP_NMID(UNO_NAME_SELECTION), WID_SELECTION, CPPU_E2T(CPPUTYPE_SEQANY), PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_RESULT_SET), WID_RESULT_SET, CPPU_E2T(CPPUTYPE_REFRESULTSET), PROPERTY_NONE, 0}, @@ -2565,12 +2455,12 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP { SW_PROP_NMID(UNO_NAME_OUT_SERVER_PASSWORD), WID_OUT_SERVER_PASSWORD, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aMailMergeMap; + aMapEntriesArr[nPropertyId] = aMailMergeMap; } break; case PROPERTY_MAP_TEXT_VIEW : { - static SfxItemPropertyMap pTextViewMap[] = + static SfxItemPropertyMapEntry pTextViewMap[] = { {SW_PROP_NMID(UNO_NAME_PAGE_COUNT), WID_PAGE_COUNT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::READONLY, 0}, {SW_PROP_NMID(UNO_NAME_LINE_COUNT), WID_LINE_COUNT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::READONLY, 0}, @@ -2578,27 +2468,631 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP {SW_PROP_NMID(UNO_NAME_IS_HIDE_SPELL_MARKS), WID_IS_HIDE_SPELL_MARKS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, // deprecated #i91949 {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = pTextViewMap; + aMapEntriesArr[nPropertyId] = pTextViewMap; } break; case PROPERTY_MAP_CHART2_DATA_SEQUENCE : { - static SfxItemPropertyMap aChart2DataSequenceMap[] = + static SfxItemPropertyMapEntry aChart2DataSequenceMap[] = { {SW_PROP_NMID(UNO_NAME_ROLE), 0, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0 }, {0,0,0,0,0,0} }; - aMapArr[nPropertyId] = aChart2DataSequenceMap; + aMapEntriesArr[nPropertyId] = aChart2DataSequenceMap; } break; default: DBG_ERROR( "unexpected property map ID" ); } - Sort(nPropertyId); + //fill the character pointers and types into the arrays + SfxItemPropertyMapEntry* p = aMapEntriesArr[nPropertyId]; + sal_uInt16 i = 0; + for( ; p->pName; ++p, ++i ) + { + // set the name + const SwPropNameLen& rPropNm = GetPropName( (USHORT)(long)p->pName ); + p->pName = rPropNm.pName; + p->nNameLen = rPropNm.nNameLen; + // get the cppu type from the comphelper + CppuTypes nTyp = (CppuTypes) (long) p->pType; + GenerateCppuType( nTyp, p->pType ); + DBG_ASSERT( nTyp != (CppuTypes) (long) p->pType, "unknown type" ); + } } - return aMapArr[nPropertyId]; + return aMapEntriesArr[nPropertyId]; } +/*-- 17.02.2009 15:29:58--------------------------------------------------- + + -----------------------------------------------------------------------*/ +const SfxItemPropertySet* SwUnoPropertyMapProvider::GetPropertySet( sal_uInt16 nPropertyId) +{ + if( !aPropertySetArr[nPropertyId] ) + { + const SfxItemPropertyMapEntry* pEntries = GetPropertyMapEntries(nPropertyId); + switch( nPropertyId ) + { + case PROPERTY_MAP_TEXT_CURSOR: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_CURSOR(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_CURSOR; + } + break; + case PROPERTY_MAP_CHAR_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_CHAR_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_CHAR_STYLE; + } + break; + case PROPERTY_MAP_PARA_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_PARA_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_PARA_STYLE; + } + break; + case PROPERTY_MAP_FRAME_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_FRAME_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FRAME_STYLE; + } + break; + case PROPERTY_MAP_PAGE_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_PAGE_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_PAGE_STYLE; + } + break; + case PROPERTY_MAP_NUM_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_NUM_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_NUM_STYLE; + } + break; + case PROPERTY_MAP_SECTION: + { + static SfxItemPropertySet aPROPERTY_MAP_SECTION(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_SECTION; + } + break; + case PROPERTY_MAP_TEXT_TABLE: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_TABLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_TABLE; + } + break; + case PROPERTY_MAP_TABLE_CELL: + { + static SfxItemPropertySet aPROPERTY_MAP_TABLE_CELL(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TABLE_CELL; + } + break; + case PROPERTY_MAP_TABLE_RANGE: + { + static SfxItemPropertySet aPROPERTY_MAP_TABLE_RANGE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TABLE_RANGE; + } + break; + case PROPERTY_MAP_TEXT_SEARCH: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_SEARCH(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_SEARCH; + } + break; + case PROPERTY_MAP_TEXT_FRAME: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_FRAME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_FRAME; + } + break; + case PROPERTY_MAP_TEXT_GRAPHIC: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_GRAPHIC(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_GRAPHIC; + } + break; + case PROPERTY_MAP_TEXT_SHAPE: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_SHAPE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_SHAPE; + } + break; + case PROPERTY_MAP_INDEX_USER: + { + static SfxItemPropertySet aPROPERTY_MAP_INDEX_USER(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_INDEX_USER; + } + break; + case PROPERTY_MAP_INDEX_CNTNT: + { + static SfxItemPropertySet aPROPERTY_MAP_INDEX_CNTNT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_INDEX_CNTNT; + } + break; + case PROPERTY_MAP_INDEX_IDX: + { + static SfxItemPropertySet aPROPERTY_MAP_INDEX_IDX(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_INDEX_IDX; + } + break; + case PROPERTY_MAP_USER_MARK: + { + static SfxItemPropertySet aPROPERTY_MAP_USER_MARK(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_USER_MARK; + } + break; + case PROPERTY_MAP_CNTIDX_MARK: + { + static SfxItemPropertySet aPROPERTY_MAP_CNTIDX_MARK(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_CNTIDX_MARK; + } + break; + case PROPERTY_MAP_INDEX_MARK: + { + static SfxItemPropertySet aPROPERTY_MAP_INDEX_MARK(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_INDEX_MARK; + } + break; + case PROPERTY_MAP_TEXT_TABLE_ROW: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_TABLE_ROW(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_TABLE_ROW; + } + break; + case PROPERTY_MAP_TEXT_SHAPE_DESCRIPTOR: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_SHAPE_DESCRIPTOR(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_SHAPE_DESCRIPTOR; + } + break; + case PROPERTY_MAP_TEXT_TABLE_CURSOR: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_TABLE_CURSOR(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_TABLE_CURSOR; + } + break; + case PROPERTY_MAP_BOOKMARK: + { + static SfxItemPropertySet aPROPERTY_MAP_BOOKMARK(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_BOOKMARK; + } + break; + case PROPERTY_MAP_PARAGRAPH_EXTENSIONS: + { + static SfxItemPropertySet aPROPERTY_MAP_PARAGRAPH_EXTENSIONS(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_PARAGRAPH_EXTENSIONS; + } + break; + case PROPERTY_MAP_INDEX_ILLUSTRATIONS: + { + static SfxItemPropertySet aPROPERTY_MAP_INDEX_ILLUSTRATIONS(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_INDEX_ILLUSTRATIONS; + } + break; + case PROPERTY_MAP_INDEX_OBJECTS: + { + static SfxItemPropertySet aPROPERTY_MAP_INDEX_OBJECTS(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_INDEX_OBJECTS; + } + break; + case PROPERTY_MAP_INDEX_TABLES: + { + static SfxItemPropertySet aPROPERTY_MAP_INDEX_TABLES(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_INDEX_TABLES; + } + break; + case PROPERTY_MAP_BIBLIOGRAPHY : + { + static SfxItemPropertySet aPROPERTY_MAP_BIBLIOGRAPHY(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_BIBLIOGRAPHY; + } + break; + case PROPERTY_MAP_TEXT_DOCUMENT: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_DOCUMENT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_DOCUMENT; + } + break; + case PROPERTY_MAP_LINK_TARGET : + { + static SfxItemPropertySet aPROPERTY_MAP_LINK_TARGET(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_LINK_TARGET; + } + break; + case PROPERTY_MAP_AUTO_TEXT_GROUP : + { + static SfxItemPropertySet aPROPERTY_MAP_AUTO_TEXT_GROUP(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_AUTO_TEXT_GROUP; + } + break; + case PROPERTY_MAP_TEXTPORTION_EXTENSIONS : + { + static SfxItemPropertySet aPROPERTY_MAP_TEXTPORTION_EXTENSIONS(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXTPORTION_EXTENSIONS; + } + break; + case PROPERTY_MAP_FOOTNOTE : + { + static SfxItemPropertySet aPROPERTY_MAP_FOOTNOTE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FOOTNOTE; + } + break; + case PROPERTY_MAP_TEXT_COLUMS : + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_COLUMS(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_COLUMS; + } + break; + case PROPERTY_MAP_PARAGRAPH : + { + static SfxItemPropertySet aPROPERTY_MAP_PARAGRAPH(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_PARAGRAPH; + } + break; + case PROPERTY_MAP_EMBEDDED_OBJECT : + { + static SfxItemPropertySet aPROPERTY_MAP_EMBEDDED_OBJECT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_EMBEDDED_OBJECT; + } + break; + case PROPERTY_MAP_REDLINE : + { + static SfxItemPropertySet aPROPERTY_MAP_REDLINE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_REDLINE; + } + break; + case PROPERTY_MAP_TEXT_DEFAULT : + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_DEFAULT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_DEFAULT; + } + break; + case PROPERTY_MAP_FLDTYP_DATETIME: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DATETIME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DATETIME; + } + break; + case PROPERTY_MAP_FLDTYP_USER: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_USER(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_USER; + } + break; + case PROPERTY_MAP_FLDTYP_SET_EXP: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_SET_EXP(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_SET_EXP; + } + break; + case PROPERTY_MAP_FLDTYP_GET_EXP: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_GET_EXP(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_GET_EXP; + } + break; + case PROPERTY_MAP_FLDTYP_FILE_NAME: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_FILE_NAME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_FILE_NAME; + } + break; + case PROPERTY_MAP_FLDTYP_PAGE_NUM: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_PAGE_NUM(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_PAGE_NUM; + } + break; + case PROPERTY_MAP_FLDTYP_AUTHOR: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_AUTHOR(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_AUTHOR; + } + break; + case PROPERTY_MAP_FLDTYP_CHAPTER: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_CHAPTER(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_CHAPTER; + } + break; + case PROPERTY_MAP_FLDTYP_GET_REFERENCE: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_GET_REFERENCE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_GET_REFERENCE; + } + break; + case PROPERTY_MAP_FLDTYP_CONDITIONED_TEXT: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_CONDITIONED_TEXT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_CONDITIONED_TEXT; + } + break; + case PROPERTY_MAP_FLDTYP_HIDDEN_TEXT: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_HIDDEN_TEXT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_HIDDEN_TEXT; + } + break; + case PROPERTY_MAP_FLDTYP_ANNOTATION : + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_ANNOTATION(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_ANNOTATION; + } + break; + case PROPERTY_MAP_FLDTYP_INPUT: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_INPUT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_INPUT; + } + break; + case PROPERTY_MAP_FLDTYP_MACRO: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_MACRO(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_MACRO; + } + break; + case PROPERTY_MAP_FLDTYP_DDE: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DDE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DDE; + } + break; + case PROPERTY_MAP_FLDTYP_HIDDEN_PARA: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_HIDDEN_PARA(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_HIDDEN_PARA; + } + break; + case PROPERTY_MAP_FLDTYP_DOC_INFO : + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOC_INFO(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOC_INFO; + } + break; + case PROPERTY_MAP_FLDTYP_TEMPLATE_NAME: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_TEMPLATE_NAME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_TEMPLATE_NAME; + } + break; + case PROPERTY_MAP_FLDTYP_USER_EXT : + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_USER_EXT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_USER_EXT; + } + break; + case PROPERTY_MAP_FLDTYP_REF_PAGE_SET: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_REF_PAGE_SET(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_REF_PAGE_SET; + } + break; + case PROPERTY_MAP_FLDTYP_REF_PAGE_GET: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_REF_PAGE_GET(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_REF_PAGE_GET; + } + break; + case PROPERTY_MAP_FLDTYP_JUMP_EDIT: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_JUMP_EDIT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_JUMP_EDIT; + } + break; + case PROPERTY_MAP_FLDTYP_SCRIPT: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_SCRIPT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_SCRIPT; + } + break; + case PROPERTY_MAP_FLDTYP_DATABASE_NEXT_SET: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DATABASE_NEXT_SET(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DATABASE_NEXT_SET; + } + break; + case PROPERTY_MAP_FLDTYP_DATABASE_NUM_SET: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DATABASE_NUM_SET(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DATABASE_NUM_SET; + } + break; + case PROPERTY_MAP_FLDTYP_DATABASE_SET_NUM: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DATABASE_SET_NUM(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DATABASE_SET_NUM; + } + break; + case PROPERTY_MAP_FLDTYP_DATABASE: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DATABASE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DATABASE; + } + break; + case PROPERTY_MAP_FLDTYP_DATABASE_NAME: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DATABASE_NAME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DATABASE_NAME; + } + break; + case PROPERTY_MAP_FLDTYP_DOCSTAT: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCSTAT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCSTAT; + } + break; + case PROPERTY_MAP_FLDTYP_DOCINFO_AUTHOR: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCINFO_AUTHOR(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCINFO_AUTHOR; + } + break; + case PROPERTY_MAP_FLDTYP_DOCINFO_DATE_TIME: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCINFO_DATE_TIME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCINFO_DATE_TIME; + } + break; + case PROPERTY_MAP_FLDTYP_DOCINFO_CHANGE_DATE_TIME: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCINFO_CHANGE_DATE_TIME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCINFO_CHANGE_DATE_TIME; + } + break; + case PROPERTY_MAP_FLDTYP_DOCINFO_CREATE_DATE_TIME: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCINFO_CREATE_DATE_TIME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCINFO_CREATE_DATE_TIME; + } + break; + case PROPERTY_MAP_FLDTYP_DOCINFO_EDIT_TIME: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCINFO_EDIT_TIME(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCINFO_EDIT_TIME; + } + break; + case PROPERTY_MAP_FLDTYP_DOCINFO_MISC : + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCINFO_MISC(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCINFO_MISC; + } + break; + case PROPERTY_MAP_FLDTYP_DOCINFO_REVISION: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCINFO_REVISION(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCINFO_REVISION; + } + break; + case PROPERTY_MAP_FLDTYP_COMBINED_CHARACTERS: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_COMBINED_CHARACTERS(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_COMBINED_CHARACTERS; + } + break; + case PROPERTY_MAP_FLDTYP_DUMMY_0: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DUMMY_0(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DUMMY_0; + } + break; + case PROPERTY_MAP_FLDTYP_TABLE_FORMULA: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_TABLE_FORMULA(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_TABLE_FORMULA; + } + break; + case PROPERTY_MAP_FLDMSTR_USER: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDMSTR_USER(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDMSTR_USER; + } + break; + case PROPERTY_MAP_FLDMSTR_DDE: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDMSTR_DDE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDMSTR_DDE; + } + break; + case PROPERTY_MAP_FLDMSTR_SET_EXP: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDMSTR_SET_EXP(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDMSTR_SET_EXP; + } + break; + case PROPERTY_MAP_FLDMSTR_DATABASE: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDMSTR_DATABASE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDMSTR_DATABASE; + } + break; + case PROPERTY_MAP_FLDMSTR_DUMMY0: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDMSTR_DUMMY0(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDMSTR_DUMMY0; + } + break; + case PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_BIBLIOGRAPHY(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_BIBLIOGRAPHY; + } + break; + case PROPERTY_MAP_FLDMSTR_BIBLIOGRAPHY: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDMSTR_BIBLIOGRAPHY(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDMSTR_BIBLIOGRAPHY; + } + break; + case PROPERTY_MAP_TEXT: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT; + } + break; + case PROPERTY_MAP_REDLINE_PORTION: + { + static SfxItemPropertySet aPROPERTY_MAP_REDLINE_PORTION(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_REDLINE_PORTION; + } + break; + case PROPERTY_MAP_MAILMERGE: + { + static SfxItemPropertySet aPROPERTY_MAP_MAILMERGE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_MAILMERGE; + } + break; + case PROPERTY_MAP_FLDTYP_DROPDOWN: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DROPDOWN(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DROPDOWN; + } + break; + case PROPERTY_MAP_CHART2_DATA_SEQUENCE: + { + static SfxItemPropertySet aPROPERTY_MAP_CHART2_DATA_SEQUENCE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_CHART2_DATA_SEQUENCE; + } + break; + case PROPERTY_MAP_TEXT_VIEW: + { + static SfxItemPropertySet aPROPERTY_MAP_TEXT_VIEW(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_TEXT_VIEW; + } + break; + case PROPERTY_MAP_CONDITIONAL_PARA_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_CONDITIONAL_PARA_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_CONDITIONAL_PARA_STYLE; + } + break; + case PROPERTY_MAP_CHAR_AUTO_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_CHAR_AUTO_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_CHAR_AUTO_STYLE; + } + break; + case PROPERTY_MAP_RUBY_AUTO_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_RUBY_AUTO_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_RUBY_AUTO_STYLE; + } + break; + case PROPERTY_MAP_PARA_AUTO_STYLE: + { + static SfxItemPropertySet aPROPERTY_MAP_PARA_AUTO_STYLE(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_PARA_AUTO_STYLE; + } + break; + case PROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM: + { + static SfxItemPropertySet aPROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM(pEntries); + aPropertySetArr[nPropertyId] = &aPROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM; + } + break; + } + } + return aPropertySetArr[nPropertyId]; +} + /* -----------------04.07.98 11:42------------------- * * --------------------------------------------------*/ @@ -2612,3 +3106,4 @@ sal_Bool SwItemPropertySet::FillItem(SfxItemSet& /*rSet*/, sal_uInt16 /*nWhich*/ }*/ return bRet; } + diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 26248270e5..82c0ec0248 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -492,18 +492,18 @@ void lcl_SetNodeNumStart( SwPaM& rCrsr, uno::Any aValue ) /* -----------------17.09.98 09:44------------------- * * --------------------------------------------------*/ -sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap, +sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertySimpleEntry* pEntry, SwPaM& rPam, SfxItemSet& rItemSet, const uno::Any& aValue ) throw (lang::IllegalArgumentException) { sal_Bool bRet = sal_True; - if(0 ==(pMap->nFlags&PropertyAttribute::MAYBEVOID) && + if(0 == ( pEntry->nFlags&PropertyAttribute::MAYBEVOID ) && aValue.getValueType() == ::getCppuVoidType()) bRet = sal_False; else { - switch(pMap->nWID) + switch(pEntry->nWID) { case RES_TXTATR_CHARFMT: lcl_setCharStyle(rPam.GetDoc(), aValue, rItemSet ); @@ -554,8 +554,8 @@ sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap, SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode(); // --> OD 2008-05-14 #refactorlists# - check on list style not needed // const SwNumRule* pRule = pTxtNd->GetNumRule(); -// if( FN_UNO_NUM_LEVEL == pMap->nWID && pRule != NULL ) - if ( FN_UNO_NUM_LEVEL == pMap->nWID ) +// if( FN_UNO_NUM_LEVEL == pEntry->nWID && pRule != NULL ) + if ( FN_UNO_NUM_LEVEL == pEntry->nWID ) // <-- { sal_Int16 nLevel = 0; @@ -565,14 +565,14 @@ sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap, } // --> OD 2008-07-14 #i91601# - else if( FN_UNO_LIST_ID == pMap->nWID ) + else if( FN_UNO_LIST_ID == pEntry->nWID ) { ::rtl::OUString sListId; aValue >>= sListId; pTxtNd->SetListId( sListId ); } // <-- - else if( FN_UNO_IS_NUMBER == pMap->nWID ) + else if( FN_UNO_IS_NUMBER == pEntry->nWID ) { BOOL bIsNumber = *(sal_Bool*) aValue.getValue(); if(!bIsNumber) @@ -595,7 +595,7 @@ sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap, break; case RES_PARATR_DROP: { - if( MID_DROPCAP_CHAR_STYLE_NAME == pMap->nMemberId) + if( MID_DROPCAP_CHAR_STYLE_NAME == pEntry->nMemberId) { OUString uStyle; if(aValue >>= uStyle) @@ -631,7 +631,7 @@ sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap, } break; case RES_TXTATR_CJK_RUBY: - if(MID_RUBY_CHARSTYLE == pMap->nMemberId ) + if(MID_RUBY_CHARSTYLE == pEntry->nMemberId ) { OUString sTmp; if(aValue >>= sTmp) @@ -662,7 +662,7 @@ sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap, bRet = sal_False; break; case RES_PAGEDESC : - if(MID_PAGEDESC_PAGEDESCNAME == pMap->nMemberId ) + if(MID_PAGEDESC_PAGEDESCNAME == pEntry->nMemberId ) { lcl_setPageDesc(rPam.GetDoc(), aValue, rItemSet); break; @@ -815,7 +815,7 @@ Sequence< OUString > SwXTextCursor::getSupportedServiceNames(void) throw( Runtim SwXTextCursor::SwXTextCursor(uno::Reference< XText > xParent, const SwPosition& rPos, CursorType eSet, SwDoc* pDoc, const SwPosition* pMark) : aLstnrCntnr(( util::XSortable*)this), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), xParentText(xParent), pLastSortOptions(0), eType(eSet), @@ -836,7 +836,7 @@ SwXTextCursor::SwXTextCursor(uno::Reference< XText > xParent, const SwPosition& SwXTextCursor::SwXTextCursor(uno::Reference< XText > xParent, SwUnoCrsr* pSourceCrsr, CursorType eSet) : aLstnrCntnr( (util::XSortable*)this), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), xParentText(xParent), pLastSortOptions(0), eType(eSet), @@ -1797,12 +1797,12 @@ Any SwXTextCursor::GetPropertyValue( throw( UnknownPropertyException, WrappedTargetException, RuntimeException) { Any aAny; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - rPropSet.getPropertyMap(), rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = rPropSet.getPropertyMap()->getByName( + rPropertyName); + if(pEntry) { PropertyState eTemp; - BOOL bDone = SwUnoCursorHelper::getCrsrPropertyValue( pMap, rPaM, &aAny, eTemp ); + BOOL bDone = SwUnoCursorHelper::getCrsrPropertyValue( *pEntry, rPaM, &aAny, eTemp ); if(!bDone) { SfxItemSet aSet(rPaM.GetDoc()->GetAttrPool(), @@ -1812,7 +1812,7 @@ Any SwXTextCursor::GetPropertyValue( 0L); SwXTextCursor::GetCrsrAttr(rPaM, aSet); - aAny = rPropSet.getPropertyValue(*pMap, aSet); + rPropSet.getPropertyValue(*pEntry, aSet, aAny); } } else @@ -1825,23 +1825,22 @@ Any SwXTextCursor::GetPropertyValue( ---------------------------------------------------------------------------*/ void SwXTextCursor::SetPropertyValue( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const OUString& rPropertyName, - const Any& aValue, const SfxItemPropertyMap* _pMap, USHORT nAttrMode) + const Any& aValue, USHORT nAttrMode) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { SwDoc* pDoc = rPaM.GetDoc(); - const SfxItemPropertyMap* pMap = _pMap ? _pMap : SfxItemPropertyMap::GetByName( - rPropSet.getPropertyMap(), rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = rPropSet.getPropertyMap()->getByName(rPropertyName); + if(pEntry) { - if ( pMap->nFlags & PropertyAttribute::READONLY) + if( pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( 0 ) ); - SfxItemSet aItemSet( pDoc->GetAttrPool(), pMap->nWID, pMap->nWID ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); SwXTextCursor::GetCrsrAttr( rPaM, aItemSet ); - if(!lcl_setCrsrPropertyValue( pMap, rPaM, aItemSet, aValue )) - rPropSet.setPropertyValue(*pMap, aValue, aItemSet ); + if(!lcl_setCrsrPropertyValue( pEntry, rPaM, aItemSet, aValue )) + rPropSet.setPropertyValue(*pEntry, aValue, aItemSet ); SwXTextCursor::SetCrsrAttr(rPaM, aItemSet, nAttrMode ); } else @@ -1851,7 +1850,7 @@ void SwXTextCursor::SetPropertyValue( ---------------------------------------------------------------------------*/ Sequence< PropertyState > SwXTextCursor::GetPropertyStates( - SwPaM& rPaM, SfxItemPropertySet& rPropSet, + SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const Sequence< OUString >& PropertyNames, SwGetPropertyStatesCaller eCaller ) throw(UnknownPropertyException, RuntimeException) @@ -1861,47 +1860,52 @@ Sequence< PropertyState > SwXTextCursor::GetPropertyStates( PropertyState* pStates = aRet.getArray(); SfxItemSet *pSet = 0, *pSetParent = 0; - const SfxItemPropertyMap* pSaveMap, *pMap = rPropSet.getPropertyMap(); + const SfxItemPropertyMap *pMap = rPropSet.getPropertyMap(); for( INT32 i = 0, nEnd = PropertyNames.getLength(); i < nEnd; i++ ) { - pSaveMap = pMap; - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[i] ); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[i] ); + if(!pEntry) { if(pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) { pStates[i] = beans::PropertyState_DEFAULT_VALUE; - pMap = pSaveMap; + continue; + } + else if( SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT == eCaller ) + { + //this values marks the element as unknown property + pStates[i] = beans::PropertyState_MAKE_FIXED_SIZE; continue; } else throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( 0 ) ); } - if (eCaller == SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION && - pMap->nWID < FN_UNO_RANGE_BEGIN && - pMap->nWID > FN_UNO_RANGE_END && - pMap->nWID < RES_CHRATR_BEGIN && - pMap->nWID > RES_TXTATR_END ) + if ((eCaller == SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION || eCaller == SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT) && + pEntry->nWID < FN_UNO_RANGE_BEGIN && + pEntry->nWID > FN_UNO_RANGE_END && + pEntry->nWID < RES_CHRATR_BEGIN && + pEntry->nWID > RES_TXTATR_END ) pStates[i] = beans::PropertyState_DEFAULT_VALUE; else { - if ( pMap->nWID >= FN_UNO_RANGE_BEGIN && - pMap->nWID <= FN_UNO_RANGE_END ) - SwUnoCursorHelper::getCrsrPropertyValue(pMap, rPaM, 0, pStates[i] ); + if ( pEntry->nWID >= FN_UNO_RANGE_BEGIN && + pEntry->nWID <= FN_UNO_RANGE_END ) + SwUnoCursorHelper::getCrsrPropertyValue(*pEntry, rPaM, 0, pStates[i] ); else { if( !pSet ) { switch ( eCaller ) { + case SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT: case SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION: pSet = new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_TXTATR_END ); break; case SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY: pSet = new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), - pMap->nWID, pMap->nWID ); + pEntry->nWID, pEntry->nWID ); break; default: pSet = new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), @@ -1916,7 +1920,7 @@ Sequence< PropertyState > SwXTextCursor::GetPropertyStates( } if( pSet->Count() ) - pStates[i] = rPropSet.getPropertyState( *pMap,*pSet ); + pStates[i] = rPropSet.getPropertyState( *pEntry, *pSet ); else pStates[i] = PropertyState_DEFAULT_VALUE; @@ -1932,13 +1936,12 @@ Sequence< PropertyState > SwXTextCursor::GetPropertyStates( } if( (pSetParent)->Count() ) - pStates[i] = rPropSet.getPropertyState( *pMap, *pSetParent ); + pStates[i] = rPropSet.getPropertyState( *pEntry, *pSetParent ); else pStates[i] = PropertyState_DEFAULT_VALUE; } } } - pMap++; } delete pSet; delete pSetParent; @@ -1948,7 +1951,7 @@ Sequence< PropertyState > SwXTextCursor::GetPropertyStates( ---------------------------------------------------------------------------*/ PropertyState SwXTextCursor::GetPropertyState( - SwPaM& rPaM, SfxItemPropertySet& rPropSet, const OUString& rPropertyName) + SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const OUString& rPropertyName) throw(UnknownPropertyException, RuntimeException) { Sequence < OUString > aStrings ( 1 ); @@ -1983,23 +1986,22 @@ void SwXTextCursor::SetPropertyToDefault( { NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex()); SwDoc* pDoc = rPaM.GetDoc(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - rPropSet.getPropertyMap(), rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = rPropSet.getPropertyMap()->getByName( rPropertyName); + if(pEntry) { - if ( pMap->nFlags & PropertyAttribute::READONLY) + if ( pEntry->nFlags & PropertyAttribute::READONLY) throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, 0 ); - if(pMap->nWID < RES_FRMATR_END) + if(pEntry->nWID < RES_FRMATR_END) { SvUShortsSort aWhichIds; - aWhichIds.Insert(pMap->nWID); - if(pMap->nWID < RES_PARATR_BEGIN) + aWhichIds.Insert(pEntry->nWID); + if(pEntry->nWID < RES_PARATR_BEGIN) pDoc->ResetAttrs(rPaM, sal_True, &aWhichIds); else lcl_SelectParaAndReset ( rPaM, pDoc, &aWhichIds ); } else - SwUnoCursorHelper::resetCrsrPropertyValue(pMap, rPaM); + SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, rPaM); } else throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( 0 ) ); @@ -2014,14 +2016,13 @@ Any SwXTextCursor::GetPropertyDefault( { Any aRet; SwDoc* pDoc = rPaM.GetDoc(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - rPropSet.getPropertyMap(), rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = rPropSet.getPropertyMap()->getByName( rPropertyName); + if(pEntry) { - if(pMap->nWID < RES_FRMATR_END) + if(pEntry->nWID < RES_FRMATR_END) { - const SfxPoolItem& rDefItem = pDoc->GetAttrPool().GetDefaultItem(pMap->nWID); - rDefItem.QueryValue(aRet, pMap->nMemberId); + const SfxPoolItem& rDefItem = pDoc->GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(aRet, pEntry->nMemberId); } } else @@ -2036,13 +2037,13 @@ uno::Reference< beans::XPropertySetInfo > SwXTextCursor::getPropertySetInfo(voi static uno::Reference< beans::XPropertySetInfo > xRef; if(!xRef.is()) { - static SfxItemPropertyMap aCrsrExtMap_Impl[] = + static SfxItemPropertyMapEntry aCrsrExtMap_Impl[] = { { SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT), FN_SKIP_HIDDEN_TEXT, &::getBooleanCppuType(), PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT), FN_SKIP_PROTECTED_TEXT, &::getBooleanCppuType(), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - uno::Reference< beans::XPropertySetInfo > xInfo = aPropSet.getPropertySetInfo(); + uno::Reference< beans::XPropertySetInfo > xInfo = m_pPropSet->getPropertySetInfo(); // PropertySetInfo verlaengern! const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties(); xRef = new SfxExtItemPropertySetInfo( @@ -2073,7 +2074,7 @@ void SwXTextCursor::setPropertyValue(const OUString& rPropertyName, const uno::A pUnoCrsr->SetSkipOverProtectSections(bSet); } else - SetPropertyValue(*pUnoCrsr, aPropSet, rPropertyName, aValue); + SetPropertyValue(*pUnoCrsr, *m_pPropSet, rPropertyName, aValue); } else throw uno::RuntimeException(); @@ -2101,7 +2102,7 @@ Any SwXTextCursor::getPropertyValue(const OUString& rPropertyName) aAny.setValue(&bSet, ::getBooleanCppuType()); } else - aAny = GetPropertyValue(*pUnoCrsr, aPropSet, rPropertyName); + aAny = GetPropertyValue(*pUnoCrsr, *m_pPropSet, rPropertyName); } else throw uno::RuntimeException(); @@ -2147,7 +2148,7 @@ beans::PropertyState SwXTextCursor::getPropertyState(const OUString& rPropertyNa SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - eRet = GetPropertyState(*pUnoCrsr, aPropSet, rPropertyName); + eRet = GetPropertyState(*pUnoCrsr, *m_pPropSet, rPropertyName); } else throw RuntimeException(); @@ -2164,7 +2165,7 @@ uno::Sequence< beans::PropertyState > SwXTextCursor::getPropertyStates( SwUnoCrsr* pUnoCrsr = GetCrsr(); if(!pUnoCrsr) throw RuntimeException(); - return GetPropertyStates(*pUnoCrsr, aPropSet, PropertyNames); + return GetPropertyStates(*pUnoCrsr, *m_pPropSet, PropertyNames); } /*-- 05.03.99 11:36:12--------------------------------------------------- @@ -2245,36 +2246,33 @@ void SAL_CALL SwXTextCursor::setPropertiesToDefault( const Sequence< OUString >& if(pUnoCrsr) { SwDoc* pDoc = pUnoCrsr->GetDoc(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMap(), *pSaveMap; const OUString * pNames = aPropertyNames.getConstArray(); SvUShortsSort aWhichIds, aParaWhichIds; for ( sal_Int32 i = 0; i < nCount; i++ ) { - pSaveMap = pMap; - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[i]); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( pNames[i] ); + if(!pEntry) { if(pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) { - pMap = pSaveMap; continue; } else throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( 0 ) ); } - if ( pMap->nFlags & PropertyAttribute::READONLY) + if( pEntry->nFlags & PropertyAttribute::READONLY) throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertiesToDefault: property is read-only: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( this ) ); - if( pMap->nWID < RES_FRMATR_END) + if( pEntry->nWID < RES_FRMATR_END) { - if(pMap->nWID < RES_PARATR_BEGIN) - aWhichIds.Insert(pMap->nWID); + if(pEntry->nWID < RES_PARATR_BEGIN) + aWhichIds.Insert(pEntry->nWID); else - aParaWhichIds.Insert (pMap->nWID); + aParaWhichIds.Insert (pEntry->nWID); } - else if ( pMap->nWID == FN_UNO_NUM_START_VALUE ) - SwUnoCursorHelper::resetCrsrPropertyValue(pMap, *pUnoCrsr); + else if ( pEntry->nWID == FN_UNO_NUM_START_VALUE ) + SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, *pUnoCrsr); } if ( aParaWhichIds.Count() ) @@ -2298,28 +2296,25 @@ Sequence< Any > SAL_CALL SwXTextCursor::getPropertyDefaults( const Sequence< OUS if (pUnoCrsr) { SwDoc* pDoc = pUnoCrsr->GetDoc(); - const SfxItemPropertyMap *pSaveMap, *pMap = aPropSet.getPropertyMap(); const OUString *pNames = aPropertyNames.getConstArray(); Any *pAny = aRet.getArray(); for ( sal_Int32 i = 0; i < nCount; i++) { - pSaveMap = pMap; - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[i]); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( pNames[i] ); + if(!pEntry) { if(pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) { - pMap = pSaveMap; continue; } else throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( 0 ) ); } - if(pMap->nWID < RES_FRMATR_END) + if(pEntry->nWID < RES_FRMATR_END) { - const SfxPoolItem& rDefItem = pDoc->GetAttrPool().GetDefaultItem(pMap->nWID); - rDefItem.QueryValue(pAny[i], pMap->nMemberId); + const SfxPoolItem& rDefItem = pDoc->GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(pAny[i], pEntry->nMemberId); } } } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 70a8cece94..9de323b5d1 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1176,7 +1176,7 @@ SwXTextRange::SwXTextRange(SwPaM& rPam, const uno::Reference< XText > & rxParent pBox(0), pBoxStartNode(0), aObjectDepend(this, 0), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), xParentText(rxParent), pMark(NULL) { @@ -1190,7 +1190,7 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rFmt, SwPaM& rPam) : pBox(0), pBoxStartNode(0), aObjectDepend(this, &rFmt), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), pMark(NULL) { //Bookmark an der anlegen @@ -1203,7 +1203,7 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt, SwTableBox& rTblBox, SwPaM& rPam) pBox(&rTblBox), pBoxStartNode(0), aObjectDepend(this, &rTblFmt), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), pMark(NULL) { //Bookmark an der anlegen @@ -1216,7 +1216,7 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt, const SwStartNode& rStartNode, SwP pBox(0), pBoxStartNode(&rStartNode), aObjectDepend(this, &rTblFmt), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), pMark(NULL) { //Bookmark an der anlegen @@ -1229,9 +1229,10 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) : pBox(0), pBoxStartNode(0), aObjectDepend(this, &rTblFmt), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), pMark(NULL) -{ } +{ +} SwXTextRange::~SwXTextRange() { @@ -1731,8 +1732,7 @@ Sequence< OUString > SAL_CALL SwXTextRange::getAvailableServiceNames(void) throw uno::Reference< XPropertySetInfo > SAL_CALL SwXTextRange::getPropertySetInfo( ) throw(RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - static uno::Reference< XPropertySetInfo > xRef = - aPropSet.getPropertySetInfo(); + static uno::Reference< XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } @@ -1746,7 +1746,7 @@ void SAL_CALL SwXTextRange::setPropertyValue( throw RuntimeException(); SwPaM aPaM(GetDoc()->GetNodes()); SwXTextRange::GetPositions(aPaM); - SwXTextCursor::SetPropertyValue(aPaM, aPropSet, rPropertyName, rValue); + SwXTextCursor::SetPropertyValue(aPaM, *m_pPropSet, rPropertyName, rValue); } Any SAL_CALL SwXTextRange::getPropertyValue( const OUString& rPropertyName ) @@ -1757,7 +1757,7 @@ Any SAL_CALL SwXTextRange::getPropertyValue( const OUString& rPropertyName ) throw RuntimeException(); SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); SwXTextRange::GetPositions(aPaM); - return SwXTextCursor::GetPropertyValue(aPaM, aPropSet, rPropertyName); + return SwXTextCursor::GetPropertyValue(aPaM, *m_pPropSet, rPropertyName); } void SAL_CALL SwXTextRange::addPropertyChangeListener( @@ -1796,7 +1796,7 @@ PropertyState SAL_CALL SwXTextRange::getPropertyState( const OUString& rProperty throw RuntimeException(); SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); SwXTextRange::GetPositions(aPaM); - return SwXTextCursor::GetPropertyState(aPaM, aPropSet, rPropertyName); + return SwXTextCursor::GetPropertyState(aPaM, *m_pPropSet, rPropertyName); } Sequence< PropertyState > SAL_CALL SwXTextRange::getPropertyStates( @@ -1807,7 +1807,7 @@ Sequence< PropertyState > SAL_CALL SwXTextRange::getPropertyStates( throw RuntimeException(); SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); SwXTextRange::GetPositions(aPaM); - return SwXTextCursor::GetPropertyStates(aPaM, aPropSet, rPropertyName); + return SwXTextCursor::GetPropertyStates(aPaM, *m_pPropSet, rPropertyName); } void SAL_CALL SwXTextRange::setPropertyToDefault( const OUString& rPropertyName ) @@ -1818,7 +1818,7 @@ void SAL_CALL SwXTextRange::setPropertyToDefault( const OUString& rPropertyName throw RuntimeException(); SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); SwXTextRange::GetPositions(aPaM); - SwXTextCursor::SetPropertyToDefault(aPaM, aPropSet, rPropertyName); + SwXTextCursor::SetPropertyToDefault(aPaM, *m_pPropSet, rPropertyName); } Any SAL_CALL SwXTextRange::getPropertyDefault( const OUString& rPropertyName ) @@ -1829,7 +1829,7 @@ Any SAL_CALL SwXTextRange::getPropertyDefault( const OUString& rPropertyName ) throw RuntimeException(); SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); SwXTextRange::GetPositions(aPaM); - return SwXTextCursor::GetPropertyDefault(aPaM, aPropSet, rPropertyName); + return SwXTextCursor::GetPropertyDefault(aPaM, *m_pPropSet, rPropertyName); } void SwXTextRange::makeRedline( diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 97e2e8a94f..4d6a86f6fb 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -50,15 +50,9 @@ #define _SVSTDARR_USHORTSSORT #include <svtools/svstdarr.hxx> -//#ifndef _COM_SUN_STAR_BEANS_SETPROPERTYTOLERANTFAILED_HPP_ -//#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp> -//#endif -//#ifndef _COM_SUN_STAR_BEANS_GETPROPERTYTOLERANTRESULT_HPP_ -//#include <com/sun/star/beans/GetPropertyTolerantResult.hpp> -//#endif -//#ifndef _COM_SUN_STAR_BEANS_TOLERANTPROPERTYSETRESULTTYPE_HPP_ -//#include <com/sun/star/beans/TolerantPropertySetResultType.hpp> -//#endif +#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp> +#include <com/sun/star/beans/GetPropertyTolerantResult.hpp> +#include <com/sun/star/beans/TolerantPropertySetResultType.hpp> #ifndef _COM_SUN_STAR_BEANS_PropertyAttribute_HPP_ #include <com/sun/star/beans/PropertyAttribute.hpp> #endif @@ -75,7 +69,7 @@ using ::rtl::OUString; beans::PropertyState lcl_SwXParagraph_getPropertyState( SwUnoCrsr& rUnoCrsr, const SwAttrSet** ppSet, - const SfxItemPropertyMap& rMap, + const SfxItemPropertySimpleEntry& rEntry, sal_Bool &rAttrSetFetched ) throw( beans::UnknownPropertyException); @@ -160,7 +154,7 @@ uno::Sequence< OUString > SwXParagraph::getSupportedServiceNames(void) throw( un SwXParagraph::SwXParagraph() : xParentText(0), aLstnrCntnr( (text::XTextRange*)this), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARAGRAPH)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH)), nSelectionStartPos(-1), nSelectionEndPos(-1), m_bIsDescriptor(TRUE) @@ -174,7 +168,7 @@ SwXParagraph::SwXParagraph(SwXText* pParent, SwUnoCrsr* pCrsr, sal_Int32 nSelSta SwClient(pCrsr), xParentText(pParent), aLstnrCntnr( (text::XTextRange*)this), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARAGRAPH)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH)), nSelectionStartPos(nSelStart), nSelectionEndPos(nSelEnd), m_bIsDescriptor(FALSE) @@ -215,7 +209,7 @@ void SwXParagraph::attachToText(SwXText* pParent, SwUnoCrsr* pCrsr) uno::Reference< beans::XPropertySetInfo > SwXParagraph::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } /*-- 11.12.98 08:12:49--------------------------------------------------- @@ -258,22 +252,21 @@ void SAL_CALL SwXParagraph::SetPropertyValues_Impl( { const OUString* pPropertyNames = rPropertyNames.getConstArray(); const uno::Any* pValues = rValues.getConstArray(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMap(); + const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); OUString sTmp; SwParaSelection aParaSel(pUnoCrsr); for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) { - pMap = SfxItemPropertyMap::GetByName(pMap, pPropertyNames[nProp]); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pPropertyNames[nProp] ); + if(!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); else { - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - SwXTextCursor::SetPropertyValue(*pUnoCrsr, aPropSet, - sTmp, pValues[nProp], pMap); - pMap++; + SwXTextCursor::SetPropertyValue(*pUnoCrsr, *m_pPropSet, + sTmp, pValues[nProp]); } } } @@ -316,25 +309,24 @@ uno::Sequence< uno::Any > SAL_CALL SwXParagraph::GetPropertyValues_Impl( { uno::Any* pValues = aValues.getArray(); const OUString* pPropertyNames = rPropertyNames.getConstArray(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMap(); + const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); SwNode& rTxtNode = pUnoCrsr->GetPoint()->nNode.GetNode(); const SwAttrSet& rAttrSet = ((SwTxtNode&)rTxtNode).GetSwAttrSet(); for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) { - pMap = SfxItemPropertyMap::GetByName(pMap, pPropertyNames[nProp]); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pPropertyNames[nProp] ); + if(pEntry) { if(!SwXParagraph::getDefaultTextContentValue( - pValues[nProp], pPropertyNames[nProp], pMap->nWID)) + pValues[nProp], pPropertyNames[nProp], pEntry->nWID)) { BOOL bDone = FALSE; beans::PropertyState eTemp; bDone = SwUnoCursorHelper::getCrsrPropertyValue( - pMap, *pUnoCrsr, &(pValues[nProp]), eTemp, rTxtNode.GetTxtNode() ); + *pEntry, *pUnoCrsr, &(pValues[nProp]), eTemp, rTxtNode.GetTxtNode() ); if(!bDone) - pValues[nProp] = aPropSet.getPropertyValue(*pMap, rAttrSet); + m_pPropSet->getPropertyValue(*pEntry, rAttrSet, pValues[nProp]); } - ++pMap; } else throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); @@ -397,9 +389,9 @@ void SwXParagraph::firePropertiesChangeEvent( ---------------------------------------------------------------------------*/ -/* disabled for #i46921# +/* disabled for #i46921# */ -uno::Sequence< SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setPropertyValuesTolerant( +uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames, const uno::Sequence< uno::Any >& rValues ) throw (lang::IllegalArgumentException, uno::RuntimeException) @@ -412,22 +404,22 @@ uno::Sequence< SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setPropertyVal if(!pUnoCrsr) throw uno::RuntimeException(); - SwNode& rTxtNode = pUnoCrsr->GetPoint()->nNode.GetNode(); - SwAttrSet& rAttrSet = ((SwTxtNode&)rTxtNode).GetSwAttrSet(); - USHORT nAttrCount = rAttrSet.Count(); + //SwNode& rTxtNode = pUnoCrsr->GetPoint()->nNode.GetNode(); + //const SwAttrSet& rAttrSet = ((SwTxtNode&)rTxtNode).GetSwAttrSet(); + //USHORT nAttrCount = rAttrSet.Count(); sal_Int32 nProps = rPropertyNames.getLength(); const OUString *pProp = rPropertyNames.getConstArray(); - sal_Int32 nVals = rValues.getLength(); + //sal_Int32 nVals = rValues.getLength(); const uno::Any *pValue = rValues.getConstArray(); sal_Int32 nFailed = 0; - uno::Sequence< SetPropertyTolerantFailed > aFailed( nProps ); - SetPropertyTolerantFailed *pFailed = aFailed.getArray(); + uno::Sequence< beans::SetPropertyTolerantFailed > aFailed( nProps ); + beans::SetPropertyTolerantFailed *pFailed = aFailed.getArray(); // get entry to start with - const SfxItemPropertyMap* pStartEntry = aPropSet.getPropertyMap(); + const SfxItemPropertyMap* pPropMap = m_pPropSet->getPropertyMap(); OUString sTmp; SwParaSelection aParaSel( pUnoCrsr ); @@ -435,46 +427,41 @@ uno::Sequence< SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setPropertyVal { try { - pFailed[ nFailed ].Name = pProp[i]; + pFailed[ nFailed ].Name = pProp[i]; - const SfxItemPropertyMap* pEntry = - SfxItemPropertyMap::GetByName( pStartEntry, pProp[i] ); + const SfxItemPropertySimpleEntry* pEntry = pPropMap->getByName( pProp[i] ); if (!pEntry) - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::UNKNOWN_PROPERTY; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; else { // set property value // (compare to SwXParagraph::setPropertyValues) if (pEntry->nFlags & beans::PropertyAttribute::READONLY) - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::PROPERTY_VETO; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; else { SwXTextCursor::SetPropertyValue( - *pUnoCrsr, aPropSet, sTmp, pValue[i], pEntry ); + *pUnoCrsr, *m_pPropSet, pProp[i], pValue[i] ); } - - // continue with search for next property after current entry - // (property map and sequence of property names are sorted!) - pStartEntry = ++pEntry; } } catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before DBG_ERROR( "unexpected exception catched" ); - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::UNKNOWN_PROPERTY; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) { - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::ILLEGAL_ARGUMENT; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT; } catch (beans::PropertyVetoException &) { - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::PROPERTY_VETO; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; } catch (lang::WrappedTargetException &) { - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::WRAPPED_TARGET; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::WRAPPED_TARGET; } } @@ -483,27 +470,27 @@ uno::Sequence< SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setPropertyVal } -uno::Sequence< GetPropertyTolerantResult > SAL_CALL SwXParagraph::getPropertyValuesTolerant( +uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL SwXParagraph::getPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames ) throw (uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - uno::Sequence< GetDirectPropertyTolerantResult > aTmpRes( + uno::Sequence< beans::GetDirectPropertyTolerantResult > aTmpRes( GetPropertyValuesTolerant_Impl( rPropertyNames, sal_False ) ); - const GetDirectPropertyTolerantResult *pTmpRes = aTmpRes.getConstArray(); + const beans::GetDirectPropertyTolerantResult *pTmpRes = aTmpRes.getConstArray(); // copy temporary result to final result type sal_Int32 nLen = aTmpRes.getLength(); - uno::Sequence< GetPropertyTolerantResult > aRes( nLen ); - GetPropertyTolerantResult *pRes = aRes.getArray(); + uno::Sequence< beans::GetPropertyTolerantResult > aRes( nLen ); + beans::GetPropertyTolerantResult *pRes = aRes.getArray(); for (sal_Int32 i = 0; i < nLen; i++) *pRes++ = *pTmpRes++; return aRes; } -uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::getDirectPropertyValuesTolerant( +uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::getDirectPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames ) throw (uno::RuntimeException) { @@ -512,7 +499,7 @@ uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::getDirec } -uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::GetPropertyValuesTolerant_Impl( +uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::GetPropertyValuesTolerant_Impl( const uno::Sequence< OUString >& rPropertyNames, sal_Bool bDirectValuesOnly ) throw (uno::RuntimeException) @@ -521,7 +508,7 @@ uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::GetPrope SwUnoCrsr* pUnoCrsr = ((SwXParagraph*)this)->GetCrsr(); if (!pUnoCrsr) - throw RuntimeException(); + throw uno::RuntimeException(); SwTxtNode* pTxtNode = pUnoCrsr->GetPoint()->nNode.GetNode().GetTxtNode(); DBG_ASSERT( pTxtNode != NULL, "need text node" ); @@ -534,40 +521,39 @@ uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::GetPrope sal_Int32 nProps = rPropertyNames.getLength(); const OUString *pProp = rPropertyNames.getConstArray(); - uno::Sequence< GetDirectPropertyTolerantResult > aResult( nProps ); - GetDirectPropertyTolerantResult *pResult = aResult.getArray(); + uno::Sequence< beans::GetDirectPropertyTolerantResult > aResult( nProps ); + beans::GetDirectPropertyTolerantResult *pResult = aResult.getArray(); sal_Int32 nIdx = 0; // get entry to start with - const SfxItemPropertyMap *pStartEntry = aPropSet.getPropertyMap(); + const SfxItemPropertyMap *pPropMap = m_pPropSet->getPropertyMap(); for (sal_Int32 i = 0; i < nProps; ++i) { DBG_ASSERT( nIdx < nProps, "index out ouf bounds" ); - GetDirectPropertyTolerantResult &rResult = pResult[nIdx]; + beans::GetDirectPropertyTolerantResult &rResult = pResult[nIdx]; try { rResult.Name = pProp[i]; - const SfxItemPropertyMap *pEntry = - SfxItemPropertyMap::GetByName( pStartEntry, pProp[i] ); + const SfxItemPropertySimpleEntry* pEntry = pPropMap->getByName( pProp[i] ); if (!pEntry) // property available? - rResult.Result = TolerantPropertySetResultType::UNKNOWN_PROPERTY; + rResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; else { // get property state // (compare to SwXParagraph::getPropertyState) sal_Bool bAttrSetFetched = sal_True; - PropertyState eState = lcl_SwXParagraph_getPropertyState( + beans::PropertyState eState = lcl_SwXParagraph_getPropertyState( *pUnoCrsr, &pAttrSet, *pEntry, bAttrSetFetched ); rResult.State = eState; // if (bDirectValuesOnly && PropertyState_DIRECT_VALUE != eState) -// rResult.Result = TolerantPropertySetResultType::NO_DIRECT_VALUE; +// rResult.Result = beans::TolerantPropertySetResultType::NO_DIRECT_VALUE; // else - rResult.Result = TolerantPropertySetResultType::UNKNOWN_FAILURE; - if (!bDirectValuesOnly || PropertyState_DIRECT_VALUE == eState) + rResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_FAILURE; + if (!bDirectValuesOnly || beans::PropertyState_DIRECT_VALUE == eState) { // get property value // (compare to SwXParagraph::getPropertyValue(s)) @@ -578,46 +564,43 @@ uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::GetPrope // handle properties that are not part of the attribute // and thus only pretendend to be paragraph attributes BOOL bDone = FALSE; - PropertyState eTemp; + beans::PropertyState eTemp; bDone = SwUnoCursorHelper::getCrsrPropertyValue( - pEntry, *pUnoCrsr, &aValue, eTemp, pTxtNode ); + *pEntry, *pUnoCrsr, &aValue, eTemp, pTxtNode ); // if not found try the real paragraph attributes... if (!bDone) - aValue = aPropSet.getPropertyValue( *pEntry, rValueAttrSet ); + m_pPropSet->getPropertyValue( *pEntry, rValueAttrSet, aValue ); } rResult.Value = aValue; - rResult.Result = TolerantPropertySetResultType::SUCCESS; + rResult.Result = beans::TolerantPropertySetResultType::SUCCESS; nIdx++; } // this assertion should never occur! - DBG_ASSERT( nIdx < 1 || pResult[nIdx - 1].Result != TolerantPropertySetResultType::UNKNOWN_FAILURE, + DBG_ASSERT( nIdx < 1 || pResult[nIdx - 1].Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE, "unknown failure while retrieving property" ); - // continue with search for next property after current entry - // (property map and sequence of property names are sorted!) - pStartEntry = ++pEntry; } } catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before - DBG_ERROR( "unexpected exception catched" ); - rResult.Result = TolerantPropertySetResultType::UNKNOWN_PROPERTY; + DBG_ERROR( "unexpected exception caught" ); + rResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) { - rResult.Result = TolerantPropertySetResultType::ILLEGAL_ARGUMENT; + rResult.Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT; } catch (beans::PropertyVetoException &) { - rResult.Result = TolerantPropertySetResultType::PROPERTY_VETO; + rResult.Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; } catch (lang::WrappedTargetException &) { - rResult.Result = TolerantPropertySetResultType::WRAPPED_TARGET; + rResult.Result = beans::TolerantPropertySetResultType::WRAPPED_TARGET; } } @@ -627,9 +610,6 @@ uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::GetPrope return aResult; } - -*/ - /* -----------------------------12.09.00 11:09-------------------------------- ---------------------------------------------------------------------------*/ @@ -699,7 +679,7 @@ void SwXParagraph::removeVetoableChangeListener(const OUString& /*PropertyName*/ beans::PropertyState lcl_SwXParagraph_getPropertyState( SwUnoCrsr& rUnoCrsr, const SwAttrSet** ppSet, - const SfxItemPropertyMap& rMap, + const SfxItemPropertySimpleEntry& rEntry, sal_Bool &rAttrSetFetched ) throw( beans::UnknownPropertyException) { @@ -711,7 +691,7 @@ beans::PropertyState lcl_SwXParagraph_getPropertyState( (*ppSet) = ((SwTxtNode&)rTxtNode).GetpSwAttrSet(); rAttrSetFetched = sal_True; } - switch( rMap.nWID ) + switch( rEntry.nWID ) { case FN_UNO_NUM_RULES: //wenn eine Numerierung gesetzt ist, dann hier herausreichen, sonst nichts tun @@ -720,18 +700,18 @@ beans::PropertyState lcl_SwXParagraph_getPropertyState( case FN_UNO_ANCHOR_TYPES: break; case RES_ANCHOR: - if ( MID_SURROUND_SURROUNDTYPE != rMap.nMemberId ) + if ( MID_SURROUND_SURROUNDTYPE != rEntry.nMemberId ) goto lcl_SwXParagraph_getPropertyStateDEFAULT; break; case RES_SURROUND: - if ( MID_ANCHOR_ANCHORTYPE != rMap.nMemberId ) + if ( MID_ANCHOR_ANCHORTYPE != rEntry.nMemberId ) goto lcl_SwXParagraph_getPropertyStateDEFAULT; break; case FN_UNO_PARA_STYLE: case FN_UNO_PARA_CONDITIONAL_STYLE_NAME: { SwFmtColl* pFmt = SwXTextCursor::GetCurTxtFmtColl( - rUnoCrsr, rMap.nWID == FN_UNO_PARA_CONDITIONAL_STYLE_NAME); + rUnoCrsr, rEntry.nWID == FN_UNO_PARA_CONDITIONAL_STYLE_NAME); eRet = pFmt ? beans::PropertyState_DIRECT_VALUE : beans::PropertyState_AMBIGUOUS_VALUE; } @@ -746,7 +726,7 @@ beans::PropertyState lcl_SwXParagraph_getPropertyState( break; lcl_SwXParagraph_getPropertyStateDEFAULT: default: - if((*ppSet) && SFX_ITEM_SET == (*ppSet)->GetItemState(rMap.nWID, FALSE)) + if((*ppSet) && SFX_ITEM_SET == (*ppSet)->GetItemState(rEntry.nWID, FALSE)) eRet = beans::PropertyState_DIRECT_VALUE; break; } @@ -765,12 +745,11 @@ beans::PropertyState SwXParagraph::getPropertyState(const OUString& rPropertyNam if( pUnoCrsr ) { const SwAttrSet* pSet = 0; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName ); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if(!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); sal_Bool bDummy = sal_False; - eRet = lcl_SwXParagraph_getPropertyState( *pUnoCrsr, &pSet, *pMap, + eRet = lcl_SwXParagraph_getPropertyState( *pUnoCrsr, &pSet, *pEntry, bDummy ); } else @@ -791,22 +770,22 @@ uno::Sequence< beans::PropertyState > SwXParagraph::getPropertyStates( beans::PropertyState* pStates = aRet.getArray(); SwUnoCrsr* pUnoCrsr = ((SwXParagraph*)this)->GetCrsr(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMap(); + const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); if( pUnoCrsr ) { const SwAttrSet* pSet = 0; sal_Bool bAttrSetFetched = sal_False; - for(sal_Int32 i = 0, nEnd = PropertyNames.getLength(); i < nEnd; i++,++pStates,++pMap,++pNames ) + for(sal_Int32 i = 0, nEnd = PropertyNames.getLength(); i < nEnd; i++,++pStates,++pNames ) { - pMap = SfxItemPropertyMap::GetByName( pMap, *pNames ); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( *pNames ); + if(!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + *pNames, static_cast < cppu::OWeakObject * > ( this ) ); if (bAttrSetFetched && !pSet && - pMap->nWID >= RES_CHRATR_BEGIN && - pMap->nWID <= RES_UNKNOWNATR_END ) + pEntry->nWID >= RES_CHRATR_BEGIN && + pEntry->nWID <= RES_UNKNOWNATR_END ) *pStates = beans::PropertyState_DEFAULT_VALUE; else - *pStates = lcl_SwXParagraph_getPropertyState( *pUnoCrsr, &pSet,*pMap, bAttrSetFetched ); + *pStates = lcl_SwXParagraph_getPropertyState( *pUnoCrsr, &pSet,*pEntry, bAttrSetFetched ); } } else @@ -831,18 +810,17 @@ void SwXParagraph::setPropertyToDefault(const OUString& rPropertyName) // Absatz selektieren SwParaSelection aParaSel(pUnoCrsr); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw uno::RuntimeException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only:" ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if(pMap->nWID < RES_FRMATR_END) + if(pEntry->nWID < RES_FRMATR_END) { SvUShortsSort aWhichIds; - aWhichIds.Insert(pMap->nWID); - if(pMap->nWID < RES_PARATR_BEGIN) + aWhichIds.Insert(pEntry->nWID); + if(pEntry->nWID < RES_PARATR_BEGIN) pUnoCrsr->GetDoc()->ResetAttrs(*pUnoCrsr, sal_True, &aWhichIds); else { @@ -868,7 +846,7 @@ void SwXParagraph::setPropertyToDefault(const OUString& rPropertyName) } } else - SwUnoCursorHelper::resetCrsrPropertyValue(pMap, *pUnoCrsr); + SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, *pUnoCrsr); } else throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); @@ -889,15 +867,14 @@ uno::Any SwXParagraph::getPropertyDefault(const OUString& rPropertyName) if(SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) return aRet; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { - if(pMap->nWID < RES_FRMATR_END) + if(pEntry->nWID < RES_FRMATR_END) { const SfxPoolItem& rDefItem = - pUnoCrsr->GetDoc()->GetAttrPool().GetDefaultItem(pMap->nWID); - rDefItem.QueryValue(aRet, pMap->nMemberId); + pUnoCrsr->GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(aRet, pEntry->nMemberId); } } else diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index f784eb58dd..79af6fd8cf 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -51,15 +51,9 @@ #include <fmtflcnt.hxx> #include <fmtfld.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> -//#ifndef _COM_SUN_STAR_BEANS_SETPROPERTYTOLERANTFAILED_HPP_ -//#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp> -//#endif -//#ifndef _COM_SUN_STAR_BEANS_GETPROPERTYTOLERANTRESULT_HPP_ -//#include <com/sun/star/beans/GetPropertyTolerantResult.hpp> -//#endif -//#ifndef _COM_SUN_STAR_BEANS_TOLERANTPROPERTYSETRESULTTYPE_HPP_ -//#include <com/sun/star/beans/TolerantPropertySetResultType.hpp> -//#endif +#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp> +#include <com/sun/star/beans/GetPropertyTolerantResult.hpp> +#include <com/sun/star/beans/TolerantPropertySetResultType.hpp> using namespace ::com::sun::star; using ::rtl::OUString; @@ -95,7 +89,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr, uno::Reference< text::XText > & rParent, SwTextPortionType eType) : aLstnrCntnr( (text::XTextRange*)this), - aPropSet(aSwMapProvider.GetPropertyMap( + m_pPropSet(aSwMapProvider.GetPropertySet( (PORTION_REDLINE_START == eType || PORTION_REDLINE_END == eType) ? PROPERTY_MAP_REDLINE_PORTION : PROPERTY_MAP_TEXTPORTION_EXTENSIONS)), @@ -130,7 +124,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr, SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr, uno::Reference< text::XText > & rParent, SwFrmFmt& rFmt ) : aLstnrCntnr( (text::XTextRange*)this), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXTPORTION_EXTENSIONS)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXTPORTION_EXTENSIONS)), xParentText(rParent), pRubyText(0), pRubyStyle(0), @@ -250,12 +244,12 @@ uno::Reference< beans::XPropertySetInfo > SwXTextPortion::getPropertySetInfo(vo { //! PropertySetInfo for text portion extensions static uno::Reference< beans::XPropertySetInfo > - xTxtPorExtRef = SfxItemPropertySet( aSwMapProvider.GetPropertyMap( - PROPERTY_MAP_TEXTPORTION_EXTENSIONS) ).getPropertySetInfo(); + xTxtPorExtRef = aSwMapProvider.GetPropertySet( + PROPERTY_MAP_TEXTPORTION_EXTENSIONS)->getPropertySetInfo(); //! PropertySetInfo for redline portions static uno::Reference< beans::XPropertySetInfo > - xRedlPorRef = SfxItemPropertySet( aSwMapProvider.GetPropertyMap( - PROPERTY_MAP_REDLINE_PORTION) ).getPropertySetInfo(); + xRedlPorRef = aSwMapProvider.GetPropertySet( + PROPERTY_MAP_REDLINE_PORTION)->getPropertySetInfo(); return (PORTION_REDLINE_START == ePortionType || PORTION_REDLINE_END == ePortionType) ? xRedlPorRef : xTxtPorExtRef; @@ -272,7 +266,7 @@ void SwXTextPortion::setPropertyValue(const OUString& rPropertyName, SwUnoCrsr* pUnoCrsr = ((SwXTextPortion*)this)->GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SetPropertyValue(*pUnoCrsr, aPropSet, rPropertyName, aValue); + SwXTextCursor::SetPropertyValue(*pUnoCrsr, *m_pPropSet, rPropertyName, aValue); } else throw uno::RuntimeException(); @@ -282,16 +276,16 @@ void SwXTextPortion::setPropertyValue(const OUString& rPropertyName, -----------------------------------------------------------------------*/ void SwXTextPortion::GetPropertyValue( uno::Any &rVal, - const SfxItemPropertyMap *pEntry, + const SfxItemPropertySimpleEntry& rEntry, SwUnoCrsr *pUnoCrsr, SfxItemSet *&pSet ) { DBG_ASSERT( pUnoCrsr, "UNO cursor missing" ); if (!pUnoCrsr) return; - if (pEntry && pUnoCrsr) + if(pUnoCrsr) { - switch(pEntry->nWID) + switch(rEntry.nWID) { case FN_UNO_TEXT_PORTION_TYPE: { @@ -400,7 +394,7 @@ void SwXTextPortion::GetPropertyValue( case RES_TXTATR_CJK_RUBY: { uno::Any* pToSet = 0; - switch(pEntry->nMemberId) + switch(rEntry.nMemberId) { case MID_RUBY_TEXT : pToSet = pRubyText; break; case MID_RUBY_ADJUST : pToSet = pRubyAdjust; break; @@ -414,7 +408,7 @@ void SwXTextPortion::GetPropertyValue( default: beans::PropertyState eTemp; BOOL bDone = SwUnoCursorHelper::getCrsrPropertyValue( - pEntry, *pUnoCrsr, &(rVal), eTemp ); + rEntry, *pUnoCrsr, &(rVal), eTemp ); if(!bDone) { if(!pSet) @@ -426,7 +420,7 @@ void SwXTextPortion::GetPropertyValue( 0L); SwXTextCursor::GetCrsrAttr(*pUnoCrsr, *pSet); } - rVal = aPropSet.getPropertyValue(*pEntry, *pSet); + m_pPropSet->getPropertyValue(rEntry, *pSet, rVal); } } } @@ -447,14 +441,13 @@ uno::Sequence< uno::Any > SAL_CALL SwXTextPortion::GetPropertyValues_Impl( SfxItemSet *pSet = 0; // get startting pount fo the look-up, either the provided one or else // from the beginning of the map - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMap(); + const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); for(sal_Int32 nProp = 0; nProp < nLength; nProp++) { - pMap = SfxItemPropertyMap::GetByName(pMap, pPropertyNames[nProp]); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(pPropertyNames[nProp]); + if(pEntry) { - GetPropertyValue( pValues[nProp], pMap, pUnoCrsr, pSet ); - pMap++; + GetPropertyValue( pValues[nProp], *pEntry, pUnoCrsr, pSet ); } else throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); @@ -491,17 +484,16 @@ void SAL_CALL SwXTextPortion::SetPropertyValues_Impl( { const OUString* pPropertyNames = rPropertyNames.getConstArray(); const uno::Any* pValues = rValues.getConstArray(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMap(); - OUString sTmp; + const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) { - pMap = SfxItemPropertyMap::GetByName(pMap, pPropertyNames[nProp]); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(pPropertyNames[nProp]); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - SwXTextCursor::SetPropertyValue( *pUnoCrsr, aPropSet, sTmp, pValues[nProp], pMap); + SwXTextCursor::SetPropertyValue( *pUnoCrsr, *m_pPropSet, pPropertyNames[nProp], pValues[nProp]); } } else @@ -560,9 +552,9 @@ uno::Sequence< uno::Any > SwXTextPortion::getPropertyValues( ---------------------------------------------------------------------------*/ -/* disabled for #i46921# +/* disabled for #i46921# */ -uno::Sequence< SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPropertyValuesTolerant( +uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames, const uno::Sequence< uno::Any >& rValues ) throw (lang::IllegalArgumentException, uno::RuntimeException) @@ -578,15 +570,14 @@ uno::Sequence< SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPropertyV sal_Int32 nProps = rPropertyNames.getLength(); const OUString *pProp = rPropertyNames.getConstArray(); - sal_Int32 nVals = rValues.getLength(); + //sal_Int32 nVals = rValues.getLength(); const uno::Any *pValue = rValues.getConstArray(); sal_Int32 nFailed = 0; - uno::Sequence< SetPropertyTolerantFailed > aFailed( nProps ); - SetPropertyTolerantFailed *pFailed = aFailed.getArray(); + uno::Sequence< beans::SetPropertyTolerantFailed > aFailed( nProps ); + beans::SetPropertyTolerantFailed *pFailed = aFailed.getArray(); - // get entry to start with - const SfxItemPropertyMap* pStartEntry = aPropSet.getPropertyMap(); + const SfxItemPropertyMap* pPropMap = m_pPropSet->getPropertyMap(); OUString sTmp; for (sal_Int32 i = 0; i < nProps; ++i) @@ -595,44 +586,39 @@ uno::Sequence< SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPropertyV { pFailed[ nFailed ].Name = pProp[i]; - const SfxItemPropertyMap *pEntry = - SfxItemPropertyMap::GetByName( pStartEntry, pProp[i] ); + const SfxItemPropertySimpleEntry* pEntry = pPropMap->getByName( pProp[i] ); if (!pEntry) - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::UNKNOWN_PROPERTY; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; else { // set property value // (compare to SwXTextPortion::setPropertyValues) if (pEntry->nFlags & beans::PropertyAttribute::READONLY) - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::PROPERTY_VETO; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; else { SwXTextCursor::SetPropertyValue( - *pUnoCrsr, aPropSet, sTmp, pValue[i], pEntry ); + *pUnoCrsr, *m_pPropSet, pProp[i], pValue[i] ); } - - // continue with search for next property after current entry - // (property map and sequence of property names are sorted!) - pStartEntry = ++pEntry; } } catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before DBG_ERROR( "unexpected exception catched" ); - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::UNKNOWN_PROPERTY; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) { - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::ILLEGAL_ARGUMENT; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT; } catch (beans::PropertyVetoException &) { - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::PROPERTY_VETO; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; } catch (lang::WrappedTargetException &) { - pFailed[ nFailed++ ].Result = TolerantPropertySetResultType::WRAPPED_TARGET; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::WRAPPED_TARGET; } } @@ -641,27 +627,27 @@ uno::Sequence< SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPropertyV } -uno::Sequence< GetPropertyTolerantResult > SAL_CALL SwXTextPortion::getPropertyValuesTolerant( +uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL SwXTextPortion::getPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames ) throw (uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - uno::Sequence< GetDirectPropertyTolerantResult > aTmpRes( + uno::Sequence< beans::GetDirectPropertyTolerantResult > aTmpRes( GetPropertyValuesTolerant_Impl( rPropertyNames, sal_False ) ); - const GetDirectPropertyTolerantResult *pTmpRes = aTmpRes.getConstArray(); + const beans::GetDirectPropertyTolerantResult *pTmpRes = aTmpRes.getConstArray(); // copy temporary result to final result type sal_Int32 nLen = aTmpRes.getLength(); - uno::Sequence< GetPropertyTolerantResult > aRes( nLen ); - GetPropertyTolerantResult *pRes = aRes.getArray(); + uno::Sequence< beans::GetPropertyTolerantResult > aRes( nLen ); + beans::GetPropertyTolerantResult *pRes = aRes.getArray(); for (sal_Int32 i = 0; i < nLen; i++) *pRes++ = *pTmpRes++; return aRes; } -uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::getDirectPropertyValuesTolerant( +uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::getDirectPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames ) throw (uno::RuntimeException) { @@ -670,7 +656,7 @@ uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::getDir } -uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::GetPropertyValuesTolerant_Impl( +uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::GetPropertyValuesTolerant_Impl( const uno::Sequence< OUString >& rPropertyNames, sal_Bool bDirectValuesOnly ) throw (uno::RuntimeException) @@ -684,93 +670,84 @@ uno::Sequence< GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::GetPro sal_Int32 nProps = rPropertyNames.getLength(); const OUString *pProp = rPropertyNames.getConstArray(); - uno::Sequence< GetDirectPropertyTolerantResult > aResult( nProps ); - GetDirectPropertyTolerantResult *pResult = aResult.getArray(); - sal_Int32 nIdx = 0; - SfxItemSet *pSet = 0; - // get entry to start with - const SfxItemPropertyMap* pStartEntry = aPropSet.getPropertyMap(); + const SfxItemPropertyMap* pPropMap = m_pPropSet->getPropertyMap(); + uno::Sequence< beans::PropertyState > aPropertyStates = SwXTextCursor::GetPropertyStates( + *pUnoCrsr, *m_pPropSet, + rPropertyNames, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT ); + const beans::PropertyState* pPropertyStates = aPropertyStates.getConstArray(); + + std::vector< beans::GetDirectPropertyTolerantResult > aResultVector; for (sal_Int32 i = 0; i < nProps; ++i) { - DBG_ASSERT( nIdx < nProps, "index out ouf bounds" ); - beans::GetDirectPropertyTolerantResult &rResult = pResult[nIdx]; - + beans::GetDirectPropertyTolerantResult aResult; try { - rResult.Name = pProp[i]; - - const SfxItemPropertyMap *pEntry = - SfxItemPropertyMap::GetByName( pStartEntry, pProp[i] ); - if (!pEntry) // property available? - rResult.Result = TolerantPropertySetResultType::UNKNOWN_PROPERTY; + aResult.Name = pProp[i]; + if(pPropertyStates[i] == beans::PropertyState_MAKE_FIXED_SIZE) // property unknown? + { + if( bDirectValuesOnly ) + continue; + else + aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; + } else { - // get property state - // (compare to SwXTextPortion::getPropertyState) - beans::PropertyState eState; - if (GetTextPortionType() == PORTION_RUBY_START && - !pProp[i].compareToAscii( RTL_CONSTASCII_STRINGPARAM( "Ruby" ) )) - eState = beans::PropertyState_DIRECT_VALUE; - else - eState = SwXTextCursor::GetPropertyState( *pUnoCrsr, aPropSet, pProp[i] ); - rResult.State = eState; - -// if (bDirectValuesOnly && beans::PropertyState_DIRECT_VALUE != eState) -// rResult.Result = TolerantPropertySetResultType::NO_DIRECT_VALUE; -// else - rResult.Result = TolerantPropertySetResultType::UNKNOWN_FAILURE; - if (!bDirectValuesOnly || beans::PropertyState_DIRECT_VALUE == eState) + const SfxItemPropertySimpleEntry* pEntry = pPropMap->getByName( pProp[i] ); + aResult.State = pPropertyStates[i]; + + aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_FAILURE; + if (!bDirectValuesOnly || beans::PropertyState_DIRECT_VALUE == aResult.State) { // get property value // (compare to SwXTextPortion::getPropertyValue(s)) - GetPropertyValue( rResult.Value, pEntry, pUnoCrsr, pSet ); - rResult.Result = TolerantPropertySetResultType::SUCCESS; - - nIdx++; + GetPropertyValue( aResult.Value, *pEntry, pUnoCrsr, pSet ); + aResult.Result = beans::TolerantPropertySetResultType::SUCCESS; + aResultVector.push_back( aResult ); } // this assertion should never occur! - DBG_ASSERT( nIdx < 1 || pResult[nIdx - 1].Result != TolerantPropertySetResultType::UNKNOWN_FAILURE, + DBG_ASSERT( !aResultVector.size() || aResult.Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE, "unknown failure while retrieving property" ); - // continue with search for next property after current entry - // (property map and sequence of property names are sorted!) - pStartEntry = ++pEntry; } } catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before DBG_ERROR( "unexpected exception catched" ); - rResult.Result = TolerantPropertySetResultType::UNKNOWN_PROPERTY; + aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) { - rResult.Result = TolerantPropertySetResultType::ILLEGAL_ARGUMENT; + aResult.Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT; } catch (beans::PropertyVetoException &) { - rResult.Result = TolerantPropertySetResultType::PROPERTY_VETO; + aResult.Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; } catch (lang::WrappedTargetException &) { - rResult.Result = TolerantPropertySetResultType::WRAPPED_TARGET; + aResult.Result = beans::TolerantPropertySetResultType::WRAPPED_TARGET; } } delete pSet; - // resize to actually used size - aResult.realloc( nIdx ); + uno::Sequence< beans::GetDirectPropertyTolerantResult > aResult( aResultVector.size() ); + std::vector< beans::GetDirectPropertyTolerantResult >::const_iterator aIt = aResultVector.begin(); + beans::GetDirectPropertyTolerantResult *pResult = aResult.getArray(); + for( sal_Int32 nResult = 0; nResult < aResult.getLength(); ++nResult ) + { + pResult[nResult] = *aIt; + ++aIt; + } return aResult; } -*/ - - /* -----------------------------02.04.01 11:44-------------------------------- ---------------------------------------------------------------------------*/ @@ -840,7 +817,7 @@ beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyN !rPropertyName.compareToAscii( RTL_CONSTASCII_STRINGPARAM("Ruby") )) eRet = beans::PropertyState_DIRECT_VALUE; else - eRet = SwXTextCursor::GetPropertyState(*pUnoCrsr, aPropSet, rPropertyName); + eRet = SwXTextCursor::GetPropertyState(*pUnoCrsr, *m_pPropSet, rPropertyName); } else throw uno::RuntimeException(); @@ -857,7 +834,7 @@ uno::Sequence< beans::PropertyState > SwXTextPortion::getPropertyStates( SwUnoCrsr* pUnoCrsr = ((SwXTextPortion*)this)->GetCrsr(); if(!pUnoCrsr) throw uno::RuntimeException(); - uno::Sequence< beans::PropertyState > aRet = SwXTextCursor::GetPropertyStates(*pUnoCrsr, aPropSet, rPropertyNames, SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION); + uno::Sequence< beans::PropertyState > aRet = SwXTextCursor::GetPropertyStates(*pUnoCrsr, *m_pPropSet, rPropertyNames, SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION); if(GetTextPortionType() == PORTION_RUBY_START) { @@ -881,7 +858,7 @@ void SwXTextPortion::setPropertyToDefault(const OUString& rPropertyName) SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SetPropertyToDefault(*pUnoCrsr, aPropSet, rPropertyName); + SwXTextCursor::SetPropertyToDefault(*pUnoCrsr, *m_pPropSet, rPropertyName); } else throw uno::RuntimeException(); @@ -896,7 +873,7 @@ uno::Any SwXTextPortion::getPropertyDefault(const OUString& rPropertyName) SwUnoCrsr* pUnoCrsr = ((SwXTextPortion*)this)->GetCrsr(); if(pUnoCrsr) { - aRet = SwXTextCursor::GetPropertyDefault(*pUnoCrsr, aPropSet, rPropertyName); + aRet = SwXTextCursor::GetPropertyDefault(*pUnoCrsr, *m_pPropSet, rPropertyName); } else throw uno::RuntimeException(); diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 7e4f91f7a9..22a12bb157 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -466,7 +466,7 @@ SwXRedline::~SwXRedline() uno::Reference< beans::XPropertySetInfo > SwXRedline::getPropertySetInfo( ) throw(uno::RuntimeException) { static uno::Reference< beans::XPropertySetInfo > xRef = - SfxItemPropertySet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_REDLINE)).getPropertySetInfo(); + aSwMapProvider.GetPropertySet(PROPERTY_MAP_REDLINE)->getPropertySetInfo(); return xRef; } /*-- 11.01.01 17:06:08--------------------------------------------------- diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 40c2a07b9b..336ba97e68 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -368,8 +368,7 @@ void SwXReferenceMark::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) uno::Reference< beans::XPropertySetInfo > SwXReferenceMark::getPropertySetInfo( ) throw(uno::RuntimeException) { static uno::Reference< beans::XPropertySetInfo > xRef = - SfxItemPropertySet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARAGRAPH_EXTENSIONS)). - getPropertySetInfo(); + aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH_EXTENSIONS)->getPropertySetInfo(); return xRef; } /*-- 12.09.00 12:58:20--------------------------------------------------- diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 66bd64d4ed..fc5c8984c3 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -278,7 +278,7 @@ sal_Int64 SAL_CALL SwXTextSection::getSomething( const uno::Sequence< sal_Int8 > SwXTextSection::SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader) : // SwClient(pFmt), aLstnrCntnr( (text::XTextContent*)this), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_SECTION)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_SECTION)), m_bIsDescriptor(!bWithFormat), m_bIndexHeader(bIndexHeader), pProps(bWithFormat ? 0 : new SwTextSectionProperties_Impl()), @@ -569,7 +569,7 @@ void SwXTextSection::removeEventListener(const uno::Reference< lang::XEventListe -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextSection::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > aRef = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); return aRef; } /* -----------------------------12.02.01 10:29-------------------------------- @@ -610,15 +610,15 @@ void SAL_CALL SwXTextSection::SetPropertyValues_Impl( sal_Bool bLinkMode = sal_False; for(sal_Int16 nProperty = 0; nProperty < rPropertyNames.getLength(); nProperty++) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), pPropertyNames[nProperty]); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName( pPropertyNames[nProperty] ); + if(!pEntry) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProperty], static_cast < cppu::OWeakObject * > ( this ) ); else { - if ( pMap->nFlags & PropertyAttribute::READONLY) + if ( pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProperty], static_cast < cppu::OWeakObject * > ( this ) ); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_SECT_CONDITION: { @@ -645,7 +645,7 @@ void SAL_CALL SwXTextSection::SetPropertyValues_Impl( pProps->sLinkFileName += sfx2::cTokenSeperator; pProps->bDDE = sal_True; } - pProps->sLinkFileName.SetToken(pMap->nWID - WID_SECT_DDE_TYPE,sfx2::cTokenSeperator,sTmp); + pProps->sLinkFileName.SetToken(pEntry->nWID - WID_SECT_DDE_TYPE,sfx2::cTokenSeperator,sTmp); } else { @@ -656,7 +656,7 @@ void SAL_CALL SwXTextSection::SetPropertyValues_Impl( sLinkFileName += sfx2::cTokenSeperator; aSection.SetType(DDE_LINK_SECTION); } - sLinkFileName.SetToken(pMap->nWID - WID_SECT_DDE_TYPE,sfx2::cTokenSeperator, sTmp); + sLinkFileName.SetToken(pEntry->nWID - WID_SECT_DDE_TYPE,sfx2::cTokenSeperator, sTmp); aSection.SetLinkFileName(sLinkFileName); } } @@ -793,56 +793,56 @@ void SAL_CALL SwXTextSection::SetPropertyValues_Impl( { const SfxItemSet& rOldAttrSet = pFmt->GetAttrSet(); aItemSet.pItemSet = new SfxItemSet(*rOldAttrSet.GetPool(), - pMap->nWID, pMap->nWID, 0); + pEntry->nWID, pEntry->nWID, 0); aItemSet.pItemSet->Put(rOldAttrSet); - aPropSet.setPropertyValue(*pMap, pValues[nProperty], *aItemSet.pItemSet); + m_pPropSet->setPropertyValue(*pEntry, pValues[nProperty], *aItemSet.pItemSet); } else { SfxPoolItem* pPutItem = 0; - if(RES_COL == pMap->nWID) + if(RES_COL == pEntry->nWID) { if(!pProps->pColItem) pProps->pColItem = new SwFmtCol; pPutItem = pProps->pColItem; } - else if(RES_BACKGROUND == pMap->nWID) + else if(RES_BACKGROUND == pEntry->nWID) { if(!pProps->pBrushItem) pProps->pBrushItem = new SvxBrushItem(RES_BACKGROUND); pPutItem = pProps->pBrushItem; } - else if(RES_FTN_AT_TXTEND == pMap->nWID) + else if(RES_FTN_AT_TXTEND == pEntry->nWID) { if(!pProps->pFtnItem) pProps->pFtnItem = new SwFmtFtnAtTxtEnd; pPutItem = pProps->pFtnItem; } - else if(RES_END_AT_TXTEND == pMap->nWID) + else if(RES_END_AT_TXTEND == pEntry->nWID) { if(!pProps->pEndItem) pProps->pEndItem = new SwFmtEndAtTxtEnd; pPutItem = pProps->pEndItem; } - else if(RES_UNKNOWNATR_CONTAINER== pMap->nWID) + else if(RES_UNKNOWNATR_CONTAINER== pEntry->nWID) { if(!pProps->pXMLAttr) pProps->pXMLAttr= new SvXMLAttrContainerItem( RES_UNKNOWNATR_CONTAINER ); pPutItem = pProps->pXMLAttr; } - else if(RES_COLUMNBALANCE== pMap->nWID) + else if(RES_COLUMNBALANCE== pEntry->nWID) { if(!pProps->pNoBalanceItem) pProps->pNoBalanceItem= new SwFmtNoBalancedColumns( RES_COLUMNBALANCE ); pPutItem = pProps->pNoBalanceItem; } - else if(RES_FRAMEDIR == pMap->nWID) + else if(RES_FRAMEDIR == pEntry->nWID) { if(!pProps->pFrameDirItem) pProps->pFrameDirItem = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR ); pPutItem = pProps->pFrameDirItem; } - else if(RES_LR_SPACE == pMap->nWID) + else if(RES_LR_SPACE == pEntry->nWID) { // #109700# if(!pProps->pLRSpaceItem) @@ -850,7 +850,7 @@ void SAL_CALL SwXTextSection::SetPropertyValues_Impl( pPutItem = pProps->pLRSpaceItem; } if(pPutItem) - pPutItem->PutValue(pValues[nProperty], pMap->nMemberId); + pPutItem->PutValue(pValues[nProperty], pEntry->nMemberId); } } } @@ -946,11 +946,11 @@ uno::Sequence< Any > SAL_CALL SwXTextSection::GetPropertyValues_Impl( const OUString* pPropertyNames = rPropertyNames.getConstArray(); for(sal_Int32 nProperty = 0; nProperty < rPropertyNames.getLength(); nProperty++) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), pPropertyNames[nProperty]); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName( pPropertyNames[nProperty]); + if(pEntry) { - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_SECT_CONDITION: { @@ -973,7 +973,7 @@ uno::Sequence< Any > SAL_CALL SwXTextSection::GetPropertyValues_Impl( { sRet = pSect->GetLinkFileName(); } - sRet = sRet.GetToken(pMap->nWID - WID_SECT_DDE_TYPE, sfx2::cTokenSeperator); + sRet = sRet.GetToken(pEntry->nWID - WID_SECT_DDE_TYPE, sfx2::cTokenSeperator); pRet[nProperty] <<= OUString(sRet); } break; @@ -1084,7 +1084,7 @@ uno::Sequence< Any > SAL_CALL SwXTextSection::GetPropertyValues_Impl( case FN_UNO_ANCHOR_TYPES: case FN_UNO_TEXT_WRAP: case FN_UNO_ANCHOR_TYPE: - SwXParagraph::getDefaultTextContentValue(pRet[nProperty], OUString(), pMap->nWID); + SwXParagraph::getDefaultTextContentValue(pRet[nProperty], OUString(), pEntry->nWID); break; case FN_UNO_REDLINE_NODE_START: case FN_UNO_REDLINE_NODE_END: @@ -1092,7 +1092,7 @@ uno::Sequence< Any > SAL_CALL SwXTextSection::GetPropertyValues_Impl( if(!pFmt) break; // lijian i73247 SwNode* pSectNode = pFmt->GetSectionNode(); - if(FN_UNO_REDLINE_NODE_END == pMap->nWID) + if(FN_UNO_REDLINE_NODE_END == pEntry->nWID) pSectNode = pSectNode->EndOfSectionNode(); const SwRedlineTbl& rRedTbl = pFmt->GetDoc()->GetRedlineTbl(); for(USHORT nRed = 0; nRed < rRedTbl.Count(); nRed++) @@ -1118,54 +1118,54 @@ uno::Sequence< Any > SAL_CALL SwXTextSection::GetPropertyValues_Impl( break; default: if(pFmt) - pRet[nProperty] = aPropSet.getPropertyValue(*pMap, pFmt->GetAttrSet()); + m_pPropSet->getPropertyValue(*pEntry, pFmt->GetAttrSet(), pRet[nProperty]); else { const SfxPoolItem* pQueryItem = 0; - if(RES_COL == pMap->nWID) + if(RES_COL == pEntry->nWID) { if(!pProps->pColItem) pProps->pColItem = new SwFmtCol; pQueryItem = pProps->pColItem; } - else if(RES_BACKGROUND == pMap->nWID) + else if(RES_BACKGROUND == pEntry->nWID) { if(!pProps->pBrushItem) pProps->pBrushItem = new SvxBrushItem(RES_BACKGROUND); pQueryItem = pProps->pBrushItem; } - else if(RES_FTN_AT_TXTEND == pMap->nWID) + else if(RES_FTN_AT_TXTEND == pEntry->nWID) { if(!pProps->pFtnItem) pProps->pFtnItem = new SwFmtFtnAtTxtEnd; pQueryItem = pProps->pFtnItem; } - else if(RES_END_AT_TXTEND == pMap->nWID) + else if(RES_END_AT_TXTEND == pEntry->nWID) { if(!pProps->pEndItem) pProps->pEndItem = new SwFmtEndAtTxtEnd; pQueryItem = pProps->pEndItem; } - else if(RES_UNKNOWNATR_CONTAINER== pMap->nWID) + else if(RES_UNKNOWNATR_CONTAINER== pEntry->nWID) { if(!pProps->pXMLAttr) pProps->pXMLAttr= new SvXMLAttrContainerItem ; pQueryItem = pProps->pXMLAttr; } - else if(RES_COLUMNBALANCE== pMap->nWID) + else if(RES_COLUMNBALANCE== pEntry->nWID) { if(!pProps->pNoBalanceItem) pProps->pNoBalanceItem= new SwFmtNoBalancedColumns; pQueryItem = pProps->pNoBalanceItem; } - else if(RES_FRAMEDIR == pMap->nWID) + else if(RES_FRAMEDIR == pEntry->nWID) { if(!pProps->pFrameDirItem) pProps->pFrameDirItem = new SvxFrameDirectionItem(FRMDIR_ENVIRONMENT, RES_FRAMEDIR); pQueryItem = pProps->pFrameDirItem; } /* -> #109700# */ - else if(RES_LR_SPACE == pMap->nWID) + else if(RES_LR_SPACE == pEntry->nWID) { if(!pProps->pLRSpaceItem) pProps->pLRSpaceItem = new SvxLRSpaceItem( RES_LR_SPACE ); @@ -1173,7 +1173,7 @@ uno::Sequence< Any > SAL_CALL SwXTextSection::GetPropertyValues_Impl( } /* <- #109700# */ if(pQueryItem) - pQueryItem->QueryValue(pRet[nProperty], pMap->nMemberId); + pQueryItem->QueryValue(pRet[nProperty], pEntry->nMemberId); } } } @@ -1307,11 +1307,11 @@ Sequence< PropertyState > SwXTextSection::getPropertyStates( for(sal_Int32 i = 0; i < rPropertyNames.getLength(); i++) { pStates[i] = PropertyState_DEFAULT_VALUE; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), pNames[i]); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName( pNames[i]); + if(!pEntry) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( this ) ); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_SECT_CONDITION: case WID_SECT_DDE_TYPE : @@ -1333,17 +1333,17 @@ Sequence< PropertyState > SwXTextSection::getPropertyStates( break; default: if(pFmt) - pStates[i] = aPropSet.getPropertyState(pNames[i], pFmt->GetAttrSet()); + pStates[i] = m_pPropSet->getPropertyState(pNames[i], pFmt->GetAttrSet()); else { - if(RES_COL == pMap->nWID) + if(RES_COL == pEntry->nWID) { if(!pProps->pColItem) pStates[i] = PropertyState_DEFAULT_VALUE; else pStates[i] = PropertyState_DIRECT_VALUE; } - else //if(RES_BACKGROUND == pMap->nWID) + else //if(RES_BACKGROUND == pEntry->nWID) { if(!pProps->pBrushItem) pStates[i] = PropertyState_DEFAULT_VALUE; @@ -1372,14 +1372,14 @@ void SwXTextSection::setPropertyToDefault( const OUString& rPropertyName ) SwSection* pSect = pFmt ? pFmt->GetSection() : 0; if(pFmt) aSection = *pSect; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if(!pEntry) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & PropertyAttribute::READONLY) + if ( pEntry->nFlags & PropertyAttribute::READONLY) throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SfxItemSet* pNewAttrSet = 0; - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_SECT_CONDITION: { @@ -1431,20 +1431,20 @@ void SwXTextSection::setPropertyToDefault( const OUString& rPropertyName ) case FN_UNO_ANCHOR_TYPE: break; default: - if(pMap->nWID <= SFX_WHICH_MAX) + if(pEntry->nWID <= SFX_WHICH_MAX) { if(pFmt) { const SfxItemSet& rOldAttrSet = pFmt->GetAttrSet(); pNewAttrSet = new SfxItemSet(*rOldAttrSet.GetPool(), - pMap->nWID, pMap->nWID, 0); - pNewAttrSet->ClearItem(pMap->nWID); + pEntry->nWID, pEntry->nWID, 0); + pNewAttrSet->ClearItem(pEntry->nWID); } else { - if(RES_COL == pMap->nWID) + if(RES_COL == pEntry->nWID) DELETEZ(pProps->pColItem); - else if(RES_BACKGROUND == pMap->nWID) + else if(RES_BACKGROUND == pEntry->nWID) DELETEZ(pProps->pBrushItem); } } @@ -1483,12 +1483,12 @@ Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName ) vos::OGuard aGuard(Application::GetSolarMutex()); uno::Any aRet; SwSectionFmt* pFmt = GetFmt(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if (!pEntry) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_SECT_CONDITION: case WID_SECT_DDE_TYPE : @@ -1520,15 +1520,15 @@ Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName ) case FN_UNO_ANCHOR_TYPES: case FN_UNO_TEXT_WRAP: case FN_UNO_ANCHOR_TYPE: - SwXParagraph::getDefaultTextContentValue(aRet, OUString(), pMap->nWID); + SwXParagraph::getDefaultTextContentValue(aRet, OUString(), pEntry->nWID); break; default: - if(pFmt && pMap->nWID <= SFX_WHICH_MAX) + if(pFmt && pEntry->nWID <= SFX_WHICH_MAX) { SwDoc* pDoc = pFmt->GetDoc(); const SfxPoolItem& rDefItem = - pDoc->GetAttrPool().GetDefaultItem(pMap->nWID); - rDefItem.QueryValue(aRet, pMap->nMemberId); + pDoc->GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(aRet, pEntry->nMemberId); } } return aRet; diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 238e0fba99..192e3a1aec 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -124,9 +124,9 @@ SV_IMPL_PTRARR(PropValDataArr, PropValDataPtr) #define WID_BEGIN_NOTICE 10 #define WID_ANCHOR_CHARACTER_STYLE 11 -const SfxItemPropertyMap* GetFootnoteMap() +const SfxItemPropertySet* GetFootnoteSet() { - static SfxItemPropertyMap aFootnoteMap_Impl[] = + static SfxItemPropertyMapEntry aFootnoteMap_Impl[] = { { SW_PROP_NAME(UNO_NAME_ANCHOR_CHAR_STYLE_NAME),WID_ANCHOR_CHARACTER_STYLE, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_BEGIN_NOTICE), WID_BEGIN_NOTICE, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0}, @@ -142,11 +142,12 @@ const SfxItemPropertyMap* GetFootnoteMap() { SW_PROP_NAME(UNO_NAME_SUFFIX), WID_SUFFIX, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - return aFootnoteMap_Impl; + static SfxItemPropertySet aFootnoteSet_Impl(aFootnoteMap_Impl); + return &aFootnoteSet_Impl; } -const SfxItemPropertyMap* GetEndnoteMap() +const SfxItemPropertySet* GetEndnoteSet() { - static SfxItemPropertyMap aEndnoteMap_Impl[] = + static SfxItemPropertyMapEntry aEndnoteMap_Impl[] = { { SW_PROP_NAME(UNO_NAME_ANCHOR_CHAR_STYLE_NAME),WID_ANCHOR_CHARACTER_STYLE, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_CHAR_STYLE_NAME), WID_CHARACTER_STYLE, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0}, @@ -158,11 +159,12 @@ const SfxItemPropertyMap* GetEndnoteMap() { SW_PROP_NAME(UNO_NAME_SUFFIX), WID_SUFFIX, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - return aEndnoteMap_Impl; + static SfxItemPropertySet aEndnoteSet_Impl(aEndnoteMap_Impl); + return &aEndnoteSet_Impl; } -const SfxItemPropertyMap* GetNumberingRulesMap() +const SfxItemPropertySet* GetNumberingRulesSet() { - static SfxItemPropertyMap aNumberingRulesMap_Impl[] = + static SfxItemPropertyMapEntry aNumberingRulesMap_Impl[] = { { SW_PROP_NAME(UNO_NAME_IS_ABSOLUTE_MARGINS), WID_IS_ABS_MARGINS, &::getBooleanCppuType(), PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_IS_AUTOMATIC), WID_IS_AUTOMATIC, &::getBooleanCppuType(), PROPERTY_NONE, 0}, @@ -172,7 +174,8 @@ const SfxItemPropertyMap* GetNumberingRulesMap() { SW_PROP_NAME(UNO_NAME_DEFAULT_LIST_ID), WID_DEFAULT_LIST_ID, &::getCppuType((const OUString*)0), PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; - return aNumberingRulesMap_Impl; + static SfxItemPropertySet aNumberingRulesSet_Impl( aNumberingRulesMap_Impl ); + return &aNumberingRulesSet_Impl; } #define WID_NUM_ON 0 #define WID_SEPARATOR_INTERVAL 1 @@ -186,9 +189,9 @@ const SfxItemPropertyMap* GetNumberingRulesMap() #define WID_COUNT_LINES_IN_FRAMES 9 #define WID_RESTART_AT_EACH_PAGE 10 -const SfxItemPropertyMap* GetLineNumberingMap() +const SfxItemPropertySet* GetLineNumberingSet() { - static SfxItemPropertyMap aLineNumberingMap_Impl[] = + static SfxItemPropertyMapEntry aLineNumberingMap_Impl[] = { { SW_PROP_NAME(UNO_NAME_CHAR_STYLE_NAME), WID_CHARACTER_STYLE, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_COUNT_EMPTY_LINES), WID_COUNT_EMPTY_LINES , &::getBooleanCppuType(),PROPERTY_NONE, 0}, @@ -203,7 +206,8 @@ const SfxItemPropertyMap* GetLineNumberingMap() { SW_PROP_NAME(UNO_NAME_SEPARATOR_INTERVAL), WID_SEPARATOR_INTERVAL, &::getCppuType((const sal_Int16*)0),PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - return aLineNumberingMap_Impl; + static SfxItemPropertySet aLineNumberingSet_Impl(aLineNumberingMap_Impl); + return &aLineNumberingSet_Impl; } /* -----------------05.05.98 08:30------------------- @@ -332,7 +336,7 @@ Sequence< OUString > SwXFootnoteProperties::getSupportedServiceNames(void) throw -----------------------------------------------------------------------*/ SwXFootnoteProperties::SwXFootnoteProperties(SwDoc* pDc) : pDoc(pDc), - _pMap(GetFootnoteMap()) + m_pPropertySet(GetFootnoteSet()) { } /*-- 14.12.98 14:03:20--------------------------------------------------- @@ -348,7 +352,7 @@ SwXFootnoteProperties::~SwXFootnoteProperties() uno::Reference< beans::XPropertySetInfo > SwXFootnoteProperties::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > aRef = new SfxItemPropertySetInfo( _pMap ); + static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo(); return aRef; } /*-- 14.12.98 14:03:20--------------------------------------------------- @@ -360,14 +364,13 @@ void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, cons vos::OGuard aGuard(Application::GetSolarMutex()); if(pDoc) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { - if ( pMap->nFlags & PropertyAttribute::READONLY) + if ( pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SwFtnInfo aFtnInfo(pDoc->GetFtnInfo()); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_PREFIX: { @@ -440,7 +443,7 @@ void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, cons SwCharFmt* pFmt = lcl_getCharFmt(pDoc, aValue); if(pFmt) { - if(pMap->nWID == WID_ANCHOR_CHARACTER_STYLE) + if(pEntry->nWID == WID_ANCHOR_CHARACTER_STYLE) aFtnInfo.SetAnchorCharFmt(pFmt); else aFtnInfo.SetCharFmt(pFmt); @@ -486,12 +489,11 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName) uno::Any aRet; if(pDoc) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { const SwFtnInfo& rFtnInfo = pDoc->GetFtnInfo(); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_PREFIX: { @@ -558,7 +560,7 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName) { String aString; const SwCharFmt* pCharFmt = 0; - if( pMap->nWID == WID_ANCHOR_CHARACTER_STYLE ) + if( pEntry->nWID == WID_ANCHOR_CHARACTER_STYLE ) { if( rFtnInfo.GetAnchorCharFmtDep()->GetRegisteredIn() ) pCharFmt = rFtnInfo.GetAnchorCharFmt(*pDoc); @@ -669,7 +671,7 @@ Sequence< OUString > SwXEndnoteProperties::getSupportedServiceNames(void) throw( -----------------------------------------------------------------------*/ SwXEndnoteProperties::SwXEndnoteProperties(SwDoc* pDc) : pDoc(pDc), - _pMap(GetEndnoteMap()) + m_pPropertySet(GetEndnoteSet()) { } @@ -685,7 +687,7 @@ SwXEndnoteProperties::~SwXEndnoteProperties() -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXEndnoteProperties::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > aRef = new SfxItemPropertySetInfo( _pMap ); + static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo(); return aRef; } /*-- 14.12.98 14:27:40--------------------------------------------------- @@ -698,14 +700,13 @@ void SwXEndnoteProperties::setPropertyValue(const OUString& rPropertyName, const vos::OGuard aGuard(Application::GetSolarMutex()); if(pDoc) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { - if ( pMap->nFlags & PropertyAttribute::READONLY) + if ( pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SwEndNoteInfo aEndInfo(pDoc->GetEndNoteInfo()); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_PREFIX: { @@ -755,7 +756,7 @@ void SwXEndnoteProperties::setPropertyValue(const OUString& rPropertyName, const SwCharFmt* pFmt = lcl_getCharFmt(pDoc, aValue); if(pFmt) { - if(pMap->nWID == WID_ANCHOR_CHARACTER_STYLE) + if(pEntry->nWID == WID_ANCHOR_CHARACTER_STYLE) aEndInfo.SetAnchorCharFmt(pFmt); else aEndInfo.SetCharFmt(pFmt); @@ -779,12 +780,11 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName) uno::Any aRet; if(pDoc) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { const SwEndNoteInfo& rEndInfo = pDoc->GetEndNoteInfo(); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_PREFIX: aRet <<= OUString(rEndInfo.GetPrefix()); @@ -832,7 +832,7 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName) { String aString; const SwCharFmt* pCharFmt = 0; - if( pMap->nWID == WID_ANCHOR_CHARACTER_STYLE ) + if( pEntry->nWID == WID_ANCHOR_CHARACTER_STYLE ) { if( rEndInfo.GetAnchorCharFmtDep()->GetRegisteredIn() ) pCharFmt = rEndInfo.GetAnchorCharFmt(*pDoc); @@ -926,7 +926,7 @@ Sequence< OUString > SwXLineNumberingProperties::getSupportedServiceNames(void) -----------------------------------------------------------------------*/ SwXLineNumberingProperties::SwXLineNumberingProperties(SwDoc* pDc) : pDoc(pDc), - _pMap(GetLineNumberingMap()) + m_pPropertySet(GetLineNumberingSet()) { } @@ -942,7 +942,7 @@ SwXLineNumberingProperties::~SwXLineNumberingProperties() -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXLineNumberingProperties::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > aRef = new SfxItemPropertySetInfo( _pMap ); + static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo(); return aRef; } /*-- 14.12.98 14:33:37--------------------------------------------------- @@ -956,14 +956,13 @@ void SwXLineNumberingProperties::setPropertyValue( vos::OGuard aGuard(Application::GetSolarMutex()); if(pDoc) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { - if ( pMap->nFlags & PropertyAttribute::READONLY) + if ( pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SwLineNumberInfo aInfo(pDoc->GetLineNumberInfo()); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_NUM_ON: { @@ -1078,12 +1077,11 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName) Any aRet; if(pDoc) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName ); + if(pEntry) { const SwLineNumberInfo& rInfo = pDoc->GetLineNumberInfo(); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_NUM_ON: { @@ -1268,7 +1266,7 @@ SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule) : pDoc(0), pDocShell(0), pNumRule(new SwNumRule(rRule)), - _pMap(GetNumberingRulesMap()), + m_pPropertySet(GetNumberingRulesSet()), bOwnNumRuleCreated(TRUE) { sal_uInt16 i; @@ -1300,7 +1298,7 @@ SwXNumberingRules::SwXNumberingRules(SwDocShell& rDocSh) : pDoc(0), pDocShell(&rDocSh), pNumRule(0), - _pMap(GetNumberingRulesMap()), + m_pPropertySet(GetNumberingRulesSet()), bOwnNumRuleCreated(FALSE) { pDocShell->GetDoc()->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); @@ -1312,7 +1310,7 @@ SwXNumberingRules::SwXNumberingRules(SwDoc& rDoc) : pDoc(&rDoc), pDocShell(0), pNumRule(0), - _pMap(GetNumberingRulesMap()), + m_pPropertySet(GetNumberingRulesSet()), bOwnNumRuleCreated(FALSE) { rDoc.GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); @@ -2256,7 +2254,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex( uno::Reference< XPropertySetInfo > SwXNumberingRules::getPropertySetInfo() throw(RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > aRef = new SfxItemPropertySetInfo( _pMap ); + static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo(); return aRef; } /*-- 19.07.00 07:49:17--------------------------------------------------- @@ -2536,7 +2534,7 @@ SwXTextColumns::SwXTextColumns(sal_uInt16 nColCount) : nReference(0), bIsAutomaticWidth(sal_True), nAutoDistance(0), - _pMap(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_COLUMS)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_COLUMS)), nSepLineWidth(0), nSepLineColor(0), //black nSepLineHeightRelative(100),//full height @@ -2553,7 +2551,7 @@ SwXTextColumns::SwXTextColumns(const SwFmtCol& rFmtCol) : nReference(0), aTextColumns(rFmtCol.GetNumCols()), bIsAutomaticWidth(rFmtCol.IsOrtho()), - _pMap(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_COLUMS)) + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_COLUMS)) { USHORT nItemGutterWidth = rFmtCol.GetGutterWidth(); nAutoDistance = bIsAutomaticWidth ? @@ -2663,7 +2661,7 @@ void SwXTextColumns::setColumns(const uno::Sequence< TextColumn >& rColumns) -----------------------------------------------------------------------*/ uno::Reference< XPropertySetInfo > SwXTextColumns::getPropertySetInfo( ) throw(RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > aRef = new SfxItemPropertySetInfo( _pMap ); + static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); return aRef; } /*-- 25.10.00 10:15:39--------------------------------------------------- @@ -2673,14 +2671,13 @@ void SwXTextColumns::setPropertyValue( const OUString& rPropertyName, const Any& throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if (!pEntry) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & PropertyAttribute::READONLY) + if ( pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_TXTCOL_LINE_WIDTH: { @@ -2746,13 +2743,12 @@ void SwXTextColumns::setPropertyValue( const OUString& rPropertyName, const Any& Any SwXTextColumns::getPropertyValue( const OUString& rPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if (!pEntry) throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); Any aRet; - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_TXTCOL_LINE_WIDTH: aRet <<= static_cast < sal_Int32 >(TWIP_TO_MM100(nSepLineWidth)); diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx index b446cbcf60..8ee8e3e141 100644 --- a/sw/source/core/unocore/unosrch.cxx +++ b/sw/source/core/unocore/unosrch.cxx @@ -58,7 +58,8 @@ using ::rtl::OUString; class SwSearchProperties_Impl { beans::PropertyValue** pValueArr; // - sal_uInt16 nArrLen; + sal_uInt32 nArrLen; + const PropertyEntryVector_t aPropertyEntries; public: SwSearchProperties_Impl(); ~SwSearchProperties_Impl(); @@ -74,17 +75,12 @@ public: --------------------------------------------------*/ SwSearchProperties_Impl::SwSearchProperties_Impl() : - nArrLen(0) + nArrLen(0), + aPropertyEntries( aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)->getPropertyMap()->getPropertyEntries()) { - const SfxItemPropertyMap* pMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR); - while(pMap->nWID) - { - if(pMap->nWID < RES_FRMATR_END) - nArrLen++; - pMap++; - } + nArrLen = aPropertyEntries.size(); pValueArr = new beans::PropertyValue*[nArrLen]; - for(sal_uInt16 i = 0; i < nArrLen; i++) + for(sal_uInt32 i = 0; i < nArrLen; i++) pValueArr[i] = 0; } /* -----------------23.06.99 13:08------------------- @@ -92,7 +88,7 @@ SwSearchProperties_Impl::SwSearchProperties_Impl() : --------------------------------------------------*/ SwSearchProperties_Impl::~SwSearchProperties_Impl() { - for(sal_uInt16 i = 0; i < nArrLen; i++) + for(sal_uInt32 i = 0; i < nArrLen; i++) delete pValueArr[i]; delete[] pValueArr; } @@ -102,10 +98,8 @@ SwSearchProperties_Impl::~SwSearchProperties_Impl() void SwSearchProperties_Impl::SetProperties(const uno::Sequence< beans::PropertyValue >& aSearchAttribs) throw( beans::UnknownPropertyException, lang::IllegalArgumentException, uno::RuntimeException ) { - const SfxItemPropertyMap* pMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR); - long nLen = aSearchAttribs.getLength(); const beans::PropertyValue* pProps = aSearchAttribs.getConstArray(); - long i; + sal_uInt32 i; //delete all existing values for( i = 0; i < nArrLen; i++) @@ -114,18 +108,18 @@ void SwSearchProperties_Impl::SetProperties(const uno::Sequence< beans::Property pValueArr[i] = 0; } + sal_uInt32 nLen = aSearchAttribs.getLength(); for(i = 0; i < nLen; i++) { - String sPropertyName(pProps[i].Name); sal_uInt16 nIndex = 0; - const SfxItemPropertyMap* pTempMap = pMap; - while(pTempMap->nWID && !sPropertyName.EqualsAscii(pTempMap->pName)) + PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin(); + while(pProps[i].Name != aIt->sName) { - pTempMap++; + ++aIt; nIndex++; + if( aIt == aPropertyEntries.end() ) + throw beans::UnknownPropertyException(); } - if(!pTempMap->nWID) - throw beans::UnknownPropertyException(); pValueArr[nIndex] = new beans::PropertyValue(pProps[i]); } } @@ -134,8 +128,8 @@ void SwSearchProperties_Impl::SetProperties(const uno::Sequence< beans::Property --------------------------------------------------*/ const uno::Sequence< beans::PropertyValue > SwSearchProperties_Impl::GetProperties() const { - sal_uInt16 nPropCount = 0; - sal_uInt16 i; + sal_uInt32 nPropCount = 0; + sal_uInt32 i; for( i = 0; i < nArrLen; i++) if(pValueArr[i]) nPropCount++; @@ -157,7 +151,6 @@ const uno::Sequence< beans::PropertyValue > SwSearchProperties_Impl::GetProperti --------------------------------------------------*/ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSearch) const { - const SfxItemPropertyMap* pMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR); // SfxPoolItem* pBoxItem = 0, @@ -196,187 +189,187 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea *pCasemapItem = 0, *pBrushItem = 0; - for(sal_uInt16 i = 0; i < nArrLen; i++) + PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin(); + for(sal_uInt32 i = 0; i < nArrLen; i++, ++aIt) { if(pValueArr[i]) { - const SfxItemPropertyMap* pTempMap = pMap + i; SfxPoolItem* pTempItem = 0; - switch(pTempMap->nWID) + switch(aIt->nWID) { case RES_BOX: if(!pBoxItem) - pBoxItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pBoxItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pBoxItem; break; case RES_BREAK: if(!pBreakItem) - pBreakItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pBreakItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pBreakItem; break; case RES_CHRATR_AUTOKERN: if(!pAutoKernItem) - pAutoKernItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pAutoKernItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pAutoKernItem; break; case RES_CHRATR_BACKGROUND: if(!pBrushItem) - pBrushItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pBrushItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pBrushItem; break; case RES_CHRATR_CASEMAP: if(!pCasemapItem) - pCasemapItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pCasemapItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pCasemapItem; break; case RES_CHRATR_COLOR: if(!pCharColorItem) - pCharColorItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pCharColorItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pCharColorItem; break; case RES_CHRATR_CONTOUR: if(!pContourItem) - pContourItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pContourItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pContourItem; break; case RES_CHRATR_CROSSEDOUT: if(!pCrossedOutItem) - pCrossedOutItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pCrossedOutItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pCrossedOutItem; break; case RES_CHRATR_ESCAPEMENT: if(!pEscItem) - pEscItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pEscItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pEscItem; break; case RES_CHRATR_BLINK: if(!pBlinkItem) - pBlinkItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pBlinkItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pBlinkItem; break; case RES_CHRATR_FONT: if(!pFontItem) - pFontItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pFontItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pFontItem; break; case RES_CHRATR_FONTSIZE: if(!pFontSizeItem) - pFontSizeItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pFontSizeItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pFontSizeItem; break; case RES_CHRATR_KERNING: if(!pKernItem) - pKernItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pKernItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pKernItem; break; case RES_CHRATR_LANGUAGE: if(!pLangItem) - pLangItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pLangItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pLangItem; break; case RES_CHRATR_NOHYPHEN: if(!pNHyphItem) - pNHyphItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pNHyphItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pNHyphItem; break; case RES_CHRATR_POSTURE: if(!pPostItem) - pPostItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pPostItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pPostItem; break; case RES_CHRATR_SHADOWED: if(!pShadItem) - pShadItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pShadItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pShadItem; break; case RES_TXTATR_CHARFMT: if(!pCharFmtItem) - pCharFmtItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pCharFmtItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pCharFmtItem; break; case RES_CHRATR_UNDERLINE: if(!pULineItem) - pULineItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pULineItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pULineItem; break; case RES_CHRATR_OVERLINE: if(!pOLineItem) - pOLineItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pOLineItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pOLineItem; break; case RES_CHRATR_WEIGHT: if(!pWeightItem) - pWeightItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pWeightItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pWeightItem; break; case RES_PARATR_DROP: if(!pDropItem) - pDropItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pDropItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pDropItem; break; case RES_TXTATR_INETFMT: if(!pInetItem) - pInetItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pInetItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pInetItem; break; case RES_PAGEDESC: if(!pDescItem) - pDescItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pDescItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pDescItem; break; case RES_PARATR_ADJUST: if(!pAdjItem) - pAdjItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pAdjItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pAdjItem; break; case RES_BACKGROUND: if(!pBackItem) - pBackItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pBackItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pBackItem; break; case RES_UL_SPACE: if(!pULItem) - pULItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pULItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pULItem; break; case RES_LR_SPACE: if(!pLRItem) - pLRItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pLRItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pLRItem; break; case RES_KEEP: if(!pKeepItem) - pKeepItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pKeepItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pKeepItem; break; case RES_LINENUMBER: if(!pLineNumItem) - pLineNumItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pLineNumItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pLineNumItem; break; case RES_PARATR_LINESPACING: if(!pLineSpaceItem) - pLineSpaceItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pLineSpaceItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pLineSpaceItem; break; case RES_PARATR_REGISTER: if(!pRegItem) - pRegItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pRegItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pRegItem; break; case RES_PARATR_SPLIT: if(!pSplitItem) - pSplitItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pSplitItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pSplitItem; break; case RES_PARATR_TABSTOP: if(!pTabItem) - pTabItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pTabItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pTabItem; break; case RES_CHRATR_WORDLINEMODE: if(!pWLineItem) - pWLineItem = rSet.GetPool()->GetDefaultItem(pTempMap->nWID).Clone(); + pWLineItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pWLineItem; break; } @@ -384,7 +377,7 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea { if(bIsValueSearch) { - pTempItem->PutValue(pValueArr[i]->Value, pTempMap->nMemberId); + pTempItem->PutValue(pValueArr[i]->Value, aIt->nMemberId); rSet.Put(*pTempItem); } else @@ -434,7 +427,7 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea --------------------------------------------------*/ sal_Bool SwSearchProperties_Impl::HasAttributes() const { - for(sal_uInt16 i = 0; i < nArrLen; i++) + for(sal_uInt32 i = 0; i < nArrLen; i++) if(pValueArr[i]) return sal_True; return sal_False; @@ -446,7 +439,7 @@ sal_Bool SwSearchProperties_Impl::HasAttributes() const SwXTextSearch::SwXTextSearch() : pSearchProperties( new SwSearchProperties_Impl), pReplaceProperties( new SwSearchProperties_Impl), - _pMap(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_SEARCH)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SEARCH)), bAll(sal_False), bWord(sal_False), bBack(sal_False), @@ -529,7 +522,7 @@ void SwXTextSearch::setReplaceString(const OUString& rReplaceString) throw( uno: -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextSearch::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > aRef = new SfxItemPropertySetInfo(_pMap); + static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); return aRef; } /*-- 14.12.98 13:07:13--------------------------------------------------- @@ -540,16 +533,15 @@ void SwXTextSearch::setPropertyValue(const OUString& rPropertyName, const uno::A lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if(pEntry) { - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); sal_Bool bVal = FALSE; if(aValue.getValueType() == ::getBooleanCppuType()) bVal = *(sal_Bool*)aValue.getValue(); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_SEARCH_ALL : bAll = bVal; break; case WID_WORDS: bWord = bVal; break; @@ -576,13 +568,12 @@ uno::Any SwXTextSearch::getPropertyValue(const OUString& rPropertyName) throw( b vos::OGuard aGuard(Application::GetSolarMutex()); uno::Any aRet; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); sal_Bool bSet = sal_False; sal_Int16 nSet = 0; - if(pMap) + if(pEntry) { - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_SEARCH_ALL : bSet = bAll; goto SET_BOOL; case WID_WORDS: bSet = bWord; goto SET_BOOL; diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 623d909f00..adc56fdf54 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1149,9 +1149,10 @@ SwXStyle* SwXStyleFamily::_FindStyle(const String& rStyleName)const for( sal_uInt16 i = 0; i < nLCount; i++) { pListener = pBasePool->GetListener( i ); - if(PTR_CAST(SwXStyle, pListener) && ((SwXStyle*)pListener)->GetFamily() == eFamily && ((SwXStyle*)pListener)->GetStyleName() == rStyleName) + SwXStyle* pTempStyle = dynamic_cast<SwXStyle*>( pListener ); + if(pTempStyle && pTempStyle->GetFamily() == eFamily && pTempStyle->GetStyleName() == rStyleName) { - return (SwXStyle*)pListener; + return pTempStyle; } } return 0; @@ -1161,34 +1162,35 @@ SwXStyle* SwXStyleFamily::_FindStyle(const String& rStyleName)const ******************************************************************/ class SwStyleProperties_Impl { - const SfxItemPropertyMap* _pMap; + const PropertyEntryVector_t aPropertyEntries; uno::Any** pAnyArr; - sal_uInt16 nArrLen; + sal_uInt32 nArrLen; public: SwStyleProperties_Impl(const SfxItemPropertyMap* _pMap); ~SwStyleProperties_Impl(); - sal_Bool SetProperty(const String& rName, uno::Any aVal); - sal_Bool GetProperty(const String& rName, uno::Any*& rpAny); - sal_Bool ClearProperty( const OUString& rPropertyName ); + sal_Bool SetProperty(const ::rtl::OUString& rName, uno::Any aVal); + sal_Bool GetProperty(const ::rtl::OUString& rName, uno::Any*& rpAny); + sal_Bool ClearProperty( const ::rtl::OUString& rPropertyName ); void ClearAllProperties( ); - void GetProperty(const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny ); + void GetProperty(const ::rtl::OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny ); + const PropertyEntryVector_t& GetPropertyVector() const {return aPropertyEntries; } - const SfxItemPropertyMap* GetPropertyMap() const {return _pMap;} }; //-------------------------------------------------------------------- //-------------------------------------------------------------------- SwStyleProperties_Impl::SwStyleProperties_Impl(const SfxItemPropertyMap* pMap) : - _pMap(pMap), +// _pMap(pMap), + aPropertyEntries( pMap->getPropertyEntries() ), nArrLen(0) { - const SfxItemPropertyMap* pTmp = _pMap; - while(pTmp[nArrLen].nWID) - nArrLen++; + nArrLen = aPropertyEntries.size(); + //const SfxItemPropertyMap* pTmp = _pMap; + pAnyArr = new uno::Any* [nArrLen]; - for ( sal_uInt16 i =0 ; i < nArrLen; i++ ) + for ( sal_uInt32 i =0 ; i < nArrLen; i++ ) pAnyArr[i] = 0; } //-------------------------------------------------------------------- @@ -1202,42 +1204,44 @@ SwStyleProperties_Impl::~SwStyleProperties_Impl() //-------------------------------------------------------------------- //-------------------------------------------------------------------- -sal_Bool SwStyleProperties_Impl::SetProperty(const String& rName, uno::Any aVal) +sal_Bool SwStyleProperties_Impl::SetProperty(const ::rtl::OUString& rName, uno::Any aVal) { sal_uInt16 nPos = 0; - const SfxItemPropertyMap* pTemp = _pMap; - while( pTemp->pName ) + sal_Bool bRet = sal_False; + PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin(); + while( aIt != aPropertyEntries.end() ) { - if(rName.EqualsAscii(pTemp->pName)) + if(rName == aIt->sName) + { + delete pAnyArr[nPos]; + pAnyArr[nPos] = new uno::Any ( aVal ); + bRet = sal_True; break; + } ++nPos; - ++pTemp; + ++aIt; } - if(nPos < nArrLen) - { - delete pAnyArr[nPos]; - pAnyArr[nPos] = new uno::Any ( aVal ); - } - return nPos < nArrLen; + return bRet; } sal_Bool SwStyleProperties_Impl::ClearProperty( const OUString& rName ) { + sal_Bool bRet = sal_False; sal_uInt16 nPos = 0; - const SfxItemPropertyMap* pTemp = _pMap; - while( pTemp->pName ) + PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin(); + while( aIt != aPropertyEntries.end() ) { - if( rName.equalsAsciiL ( pTemp->pName, pTemp->nNameLen ) ) + if( rName == aIt->sName ) + { + delete pAnyArr[nPos]; + pAnyArr[ nPos ] = 0; + bRet = sal_True; break; + } ++nPos; - ++pTemp; + ++aIt; } - if( nPos < nArrLen ) - { - delete pAnyArr[nPos]; - pAnyArr[ nPos ] = 0; - } - return nPos < nArrLen; + return bRet; } void SwStyleProperties_Impl::ClearAllProperties( ) { @@ -1249,20 +1253,23 @@ void SwStyleProperties_Impl::ClearAllProperties( ) } //-------------------------------------------------------------------- //-------------------------------------------------------------------- -sal_Bool SwStyleProperties_Impl::GetProperty(const String& rName, uno::Any*& rpAny ) +sal_Bool SwStyleProperties_Impl::GetProperty(const ::rtl::OUString& rName, uno::Any*& rpAny ) { + sal_Bool bRet = sal_False; sal_uInt16 nPos = 0; - const SfxItemPropertyMap* pTemp = _pMap; - while( pTemp->pName ) + PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin(); + while( aIt != aPropertyEntries.end() ) { - if(rName.EqualsAscii(pTemp->pName)) + if( rName == aIt->sName ) + { + rpAny = pAnyArr[nPos]; + bRet = sal_True; break; - ++nPos; - ++pTemp; + } + ++aIt; } - if(nPos < nArrLen) - rpAny = pAnyArr[nPos]; - return nPos < nArrLen; + + return bRet; } void SwStyleProperties_Impl::GetProperty( const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any & rAny ) @@ -1439,7 +1446,7 @@ SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, BOOL bConditional) : default: ; } - pPropImpl = new SwStyleProperties_Impl(aSwMapProvider.GetPropertyMap(nMapId)); + pPropImpl = new SwStyleProperties_Impl(aSwMapProvider.GetPropertySet(nMapId)->getPropertyMap()); } @@ -1655,9 +1662,7 @@ uno::Reference< beans::XPropertySetInfo > lcl_getPropertySetInfo( SfxStyleFamily static uno::Reference< beans::XPropertySetInfo > xCharRef; if(!xCharRef.is()) { - SfxItemPropertySet aPropSet( - aSwMapProvider.GetPropertyMap(PROPERTY_MAP_CHAR_STYLE)); - xCharRef = aPropSet.getPropertySetInfo(); + xCharRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_CHAR_STYLE)->getPropertySetInfo(); } xRet = xCharRef; } @@ -1668,9 +1673,7 @@ uno::Reference< beans::XPropertySetInfo > lcl_getPropertySetInfo( SfxStyleFamily if(!xParaRef.is()) { sal_uInt16 nMapId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; - SfxItemPropertySet aPropSet( - aSwMapProvider.GetPropertyMap(nMapId)); - xParaRef = aPropSet.getPropertySetInfo(); + xParaRef = aSwMapProvider.GetPropertySet(nMapId)->getPropertySetInfo(); } xRet = xParaRef; } @@ -1680,9 +1683,7 @@ uno::Reference< beans::XPropertySetInfo > lcl_getPropertySetInfo( SfxStyleFamily static uno::Reference< beans::XPropertySetInfo > xPageRef; if(!xPageRef.is()) { - SfxItemPropertySet aPropSet( - aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PAGE_STYLE) ); - xPageRef = aPropSet.getPropertySetInfo(); + xPageRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PAGE_STYLE)->getPropertySetInfo(); } xRet = xPageRef; } @@ -1692,9 +1693,7 @@ uno::Reference< beans::XPropertySetInfo > lcl_getPropertySetInfo( SfxStyleFamily static uno::Reference< beans::XPropertySetInfo > xFrameRef; if(!xFrameRef.is()) { - SfxItemPropertySet aPropSet( - aSwMapProvider.GetPropertyMap(PROPERTY_MAP_FRAME_STYLE)); - xFrameRef = aPropSet.getPropertySetInfo(); + xFrameRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_FRAME_STYLE)->getPropertySetInfo(); } xRet = xFrameRef; } @@ -1704,9 +1703,7 @@ uno::Reference< beans::XPropertySetInfo > lcl_getPropertySetInfo( SfxStyleFamily static uno::Reference< beans::XPropertySetInfo > xNumRef; if(!xNumRef.is()) { - SfxItemPropertySet aPropSet( - aSwMapProvider.GetPropertyMap(PROPERTY_MAP_NUM_STYLE)); - xNumRef = aPropSet.getPropertySetInfo(); + xNumRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_NUM_STYLE)->getPropertySetInfo(); } xRet = xNumRef; } @@ -1732,16 +1729,15 @@ void SwXStyle::ApplyDescriptorProperties() mxStyleData.clear(); mxStyleFamily.clear(); - const SfxItemPropertyMap* pTemp = pPropImpl->GetPropertyMap(); - while(pTemp->nWID) + const PropertyEntryVector_t& rPropertyVector = pPropImpl->GetPropertyVector(); + PropertyEntryVector_t::const_iterator aIt = rPropertyVector.begin(); + while(aIt != rPropertyVector.end()) { uno::Any* pAny; - String sPropName(C2S(pTemp->pName)); - OUString sUPropName(sPropName); - pPropImpl->GetProperty(sPropName, pAny); + pPropImpl->GetProperty(aIt->sName, pAny); if(pAny) - setPropertyValue(sUPropName, *pAny); - pTemp++; + setPropertyValue(aIt->sName, *pAny); + ++aIt; } } @@ -1831,8 +1827,8 @@ const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc() ---------------------------------------------------------------------------*/ -void lcl_SetStyleProperty(const SfxItemPropertyMap* pMap, - SfxItemPropertySet& rPropSet, +void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, + const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& rBase, SfxStyleSheetBasePool* pBasePool, @@ -1842,7 +1838,7 @@ void lcl_SetStyleProperty(const SfxItemPropertyMap* pMap, lang::WrappedTargetException, uno::RuntimeException) { - switch(pMap->nWID) + switch(rEntry.nWID) { case RES_PAPER_BIN: { @@ -1869,9 +1865,9 @@ void lcl_SetStyleProperty(const SfxItemPropertyMap* pMap, else { SfxItemSet& rStyleSet = rBase.GetItemSet(); - SfxItemSet aSet(*rStyleSet.GetPool(), pMap->nWID, pMap->nWID); + SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID); aSet.SetParent(&rStyleSet); - rPropSet.setPropertyValue(*pMap, uno::makeAny ( static_cast < sal_Int8 > ( nBin == USHRT_MAX-1 ? -1 : nBin ) ), aSet); + rPropSet.setPropertyValue(rEntry, uno::makeAny ( static_cast < sal_Int8 > ( nBin == USHRT_MAX-1 ? -1 : nBin ) ), aSet); rStyleSet.Put(aSet); } } @@ -1991,7 +1987,7 @@ void lcl_SetStyleProperty(const SfxItemPropertyMap* pMap, } break; case RES_PAGEDESC : - if( MID_PAGEDESC_PAGEDESCNAME != pMap->nMemberId) + if( MID_PAGEDESC_PAGEDESCNAME != rEntry.nMemberId) goto put_itemset; { // Sonderbehandlung RES_PAGEDESC @@ -2148,7 +2144,7 @@ void lcl_SetStyleProperty(const SfxItemPropertyMap* pMap, } break; case RES_TXTATR_CJK_RUBY: - if(MID_RUBY_CHARSTYLE == pMap->nMemberId ) + if(MID_RUBY_CHARSTYLE == rEntry.nMemberId ) { OUString sTmp; if(rValue >>= sTmp) @@ -2179,7 +2175,7 @@ void lcl_SetStyleProperty(const SfxItemPropertyMap* pMap, //break; case RES_PARATR_DROP: { - if( MID_DROPCAP_CHAR_STYLE_NAME == pMap->nMemberId) + if( MID_DROPCAP_CHAR_STYLE_NAME == rEntry.nMemberId) { if(rValue.getValueType() == ::getCppuType((const OUString*)0)) { @@ -2214,13 +2210,13 @@ void lcl_SetStyleProperty(const SfxItemPropertyMap* pMap, put_itemset: { SfxItemSet& rStyleSet = rBase.GetItemSet(); - SfxItemSet aSet(*rStyleSet.GetPool(), pMap->nWID, pMap->nWID); + SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID); aSet.SetParent(&rStyleSet); - rPropSet.setPropertyValue(*pMap, rValue, aSet); + rPropSet.setPropertyValue(rEntry, rValue, aSet); rStyleSet.Put(aSet); // --> OD 2006-10-18 #i70223# if ( SFX_STYLE_FAMILY_PARA == eFamily && - pMap->nWID == RES_PARATR_NUMRULE && + rEntry.nWID == RES_PARATR_NUMRULE && rBase.mxNewBase.is() && rBase.mxNewBase->GetCollection() && //rBase.mxNewBase->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei rBase.mxNewBase->GetCollection()->IsAssignedToListLevelOfOutlineStyle() ) ////<-end,add by zhaojianwei @@ -2251,18 +2247,18 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl( { if ( !m_pDoc ) throw uno::RuntimeException(); - sal_Int8 nPropSetId = PROPERTY_SET_CHAR_STYLE; + sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE; switch(eFamily) { - case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_SET_CONDITIONAL_PARA_STYLE : PROPERTY_SET_PARA_STYLE; break; - case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_SET_FRAME_STYLE ;break; - case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_SET_PAGE_STYLE ;break; - case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_SET_NUM_STYLE ;break; + case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break; + case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE ;break; + case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE ;break; + case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE ;break; default: ; } - SfxItemPropertySet &rPropSet = aSwMapProvider.GetPropertySet(nPropSetId); - const SfxItemPropertyMap *pMap = rPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); + const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap(); if(rPropertyNames.getLength() != rValues.getLength()) throw lang::IllegalArgumentException(); @@ -2286,16 +2282,16 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl( for(sal_Int16 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) { - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[nProp]); + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp]); - if(!pMap || + if(!pEntry || (!bIsConditional && pNames[nProp].equalsAsciiL(SW_PROP_NAME(UNO_NAME_PARA_STYLE_CONDITIONS)))) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); if(aBaseImpl.mxNewBase.is()) { - lcl_SetStyleProperty(pMap, rPropSet, pValues[nProp], aBaseImpl, + lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, pBasePool, m_pDoc, eFamily); } else if(bIsDescriptor) @@ -2334,15 +2330,15 @@ void SwXStyle::setPropertyValues( } -uno::Any lcl_GetStyleProperty(const SfxItemPropertyMap* pMap, - SfxItemPropertySet& rPropSet, +uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, + const SfxItemPropertySet& rPropSet, SwStyleBase_Impl& rBase, SfxStyleSheetBase* pBase, SfxStyleFamily eFamily, SwDoc *pDoc) throw(uno::RuntimeException) { uno::Any aRet; - if(FN_UNO_IS_PHYSICAL == pMap->nWID) + if(FN_UNO_IS_PHYSICAL == rEntry.nWID) { BOOL bPhys = pBase != 0; if(pBase) @@ -2360,12 +2356,12 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertyMap* pMap, { if(!rBase.mxNewBase.is()) rBase.mxNewBase = new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ); - switch(pMap->nWID) + switch(rEntry.nWID) { case RES_PAPER_BIN: { SfxItemSet& rSet = rBase.GetItemSet(); - aRet = rPropSet.getPropertyValue(*pMap, rSet); + rPropSet.getPropertyValue(rEntry, rSet, aRet); sal_Int8 nBin = 0; aRet >>= nBin; if ( nBin == -1 ) @@ -2411,7 +2407,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertyMap* pMap, } break; case RES_PAGEDESC : - if( MID_PAGEDESC_PAGEDESCNAME != pMap->nMemberId) + if( MID_PAGEDESC_PAGEDESCNAME != rEntry.nMemberId) goto query_itemset; { // Sonderbehandlung RES_PAGEDESC @@ -2520,7 +2516,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertyMap* pMap, query_itemset: { SfxItemSet& rSet = rBase.GetItemSet(); - aRet = rPropSet.getPropertyValue(*pMap, rSet); + rPropSet.getPropertyValue(rEntry, rSet, aRet); } } } @@ -2537,18 +2533,18 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl( { if ( !m_pDoc ) throw uno::RuntimeException(); - sal_Int8 nPropSetId = PROPERTY_SET_CHAR_STYLE; + sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE; switch(eFamily) { - case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_SET_CONDITIONAL_PARA_STYLE : PROPERTY_SET_PARA_STYLE; break; - case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_SET_FRAME_STYLE ;break; - case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_SET_PAGE_STYLE ;break; - case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_SET_NUM_STYLE ;break; + case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break; + case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE ;break; + case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE ;break; + case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE ;break; default: ; } - SfxItemPropertySet &rPropSet = aSwMapProvider.GetPropertySet(nPropSetId); - const SfxItemPropertyMap *pMap = rPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); + const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap(); const OUString* pNames = rPropertyNames.getConstArray(); uno::Sequence< uno::Any > aRet(rPropertyNames.getLength()); @@ -2557,8 +2553,8 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl( SfxStyleSheetBase* pBase = 0; for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) { - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[nProp]); - if(!pMap || + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp]); + if(!pEntry || (!bIsConditional && pNames[nProp].equalsAsciiL(SW_PROP_NAME(UNO_NAME_PARA_STYLE_CONDITIONS)))) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); if(pBasePool) @@ -2570,7 +2566,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl( pBase = pBasePool->Find(sStyleName); pBasePool->SetSearchMask(eFamily, nSaveMask ); } - pRet[nProp] = lcl_GetStyleProperty(pMap, rPropSet, aBase, pBase, eFamily, GetDoc() ); + pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, eFamily, GetDoc() ); } else if(bIsDescriptor) { @@ -2591,7 +2587,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl( case SFX_STYLE_FAMILY_CHAR: case SFX_STYLE_FAMILY_FRAME : { - if (pMap->nWID >= POOLATTR_BEGIN && pMap->nWID < RES_UNKNOWNATR_END ) + if (pEntry->nWID >= POOLATTR_BEGIN && pEntry->nWID < RES_UNKNOWNATR_END ) { SwFmt * pFmt; if ( eFamily == SFX_STYLE_FAMILY_CHAR ) @@ -2599,8 +2595,8 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl( else pFmt = m_pDoc->GetDfltFrmFmt(); const SwAttrPool * pPool = pFmt->GetAttrSet().GetPool(); - const SfxPoolItem & rItem = pPool->GetDefaultItem ( pMap->nWID ); - rItem.QueryValue ( pRet[nProp], pMap->nMemberId ); + const SfxPoolItem & rItem = pPool->GetDefaultItem ( pEntry->nWID ); + rItem.QueryValue ( pRet[nProp], pEntry->nMemberId ); } else bExcept = sal_True; @@ -2772,32 +2768,32 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates( { const OUString* pNames = rPropertyNames.getConstArray(); rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); - sal_Int8 nPropSetId = PROPERTY_SET_CHAR_STYLE; + sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE; switch(eFamily) { - case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_SET_CONDITIONAL_PARA_STYLE : PROPERTY_SET_PARA_STYLE; break; - case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_SET_FRAME_STYLE ;break; - case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_SET_PAGE_STYLE; break; - case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_SET_NUM_STYLE ;break; + case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break; + case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE ;break; + case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE; break; + case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE ;break; default: ; } - SfxItemPropertySet &rPropSet = aSwMapProvider.GetPropertySet(nPropSetId); - const SfxItemPropertyMap *pMap = rPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); + const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap(); SfxItemSet aSet = xStyle->GetItemSet(); for(sal_Int32 i = 0; i < rPropertyNames.getLength(); i++) { const String& rPropName = pNames[i]; - pMap = SfxItemPropertyMap::GetByName(pMap, rPropName); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( rPropName); + if(!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) ); - if( FN_UNO_NUM_RULES == pMap->nWID || - FN_UNO_FOLLOW_STYLE == pMap->nWID ) + if( FN_UNO_NUM_RULES == pEntry->nWID || + FN_UNO_FOLLOW_STYLE == pEntry->nWID ) { pStates[i] = beans::PropertyState_DIRECT_VALUE; } - // else if( FN_UNO_DEFAULT_OUTLINE_LEVEL == pMap->nWID ) //#outline level,removed by zahojianwei + // else if( FN_UNO_DEFAULT_OUTLINE_LEVEL == pEntry->nWID ) //#outline level,removed by zahojianwei // { // pStates[i] = // ( xStyle->GetCollection()->GetOutlineLevel() @@ -2809,7 +2805,7 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates( (rPropName.EqualsAscii("Header", 0, 6) || rPropName.EqualsAscii("Footer", 0, 6))) { - sal_uInt16 nResId = lcl_ConvertFNToRES(pMap->nWID); + sal_uInt16 nResId = lcl_ConvertFNToRES(pEntry->nWID); BOOL bFooter = rPropName.EqualsAscii("Footer", 0, 6); const SvxSetItem* pSetItem; if(SFX_ITEM_SET == aSet.GetItemState( @@ -2828,15 +2824,15 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates( } else { - pStates[i] = rPropSet.getPropertyState(*pMap, aSet); + pStates[i] = pPropSet->getPropertyState(*pEntry, aSet); if( SFX_STYLE_FAMILY_PAGE == eFamily && - SID_ATTR_PAGE_SIZE == pMap->nWID && + SID_ATTR_PAGE_SIZE == pEntry->nWID && beans::PropertyState_DIRECT_VALUE == pStates[i] ) { const SvxSizeItem& rSize = static_cast < const SvxSizeItem& >( aSet.Get(SID_ATTR_PAGE_SIZE) ); - sal_uInt8 nMemberId = pMap->nMemberId & 0x7f; + sal_uInt8 nMemberId = pEntry->nMemberId & 0x7f; if( ( LONG_MAX == rSize.GetSize().Width() && (MID_SIZE_WIDTH == nMemberId || MID_SIZE_SIZE == nMemberId ) ) || @@ -2901,18 +2897,18 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >& } } } - sal_Int8 nPropSetId = PROPERTY_SET_CHAR_STYLE; + sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE; switch(eFamily) { - case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_SET_CONDITIONAL_PARA_STYLE : PROPERTY_SET_PARA_STYLE; break; - case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_SET_FRAME_STYLE; break; - case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_SET_PAGE_STYLE; break; - case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_SET_NUM_STYLE; break; + case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break; + case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE; break; + case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE; break; + case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE; break; default: ; } - SfxItemPropertySet &rPropSet = aSwMapProvider.GetPropertySet(nPropSetId); - const SfxItemPropertyMap *pMap = rPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); + const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap(); const OUString* pNames = aPropertyNames.getConstArray(); @@ -2920,22 +2916,22 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >& { for( sal_Int32 nProp = 0, nEnd = aPropertyNames.getLength(); nProp < nEnd; nProp++ ) { - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[nProp] ); - if( !pMap ) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp] ); + if( !pEntry ) throw beans::UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is unknown: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nWID == FN_UNO_FOLLOW_STYLE || pMap->nWID == FN_UNO_NUM_RULES ) + if ( pEntry->nWID == FN_UNO_FOLLOW_STYLE || pEntry->nWID == FN_UNO_NUM_RULES ) throw uno::RuntimeException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Cannot reset: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY ) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY ) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertiesToDefault: property is read-only: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - //if( pMap->nWID == FN_UNO_DEFAULT_OUTLINE_LEVEL ) //#outline level, removed by zhaojianwei + //if( pEntry->nWID == FN_UNO_DEFAULT_OUTLINE_LEVEL ) //#outline level, removed by zhaojianwei // static_cast<SwTxtFmtColl*>(pTargetFmt)->SetOutlineLevel( NO_NUMBERING ); //else - // pTargetFmt->ResetFmtAttr( pMap->nWID ); - if( pMap->nWID == RES_PARATR_OUTLINELEVEL ) //add by zhaojianwei + // pTargetFmt->ResetFmtAttr( pEntry->nWID ); + if( pEntry->nWID == RES_PARATR_OUTLINELEVEL ) //add by zhaojianwei static_cast<SwTxtFmtColl*>(pTargetFmt)->DeleteAssignmentToListLevelOfOutlineStyle(); else - pTargetFmt->ResetFmtAttr( pMap->nWID ); //<-end,zhaojianwei + pTargetFmt->ResetFmtAttr( pEntry->nWID ); //<-end,zhaojianwei } } else if ( bIsDescriptor ) @@ -3089,35 +3085,34 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::getPropertyDefaults( const uno::Seq if(pBase) { rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); - sal_Int8 nPropSetId = PROPERTY_SET_CHAR_STYLE; + sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE; switch(eFamily) { - case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_SET_CONDITIONAL_PARA_STYLE : PROPERTY_SET_PARA_STYLE; break; - case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_SET_FRAME_STYLE; break; - case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_SET_PAGE_STYLE; break; - case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_SET_NUM_STYLE; break; + case SFX_STYLE_FAMILY_PARA : nPropSetId = bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : PROPERTY_MAP_PARA_STYLE; break; + case SFX_STYLE_FAMILY_FRAME : nPropSetId = PROPERTY_MAP_FRAME_STYLE; break; + case SFX_STYLE_FAMILY_PAGE : nPropSetId = PROPERTY_MAP_PAGE_STYLE; break; + case SFX_STYLE_FAMILY_PSEUDO: nPropSetId = PROPERTY_MAP_NUM_STYLE; break; default: ; } - SfxItemPropertySet &rPropSet = aSwMapProvider.GetPropertySet(nPropSetId); - const SfxItemPropertyMap* pMap = rPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); + const SfxItemPropertyMap* pMap = pPropSet->getPropertyMap(); const SfxItemSet &rSet = xStyle->GetItemSet(), *pParentSet = rSet.GetParent(); const OUString *pNames = aPropertyNames.getConstArray(); uno::Any *pRet = aRet.getArray(); for ( sal_Int32 i = 0 ; i < nCount; i++) { - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[i]); - - if ( !pMap ) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[i] ); + if ( !pEntry ) throw beans::UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( this ) ); if( pParentSet ) - pRet[i] = aSwMapProvider.GetPropertySet(nPropSetId).getPropertyValue(pNames[i], *pParentSet); - else if( pMap->nWID != rSet.GetPool()->GetSlotId(pMap->nWID) ) + aSwMapProvider.GetPropertySet(nPropSetId)->getPropertyValue(pNames[i], *pParentSet, pRet[i]); + else if( pEntry->nWID != rSet.GetPool()->GetSlotId(pEntry->nWID) ) { - const SfxPoolItem& rItem = rSet.GetPool()->GetDefaultItem(pMap->nWID); - rItem.QueryValue(pRet[i], pMap->nMemberId); + const SfxPoolItem& rItem = rSet.GetPool()->GetDefaultItem(pEntry->nWID); + rItem.QueryValue(pRet[i], pEntry->nMemberId); } } } @@ -3217,14 +3212,14 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( { if(!GetDoc()) throw uno::RuntimeException(); - SfxItemPropertySet& aPropSet = aSwMapProvider.GetPropertySet(PROPERTY_SET_PAGE_STYLE); if(rPropertyNames.getLength() != rValues.getLength()) throw lang::IllegalArgumentException(); const OUString* pNames = rPropertyNames.getConstArray(); const uno::Any* pValues = rValues.getConstArray(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PAGE_STYLE); + const SfxItemPropertyMap* pMap = pPropSet->getPropertyMap(); SwStyleBase_Impl aBaseImpl(*GetDoc(), GetStyleName()); if(GetBasePool()) { @@ -3241,15 +3236,15 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( for(sal_Int16 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) { - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[nProp]); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp] ); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); if(GetBasePool()) { - switch(pMap->nWID) + switch(pEntry->nWID) { case FN_UNO_HEADER_ON: case FN_UNO_HEADER_BACKGROUND: @@ -3277,7 +3272,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( sal_Bool bFooter = sal_False; sal_uInt16 nItemType = TYPE_BOOL; sal_uInt16 nRes = 0; - switch(pMap->nWID) + switch(pEntry->nWID) { case FN_UNO_FOOTER_ON: bFooter = sal_True; //kein break; @@ -3349,7 +3344,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( case TYPE_BOX: pNewItem = new SvxBoxItem(nRes); break; } } - bSetItem = pNewItem->PutValue(pValues[nProp], pMap->nMemberId); + bSetItem = pNewItem->PutValue(pValues[nProp], pEntry->nMemberId); rSetSet.Put(*pNewItem); aBaseImpl.GetItemSet().Put(*pNewSetItem); delete pNewItem; @@ -3386,7 +3381,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( { const SfxPoolItem& rItem = aBaseImpl.GetItemSet().Get(FN_PARAM_FTN_INFO); SfxPoolItem* pNewFtnItem = rItem.Clone(); - sal_Bool bPut = pNewFtnItem->PutValue(pValues[nProp], pMap->nMemberId); + sal_Bool bPut = pNewFtnItem->PutValue(pValues[nProp], pEntry->nMemberId); aBaseImpl.GetItemSet().Put(*pNewFtnItem); delete pNewFtnItem; if(!bPut) @@ -3402,7 +3397,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( throw lang::IllegalArgumentException(); //break; default: - lcl_SetStyleProperty(pMap, aPropSet, pValues[nProp], aBaseImpl, + lcl_SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl, GetBasePool(), GetDoc(), GetFamily()); } } @@ -3460,18 +3455,18 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( throw uno::RuntimeException(); sal_Int32 nLength = rPropertyNames.getLength(); - SfxItemPropertySet& aPropSet = aSwMapProvider.GetPropertySet(PROPERTY_SET_PAGE_STYLE); const OUString* pNames = rPropertyNames.getConstArray(); uno::Sequence< uno::Any > aRet ( nLength ); uno::Any* pRet = aRet.getArray(); - const SfxItemPropertyMap* pMap = aPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PAGE_STYLE); + const SfxItemPropertyMap* pMap = pPropSet->getPropertyMap(); SwStyleBase_Impl aBase(*GetDoc(), GetStyleName()); SfxStyleSheetBase* pBase = 0; for(sal_Int32 nProp = 0; nProp < nLength; nProp++) { - pMap = SfxItemPropertyMap::GetByName( pMap, pNames[nProp]); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[nProp] ); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); if(GetBasePool()) @@ -3485,7 +3480,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( } sal_uInt16 nRes = 0; sal_Bool bHeader = sal_False, bAll = sal_False, bLeft = sal_False, bRight = sal_False; - switch(pMap->nWID) + switch(pEntry->nWID) { case FN_UNO_HEADER_ON: case FN_UNO_HEADER_BACKGROUND: @@ -3517,7 +3512,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); const SfxItemSet& rSet = xStyle->GetItemSet(); sal_Bool bFooter = sal_False; - switch(pMap->nWID) + switch(pEntry->nWID) { case FN_UNO_FOOTER_ON: bFooter = sal_True; @@ -3578,7 +3573,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( if(!pItem && nRes != rTmpSet.GetPool()->GetSlotId(nRes)) pItem = &rTmpSet.GetPool()->GetDefaultItem(nRes); if(pItem) - pItem->QueryValue(pRet[nProp], pMap->nMemberId); + pItem->QueryValue(pRet[nProp], pEntry->nMemberId); } } } @@ -3640,11 +3635,11 @@ MakeObject: rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); const SfxItemSet& rSet = xStyle->GetItemSet(); const SfxPoolItem& rItem = rSet.Get(FN_PARAM_FTN_INFO); - rItem.QueryValue(pRet[nProp], pMap->nMemberId); + rItem.QueryValue(pRet[nProp], pEntry->nMemberId); } break; default: - pRet[nProp] = lcl_GetStyleProperty(pMap, aPropSet, aBase, pBase, GetFamily(), GetDoc() ); + pRet[nProp] = lcl_GetStyleProperty(*pEntry, *pPropSet, aBase, pBase, GetFamily(), GetDoc() ); } } else if(IsDescriptor()) @@ -3912,25 +3907,25 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle( if( !pDocShell ) throw uno::RuntimeException(); const USHORT* pRange = 0; - const SfxItemPropertyMap* pMap = 0; + const SfxItemPropertySet* pPropSet = 0; switch( eFamily ) { case IStyleAccess::AUTO_STYLE_CHAR: { pRange = aCharAutoFmtSetRange; - pMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_CHAR_AUTO_STYLE); + pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_CHAR_AUTO_STYLE); } break; case IStyleAccess::AUTO_STYLE_RUBY: { pRange = 0;//aTxtNodeSetRange; - pMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_RUBY_AUTO_STYLE); + pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_RUBY_AUTO_STYLE); } break; case IStyleAccess::AUTO_STYLE_PARA: { pRange = aTxtNodeSetRange; - pMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARA_AUTO_STYLE); + pPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARA_AUTO_STYLE); } break; @@ -3938,14 +3933,13 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle( ; } SwAttrSet aSet( pDocShell->GetDoc()->GetAttrPool(), pRange ); - SfxItemPropertySet aPropSet( pMap ); const beans::PropertyValue* pSeq = Values.getConstArray(); sal_Int32 nLen = Values.getLength(); for( sal_Int32 i = 0; i < nLen; ++i ) { try { - aPropSet.setPropertyValue( pSeq[i].Name, pSeq[i].Value, aSet ); + pPropSet->setPropertyValue( pSeq[i].Name, pSeq[i].Value, aSet ); } catch (beans::UnknownPropertyException &) { @@ -4118,9 +4112,7 @@ uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( ) static uno::Reference< beans::XPropertySetInfo > xCharRef; if(!xCharRef.is()) { - SfxItemPropertySet aPropSet( - aSwMapProvider.GetPropertyMap(PROPERTY_MAP_CHAR_AUTO_STYLE)); - xCharRef = aPropSet.getPropertySetInfo(); + xCharRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_CHAR_AUTO_STYLE)->getPropertySetInfo(); } xRet = xCharRef; } @@ -4131,9 +4123,7 @@ uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( ) if(!xRubyRef.is()) { sal_uInt16 nMapId = PROPERTY_MAP_RUBY_AUTO_STYLE; - SfxItemPropertySet aPropSet( - aSwMapProvider.GetPropertyMap(nMapId)); - xRubyRef = aPropSet.getPropertySetInfo(); + xRubyRef = aSwMapProvider.GetPropertySet(nMapId)->getPropertySetInfo(); } xRet = xRubyRef; } @@ -4144,9 +4134,7 @@ uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( ) if(!xParaRef.is()) { sal_uInt16 nMapId = PROPERTY_MAP_PARA_AUTO_STYLE; - SfxItemPropertySet aPropSet( - aSwMapProvider.GetPropertyMap(nMapId)); - xParaRef = aPropSet.getPropertySetInfo(); + xParaRef = aSwMapProvider.GetPropertySet(nMapId)->getPropertySetInfo(); } xRet = xParaRef; } @@ -4250,18 +4238,18 @@ uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl( throw uno::RuntimeException(); // query_item - sal_Int8 nPropSetId = PROPERTY_SET_CHAR_AUTO_STYLE; + sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; switch(eFamily) { - case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_SET_CHAR_AUTO_STYLE; break; - case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_SET_RUBY_AUTO_STYLE; break; - case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_SET_PARA_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_MAP_RUBY_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_MAP_PARA_AUTO_STYLE; break; default: ; } - SfxItemPropertySet &rPropSet = aSwMapProvider.GetPropertySet(nPropSetId); - const SfxItemPropertyMap *pMap = rPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); + const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap(); const OUString* pNames = rPropertyNames.getConstArray(); sal_Int32 nLen = rPropertyNames.getLength(); @@ -4273,16 +4261,16 @@ uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl( for( sal_Int32 i = 0; i < nLen; ++i ) { const String& rPropName = pNames[i]; - pMap = SfxItemPropertyMap::GetByName(pMap, rPropName); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(rPropName); + if(!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) ); - else if ( RES_TXTATR_AUTOFMT == pMap->nWID || RES_AUTO_STYLE == pMap->nWID ) + else if ( RES_TXTATR_AUTOFMT == pEntry->nWID || RES_AUTO_STYLE == pEntry->nWID ) { OUString sName(StylePool::nameOf( pSet )); pValues[i] <<= sName; } else - pValues[i] = rPropSet.getPropertyValue( *pMap, rSet ); + pPropSet->getPropertyValue( *pEntry, rSet, pValues[i] ); } return aRet; } @@ -4394,26 +4382,26 @@ uno::Sequence< beans::PropertyState > SwXAutoStyle::getPropertyStates( beans::PropertyState* pStates = aRet.getArray(); const OUString* pNames = rPropertyNames.getConstArray(); - sal_Int8 nPropSetId = PROPERTY_SET_CHAR_AUTO_STYLE; + sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; switch(eFamily) { - case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_SET_CHAR_AUTO_STYLE; break; - case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_SET_RUBY_AUTO_STYLE; break; - case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_SET_PARA_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_MAP_RUBY_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_MAP_PARA_AUTO_STYLE; break; default: ; } - SfxItemPropertySet &rPropSet = aSwMapProvider.GetPropertySet(nPropSetId); - const SfxItemPropertyMap *pMap = rPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); + const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap(); SfxItemSet& rSet = *pSet.get(); for(sal_Int32 i = 0; i < rPropertyNames.getLength(); i++) { const String& rPropName = pNames[i]; - pMap = SfxItemPropertyMap::GetByName(pMap, rPropName); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(rPropName); + if(!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) ); - pStates[i] = rPropSet.getPropertyState(*pMap, rSet); + pStates[i] = pPropSet->getPropertyState(*pEntry, rSet ); } return aRet; } @@ -4460,15 +4448,32 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno:: sal_Int8 nPropSetId = 0; switch(eFamily) { - case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_SET_CHAR_AUTO_STYLE; break; - case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_SET_RUBY_AUTO_STYLE; break; - case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_SET_PARA_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_MAP_RUBY_AUTO_STYLE; break; + case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_MAP_PARA_AUTO_STYLE; break; default: ; } - SfxItemPropertySet& rPropSet = aSwMapProvider.GetPropertySet(nPropSetId); - const SfxItemPropertyMap* pMap = rPropSet.getPropertyMap(); + const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); + const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap(); + PropertyEntryVector_t aPropVector = pMap->getPropertyEntries(); +// struct compareWhichIds +// { +// bool operator()(const USHORT w1, const USHORT w2) const +// { +// return w1 < w2; +// } +// }; +// typedef std::map<const USHORT, SfxItemPropertyNamedEntry, compareWhichIds> PropertyMap_t; +// PropertyMap_t aPropMap; +// aPropMap.reserve( aPropVector.size() ); +// PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin(); +// while( aIt != aPropertyEntries.end() ) +// { +// aPropMap[aIt->nWID] = *aIt; +// ++aIt; +// } SfxItemSet& rSet = *pSet.get(); SfxItemIter aIter(rSet); @@ -4478,8 +4483,29 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno:: { const USHORT nWID = pItem->Which(); - // TODO: Optimize - int i = 0; +// PropertyMap_t::const_iterator aMapIt = aPropMap[nWID]; +// if( aMapIt != aPropMap.getEnd() ) +// { +// beans::PropertyValue aPropertyValue; +// aPropertyValue.Name = aIt->sName; +// pItem->QueryValue( aPropertyValue.Value, aIt->nMemberId ); +// aPropertyVector.push_back( aPropertyValue ); +// } + // TODO: Optimize - and fix! the old iteration filled each WhichId + // only once but there are more properties than WhichIds + PropertyEntryVector_t::const_iterator aIt = aPropVector.begin(); + while( aIt != aPropVector.end() ) + { + if ( aIt->nWID == nWID ) + { + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = aIt->sName; + pItem->QueryValue( aPropertyValue.Value, aIt->nMemberId ); + aPropertyVector.push_back( aPropertyValue ); + } + ++aIt; + } +/* int i = 0; while ( pMap[i].nWID != 0 ) { if ( pMap[i].nWID == nWID ) @@ -4492,7 +4518,7 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno:: break; } ++i; - } + }*/ pItem = aIter.NextItem(); } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index f89f8b9a8d..9f4e83f1b0 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -69,6 +69,7 @@ #include <redline.hxx> #include <unoredline.hxx> #include <unoprnms.hxx> +#include <unocrsrhelper.hxx> #include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> #include <com/sun/star/text/TableColumnSeparator.hpp> @@ -149,11 +150,11 @@ sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLi /* -----------------11.12.98 14:22------------------- * * --------------------------------------------------*/ -void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertyMap* pMap, const uno::Any& aValue) +void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue) throw (lang::IllegalArgumentException) { //Sonderbehandlung fuer "Nicht-Items" - switch(pMap->nWID) + switch(pEntry->nWID) { case FN_TABLE_HEADLINE_REPEAT: case FN_TABLE_HEADLINE_COUNT: @@ -161,7 +162,7 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertyMap* pMap, cons SwTable* pTable = SwTable::FindTable( pFmt ); { UnoActionContext aAction(pFmt->GetDoc()); - if( pMap->nWID == FN_TABLE_HEADLINE_REPEAT) + if( pEntry->nWID == FN_TABLE_HEADLINE_REPEAT) { sal_Bool bVal = *(sal_Bool*)aValue.getValue(); pFmt->GetDoc()->SetRowsToRepeat( *pTable, bVal ? 1 : 0 ); @@ -182,20 +183,20 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertyMap* pMap, cons { sal_Int32 nWidth = 0; SwFmtFrmSize aSz( pFmt->GetFrmSize() ); - if(FN_TABLE_WIDTH == pMap->nWID) + if(FN_TABLE_WIDTH == pEntry->nWID) { aValue >>= nWidth; aSz.SetWidthPercent(0); aSz.SetWidth ( MM100_TO_TWIP ( nWidth ) ); } - else if(FN_TABLE_RELATIVE_WIDTH == pMap->nWID) + else if(FN_TABLE_RELATIVE_WIDTH == pEntry->nWID) { sal_Int16 nSet = 0; aValue >>= nSet; if(nSet && nSet <=100) aSz.SetWidthPercent( (BYTE)nSet ); } - else if(FN_TABLE_IS_RELATIVE_WIDTH == pMap->nWID) + else if(FN_TABLE_IS_RELATIVE_WIDTH == pEntry->nWID) { sal_Bool bPercent = *(sal_Bool*)aValue.getValue(); if(!bPercent) @@ -233,17 +234,17 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertyMap* pMap, cons /* -----------------27.04.98 08:50------------------- * * --------------------------------------------------*/ -uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertyMap* pMap ) +uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry ) { uno::Any aRet; - switch(pMap->nWID) + switch(pEntry->nWID) { case FN_TABLE_HEADLINE_REPEAT: case FN_TABLE_HEADLINE_COUNT: { SwTable* pTable = SwTable::FindTable( pFmt ); USHORT nRepeat = pTable->GetRowsToRepeat(); - if(pMap->nWID == FN_TABLE_HEADLINE_REPEAT) + if(pEntry->nWID == FN_TABLE_HEADLINE_REPEAT) { BOOL bTemp = nRepeat > 0; aRet.setValue(&bTemp, ::getCppuBooleanType()); @@ -257,9 +258,9 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertyMap* pMap ) case FN_TABLE_RELATIVE_WIDTH: { const SwFmtFrmSize& rSz = pFmt->GetFrmSize(); - if(FN_TABLE_WIDTH == pMap->nWID) + if(FN_TABLE_WIDTH == pEntry->nWID) rSz.QueryValue(aRet, MID_FRMSIZE_WIDTH|CONVERT_TWIPS); - else if(FN_TABLE_RELATIVE_WIDTH == pMap->nWID) + else if(FN_TABLE_RELATIVE_WIDTH == pEntry->nWID) rSz.QueryValue(aRet, MID_FRMSIZE_REL_WIDTH); else { @@ -308,7 +309,7 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertyMap* pMap ) { SwTable* pTable = SwTable::FindTable( pFmt ); SwNode* pTblNode = pTable->GetTableNode(); - if(FN_UNO_REDLINE_NODE_END == pMap->nWID) + if(FN_UNO_REDLINE_NODE_END == pEntry->nWID) pTblNode = pTblNode->EndOfSectionNode(); const SwRedlineTbl& rRedTbl = pFmt->GetDoc()->GetRedlineTbl(); for(USHORT nRed = 0; nRed < rRedTbl.Count(); nRed++) @@ -760,45 +761,6 @@ void lcl_setValue( SwXCell &rCell, double nVal ) pDoc->UpdateTblFlds( &aTblUpdate ); } } - -/****************************************************************************** - * - ******************************************************************************/ - -const SfxItemPropertyMap* GetTableDescPropertyMap() -{ - static SfxItemPropertyMap aTableDescPropertyMap_Impl[] = - { - { SW_PROP_NAME(UNO_NAME_BACK_COLOR ) , RES_BACKGROUND, &::getCppuType((const sal_Int32*)0), PROPERTY_NONE,MID_BACK_COLOR }, - { SW_PROP_NAME(UNO_NAME_BREAK_TYPE), RES_BREAK, &::getCppuType((const style::BreakType*)0), PROPERTY_NONE, 0}, - { SW_PROP_NAME(UNO_NAME_GRAPHIC_URL ), RES_BACKGROUND, &::getCppuType((const OUString*)0), PROPERTY_NONE ,MID_GRAPHIC_URL }, - { SW_PROP_NAME(UNO_NAME_GRAPHIC_FILTER ), RES_BACKGROUND, &::getCppuType((const OUString*)0), PROPERTY_NONE ,MID_GRAPHIC_FILTER }, - { SW_PROP_NAME(UNO_NAME_GRAPHIC_LOCATION) , RES_BACKGROUND, &::getCppuType((const style::GraphicLocation*)0), PROPERTY_NONE ,MID_GRAPHIC_POSITION}, - { SW_PROP_NAME(UNO_NAME_LEFT_MARGIN), RES_LR_SPACE, &::getCppuType((const sal_Int32*)0), PROPERTY_NONE, MID_L_MARGIN}, - { SW_PROP_NAME(UNO_NAME_RIGHT_MARGIN), RES_LR_SPACE, &::getCppuType((const sal_Int32*)0), PROPERTY_NONE, MID_R_MARGIN}, - { SW_PROP_NAME(UNO_NAME_HORI_ORIENT ), RES_HORI_ORIENT, &::getCppuType((const sal_Int16*)0), PROPERTY_NONE ,MID_HORIORIENT_ORIENT }, - { SW_PROP_NAME(UNO_NAME_KEEP_TOGETHER), RES_KEEP, &::getBooleanCppuType() , PROPERTY_NONE, 0}, - { SW_PROP_NAME(UNO_NAME_SPLIT ), RES_LAYOUT_SPLIT, &::getBooleanCppuType() , PROPERTY_NONE, 0}, - { SW_PROP_NAME(UNO_NAME_PAGE_NUMBER_OFFSET), RES_PAGEDESC, &::getCppuType((const sal_Int16*)0), PROPERTY_NONE, MID_PAGEDESC_PAGENUMOFFSET}, - { SW_PROP_NAME(UNO_NAME_PAGE_STYLE_NAME), 0, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0}, - { SW_PROP_NAME(UNO_NAME_RELATIVE_WIDTH), FN_TABLE_RELATIVE_WIDTH,&::getCppuType((const sal_Int16*)0) , PROPERTY_NONE, 0 }, - { SW_PROP_NAME(UNO_NAME_REPEAT_HEADLINE) , FN_TABLE_HEADLINE_REPEAT,&::getBooleanCppuType(), PROPERTY_NONE, 0}, - { SW_PROP_NAME(UNO_NAME_SHADOW_FORMAT), RES_SHADOW, &::getCppuType((const table::ShadowFormat*)0), PROPERTY_NONE, CONVERT_TWIPS}, - { SW_PROP_NAME(UNO_NAME_IS_WIDTH_RELATIVE), FN_TABLE_IS_RELATIVE_WIDTH, &::getBooleanCppuType() , PROPERTY_NONE, 0 }, - { SW_PROP_NAME(UNO_NAME_TABLE_NAME), 0, &::getCppuType((const OUString*)0), PROPERTY_NONE, 0 }, - { SW_PROP_NAME(UNO_NAME_TOP_MARGIN), RES_UL_SPACE, &::getCppuType((const sal_Int32*)0), PROPERTY_NONE, MID_UP_MARGIN|CONVERT_TWIPS}, - { SW_PROP_NAME(UNO_NAME_BOTTOM_MARGIN), RES_UL_SPACE, &::getCppuType((const sal_Int32*)0), PROPERTY_NONE, MID_LO_MARGIN|CONVERT_TWIPS}, - { SW_PROP_NAME(UNO_NAME_BACK_TRANSPARENT), RES_BACKGROUND, &::getBooleanCppuType(), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT }, - { SW_PROP_NAME(UNO_NAME_WIDTH), FN_TABLE_WIDTH, &::getCppuType((const sal_Int32*)0) , PROPERTY_NONE, 0}, - { SW_PROP_NAME(UNO_NAME_CHART_ROW_AS_LABEL), FN_UNO_RANGE_ROW_LABEL, &::getBooleanCppuType(), PROPERTY_NONE, 0}, - { SW_PROP_NAME(UNO_NAME_CHART_COLUMN_AS_LABEL), FN_UNO_RANGE_COL_LABEL, &::getBooleanCppuType() , PROPERTY_NONE, 0}, - { SW_PROP_NAME(UNO_NAME_TABLE_BORDER), FN_UNO_TABLE_BORDER, &::getCppuType((const table::TableBorder*)0), beans::PropertyAttribute::MAYBEVOID, CONVERT_TWIPS }, - { SW_PROP_NAME(UNO_NAME_TABLE_BORDER_DISTANCES), FN_UNO_TABLE_BORDER_DISTANCES, &::getCppuType((const table::TableBorderDistances*)0), beans::PropertyAttribute::MAYBEVOID, CONVERT_TWIPS }, - {0,0,0,0,0,0} - }; - #define TABLE_PROP_COUNT 25 - return aTableDescPropertyMap_Impl; -} /****************************************************************** * SwXCell ******************************************************************/ @@ -809,7 +771,7 @@ TYPEINIT1(SwXCell, SwClient); SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) : SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT), SwClient(pTblFmt), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TABLE_CELL)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TABLE_CELL)), pBox(pBx), pStartNode(0), nFndPos(nPos) @@ -821,7 +783,7 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) : SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) : SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT), SwClient(pTblFmt), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TABLE_CELL)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TABLE_CELL)), pBox(0), pStartNode(&rStartNode), nFndPos(USHRT_MAX) @@ -1120,7 +1082,7 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno: -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXCell::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } /*-- 11.12.98 10:56:34--------------------------------------------------- @@ -1132,15 +1094,15 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV vos::OGuard aGuard(Application::GetSolarMutex()); if(IsValid()) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if( !pMap ) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if( !pEntry ) { beans::UnknownPropertyException aEx; aEx.Message = rPropertyName; throw( aEx ); } - if( pMap->nWID == FN_UNO_CELL_ROW_SPAN ) + if( pEntry->nWID == FN_UNO_CELL_ROW_SPAN ) { sal_Int32 nRowSpan = 0; if( aValue >>= nRowSpan ) @@ -1150,7 +1112,7 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV { SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt(); SwAttrSet aSet(pBoxFmt->GetAttrSet()); - aPropSet.setPropertyValue(rPropertyName, aValue, aSet); + m_pPropSet->setPropertyValue(rPropertyName, aValue, aSet); pBoxFmt->GetDoc()->SetAttr(aSet, *pBoxFmt); } } @@ -1165,15 +1127,15 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName) uno::Any aRet; if(IsValid()) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if( !pMap ) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if( !pEntry ) { beans::UnknownPropertyException aEx; aEx.Message = rPropertyName; throw( aEx ); } - switch( pMap->nWID ) + switch( pEntry->nWID ) { case FN_UNO_CELL_ROW_SPAN: aRet <<= pBox->getRowSpan(); @@ -1207,7 +1169,7 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName) { const SwFrmFmt* pBoxFmt = pBox->GetFrmFmt(); const SwAttrSet& rSet = pBoxFmt->GetAttrSet(); - aRet = aPropSet.getPropertyValue(rPropertyName, rSet); + m_pPropSet->getPropertyValue(rPropertyName, rSet, aRet); } } } @@ -1405,7 +1367,7 @@ TYPEINIT1(SwXTextTableRow, SwClient); -----------------------------------------------------------------------*/ SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) : SwClient(pFmt), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_TABLE_ROW)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_ROW)), pLine(pLn) { @@ -1422,7 +1384,7 @@ SwXTextTableRow::~SwXTextTableRow() -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextTableRow::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } /*-- 11.12.98 12:04:46--------------------------------------------------- @@ -1440,21 +1402,21 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, SwTableLine* pLn = SwXTextTableRow::FindLine(pTable, pLine); if(pLn) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); SwDoc* pDoc = pFmt->GetDoc(); - if (!pMap) + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - switch(pMap->nWID) + switch(pEntry->nWID) { case FN_UNO_ROW_HEIGHT: case FN_UNO_ROW_AUTO_HEIGHT: { SwFmtFrmSize aFrmSize(pLn->GetFrmFmt()->GetFrmSize()); - if(FN_UNO_ROW_AUTO_HEIGHT== pMap->nWID) + if(FN_UNO_ROW_AUTO_HEIGHT== pEntry->nWID) { sal_Bool bSet = *(sal_Bool*)aValue.getValue(); aFrmSize.SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE); @@ -1481,7 +1443,7 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, { SwFrmFmt* pLnFmt = pLn->ClaimFrmFmt(); SwAttrSet aSet(pLnFmt->GetAttrSet()); - aPropSet.setPropertyValue(*pMap, aValue, aSet); + m_pPropSet->setPropertyValue(*pEntry, aValue, aSet); pDoc->SetAttr(aSet, *pLnFmt); } } @@ -1502,18 +1464,18 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( SwTableLine* pLn = SwXTextTableRow::FindLine(pTable, pLine); if(pLn) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if (!pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - switch(pMap->nWID) + switch(pEntry->nWID) { case FN_UNO_ROW_HEIGHT: case FN_UNO_ROW_AUTO_HEIGHT: { const SwFmtFrmSize& rSize = pLn->GetFrmFmt()->GetFrmSize(); - if(FN_UNO_ROW_AUTO_HEIGHT== pMap->nWID) + if(FN_UNO_ROW_AUTO_HEIGHT== pEntry->nWID) { BOOL bTmp = ATT_VAR_SIZE == rSize.GetHeightSizeType(); aRet.setValue(&bTmp, ::getCppuBooleanType()); @@ -1530,7 +1492,7 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( default: { const SwAttrSet& rSet = pLn->GetFrmFmt()->GetAttrSet(); - aRet = aPropSet.getPropertyValue(*pMap, rSet); + m_pPropSet->getPropertyValue(*pEntry, rSet, aRet); } } } @@ -1630,7 +1592,7 @@ uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) thr SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) : SwClient(pFmt), aCrsrDepend(this, 0), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_TABLE_CURSOR)) + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_CURSOR)) { SwDoc* pDoc = pFmt->GetDoc(); const SwStartNode* pSttNd = pBox->GetSttNd(); @@ -1647,7 +1609,7 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) : SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor* pTableSelection) : SwClient(&rTableFmt), aCrsrDepend(this, 0), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_TABLE_CURSOR)) + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_CURSOR)) { SwUnoCrsr* pUnoCrsr = pTableSelection->GetDoc()->CreateUnoCrsr(*pTableSelection->GetPoint(), sal_True); if(pTableSelection->HasMark()) @@ -1888,13 +1850,13 @@ sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) th -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextTableCursor::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } /*-- 11.12.98 12:16:17--------------------------------------------------- -----------------------------------------------------------------------*/ -extern sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap, +extern sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertySimpleEntry* pEntry, SwPaM& rPam, SfxItemSet& rSet, const uno::Any& aValue ) throw (lang::IllegalArgumentException); @@ -1916,21 +1878,21 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const SwTableNode* pTblNode = pSttNode->FindTableNode(); lcl_FormatTable((SwFrmFmt*)pTblNode->GetTable().GetFrmFmt()); SwUnoTableCrsr* pTblCrsr = *pUnoCrsr; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if(pEntry) { - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); pTblCrsr->MakeBoxSels(); SwDoc* pDoc = pUnoCrsr->GetDoc(); - switch(pMap->nWID ) + switch(pEntry->nWID ) { case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush( RES_BACKGROUND ); pDoc->GetBoxAttr( *pUnoCrsr, aBrush ); - aBrush.PutValue(aValue, pMap->nMemberId); + aBrush.PutValue(aValue, pEntry->nMemberId); pDoc->SetBoxAttr( *pUnoCrsr, aBrush ); } @@ -1947,11 +1909,11 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, break; default: { - SfxItemSet aItemSet( pDoc->GetAttrPool(), pMap->nWID, pMap->nWID ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); SwXTextCursor::GetCrsrAttr( pTblCrsr->GetSelRing(), aItemSet ); - if(!lcl_setCrsrPropertyValue( pMap, pTblCrsr->GetSelRing(), aItemSet, aValue )) - aPropSet.setPropertyValue( *pMap, aValue, aItemSet ); + if(!lcl_setCrsrPropertyValue( pEntry, pTblCrsr->GetSelRing(), aItemSet, aValue )) + m_pPropSet->setPropertyValue( *pEntry, aValue, aItemSet ); SwXTextCursor::SetCrsrAttr( pTblCrsr->GetSelRing(), aItemSet, CRSR_ATTR_MODE_TABLE ); } } @@ -1975,18 +1937,18 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) const SwTableNode* pTblNode = pSttNode->FindTableNode(); lcl_FormatTable((SwFrmFmt*)pTblNode->GetTable().GetFrmFmt()); SwUnoTableCrsr* pTblCrsr = *pUnoCrsr; - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if(pEntry) { pTblCrsr->MakeBoxSels(); - switch(pMap->nWID ) + switch(pEntry->nWID ) { case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush( RES_BACKGROUND ); if(pTblCrsr->GetDoc()->GetBoxAttr( *pUnoCrsr, aBrush )) - aBrush.QueryValue(aRet, pMap->nMemberId); + aBrush.QueryValue(aRet, pEntry->nMemberId); } break; @@ -2011,7 +1973,7 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) 0L); // erstmal die Attribute des Cursors SwXTextCursor::GetCrsrAttr(pTblCrsr->GetSelRing(), aSet); - aRet = aPropSet.getPropertyValue(*pMap, aSet); + m_pPropSet->getPropertyValue(*pEntry, aSet, aRet); } } } @@ -2064,85 +2026,43 @@ void SwXTextTableCursor::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) class SwTableProperties_Impl { - const SfxItemPropertyMap* _pMap; - uno::Any* pAnyArr[TABLE_PROP_COUNT]; - sal_uInt16 nArrLen; - + SwUnoCursorHelper::SwAnyMapHelper aAnyMap; public: - SwTableProperties_Impl(const SfxItemPropertyMap* pMap); + SwTableProperties_Impl(); ~SwTableProperties_Impl(); - sal_Bool SetProperty(const char* pName , uno::Any aVal); - sal_Bool GetProperty(const char* pName, uno::Any*& rpAny); - - sal_Bool SetProperty(USHORT nId , uno::Any aVal) - { return SetProperty(SW_PROP_NAME_STR( nId ), aVal); } - sal_Bool GetProperty(USHORT nId, uno::Any*& rpAny) - { return GetProperty(SW_PROP_NAME_STR( nId ), rpAny); } + void SetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any& aVal); + sal_Bool GetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any*& rpAny); - const SfxItemPropertyMap* GetMap() const {return _pMap;} - void ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc); + void ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc); }; /* -----------------22.06.98 09:43------------------- * * --------------------------------------------------*/ -SwTableProperties_Impl::SwTableProperties_Impl(const SfxItemPropertyMap* pMap) : - _pMap(pMap), - nArrLen(TABLE_PROP_COUNT) +SwTableProperties_Impl::SwTableProperties_Impl() { - for(sal_uInt16 i = 0; i < nArrLen; i++) - pAnyArr[i] = 0; } /* -----------------22.06.98 09:51------------------- * * --------------------------------------------------*/ SwTableProperties_Impl::~SwTableProperties_Impl() { - for(sal_uInt16 i = 0; i < nArrLen; i++) - delete pAnyArr[i]; } /* -----------------22.06.98 09:51------------------- * * --------------------------------------------------*/ -sal_Bool SwTableProperties_Impl::SetProperty(const char* pName, uno::Any aVal) +void SwTableProperties_Impl::SetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any& rVal) { - sal_uInt16 nPos = 0; - const SfxItemPropertyMap* pTemp = _pMap; - String aName(C2S( pName )); - while( pTemp->pName ) - { - if( aName.EqualsAscii(pTemp->pName)) - break; - ++nPos; - ++pTemp; - } - if(nPos < nArrLen) - { - delete pAnyArr[nPos]; - pAnyArr[nPos] = new uno::Any(aVal); - } - return nPos < nArrLen; + aAnyMap.SetValue( nWhichId, nMemberId, rVal ); } /* -----------------22.06.98 09:51------------------- * * --------------------------------------------------*/ -sal_Bool SwTableProperties_Impl::GetProperty(const char* pName, uno::Any*& rpAny ) +sal_Bool SwTableProperties_Impl::GetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any*& rpAny ) { - sal_uInt16 nPos = 0; - const SfxItemPropertyMap* pTemp = _pMap; - String aName(C2S(pName)); - while( pTemp->pName ) - { - if(aName.EqualsAscii(pTemp->pName)) - break; - ++nPos; - ++pTemp; - } - if(nPos < nArrLen) - rpAny = pAnyArr[nPos]; - return rpAny && nPos < nArrLen; + return aAnyMap.FillValue( nWhichId, nMemberId, rpAny ); } /* -----------------13.01.99 15:42------------------- * @@ -2160,24 +2080,24 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) RES_PAGEDESC, RES_PAGEDESC, 0 ); - uno::Any* pRepHead; + const uno::Any* pRepHead; const SwFrmFmt &rFrmFmt = *rTbl.GetFrmFmt(); - if(GetProperty(UNO_NAME_REPEAT_HEADLINE, pRepHead )) + if(GetProperty(FN_TABLE_HEADLINE_REPEAT, 0xff, pRepHead )) { sal_Bool bVal = *(sal_Bool*)pRepHead->getValue(); ((SwTable&)rTbl).SetRowsToRepeat( bVal ? 1 : 0 ); // TODO MULTIHEADER } - uno::Any* pBackColor = 0; - GetProperty(UNO_NAME_BACK_COLOR, pBackColor ); - uno::Any* pBackTrans = 0; - GetProperty(UNO_NAME_BACK_TRANSPARENT, pBackTrans ); - uno::Any* pGrLoc = 0; - GetProperty(UNO_NAME_GRAPHIC_LOCATION, pGrLoc ); - uno::Any* pGrURL = 0; - GetProperty(UNO_NAME_GRAPHIC_URL, pGrURL ); - uno::Any* pGrFilter = 0; - GetProperty(UNO_NAME_GRAPHIC_FILTER, pGrFilter ); + const uno::Any* pBackColor = 0; + GetProperty(RES_BACKGROUND, MID_BACK_COLOR, pBackColor ); + const uno::Any* pBackTrans = 0; + GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENT, pBackTrans ); + const uno::Any* pGrLoc = 0; + GetProperty(RES_BACKGROUND, MID_GRAPHIC_POSITION, pGrLoc ); + const uno::Any* pGrURL = 0; + GetProperty(RES_BACKGROUND, MID_GRAPHIC_URL, pGrURL ); + const uno::Any* pGrFilter = 0; + GetProperty(RES_BACKGROUND, MID_GRAPHIC_FILTER, pGrFilter ); if(pBackColor||pBackTrans||pGrURL||pGrFilter||pGrLoc) { @@ -2196,8 +2116,8 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) } sal_Bool bPutBreak = sal_True; - uno::Any* pPage; - if(GetProperty(UNO_NAME_PAGE_STYLE_NAME, pPage)) + const uno::Any* pPage; + if(GetProperty(FN_UNO_PAGE_STYLE, 0, pPage) || GetProperty(RES_PAGEDESC, 0xff, pPage)) { OUString uTmp; (*pPage) >>= uTmp; @@ -2209,8 +2129,8 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) if(pDesc) { SwFmtPageDesc aDesc( pDesc ); - uno::Any* pPgNo; - if(GetProperty(UNO_NAME_PAGE_NUMBER_OFFSET, pPgNo )) + const uno::Any* pPgNo; + if(GetProperty(RES_PAGEDESC, MID_PAGEDESC_PAGENUMOFFSET, pPgNo )) { INT16 nTmp = 0; (*pPgNo) >>= nTmp; @@ -2222,22 +2142,22 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) } } - uno::Any* pBreak; - if(bPutBreak && GetProperty(UNO_NAME_BREAK_TYPE, pBreak)) + const uno::Any* pBreak; + if(bPutBreak && GetProperty(RES_BREAK, 0, pBreak)) { SvxFmtBreakItem aBreak ( rFrmFmt.GetBreak() ); aBreak.PutValue(*pBreak, 0); aSet.Put(aBreak); } - uno::Any* pShadow; - if(GetProperty(UNO_NAME_SHADOW_FORMAT, pShadow)) + const uno::Any* pShadow; + if(GetProperty(RES_SHADOW, 0, pShadow)) { SvxShadowItem aShd ( rFrmFmt.GetShadow() ); aShd.PutValue(*pShadow, CONVERT_TWIPS); aSet.Put(aShd); } - uno::Any* pKeep; - if(GetProperty(UNO_NAME_KEEP_TOGETHER, pKeep)) + const uno::Any* pKeep; + if(GetProperty(RES_KEEP, 0, pKeep)) { SvxFmtKeepItem aKeep( rFrmFmt.GetKeep() ); aKeep.PutValue(*pKeep, 0); @@ -2245,8 +2165,8 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) } sal_Bool bFullAlign = sal_True; - uno::Any* pHOrient; - if(GetProperty(UNO_NAME_HORI_ORIENT, pHOrient)) + const uno::Any* pHOrient; + if(GetProperty(RES_HORI_ORIENT, MID_HORIORIENT_ORIENT, pHOrient)) { SwFmtHoriOrient aOrient ( rFrmFmt.GetHoriOrient() ); ((SfxPoolItem&)aOrient).PutValue(*pHOrient, MID_HORIORIENT_ORIENT|CONVERT_TWIPS); @@ -2255,12 +2175,12 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) } - uno::Any* pSzRel = 0; - GetProperty(UNO_NAME_IS_WIDTH_RELATIVE, pSzRel ); - uno::Any* pRelWidth = 0; - GetProperty(UNO_NAME_RELATIVE_WIDTH, pRelWidth); - uno::Any* pWidth = 0; - GetProperty(UNO_NAME_WIDTH, pWidth ); + const uno::Any* pSzRel = 0; + GetProperty(FN_TABLE_IS_RELATIVE_WIDTH, 0xff, pSzRel ); + const uno::Any* pRelWidth = 0; + GetProperty(FN_TABLE_RELATIVE_WIDTH, 0xff, pRelWidth); + const uno::Any* pWidth = 0; + GetProperty(FN_TABLE_WIDTH, 0xff, pWidth ); sal_Bool bPutSize = pWidth != 0; SwFmtFrmSize aSz( ATT_VAR_SIZE); @@ -2281,10 +2201,10 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) aSz.SetWidth(MINLAY); aSet.Put(aSz); } - uno::Any* pL = 0; - GetProperty(UNO_NAME_LEFT_MARGIN, pL); - uno::Any* pR = 0; - GetProperty(UNO_NAME_RIGHT_MARGIN, pR); + const uno::Any* pL = 0; + GetProperty(RES_LR_SPACE, MID_L_MARGIN|CONVERT_TWIPS, pL); + const uno::Any* pR = 0; + GetProperty(RES_LR_SPACE, MID_R_MARGIN|CONVERT_TWIPS, pR); if(pL||pR) { SvxLRSpaceItem aLR ( rFrmFmt.GetLRSpace() ); @@ -2294,10 +2214,10 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) ((SfxPoolItem&)aLR).PutValue(*pR, MID_R_MARGIN|CONVERT_TWIPS); aSet.Put(aLR); } - uno::Any* pU = 0; - GetProperty(UNO_NAME_TOP_MARGIN, pU); - uno::Any* pLo = 0; - GetProperty(UNO_NAME_BOTTOM_MARGIN, pLo); + const uno::Any* pU = 0; + GetProperty(RES_UL_SPACE, MID_UP_MARGIN|CONVERT_TWIPS, pU); + const uno::Any* pLo = 0; + GetProperty(RES_UL_SPACE, MID_LO_MARGIN|CONVERT_TWIPS, pLo); if(pU||pLo) { SvxULSpaceItem aUL ( rFrmFmt.GetULSpace() ); @@ -2307,8 +2227,8 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) ((SfxPoolItem&)aUL).PutValue(*pLo, MID_LO_MARGIN|CONVERT_TWIPS); aSet.Put(aUL); } - uno::Any* pSplit; - if(GetProperty(UNO_NAME_SPLIT, pSplit )) + const::uno::Any* pSplit; + if(GetProperty(RES_LAYOUT_SPLIT, 0, pSplit )) { sal_Bool bTmp = *(sal_Bool*)pSplit->getValue(); SwFmtLayoutSplit aSp(bTmp); @@ -2369,9 +2289,8 @@ TYPEINIT1(SwXTextTable, SwClient) SwXTextTable::SwXTextTable() : aLstnrCntnr( (text::XTextTable*)this), aChartLstnrCntnr( (text::XTextTable*)this), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_TABLE)), - _pMap(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_TABLE)), - pTableProps(new SwTableProperties_Impl(GetTableDescPropertyMap())), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE)), + pTableProps(new SwTableProperties_Impl), bIsDescriptor(sal_True), nRows(2), nColumns(2), @@ -2387,8 +2306,7 @@ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) : SwClient( &rFrmFmt ), aLstnrCntnr( (text::XTextTable*)this), aChartLstnrCntnr( (text::XTextTable*)this), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_TABLE)), - _pMap(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_TABLE)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE)), pTableProps(0), bIsDescriptor(sal_False), nRows(0), @@ -2607,8 +2525,8 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex pDoc->SetTableName( *pTblFmt, sTmpNameIndex); } - uno::Any* pName; - if(pTableProps->GetProperty(UNO_NAME_TABLE_NAME, pName)) + const::uno::Any* pName; + if(pTableProps->GetProperty(FN_UNO_TABLE_NAME, 0, pName)) { OUString sTmp; (*pName) >>= sTmp; @@ -3312,7 +3230,7 @@ void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumen -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextTable::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } /*-- 11.12.98 12:42:50--------------------------------------------------- @@ -3327,23 +3245,30 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, SwFrmFmt* pFmt = GetFrmFmt(); if(!aValue.hasValue()) throw lang::IllegalArgumentException(); + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if( !pEntry ) + throw lang::IllegalArgumentException(); if(pFmt) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if (!pMap) - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if(0xFF == pMap->nMemberId) + if(0xFF == pEntry->nMemberId) { - lcl_SetSpecialProperty(pFmt, pMap, aValue); + lcl_SetSpecialProperty(pFmt, pEntry, aValue); } else { - switch(pMap->nWID) + switch(pEntry->nWID) { + case UNO_NAME_TABLE_NAME : + { + ::rtl::OUString sName; + aValue >>= sName; + setName( sName ); + } + break; case FN_UNO_RANGE_ROW_LABEL: { sal_Bool bTmp = *(sal_Bool*)aValue.getValue(); @@ -3506,7 +3431,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, default: { SwAttrSet aSet(pFmt->GetAttrSet()); - aPropSet.setPropertyValue(*pMap, aValue, aSet); + m_pPropSet->setPropertyValue(*pEntry, aValue, aSet); pFmt->GetDoc()->SetAttr(aSet, *pFmt); } } @@ -3515,10 +3440,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, else if(bIsDescriptor) { String aPropertyName(rPropertyName); - if(!pTableProps->SetProperty( - ByteString( aPropertyName, RTL_TEXTENCODING_ASCII_US).GetBuffer(), - aValue)) - throw lang::IllegalArgumentException(); + pTableProps->SetProperty( pEntry->nWID, pEntry->nMemberId, aValue); } else throw uno::RuntimeException(); @@ -3531,25 +3453,30 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be vos::OGuard aGuard(Application::GetSolarMutex()); uno::Any aRet; SwFrmFmt* pFmt = GetFrmFmt(); + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); if(pFmt) { - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if (!pMap) + if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if(0xFF == pMap->nMemberId) + if(0xFF == pEntry->nMemberId) { - aRet = lcl_GetSpecialProperty(pFmt, pMap ); + aRet = lcl_GetSpecialProperty(pFmt, pEntry ); } else { - switch(pMap->nWID) + switch(pEntry->nWID) { + case UNO_NAME_TABLE_NAME: + { + aRet <<= getName(); + } + break; case FN_UNO_ANCHOR_TYPES: case FN_UNO_TEXT_WRAP: case FN_UNO_ANCHOR_TYPE: - SwXParagraph::getDefaultTextContentValue(aRet, OUString(), pMap->nWID); + SwXParagraph::getDefaultTextContentValue(aRet, OUString(), pEntry->nWID); break; case FN_UNO_RANGE_ROW_LABEL: { @@ -3714,17 +3641,16 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be default: { const SwAttrSet& rSet = pFmt->GetAttrSet(); - aRet = aPropSet.getPropertyValue(*pMap, rSet); + m_pPropSet->getPropertyValue(*pEntry, rSet, aRet); } } } } else if(bIsDescriptor) { - uno::Any* pAny = 0; + const uno::Any* pAny = 0; String aPropertyName(rPropertyName); - if(!pTableProps->GetProperty(ByteString(aPropertyName, RTL_TEXTENCODING_ASCII_US).GetBuffer(), - pAny)) + if(!pTableProps->GetProperty(pEntry->nWID, pEntry->nMemberId, pAny)) throw lang::IllegalArgumentException(); else if(pAny) aRet = *pAny; @@ -4004,9 +3930,8 @@ SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt, aCursorDepend(this, pCrsr), aChartLstnrCntnr((cppu::OWeakObject*)this), aRgDesc(rDesc), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TABLE_RANGE)), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TABLE_RANGE)), pTblCrsr(pCrsr), - _pMap(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TABLE_RANGE)), bFirstRowAsLabel(sal_False), bFirstColumnAsLabel(sal_False) { @@ -4127,7 +4052,7 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUSt -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXCellRange::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } /*-- 11.12.98 14:27:35--------------------------------------------------- @@ -4144,11 +4069,11 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, { /* ASK OLIVER lcl_FormatTable(pFmt);*/ - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if(pEntry) { - if ( pMap->nFlags & beans::PropertyAttribute::READONLY) + if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SwDoc* pDoc = pTblCrsr->GetDoc(); @@ -4158,13 +4083,13 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, } SwUnoTableCrsr* pCrsr = *pTblCrsr; pCrsr->MakeBoxSels(); - switch(pMap->nWID ) + switch(pEntry->nWID ) { case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush( RES_BACKGROUND ); pDoc->GetBoxAttr( *pTblCrsr, aBrush ); - ((SfxPoolItem&)aBrush).PutValue(aValue, pMap->nMemberId); + ((SfxPoolItem&)aBrush).PutValue(aValue, pEntry->nMemberId); pDoc->SetBoxAttr( *pTblCrsr, aBrush ); } @@ -4178,7 +4103,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aBoxInfo.SetValid(0xff, FALSE); BYTE nValid = 0; - switch(pMap->nMemberId & ~CONVERT_TWIPS) + switch(pEntry->nMemberId & ~CONVERT_TWIPS) { case LEFT_BORDER : nValid = VALID_LEFT; break; case RIGHT_BORDER: nValid = VALID_RIGHT; break; @@ -4199,7 +4124,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, aSet.Put(aBoxInfo); SvxBoxItem aBoxItem((const SvxBoxItem&)aSet.Get(RES_BOX)); - ((SfxPoolItem&)aBoxItem).PutValue(aValue, pMap->nMemberId); + ((SfxPoolItem&)aBoxItem).PutValue(aValue, pEntry->nMemberId); aSet.Put(aBoxItem); pDoc->SetTabBorders( *pTblCrsr, aSet ); } @@ -4233,11 +4158,11 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, break; default: { - SfxItemSet aItemSet( pDoc->GetAttrPool(), pMap->nWID, pMap->nWID ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); SwXTextCursor::GetCrsrAttr( pCrsr->GetSelRing(), aItemSet ); - if(!lcl_setCrsrPropertyValue( pMap, pCrsr->GetSelRing(), aItemSet, aValue )) - aPropSet.setPropertyValue(*pMap, aValue, aItemSet ); + if(!lcl_setCrsrPropertyValue( pEntry, pCrsr->GetSelRing(), aItemSet, aValue )) + m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet ); SwXTextCursor::SetCrsrAttr(pCrsr->GetSelRing(), aItemSet, CRSR_ATTR_MODE_TABLE ); } } @@ -4258,17 +4183,17 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be { /* ASK OLIVER lcl_FormatTable(pFmt);*/ - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); - if(pMap) + const SfxItemPropertySimpleEntry* pEntry = + m_pPropSet->getPropertyMap()->getByName(rPropertyName); + if(pEntry) { - switch(pMap->nWID ) + switch(pEntry->nWID ) { case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush( RES_BACKGROUND ); if(pTblCrsr->GetDoc()->GetBoxAttr( *pTblCrsr, aBrush )) - aBrush.QueryValue(aRet, pMap->nMemberId); + aBrush.QueryValue(aRet, pEntry->nMemberId); } break; @@ -4282,7 +4207,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); pDoc->GetTabBorders(*pTblCrsr, aSet); const SvxBoxItem& rBoxItem = ((const SvxBoxItem&)aSet.Get(RES_BOX)); - rBoxItem.QueryValue(aRet, pMap->nMemberId); + rBoxItem.QueryValue(aRet, pEntry->nMemberId); } break; case RES_BOXATR_FORMAT: @@ -4320,7 +4245,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be // erstmal die Attribute des Cursors SwUnoTableCrsr* pCrsr = *pTblCrsr; SwXTextCursor::GetCrsrAttr(pCrsr->GetSelRing(), aSet); - aRet = aPropSet.getPropertyValue(*pMap, aSet); + m_pPropSet->getPropertyValue(*pEntry, aSet, aRet); } } } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index f7939cb85f..c0b1a937c2 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -104,7 +104,7 @@ SwXText::SwXText(SwDoc* pDc, CursorType eType) : pDoc(pDc), bObjectValid(0 != pDc), eCrsrType(eType), - _pMap(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT)) + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT)) { } /*-- 09.12.98 12:43:55--------------------------------------------------- @@ -1169,8 +1169,7 @@ sal_Int16 SwXText::compareRegionEnds( uno::Reference< beans::XPropertySetInfo > SwXText::getPropertySetInfo( ) throw(uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xInfo = - new SfxItemPropertySetInfo(_pMap); + static uno::Reference< beans::XPropertySetInfo > xInfo = m_pPropSet->getPropertySetInfo(); return xInfo; } /*-- 15.03.2002 12:30:42--------------------------------------------------- @@ -1194,12 +1193,11 @@ uno::Any SwXText::getPropertyValue( vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw uno::RuntimeException(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - _pMap, rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); uno::Any aRet; - if(pMap) + if(pEntry) { - switch(pMap->nWID) + switch(pEntry->nWID) { // no code necessary - the redline is always located at the end node // case FN_UNO_REDLINE_NODE_START: @@ -1359,26 +1357,22 @@ uno::Reference< text::XTextRange > SwXText::finishOrAppendParagraph( if(rProperties.getLength()) { // now set the properties - const SfxItemPropertyMap* pParagraphMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARAGRAPH); - SfxItemPropertySet aParaPropSet(pParagraphMap); + const SfxItemPropertySet* pParaPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH); + const SfxItemPropertyMap* pParagraphMap = pParaPropSet->getPropertyMap(); const beans::PropertyValue* pValues = rProperties.getConstArray(); for( sal_Int32 nProp = 0; nProp < rProperties.getLength(); ++nProp) { - // no sorting of property names required - results in performance issues as long as SfxItemPropertyMap::GetByName - // is not able to hash the maps - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( pParagraphMap, pValues[nProp].Name ); - if(pMap) + if(pParagraphMap->getByName( pValues[nProp].Name )) { try { SwXTextCursor::SetPropertyValue( aPam, - aParaPropSet, + *pParaPropSet, pValues[nProp].Name, - pValues[nProp].Value, - pMap, 0); + pValues[nProp].Value); } catch( lang::IllegalArgumentException& rIllegal ) { @@ -1464,25 +1458,21 @@ uno::Reference< text::XTextRange > SwXText::appendTextPortion( if(rCharacterAndParagraphProperties.getLength()) { - + const SfxItemPropertyMap* pCursorMap = aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)->getPropertyMap(); const beans::PropertyValue* pValues = rCharacterAndParagraphProperties.getConstArray(); + const SfxItemPropertySet* pCursorPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR); for( sal_Int32 nProp = 0; nProp < rCharacterAndParagraphProperties.getLength(); ++nProp) { - // no sorting of property names required - results in performance issues as long as SfxItemPropertyMap::GetByName - // is not able to hash the maps - const SfxItemPropertyMap* pCursorMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR); - SfxItemPropertySet aCursorPropSet(pCursorMap); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( pCursorMap, pValues[nProp].Name ); - if(pMap) + if( pCursorMap->getByName( pValues[nProp].Name ) ) { try { SwXTextCursor::SetPropertyValue( *pCursor, - aCursorPropSet, + *pCursorPropSet, pValues[nProp].Name, pValues[nProp].Value, - pMap, nsSetAttrMode::SETATTR_NOFORMATATTR); + nsSetAttrMode::SETATTR_NOFORMATATTR); } catch( lang::IllegalArgumentException& rIllegal ) { @@ -1495,7 +1485,7 @@ uno::Reference< text::XTextRange > SwXText::appendTextPortion( bRuntimeException = true; } } - else + else bIllegalException = true; if( bIllegalException || bRuntimeException ) { diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index 65ae9890c3..84a39dd84b 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -209,17 +209,8 @@ void SwXMLExport::_ExportAutoStyles() // only master pages are exported => styles for frames bound // to frames (but none for frames bound to pages) need to be // collected. - GetTextParagraphExport()->collectFramesBoundToFrameAutoStyles(); + // TODO: exclude PageBoundFrames on export } - else - { - // content (and optional master pages) are exported => styles - // for frames bound to frame or to pages need to be - // collected. - GetTextParagraphExport()->collectFramesBoundToPageOrFrameAutoStyles( - bShowProgress ); - } - } // exported in _ExportMasterStyles diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index cef408e123..033d96e955 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -322,9 +322,16 @@ void SwCharURLPage::Reset(const SfxItemSet& rSet) BOOL SwCharURLPage::FillItemSet(SfxItemSet& rSet) { - String sURL = aURLED.GetText(); - if(sURL.Len()) + ::rtl::OUString sURL = aURLED.GetText(); + if(sURL.getLength()) + { sURL = URIHelper::SmartRel2Abs(INetURLObject(), sURL, Link(), false ); + // #i100683# file URLs should be normalized in the UI + static const sal_Char* pFile = "file:"; + sal_Int32 nLength = ((sal_Int32)sizeof(pFile)-1); + if( sURL.copy(0, nLength ).equalsAsciiL( pFile, nLength )) + sURL = URIHelper::simpleNormalizedMakeRelative(::rtl::OUString(), sURL); + } SwFmtINetFmt aINetFmt(sURL, aTargetFrmLB.GetText()); aINetFmt.SetName(aNameED.GetText()); diff --git a/sw/source/ui/inc/unotxvw.hxx b/sw/source/ui/inc/unotxvw.hxx index b066ba859c..7062a4b78e 100644 --- a/sw/source/ui/inc/unotxvw.hxx +++ b/sw/source/ui/inc/unotxvw.hxx @@ -76,8 +76,8 @@ class SwXTextView : { SelectionChangeListenerArr aSelChangedListeners; - SwView* pView; - const SfxItemPropertyMap* pMap; // property map for SwXTextView properties + SwView* m_pView; + const SfxItemPropertySet* m_pPropSet; // property map for SwXTextView properties // (not related to pxViewSettings!) ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxViewSettings; @@ -155,7 +155,7 @@ public: void NotifySelChanged(); void NotifyDBChanged(); - SwView* GetView() {return pView;} + SwView* GetView() {return m_pView;} void Invalidate(); // temporary document used for PDF export of selections/multi-selections @@ -181,8 +181,8 @@ class SwXTextViewCursor : public SwXTextViewCursor_Base, public SwClient, public OTextCursorHelper { - SwView* pView; - SfxItemPropertySet aPropSet; + SwView* m_pView; + const SfxItemPropertySet* m_pPropSet; protected: sal_Bool IsTextSelection( sal_Bool bAllowTables = sal_True ) const; virtual ~SwXTextViewCursor(); @@ -264,7 +264,7 @@ public: //XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - void Invalidate(){pView = 0;} + void Invalidate(){m_pView = 0;} // ITextCursorHelper virtual const SwPaM* GetPaM() const; diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index cb52c8e1ac..b90c50be8a 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -324,7 +324,7 @@ sal_Int64 SAL_CALL SwXAutoTextGroup::getSomething( const uno::Sequence< sal_Int8 -----------------------------------------------------------------------*/ SwXAutoTextGroup::SwXAutoTextGroup(const OUString& rName, SwGlossaries* pGlos) : - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_AUTO_TEXT_GROUP)), + pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_AUTO_TEXT_GROUP)), pGlossaries(pGlos), sName(rName), m_sGroupName(rName) @@ -721,7 +721,7 @@ sal_Bool SwXAutoTextGroup::hasByName(const OUString& rName) uno::Reference< beans::XPropertySetInfo > SwXAutoTextGroup::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > xRet = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > xRet = pPropSet->getPropertySetInfo(); return xRet; } /*-- 09.02.00 15:33:31--------------------------------------------------- @@ -733,16 +733,15 @@ void SwXAutoTextGroup::setPropertyValue( lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName ); - if(!pMap) + if(!pEntry) throw beans::UnknownPropertyException(); SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; if(!pGlosGroup || pGlosGroup->GetError()) throw uno::RuntimeException(); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_GROUP_TITLE: { @@ -766,17 +765,16 @@ uno::Any SwXAutoTextGroup::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); - if(!pMap) + if(!pEntry) throw beans::UnknownPropertyException(); SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; if(!pGlosGroup || pGlosGroup->GetError()) throw uno::RuntimeException(); uno::Any aAny; - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_GROUP_PATH: aAny <<= OUString(pGlosGroup->GetFileName()); diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index 578734110d..2679791f07 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -418,7 +418,7 @@ SwXMailMerge::SwXMailMerge() : aEvtListeners ( GetMailMergeMutex() ), aMergeListeners ( GetMailMergeMutex() ), aPropListeners ( GetMailMergeMutex() ), - pMap( aSwMapProvider.GetPropertyMap( PROPERTY_MAP_MAILMERGE ) ), + pPropSet( aSwMapProvider.GetPropertySet( PROPERTY_MAP_MAILMERGE ) ), bSendAsHTML(sal_False), bSendAsAttachment(sal_False), bSaveAsSingleFile(sal_False) @@ -887,7 +887,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXMailMerge::getPropertySetI throw (RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - static Reference< XPropertySetInfo > aRef = new SfxItemPropertySetInfo( pMap ); + static Reference< XPropertySetInfo > aRef = pPropSet->getPropertySetInfo(); return aRef; } @@ -897,8 +897,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue( { vos::OGuard aGuard( Application::GetSolarMutex() ); - const SfxItemPropertyMap* pCur = - SfxItemPropertyMap::GetByName( pMap, rPropertyName ); + const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pCur) throw UnknownPropertyException(); else if (pCur->nFlags & PropertyAttribute::READONLY) @@ -1055,7 +1054,7 @@ uno::Any SAL_CALL SwXMailMerge::getPropertyValue( Any aRet; - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName( pMap, rPropertyName ); + const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pCur) throw UnknownPropertyException(); else @@ -1109,8 +1108,7 @@ void SAL_CALL SwXMailMerge::addPropertyChangeListener( vos::OGuard aGuard( Application::GetSolarMutex() ); if (!bDisposing && rListener.is()) { - const SfxItemPropertyMap* pCur = - SfxItemPropertyMap::GetByName( pMap, rPropertyName ); + const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName ); if (pCur) aPropListeners.addInterface( pCur->nWID, rListener ); else @@ -1126,8 +1124,7 @@ void SAL_CALL SwXMailMerge::removePropertyChangeListener( vos::OGuard aGuard( Application::GetSolarMutex() ); if (!bDisposing && rListener.is()) { - const SfxItemPropertyMap* pCur = - SfxItemPropertyMap::GetByName( pMap, rPropertyName ); + const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName ); if (pCur) aPropListeners.removeInterface( pCur->nWID, rListener ); else diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 8d927112e1..56c3a0b2ba 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -329,7 +329,7 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) : aRefreshCont ( static_cast < XTextDocument* > ( this ) ), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_DOCUMENT)), + pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_DOCUMENT)), pDocShell(pShell), @@ -1942,7 +1942,7 @@ Reference< XIndexAccess > SwXTextDocument::getDocumentIndexes(void) throw( Runt -----------------------------------------------------------------------*/ Reference< XPropertySetInfo > SwXTextDocument::getPropertySetInfo(void) throw( RuntimeException ) { - static Reference< XPropertySetInfo > xRet = aPropSet.getPropertySetInfo(); + static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo(); return xRet; } /*-- 10.05.99 13:58:58--------------------------------------------------- @@ -1956,14 +1956,13 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); - if(!pMap) + if(!pEntry) throw UnknownPropertyException(); - if(pMap->nFlags & PropertyAttribute::READONLY) + if(pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException(); - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_DOC_CHAR_COUNT : case WID_DOC_PARA_COUNT : @@ -1981,14 +1980,14 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, { sal_Bool bSet = *(sal_Bool*)aValue.getValue(); sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode(); - if(WID_DOC_CHANGES_SHOW == pMap->nWID) + if(WID_DOC_CHANGES_SHOW == pEntry->nWID) { eMode &= ~(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE); eMode |= nsRedlineMode_t::REDLINE_SHOW_INSERT; if( bSet ) eMode |= nsRedlineMode_t::REDLINE_SHOW_DELETE; } - else if(WID_DOC_CHANGES_RECORD == pMap->nWID) + else if(WID_DOC_CHANGES_RECORD == pEntry->nWID) { eMode = bSet ? eMode|nsRedlineMode_t::REDLINE_ON : eMode&~nsRedlineMode_t::REDLINE_ON; } @@ -2118,9 +2117,9 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, default: { - const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pMap->nWID); + const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pEntry->nWID); SfxPoolItem* pNewItem = rItem.Clone(); - pNewItem->PutValue(aValue, pMap->nMemberId); + pNewItem->PutValue(aValue, pEntry->nMemberId); pDocShell->GetDoc()->SetDefault(*pNewItem); delete pNewItem; } @@ -2135,13 +2134,12 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); - if(!pMap) + if(!pEntry) throw UnknownPropertyException(); Any aAny; - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_DOC_CHAR_COUNT : case WID_DOC_PARA_COUNT : @@ -2151,7 +2149,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) if(aStat.bModified) pDocShell->GetDoc()->UpdateDocStat( aStat ); sal_Int32 nValue; - switch(pMap->nWID) + switch(pEntry->nWID) { case WID_DOC_CHAR_COUNT :nValue = aStat.nChar;break; case WID_DOC_PARA_COUNT :nValue = aStat.nPara;break; @@ -2170,12 +2168,12 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) { sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode(); sal_Bool bSet = sal_False; - if(WID_DOC_CHANGES_SHOW == pMap->nWID) + if(WID_DOC_CHANGES_SHOW == pEntry->nWID) { sal_uInt16 nMask = nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE; bSet = (eMode & nMask) == nMask; } - else if(WID_DOC_CHANGES_RECORD == pMap->nWID) + else if(WID_DOC_CHANGES_RECORD == pEntry->nWID) { bSet = (eMode& nsRedlineMode_t::REDLINE_ON) != 0; } @@ -2273,8 +2271,8 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) default: { - const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pMap->nWID); - rItem.QueryValue(aAny, pMap->nMemberId); + const SfxPoolItem& rItem = pDocShell->GetDoc()->GetDefault(pEntry->nWID); + rItem.QueryValue(aAny, pEntry->nMemberId); } } return aAny; @@ -2397,13 +2395,12 @@ PropertyState SAL_CALL SwXTextDocument::getPropertyState( const OUString& rPrope PropertyState eRet = PropertyState_DIRECT_VALUE; if(!IsValid()) throw RuntimeException(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); - if(!pMap) + if(!pEntry) throw UnknownPropertyException(); Any aAny; - switch(pMap->nWID) + switch(pEntry->nWID) { case 0:default:break; } @@ -2428,11 +2425,10 @@ void SAL_CALL SwXTextDocument::setPropertyToDefault( const OUString& rPropertyNa ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); + if(!pEntry) throw UnknownPropertyException(); - switch(pMap->nWID) + switch(pEntry->nWID) { case 0:default:break; } @@ -2443,12 +2439,11 @@ Any SAL_CALL SwXTextDocument::getPropertyDefault( const OUString& rPropertyName ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); - const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( - aPropSet.getPropertyMap(), rPropertyName); - if(!pMap) + const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); + if(!pEntry) throw UnknownPropertyException(); Any aAny; - switch(pMap->nWID) + switch(pEntry->nWID) { case 0:default:break; } @@ -3253,7 +3248,7 @@ Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void) SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper( Reference< XNameAccess > xAccess, const String& rLinkDisplayName, String sSuffix ) : xRealAccess(xAccess), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_LINK_TARGET)), + pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_LINK_TARGET)), sLinkSuffix(sSuffix), sLinkDisplayName(rLinkDisplayName), pxDoc(0) @@ -3264,7 +3259,7 @@ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper( --------------------------------------------------*/ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc, const String& rLinkDisplayName, String sSuffix) : - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_LINK_TARGET)), + pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_LINK_TARGET)), sLinkSuffix(sSuffix), sLinkDisplayName(rLinkDisplayName), xDoc(&rxDoc), @@ -3442,7 +3437,7 @@ sal_Bool SwXLinkNameAccessWrapper::hasElements(void) throw( RuntimeException ) Reference< XPropertySetInfo > SwXLinkNameAccessWrapper::getPropertySetInfo(void) throw( RuntimeException ) { - static Reference< XPropertySetInfo > xRet = aPropSet.getPropertySetInfo(); + static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo(); return xRet; } /*-- 26.10.99 09:16:26--------------------------------------------------- @@ -3583,7 +3578,7 @@ Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void) --------------------------------------------------*/ SwXOutlineTarget::SwXOutlineTarget(const String& rOutlineText) : - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_LINK_TARGET)), + pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_LINK_TARGET)), sOutlineText(rOutlineText) { } @@ -3598,7 +3593,7 @@ SwXOutlineTarget::~SwXOutlineTarget() -----------------------------------------------------------------------*/ Reference< XPropertySetInfo > SwXOutlineTarget::getPropertySetInfo(void) throw( RuntimeException ) { - static Reference< XPropertySetInfo > xRet = aPropSet.getPropertySetInfo(); + static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo(); return xRet; } /*-- 26.10.99 15:51:46--------------------------------------------------- diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 8859d18d08..3718959c98 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -134,8 +134,8 @@ SwPaM* lcl_createPamCopy(const SwPaM& rPam) -----------------------------------------------------------------------*/ SwXTextView::SwXTextView(SwView* pSwView) : SfxBaseController(pSwView), - pView(pSwView), - pMap( aSwMapProvider.GetPropertyMap( PROPERTY_MAP_TEXT_VIEW ) ), + m_pView(pSwView), + m_pPropSet( aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_VIEW ) ), pxViewSettings(0), pxTextViewCursor(0) { @@ -188,7 +188,7 @@ void SwXTextView::Invalidate() } m_refCount--; - pView = 0; + m_pView = 0; } /* -----------------------------18.05.00 10:18-------------------------------- @@ -497,7 +497,7 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg SdrObject *pObj = pSvxShape->GetSdrObject(); if (pObj) { -// lcl_ShowObject( *pViewSh, *pDrawView, pObj ); +// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj ); SdrPageView* pPV = pDrawView->GetSdrPageView(); if ( pPV && pObj->GetPage() == pPV->GetPage() ) { @@ -530,7 +530,7 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg { if (!pPV) // erstes Objekt { -// lcl_ShowObject( *pViewSh, *pDrawView, pObj ); +// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj ); pPV = pDrawView->GetSdrPageView(); } if ( pPV && pObj->GetPage() == pPV->GetPage() ) @@ -560,10 +560,10 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) if(GetView()) { //force immediat shell update - pView->StopShellTimer(); + m_pView->StopShellTimer(); // ein interface aus der aktuellen Selektion erzeugen - SwWrtShell& rSh = pView->GetWrtShell(); - ShellModes eSelMode = pView->GetShellMode(); + SwWrtShell& rSh = m_pView->GetWrtShell(); + ShellModes eSelMode = m_pView->GetShellMode(); switch(eSelMode) { case SHELL_MODE_TABLE_TEXT : @@ -631,7 +631,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) case SHELL_MODE_BEZIER : { uno::Reference< drawing::XDrawPageSupplier > xPageSupp; - uno::Reference< frame::XModel > xModel = pView->GetDocShell()->GetBaseModel(); + uno::Reference< frame::XModel > xModel = m_pView->GetDocShell()->GetBaseModel(); uno::Reference< lang::XUnoTunnel > xModelTunnel(xModel, uno::UNO_QUERY); SwXTextDocument* pTextDoc = reinterpret_cast<SwXTextDocument*>(xModelTunnel-> getSomething(SwXTextDocument::getUnoTunnelId())); @@ -786,12 +786,12 @@ uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw( uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if(!pxViewSettings) { ((SwXTextView*)this)->pxViewSettings = new uno::Reference< beans::XPropertySet > ; - *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( sal_False, pView ) ); + *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( sal_False, m_pView ) ); } } else @@ -807,15 +807,15 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto if(!GetView()) throw RuntimeException(); - SwWrtShell& rSh = pView->GetWrtShell(); - ShellModes eSelMode = pView->GetShellMode(); + SwWrtShell& rSh = m_pView->GetWrtShell(); + ShellModes eSelMode = m_pView->GetShellMode(); if (eSelMode != SHELL_MODE_LIST_TEXT && eSelMode != SHELL_MODE_TABLE_LIST_TEXT && eSelMode != SHELL_MODE_TABLE_TEXT && eSelMode != SHELL_MODE_TEXT ) return Sequence< Sequence< PropertyValue > > (); - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); SwRubyList aList; USHORT nCount = pDoc->FillRubyList( *rSh.GetCrsr(), aList, 0 ); @@ -857,8 +857,8 @@ void SAL_CALL SwXTextView::setRubyList( if(!GetView() || !rRubyList.getLength()) throw RuntimeException(); - SwWrtShell& rSh = pView->GetWrtShell(); - ShellModes eSelMode = pView->GetShellMode(); + SwWrtShell& rSh = m_pView->GetWrtShell(); + ShellModes eSelMode = m_pView->GetShellMode(); if (eSelMode != SHELL_MODE_LIST_TEXT && eSelMode != SHELL_MODE_TABLE_LIST_TEXT && eSelMode != SHELL_MODE_TABLE_TEXT && @@ -918,7 +918,7 @@ void SAL_CALL SwXTextView::setRubyList( } aList.Insert(pEntry, (USHORT)nPos); } - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); pDoc->SetRubyList( *rSh.GetCrsr(), aList, 0 ); } /*-- 29.12.02 15:45:29--------------------------------------------------- @@ -926,7 +926,7 @@ void SAL_CALL SwXTextView::setRubyList( -----------------------------------------------------------------------*/ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ ) { - SwWrtShell* pOldSh = &pView->GetWrtShell(); + SwWrtShell* pOldSh = &m_pView->GetWrtShell(); SfxPrinter *pPrt = pOldSh->getIDocumentDeviceAccess()->getPrinter( false ); SwDocShell* pDocSh; SfxObjectShellRef xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SFX_CREATE_MODE_STANDARD ) ); @@ -964,14 +964,14 @@ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ -----------------------------------------------------------------------*/ void SwXTextView::NotifySelChanged() { - DBG_ASSERT( pView, "view is missing" ); + DBG_ASSERT( m_pView, "view is missing" ); // destroy temporary document with selected text that is used // in PDF export of (multi-)selections. - if (pView && pView->GetTmpSelectionDoc().Is()) + if (m_pView && m_pView->GetTmpSelectionDoc().Is()) { - pView->GetTmpSelectionDoc()->DoClose(); - pView->GetTmpSelectionDoc() = 0; + m_pView->GetTmpSelectionDoc()->DoClose(); + m_pView->GetTmpSelectionDoc() = 0; } uno::Reference< uno::XInterface > xInt = (cppu::OWeakObject*)(SfxBaseController*)this; @@ -1011,7 +1011,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXTextView::getPropertySetIn throw (uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - static uno::Reference< XPropertySetInfo > aRef = new SfxItemPropertySetInfo( pMap ); + static uno::Reference< XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); return aRef; } @@ -1021,15 +1021,14 @@ void SAL_CALL SwXTextView::setPropertyValue( throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName( pMap, rPropertyName ); - if (!pCur) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if (!pEntry) throw UnknownPropertyException(); - else if (pCur->nFlags & PropertyAttribute::READONLY) + else if (pEntry->nFlags & PropertyAttribute::READONLY) throw PropertyVetoException(); else { - switch (pCur->nWID) + switch (pEntry->nWID) { case WID_IS_HIDE_SPELL_MARKS : // deprecated #i91949 @@ -1037,13 +1036,13 @@ void SAL_CALL SwXTextView::setPropertyValue( case WID_IS_CONSTANT_SPELLCHECK : { sal_Bool bVal = sal_False; - const SwViewOption *pOpt = pView->GetWrtShell().GetViewOptions(); + const SwViewOption *pOpt = m_pView->GetWrtShell().GetViewOptions(); if (!pOpt || !(rValue >>= bVal)) throw RuntimeException(); SwViewOption aNewOpt( *pOpt ); - if (pCur->nWID == WID_IS_CONSTANT_SPELLCHECK) + if (pEntry->nWID == WID_IS_CONSTANT_SPELLCHECK) aNewOpt.SetOnlineSpell(bVal); - pView->GetWrtShell().ApplyViewOptions( aNewOpt ); + m_pView->GetWrtShell().ApplyViewOptions( aNewOpt ); } break; default : @@ -1061,12 +1060,12 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue( Any aRet; - const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName( pMap, rPropertyName ); - if (!pCur) + const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + if (!pEntry) throw UnknownPropertyException(); else { - sal_Int16 nWID = pCur->nWID; + sal_Int16 nWID = pEntry->nWID; switch (nWID) { case WID_PAGE_COUNT : @@ -1074,13 +1073,13 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue( { // format document completely in order to get meaningful // values for page count and line count - pView->GetWrtShell().CalcLayout(); + m_pView->GetWrtShell().CalcLayout(); sal_Int32 nCount = -1; if (nWID == WID_PAGE_COUNT) - nCount = pView->GetDocShell()->GetDoc()->GetPageCount(); + nCount = m_pView->GetDocShell()->GetDoc()->GetPageCount(); else // WID_LINE_COUNT - nCount = pView->GetWrtShell().GetLineCount( FALSE /*of whole document*/ ); + nCount = m_pView->GetWrtShell().GetLineCount( FALSE /*of whole document*/ ); aRet <<= nCount; } break; @@ -1089,7 +1088,7 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue( break; case WID_IS_CONSTANT_SPELLCHECK : { - const SwViewOption *pOpt = pView->GetWrtShell().GetViewOptions(); + const SwViewOption *pOpt = m_pView->GetWrtShell().GetViewOptions(); if (!pOpt) throw RuntimeException(); UINT32 nFlag = VIEWOPT_1_ONLINESPELL; @@ -1175,8 +1174,8 @@ Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeE -----------------------------------------------------------------------*/ SwXTextViewCursor::SwXTextViewCursor(SwView* pVw) : - pView(pVw), - aPropSet(aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_CURSOR)) + m_pView(pVw), + m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)) { } /*-- 17.12.98 09:36:24--------------------------------------------------- @@ -1202,12 +1201,12 @@ sal_Bool SwXTextViewCursor::IsTextSelection( sal_Bool bAllowTables ) const { sal_Bool bRes = sal_False; - DBG_ASSERT(pView, "pView is NULL ???"); - if(pView) + DBG_ASSERT(m_pView, "m_pView is NULL ???"); + if(m_pView) { - //! pView->GetShellMode() will only work after the shell + //! m_pView->GetShellMode() will only work after the shell //! has already changed and thus can not be used here! - SelectionType eSelType = pView->GetWrtShell().GetSelectionType(); + SelectionType eSelType = m_pView->GetWrtShell().GetSelectionType(); bRes = ( (nsSelectionType::SEL_TXT & eSelType) || (nsSelectionType::SEL_NUM & eSelType) ) && (!(nsSelectionType::SEL_TBL_CELLS & eSelType) || bAllowTables); @@ -1239,9 +1238,9 @@ awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); awt::Point aRet; - if(pView) + if(m_pView) { - const SwWrtShell& rSh = pView->GetWrtShell(); + const SwWrtShell& rSh = m_pView->GetWrtShell(); const SwRect aCharRect(rSh.GetCharRect()); const SwFrmFmt& rMaster = rSh.GetPageDesc( rSh.GetCurPageDesc() ).GetMaster(); @@ -1264,12 +1263,12 @@ awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException ) void SwXTextViewCursor::collapseToStart(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); if(rSh.HasSelection()) { SwPaM* pShellCrsr = rSh.GetCrsr(); @@ -1289,12 +1288,12 @@ void SwXTextViewCursor::collapseToStart(void) throw( uno::RuntimeException ) void SwXTextViewCursor::collapseToEnd(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); if(rSh.HasSelection()) { SwPaM* pShellCrsr = rSh.GetCrsr(); @@ -1315,12 +1314,12 @@ sal_Bool SwXTextViewCursor::isCollapsed(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - const SwWrtShell& rSh = pView->GetWrtShell(); + const SwWrtShell& rSh = m_pView->GetWrtShell(); bRet = !rSh.HasSelection(); } else @@ -1335,13 +1334,13 @@ sal_Bool SwXTextViewCursor::goLeft(sal_Int16 nCount, sal_Bool bExpand) throw( un { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); for( sal_uInt16 i = 0; i < nCount; i++ ) - bRet = pView->GetWrtShell().Left( CRSR_SKIP_CHARS, bExpand, 1, sal_True ); + bRet = m_pView->GetWrtShell().Left( CRSR_SKIP_CHARS, bExpand, 1, sal_True ); } else throw uno::RuntimeException(); @@ -1354,13 +1353,13 @@ sal_Bool SwXTextViewCursor::goRight(sal_Int16 nCount, sal_Bool bExpand) throw( u { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); for( sal_uInt16 i = 0; i < nCount; i++ ) - bRet = pView->GetWrtShell().Right( CRSR_SKIP_CHARS, bExpand, 1, sal_True ); + bRet = m_pView->GetWrtShell().Right( CRSR_SKIP_CHARS, bExpand, 1, sal_True ); } else throw uno::RuntimeException(); @@ -1376,17 +1375,17 @@ void SwXTextViewCursor::gotoRange( throw(RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView && xRange.is()) + if(m_pView && xRange.is()) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwUnoInternalPaM rDestPam(*pView->GetDocShell()->GetDoc()); + SwUnoInternalPaM rDestPam(*m_pView->GetDocShell()->GetDoc()); if(!SwXTextRange::XTextRangeToSwPaM( rDestPam, xRange)) throw IllegalArgumentException(); - ShellModes eSelMode = pView->GetShellMode(); - SwWrtShell& rSh = pView->GetWrtShell(); + ShellModes eSelMode = m_pView->GetShellMode(); + SwWrtShell& rSh = m_pView->GetWrtShell(); // call EnterStdMode in non-text selections only if(!bExpand || (eSelMode != SHELL_MODE_TABLE_TEXT && @@ -1512,12 +1511,12 @@ void SwXTextViewCursor::gotoRange( void SwXTextViewCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pView->GetWrtShell().SttDoc( bExpand ); + m_pView->GetWrtShell().SttDoc( bExpand ); } else throw uno::RuntimeException(); @@ -1528,12 +1527,12 @@ void SwXTextViewCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException void SwXTextViewCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pView->GetWrtShell().EndDoc( bExpand ); + m_pView->GetWrtShell().EndDoc( bExpand ); } else throw uno::RuntimeException(); @@ -1545,9 +1544,9 @@ sal_Bool SwXTextViewCursor::jumpToFirstPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); if (rSh.IsSelFrmMode()) { rSh.UnSelectFrm(); @@ -1567,9 +1566,9 @@ sal_Bool SwXTextViewCursor::jumpToLastPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); if (rSh.IsSelFrmMode()) { rSh.UnSelectFrm(); @@ -1590,8 +1589,8 @@ sal_Bool SwXTextViewCursor::jumpToPage(sal_Int16 nPage) throw( uno::RuntimeExcep { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().GotoPage(nPage, TRUE); + if(m_pView) + bRet = m_pView->GetWrtShell().GotoPage(nPage, TRUE); else throw uno::RuntimeException(); return bRet; @@ -1603,8 +1602,8 @@ sal_Bool SwXTextViewCursor::jumpToNextPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().SttNxtPg(); + if(m_pView) + bRet = m_pView->GetWrtShell().SttNxtPg(); else throw uno::RuntimeException(); return bRet; @@ -1616,8 +1615,8 @@ sal_Bool SwXTextViewCursor::jumpToPreviousPage(void) throw( uno::RuntimeExceptio { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().EndPrvPg(); + if(m_pView) + bRet = m_pView->GetWrtShell().EndPrvPg(); else throw uno::RuntimeException(); return bRet; @@ -1629,8 +1628,8 @@ sal_Bool SwXTextViewCursor::jumpToEndOfPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().EndPg(); + if(m_pView) + bRet = m_pView->GetWrtShell().EndPg(); else throw uno::RuntimeException(); return bRet; @@ -1642,8 +1641,8 @@ sal_Bool SwXTextViewCursor::jumpToStartOfPage(void) throw( uno::RuntimeException { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) - bRet = pView->GetWrtShell().SttPg(); + if(m_pView) + bRet = m_pView->GetWrtShell().SttPg(); else throw uno::RuntimeException(); return bRet; @@ -1655,9 +1654,9 @@ sal_Int16 SwXTextViewCursor::getPage(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); short nRet = 0; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); nRet = (short)pShellCrsr->GetPageNum( TRUE, 0 ); } @@ -1672,10 +1671,10 @@ sal_Bool SwXTextViewCursor::screenDown(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { - SfxRequest aReq(FN_PAGEDOWN, SFX_CALLMODE_SLOT, pView->GetPool()); - pView->Execute(aReq); + SfxRequest aReq(FN_PAGEDOWN, SFX_CALLMODE_SLOT, m_pView->GetPool()); + m_pView->Execute(aReq); const SfxPoolItem* pRet = aReq.GetReturnValue(); bRet = pRet && ((const SfxBoolItem*)pRet)->GetValue(); } @@ -1690,10 +1689,10 @@ sal_Bool SwXTextViewCursor::screenUp(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { - SfxRequest aReq(FN_PAGEUP, SFX_CALLMODE_SLOT, pView->GetPool()); - pView->Execute(aReq); + SfxRequest aReq(FN_PAGEUP, SFX_CALLMODE_SLOT, m_pView->GetPool()); + m_pView->Execute(aReq); const SfxPoolItem* pRet = aReq.GetReturnValue(); bRet = pRet && ((const SfxBoolItem*)pRet)->GetValue(); } @@ -1708,14 +1707,14 @@ uno::Reference< text::XText > SwXTextViewCursor::getText(void) throw( uno::Runt { ::vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< text::XText > xRet; - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); uno::Reference< text::XTextRange > xRg = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->Start(), 0); xRet = xRg->getText(); @@ -1731,14 +1730,14 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getStart(void) throw( uno { ::vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< text::XTextRange > xRet; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->Start(), 0); } @@ -1753,14 +1752,14 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd(void) throw( uno:: { ::vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< text::XTextRange > xRet; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwDoc* pDoc = pView->GetDocShell()->GetDoc(); + SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, *pShellCrsr->End(), 0); } @@ -1775,12 +1774,12 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); OUString uRet; - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - ShellModes eSelMode = pView->GetShellMode(); + ShellModes eSelMode = m_pView->GetShellMode(); switch(eSelMode) { //! since setString for SEL_TABLE_TEXT (with possible @@ -1792,7 +1791,7 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) case SHELL_MODE_TABLE_LIST_TEXT: case SHELL_MODE_TEXT : { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwXTextCursor::getTextFromPam(*pShellCrsr, uRet); } @@ -1807,12 +1806,12 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - ShellModes eSelMode = pView->GetShellMode(); + ShellModes eSelMode = m_pView->GetShellMode(); switch(eSelMode) { //! since setString for SEL_TABLE_TEXT (with possible @@ -1824,7 +1823,7 @@ void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeEx case SHELL_MODE_TABLE_LIST_TEXT : case SHELL_MODE_TEXT : { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwCursor* pShellCrsr = rSh.GetSwCrsr(); SwXTextCursor::SetString( *pShellCrsr, aString ); } @@ -1838,7 +1837,7 @@ void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeEx -----------------------------------------------------------------------*/ uno::Reference< XPropertySetInfo > SwXTextViewCursor::getPropertySetInfo( ) throw(RuntimeException) { - static uno::Reference< XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } /*-- 29.06.00 17:33:39--------------------------------------------------- @@ -1849,13 +1848,13 @@ void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const IllegalArgumentException, WrappedTargetException, RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwNode *pNode = pShellCrsr->GetNode(); if (pNode && pNode->IsTxtNode()) - SwXTextCursor::SetPropertyValue(*pShellCrsr, aPropSet, rPropertyName, aValue ); + SwXTextCursor::SetPropertyValue(*pShellCrsr, *m_pPropSet, rPropertyName, aValue ); else throw RuntimeException(); } @@ -1870,11 +1869,11 @@ Any SwXTextViewCursor::getPropertyValue( const OUString& rPropertyName ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); Any aRet; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyValue( *pShellCrsr, aPropSet, rPropertyName); + aRet = SwXTextCursor::GetPropertyValue( *pShellCrsr, *m_pPropSet, rPropertyName); } else throw RuntimeException(); @@ -1919,11 +1918,11 @@ PropertyState SwXTextViewCursor::getPropertyState( const OUString& rPropertyNam { ::vos::OGuard aGuard(Application::GetSolarMutex()); PropertyState eState; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - eState = SwXTextCursor::GetPropertyState( *pShellCrsr, aPropSet, rPropertyName); + eState = SwXTextCursor::GetPropertyState( *pShellCrsr, *m_pPropSet, rPropertyName); } else throw RuntimeException(); @@ -1937,11 +1936,11 @@ Sequence< PropertyState > SwXTextViewCursor::getPropertyStates( { ::vos::OGuard aGuard(Application::GetSolarMutex()); Sequence< PropertyState > aRet; - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyStates(*pShellCrsr, aPropSet, rPropertyNames); + aRet = SwXTextCursor::GetPropertyStates(*pShellCrsr, *m_pPropSet, rPropertyNames); } return aRet; } @@ -1952,11 +1951,11 @@ void SwXTextViewCursor::setPropertyToDefault( const OUString& rPropertyName ) throw(UnknownPropertyException, RuntimeException) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwXTextCursor::SetPropertyToDefault( *pShellCrsr, aPropSet, rPropertyName); + SwXTextCursor::SetPropertyToDefault( *pShellCrsr, *m_pPropSet, rPropertyName); } } /*-- 29.06.00 17:33:43--------------------------------------------------- @@ -1967,11 +1966,11 @@ Any SwXTextViewCursor::getPropertyDefault( const OUString& rPropertyName ) { Any aRet; ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyDefault( *pShellCrsr, aPropSet, rPropertyName); + aRet = SwXTextCursor::GetPropertyDefault( *pShellCrsr, *m_pPropSet, rPropertyName); } return aRet; } @@ -1982,13 +1981,13 @@ sal_Bool SwXTextViewCursor::goDown(sal_Int16 nCount, sal_Bool bExpand) throw( un { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); for( sal_uInt16 i = 0; i < nCount; i++ ) - bRet = pView->GetWrtShell().Down( bExpand, 1, sal_True ); + bRet = m_pView->GetWrtShell().Down( bExpand, 1, sal_True ); } else throw uno::RuntimeException(); @@ -2001,13 +2000,13 @@ sal_Bool SwXTextViewCursor::goUp(sal_Int16 nCount, sal_Bool bExpand) throw( uno: { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection()) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); for( sal_uInt16 i = 0; i < nCount; i++ ) - bRet = pView->GetWrtShell().Up( bExpand, 1, sal_True ); + bRet = m_pView->GetWrtShell().Up( bExpand, 1, sal_True ); } else throw uno::RuntimeException(); @@ -2020,12 +2019,12 @@ sal_Bool SwXTextViewCursor::isAtStartOfLine(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - bRet = pView->GetWrtShell().IsAtLeftMargin(); + bRet = m_pView->GetWrtShell().IsAtLeftMargin(); } else throw uno::RuntimeException(); @@ -2038,12 +2037,12 @@ sal_Bool SwXTextViewCursor::isAtEndOfLine(void) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); sal_Bool bRet = sal_False; - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - bRet = pView->GetWrtShell().IsAtRightMargin(sal_True); + bRet = m_pView->GetWrtShell().IsAtRightMargin(sal_True); } else throw uno::RuntimeException(); @@ -2055,12 +2054,12 @@ sal_Bool SwXTextViewCursor::isAtEndOfLine(void) throw( uno::RuntimeException ) void SwXTextViewCursor::gotoEndOfLine(sal_Bool bExpand) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pView->GetWrtShell().RightMargin(bExpand, sal_True); + m_pView->GetWrtShell().RightMargin(bExpand, sal_True); } else throw uno::RuntimeException(); @@ -2071,12 +2070,12 @@ void SwXTextViewCursor::gotoEndOfLine(sal_Bool bExpand) throw( uno::RuntimeExcep void SwXTextViewCursor::gotoStartOfLine(sal_Bool bExpand) throw( uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(pView) + if(m_pView) { if (!IsTextSelection( sal_False )) throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pView->GetWrtShell().LeftMargin(bExpand, sal_True); + m_pView->GetWrtShell().LeftMargin(bExpand, sal_True); } else throw uno::RuntimeException(); @@ -2146,25 +2145,25 @@ sal_Int64 SAL_CALL SwXTextViewCursor::getSomething( IMPLEMENT_FORWARD_XINTERFACE2(SwXTextViewCursor,SwXTextViewCursor_Base,OTextCursorHelper) const SwDoc* SwXTextViewCursor::GetDoc() const { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr() ? rSh.GetCrsr()->GetDoc() : 0; } // ----------------------------------------------------------------------------- SwDoc* SwXTextViewCursor::GetDoc() { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr() ? rSh.GetCrsr()->GetDoc() : 0; } // ----------------------------------------------------------------------------- const SwPaM* SwXTextViewCursor::GetPaM() const { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr(); } // ----------------------------------------------------------------------------- SwPaM* SwXTextViewCursor::GetPaM() { - SwWrtShell& rSh = pView->GetWrtShell(); + SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr(); } |