diff options
Diffstat (limited to 'svx')
42 files changed, 998 insertions, 525 deletions
diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc index daf2ff4c1812..c7f172cbe5db 100644 --- a/svx/inc/fmhelp.hrc +++ b/svx/inc/fmhelp.hrc @@ -43,121 +43,6 @@ #define HID_DLG_DBINFO (HID_FORMS_START + 0) #define HID_DLG_DBMSG (HID_FORMS_START + 1) -#define HID_PROP_GROUPBOX (HID_FORMS_START + 2) -#define HID_PROP_CONTROLSOURCE (HID_FORMS_START + 3) -#define HID_PROP_NAME (HID_FORMS_START + 4) -#define HID_PROP_TABINDEX (HID_FORMS_START + 5) -#define HID_PROP_MASTERFIELDS (HID_FORMS_START + 6) -#define HID_PROP_SLAVEFIELDS (HID_FORMS_START + 7) -#define HID_PROP_DATASOURCE (HID_FORMS_START + 8) -#define HID_PROP_CURSORSOURCE (HID_FORMS_START + 9) -#define HID_PROP_CURSORSOURCETYPE (HID_FORMS_START + 10) -#define HID_PROP_CURSORTYPE (HID_FORMS_START + 11) -#define HID_PROP_READONLY (HID_FORMS_START + 12) -#define HID_PROP_DATAENTRY (HID_FORMS_START + 13) -#define HID_PROP_NAVIGATION (HID_FORMS_START + 14) -#define HID_PROP_CYCLE (HID_FORMS_START + 15) -#define HID_PROP_ALLOW_ADDITIONS (HID_FORMS_START + 16) -#define HID_PROP_ALLOW_EDITS (HID_FORMS_START + 17) -#define HID_PROP_ALLOW_DELETIONS (HID_FORMS_START + 18) -#define HID_PROP_DIRTY (HID_FORMS_START + 19) -#define HID_PROP_OLDVALUE (HID_FORMS_START + 20) -#define HID_PROP_VALUE (HID_FORMS_START + 21) -#define HID_PROP_LOCKED (HID_FORMS_START + 22) -#define HID_PROP_FORMATKEY (HID_FORMS_START + 23) -#define HID_PROP_REQUIRED (HID_FORMS_START + 24) -#define HID_PROP_SCALE (HID_FORMS_START + 25) -#define HID_PROP_SIZE (HID_FORMS_START + 26) -#define HID_PROP_UNIQUE (HID_FORMS_START + 27) -#define HID_PROP_CLASSID (HID_FORMS_START + 28) -#define HID_PROP_LEFT (HID_FORMS_START + 29) -#define HID_PROP_RIGHT (HID_FORMS_START + 30) -#define HID_PROP_HEIGHT (HID_FORMS_START + 31) -#define HID_PROP_WIDTH (HID_FORMS_START + 32) -#define HID_PROP_BOUNDCOLUMN (HID_FORMS_START + 33) -#define HID_PROP_LISTSOURCETYPE (HID_FORMS_START + 34) -#define HID_PROP_LISTSOURCE (HID_FORMS_START + 35) -#define HID_PROP_LISTINDEX (HID_FORMS_START + 36) -#define HID_PROP_TEXT (HID_FORMS_START + 37) -#define HID_PROP_LABEL (HID_FORMS_START + 38) -#define HID_PROP_STRINGITEMLIST (HID_FORMS_START + 39) -#define HID_PROP_SEARCHING (HID_FORMS_START + 40) -#define HID_PROP_FONT (HID_FORMS_START + 41) -#define HID_PROP_ROWHEIGHT (HID_FORMS_START + 42) -#define HID_PROP_BACKGROUNDCOLOR (HID_FORMS_START + 43) -#define HID_PROP_FILLCOLOR (HID_FORMS_START + 44) -#define HID_PROP_TEXTCOLOR (HID_FORMS_START + 45) -#define HID_PROP_LINECOLOR (HID_FORMS_START + 46) -#define HID_PROP_BORDER (HID_FORMS_START + 47) -#define HID_PROP_ALIGN (HID_FORMS_START + 48) -#define HID_PROP_DROPDOWN (HID_FORMS_START + 49) -#define HID_PROP_MULTILINE (HID_FORMS_START + 50) -#define HID_PROP_HSCROLL (HID_FORMS_START + 51) -#define HID_PROP_VSCROLL (HID_FORMS_START + 52) -#define HID_PROP_TABSTOP (HID_FORMS_START + 53) -#define HID_PROP_REFVALUE (HID_FORMS_START + 54) -#define HID_PROP_BUTTONTYPE (HID_FORMS_START + 55) -#define HID_PROP_SUBMIT_ACTION (HID_FORMS_START + 56) -#define HID_PROP_SUBMIT_METHOD (HID_FORMS_START + 57) -#define HID_PROP_SUBMIT_ENCODING (HID_FORMS_START + 58) -#define HID_PROP_DEFAULTVALUE (HID_FORMS_START + 59) -#define HID_PROP_SUBMIT_TARGET (HID_FORMS_START + 60) -#define HID_PROP_DEFAULT_CHECKED (HID_FORMS_START + 61) -#define HID_PROP_IMAGE_URL (HID_FORMS_START + 62) -#define HID_PROP_DEFAULT_SELECT_SEQ (HID_FORMS_START + 63) -#define HID_PROP_MULTISELECTION (HID_FORMS_START + 64) - -#define HID_PROP_DATE (HID_FORMS_START + 65) -#define HID_PROP_DATEMIN (HID_FORMS_START + 66) -#define HID_PROP_DATEMAX (HID_FORMS_START + 67) -#define HID_PROP_DATEFORMAT (HID_FORMS_START + 68) -#define HID_PROP_TIME (HID_FORMS_START + 69) -#define HID_PROP_TIMEMIN (HID_FORMS_START + 70) -#define HID_PROP_TIMEMAX (HID_FORMS_START + 71) -#define HID_PROP_TIMEFORMAT (HID_FORMS_START + 72) -#define HID_PROP_VALUEMIN (HID_FORMS_START + 73) -#define HID_PROP_VALUEMAX (HID_FORMS_START + 74) -#define HID_PROP_VALUESTEP (HID_FORMS_START + 75) -#define HID_PROP_CURRENCYSYMBOL (HID_FORMS_START + 76) -#define HID_PROP_EDITMASK (HID_FORMS_START + 77) -#define HID_PROP_LITERALMASK (HID_FORMS_START + 78) -#define HID_PROP_ENABLED (HID_FORMS_START + 79) -#define HID_PROP_AUTOCOMPLETE (HID_FORMS_START + 80) -#define HID_PROP_LINECOUNT (HID_FORMS_START + 81) -#define HID_PROP_MAXTEXTLEN (HID_FORMS_START + 82) -#define HID_PROP_SPIN (HID_FORMS_START + 83) -#define HID_PROP_STRICTFORMAT (HID_FORMS_START + 84) -#define HID_PROP_SHOWTHOUSANDSEP (HID_FORMS_START + 85) - // FREE -#define HID_PROP_PRINTABLE (HID_FORMS_START + 87) -#define HID_PROP_TARGET_URL (HID_FORMS_START + 88) -#define HID_PROP_TARGET_FRAME (HID_FORMS_START + 89) -#define HID_PROP_TAG (HID_FORMS_START + 90) -#define HID_PROP_ECHO_CHAR (HID_FORMS_START + 91) -#define HID_PROP_EMPTY_IS_NULL (HID_FORMS_START + 92) -#define HID_PROP_DECIMAL_ACCURACY (HID_FORMS_START + 93) - // FREE -#define HID_PROP_DEFAULT_BUTTON (HID_FORMS_START + 95) -#define HID_PROP_HIDDEN_VALUE (HID_FORMS_START + 96) -#define HID_PROP_TRISTATE (HID_FORMS_START + 97) -#define HID_PROP_NAVIGATIONBAR (HID_FORMS_START + 98) -#define HID_PROP_FILTER_CRITERIA (HID_FORMS_START + 99) -#define HID_PROP_SORT_CRITERIA (HID_FORMS_START + 100) -#define HID_PROP_DEFAULT_LONG_VALUE (HID_FORMS_START + 101) -#define HID_PROP_DEFAULT_TIME (HID_FORMS_START + 102) -#define HID_PROP_DEFAULT_DATE (HID_FORMS_START + 103) -#define HID_PROP_HELPTEXT (HID_FORMS_START + 104) -#define HID_PROP_HELPURL (HID_FORMS_START + 105) -#define HID_PROP_RECORDMARKER (HID_FORMS_START + 106) -#define HID_PROP_FILTERPROPOSAL (HID_FORMS_START + 107) -#define HID_PROP_EFFECTIVEMIN (HID_FORMS_START + 108) -#define HID_PROP_EFFECTIVEMAX (HID_FORMS_START + 109) -#define HID_PROP_EFFECTIVEDEFAULT (HID_FORMS_START + 110) -#define HID_PROP_CONTROLLABEL (HID_FORMS_START + 111) -#define HID_PROP_CURRSYM_POSITION (HID_FORMS_START + 112) -#define HID_PROP_ESCAPE_PROCESSING (HID_FORMS_START + 113) -#define HID_PROP_IMAGE_ALIGN (HID_FORMS_START + 114) - #define HID_FM_OTHER_START (HID_FORMS_START + 300) #define HID_FORM_NAVIGATOR (HID_FM_OTHER_START + 0) #define HID_FORM_NAVIGATOR_WIN (HID_FM_OTHER_START + 1) diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index 283bb9b2d6fd..8e9bc4d17930 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -909,7 +909,7 @@ #include "unotools/configvaluecontainer.hxx" #include "unotools/localfilehelper.hxx" #include "unotools/processfactory.hxx" -#include "unotools/servicehelper.hxx" +#include "comphelper/servicehelper.hxx" #include "unotools/streamwrap.hxx" #include "unotools/textsearch.hxx" #include "unotools/transliterationwrapper.hxx" diff --git a/svx/inc/svx/fmpage.hxx b/svx/inc/svx/fmpage.hxx index 2efda5fa2cc4..1b5de5eabf08 100644 --- a/svx/inc/svx/fmpage.hxx +++ b/svx/inc/svx/fmpage.hxx @@ -59,11 +59,6 @@ public: FmFormPage(const FmFormPage& rPage); ~FmFormPage(); - using SdrPage::NbcInsertObject; - using SdrPage::NbcRemoveObject; - using SdrPage::NbcReplaceObject; - using SdrPage::ReplaceObject; - virtual void SetModel(SdrModel* pNewModel); virtual SdrPage* Clone() const; @@ -77,7 +72,9 @@ public: // Zugriff auf alle Formulare const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& GetForms( bool _bForceCreate = true ) const; - FmFormPageImpl* GetImpl() const {return m_pImpl;} +#ifndef SVX_LIGHT + FmFormPageImpl& GetImpl() const { return *m_pImpl; } +#endif // SVX_LIGHT public: const String& GetName() const { return m_sPageName; } diff --git a/svx/inc/svx/shapeproperty.hxx b/svx/inc/svx/shapeproperty.hxx new file mode 100755 index 000000000000..267b5e229d08 --- /dev/null +++ b/svx/inc/svx/shapeproperty.hxx @@ -0,0 +1,58 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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. +************************************************************************/ +
+#ifndef SVX_SHAPEPROPERTY_HXX +#define SVX_SHAPEPROPERTY_HXX + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +//........................................................................ +namespace svx +{ +//........................................................................ + + //==================================================================== + //= ShapeProperty + //==================================================================== + enum ShapeProperty + { + // generic (UNO) shape properties + eShapePosition, + eShapeSize, + // text doc shape properties + eTextShapeAnchorType, + // spreadsheet doc shape properties + eSpreadsheetAnchor, + + // invalid, not to be used + eInvalidShapeProperty + }; + +//........................................................................ +} // namespace svx +//........................................................................ + +#endif // SVX_SHAPEPROPERTY_HXX diff --git a/svx/inc/svx/shapepropertynotifier.hxx b/svx/inc/svx/shapepropertynotifier.hxx new file mode 100644 index 000000000000..b5598e5fb0da --- /dev/null +++ b/svx/inc/svx/shapepropertynotifier.hxx @@ -0,0 +1,147 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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. +************************************************************************/ +
+#ifndef SVX_PROPERTYCHANGENOTIFIER_HXX +#define SVX_PROPERTYCHANGENOTIFIER_HXX + +#include "svx/svxdllapi.h" +#include "svx/shapeproperty.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/beans/PropertyChangeEvent.hpp> +#include <com/sun/star/beans/XPropertyChangeListener.hpp> +/** === end UNO includes === **/ + +#include <boost/noncopyable.hpp> +#include <boost/shared_ptr.hpp> +#include <memory> + +namespace cppu +{ + class OWeakObject; +} + +//........................................................................ +namespace svx +{ +//........................................................................ + + //==================================================================== + //= IPropertyValueProvider + //==================================================================== + /** a provider for a property value + */ + class SVX_DLLPUBLIC IPropertyValueProvider + { + public: + /** returns the name of the property which this provider is responsible for + */ + virtual ::rtl::OUString getPropertyName() const = 0; + + /** returns the current value of the property which the provider is responsible for + */ + virtual void getCurrentValue( ::com::sun::star::uno::Any& _out_rValue ) const = 0; + + virtual ~IPropertyValueProvider(); + }; + typedef ::boost::shared_ptr< IPropertyValueProvider > PPropertyValueProvider; + + //==================================================================== + //= PropertyValueProvider + //==================================================================== + /** default implementation of a IPropertyValueProvider + + This default implementation queries the object which it is constructed with for the XPropertySet interface, + and calls the getPropertyValue method. + */ + class SVX_DLLPUBLIC PropertyValueProvider :public IPropertyValueProvider + ,public ::boost::noncopyable + { + public: + PropertyValueProvider( ::cppu::OWeakObject& _rContext, const sal_Char* _pAsciiPropertyName ) + :m_rContext( _rContext ) + ,m_sPropertyName( ::rtl::OUString::createFromAscii( _pAsciiPropertyName ) ) + { + } + + virtual ::rtl::OUString getPropertyName() const; + virtual void getCurrentValue( ::com::sun::star::uno::Any& _out_rValue ) const; + + protected: + ::cppu::OWeakObject& getContext() const { return m_rContext; } + private: + ::cppu::OWeakObject& m_rContext; + const ::rtl::OUString m_sPropertyName; + }; + + //==================================================================== + //= PropertyChangeNotifier + //==================================================================== + struct PropertyChangeNotifier_Data; + + /** helper class for notifying XPropertyChangeListeners + + The class is intended to be held as member of the class which does the property change broadcasting. + */ + class SVX_DLLPUBLIC PropertyChangeNotifier : public ::boost::noncopyable + { + public: + /** constructs a notifier instance + + @param _rOwner + the owner instance of the notifier. Will be used as css.lang.EventObject.Source when + notifying events. + */ + PropertyChangeNotifier( ::cppu::OWeakObject& _rOwner, ::osl::Mutex& _rMutex ); + ~PropertyChangeNotifier(); + + // listener maintanance + void addPropertyChangeListener( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ); + void removePropertyChangeListener( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ); + + /** registers a IPropertyValueProvider + */ + void registerProvider( const ShapeProperty _eProperty, const PPropertyValueProvider _pProvider ); + + /** notifies changes in the given property to all registered listeners + + If no property value provider for the given property ID is registered, this is worth an assertion in a + non-product build, and otherwise ignored. + */ + void notifyPropertyChange( const ShapeProperty _eProperty ) const; + + /** is called to dispose the instance + */ + void disposing(); + + private: + ::std::auto_ptr< PropertyChangeNotifier_Data > m_pData; + }; + +//........................................................................ +} // namespace svx +//........................................................................ + +#endif // SVX_PROPERTYCHANGENOTIFIER_HXX diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index 0b6e190ff025..cc5c9be64438 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -46,6 +46,7 @@ #include <vcl/bitmapex.hxx> #include <svx/sdrobjectuser.hxx> #include "svx/svxdllapi.h" +#include "svx/shapeproperty.hxx" //************************************************************ // Vorausdeklarationen @@ -95,6 +96,11 @@ namespace sdr } // end of namespace contact } // end of namespace sdr +namespace svx +{ + class PropertyChangeNotifier; +} + //************************************************************ // Defines //************************************************************ @@ -529,9 +535,6 @@ protected: // ueberladen, wenn man sich von SdrObjPlusData abgeleitet hat: virtual SdrObjPlusData* NewPlusData() const; - // this is a weak reference to a possible living api wrapper for this shape - ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > mxUnoShape; - protected: // Diese 3 Methoden muss ein abgeleitetes Objekt ueberladen, wenn es eigene // geometrische Daten besitzt, die fuer den Undo-Fall gesichert werden @@ -1053,7 +1056,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////////////////// // access to the UNO representation of the shape virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape(); - ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > getWeakUnoShape() { return mxUnoShape; } + ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > getWeakUnoShape() const { return maWeakUnoShape; } static SdrObject* getSdrObjectFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xInt ); @@ -1067,9 +1070,31 @@ public: // setting the UNO representation is allowed for the UNO representation itself only! void setUnoShape( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape, - GrantXShapeAccess /*aGrant*/ - ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape, + GrantXShapeAccess /*aGrant*/ + ) + { + impl_setUnoShape( _rxUnoShape ); + } + + /** retrieves the instance responsible for notifying changes in the properties of the shape associated with + the SdrObject + + @precond + There already exists an SvxShape instance associated with the SdrObject + @throws ::com::sun::star::uno::RuntimeException + if there does nt yet exists an SvxShape instance associated with the SdrObject. + */ + ::svx::PropertyChangeNotifier& + getShapePropertyChangeNotifier(); + + /** notifies a change in the given property, to all applicable listeners registered at the associated SvxShape + + This method is equivalent to calling getShapePropertyChangeNotifier().notifyPropertyChange( _eProperty ), + exception that it is allowed to be called when there does not yet exist an associated SvxShape - in which + case the method will silently return without doing anything. + */ + void notifyShapePropertyChange( const ::svx::ShapeProperty _eProperty ) const; //////////////////////////////////////////////////////////////////////////////////////////////////// // @@ -1110,18 +1135,17 @@ public: void SetBLIPSizeRectangle( const Rectangle& aRect ); protected: - // #b4899532# - // Force LineStyle with hard attributes to hair line in COL_LIGHTGRAY + void impl_setUnoShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape ); + +private: /** only for internal use! - The returned SvxShape pointer may be null and if not it is only valid as long as you - hold the xShapeGuard reference. */ - SvxShape* getSvxShape( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xShapeGuard ); + SvxShape* getSvxShape() const; -private: /** do not use directly, always use getSvxShape() if you have to! */ - SvxShape* mpSvxShape; - + SvxShape* mpSvxShape; + ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > + maWeakUnoShape; }; //************************************************************ diff --git a/svx/inc/svx/svdouno.hxx b/svx/inc/svx/svdouno.hxx index d0dd60fd8c9a..b366c50cfc84 100644 --- a/svx/inc/svx/svdouno.hxx +++ b/svx/inc/svx/svdouno.hxx @@ -144,7 +144,7 @@ public: const String& GetUnoControlModelTypeName() const { return aUnoControlTypeName; } const String& GetUnoControlTypeName() const { return aUnoControlTypeName; } - void SetUnoControlModel(::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > xModel); + virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& xModel ); protected: // SdrObject overridables diff --git a/svx/inc/svx/unofield.hxx b/svx/inc/svx/unofield.hxx index fbd0976db497..ad819e1b9dbe 100644 --- a/svx/inc/svx/unofield.hxx +++ b/svx/inc/svx/unofield.hxx @@ -39,7 +39,7 @@ #include <cppuhelper/component.hxx> #include "svx/svxdllapi.h" -#include <unotools/servicehelper.hxx> +#include <comphelper/servicehelper.hxx> #include <svx/mutxhelp.hxx> diff --git a/svx/inc/svx/unopage.hxx b/svx/inc/svx/unopage.hxx index f985d6e9b057..39caa0849ec6 100644 --- a/svx/inc/svx/unopage.hxx +++ b/svx/inc/svx/unopage.hxx @@ -49,7 +49,7 @@ #include "svx/svxdllapi.h" #include <cppuhelper/implbase5.hxx> -#include <unotools/servicehelper.hxx> +#include <comphelper/servicehelper.hxx> #include <svx/unoprov.hxx> diff --git a/svx/inc/svx/unoshape.hxx b/svx/inc/svx/unoshape.hxx index 54c6de369878..f400376a6937 100644 --- a/svx/inc/svx/unoshape.hxx +++ b/svx/inc/svx/unoshape.hxx @@ -60,7 +60,7 @@ #include <svx/svdouno.hxx> -#include <unotools/servicehelper.hxx> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase12.hxx> @@ -107,8 +107,7 @@ class SVX_DLLPUBLIC SvxShape : public SvxShape_UnoImplHelper, public SfxListener, public SvxShapeMutex { - private: - SVX_DLLPRIVATE void Init() throw(); +private: ::com::sun::star::awt::Size maSize; ::com::sun::star::awt::Point maPosition; ::rtl::OUString maShapeType; @@ -128,10 +127,6 @@ protected: const SvxItemPropertySet* mpPropSet; const SfxItemPropertyMapEntry* maPropMapEntries; - // for xComponent - ::cppu::OInterfaceContainerHelper maDisposeListeners; - bool mbDisposing; - ::tools::WeakReference< SdrObject > mpObj; SdrModel* mpModel; // Umrechnungen fuer den Writer, der in TWIPS arbeitet @@ -175,8 +170,8 @@ public: virtual ~SvxShape() throw (); // Internals - void ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet) throw (); - virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ) throw (); + void ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet); + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ); /** takes the ownership of the SdrObject. When the shape is disposed, and it has the ownership of its associated SdrObject, then @@ -194,6 +189,8 @@ public: ::com::sun::star::uno::Any GetBitmap( BOOL bMetaFile = FALSE ) const throw (); static SvxShape* GetShapeForSdrObj( SdrObject* pObj ) throw (); + ::svx::PropertyChangeNotifier& getShapePropertyChangeNotifier(); + void setShapeKind( sal_uInt32 nKind ); sal_uInt32 getShapeKind() const; @@ -232,10 +229,11 @@ public: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw (); - /** called from SdrObject::SendUserCall - Currently only called for SDRUSERCALL_CHILD_CHGATTR + /** @obsolete + not used anymore */ virtual void onUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundRect); + // XAggregation virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); @@ -317,6 +315,13 @@ public: virtual void SAL_CALL removeActionLock( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) throw (::com::sun::star::uno::RuntimeException); virtual sal_Int16 SAL_CALL resetActionLocks( ) throw (::com::sun::star::uno::RuntimeException); + +private: + /** initializes SdrObj-dependent members. Only to be called when GetSdrObject() != NULL + */ + SVX_DLLPRIVATE void impl_initFromSdrObject(); + /// CTOR-Impl + SVX_DLLPRIVATE void impl_construct(); }; #include <svx/unotext.hxx> @@ -346,7 +351,7 @@ public: SvxShapeText( SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet ) throw (); virtual ~SvxShapeText() throw (); - virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ) throw (); + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); @@ -406,7 +411,7 @@ public: SvxShapeGroup( SdrObject* pObj,SvxDrawPage* pDrawPage ) throw (); virtual ~SvxShapeGroup() throw (); - virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ) throw (); + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); @@ -690,7 +695,7 @@ public: virtual ~Svx3DSceneObject() throw(); - virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ) throw(); + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); @@ -833,7 +838,7 @@ public: virtual ~SvxCustomShape() throw (); - virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ) throw(); + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); diff --git a/svx/inc/svx/unotext.hxx b/svx/inc/svx/unotext.hxx index 30b48b463c46..4fe716c259ff 100644 --- a/svx/inc/svx/unotext.hxx +++ b/svx/inc/svx/unotext.hxx @@ -73,7 +73,7 @@ #include <osl/mutex.hxx> #include "svx/svxdllapi.h" -#include <unotools/servicehelper.hxx> +#include <comphelper/servicehelper.hxx> #ifndef SEQTYPE #if defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500) diff --git a/svx/prj/d.lst b/svx/prj/d.lst index 3b70b59970fb..74236afdad1c 100644 --- a/svx/prj/d.lst +++ b/svx/prj/d.lst @@ -324,6 +324,8 @@ mkdir: %_DEST%\inc%_EXT%\svx ..\inc\svx\unopage.hxx %_DEST%\inc%_EXT%\svx\unopage.hxx ..\inc\svx\unoprnms.hxx %_DEST%\inc%_EXT%\svx\unoprnms.hxx ..\inc\svx\unoshape.hxx %_DEST%\inc%_EXT%\svx\unoshape.hxx +..\inc\svx\shapepropertynotifier.hxx %_DEST%\inc%_EXT%\svx\shapepropertynotifier.hxx +..\inc\svx\shapeproperty.hxx %_DEST%\inc%_EXT%\svx\shapeproperty.hxx ..\inc\unoshcol.hxx %_DEST%\inc%_EXT%\svx\unoshcol.hxx ..\inc\svx\unoipset.hxx %_DEST%\inc%_EXT%\svx\unoipset.hxx ..\inc\svx\unoprov.hxx %_DEST%\inc%_EXT%\svx\unoprov.hxx diff --git a/svx/source/cui/backgrnd.cxx b/svx/source/cui/backgrnd.cxx index 6d9c06484658..9ba19816b1bf 100644 --- a/svx/source/cui/backgrnd.cxx +++ b/svx/source/cui/backgrnd.cxx @@ -1204,8 +1204,6 @@ void SvxBackgroundTabPage::FillColorValueSets_Impl() const Size aSize15x15 = Size( 15, 15 ); FASTBOOL bOwn = FALSE; - DBG_ASSERT( pDocSh, "DocShell not found!" ); - if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) ) pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); diff --git a/svx/source/cui/numfmt.cxx b/svx/source/cui/numfmt.cxx index 2f11f1af0223..a3b426c6110e 100644 --- a/svx/source/cui/numfmt.cxx +++ b/svx/source/cui/numfmt.cxx @@ -64,7 +64,9 @@ #include <svx/dialmgr.hxx> #include <sfx2/request.hxx> //CHINA001 #include <sfx2/app.hxx> //CHINA001 +#include <sfx2/basedlgs.hxx> #include "flagsdef.hxx" //CHINA001 + #define NUMKEY_UNDEFINED SAL_MAX_UINT32 // static ---------------------------------------------------------------- @@ -1278,8 +1280,18 @@ IMPL_LINK( SvxNumberFormatTabPage, DoubleClickHdl_Impl, SvxFontListBox*, pLb ) if ( pLb == &aLbFormat ) { SelFormatHdl_Impl( pLb ); - // Uebergangsloesung, sollte von SfxTabPage angeboten werden - fnOkHdl.Call( NULL ); + + if ( fnOkHdl.IsSet() ) + { // Uebergangsloesung, sollte von SfxTabPage angeboten werden + fnOkHdl.Call( NULL ); + } + else + { + SfxSingleTabDialog* pParent = dynamic_cast< SfxSingleTabDialog* >( GetParent() ); + OKButton* pOKButton = pParent ? pParent->GetOKButton() : NULL; + if ( pOKButton ) + pOKButton->Click(); + } } return 0; } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 49778b7a4b69..d6cd4f2d2bae 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -172,8 +172,9 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, const Reference< ::com::s case DataType::TINYINT: case DataType::SMALLINT: case DataType::INTEGER: - case DataType::REAL: case DataType::BIGINT: + case DataType::FLOAT: + case DataType::REAL: case DataType::DOUBLE: case DataType::NUMERIC: case DataType::DECIMAL: @@ -182,6 +183,7 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, const Reference< ::com::s break; default: m_nAlign = ::com::sun::star::awt::TextAlign::LEFT; + break; } } diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index 47de621f99dd..d968342d6ef5 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -30,24 +30,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" + +#include "fmhelp.hrc"
+#include "fmprop.hrc"
#include "fmPropBrw.hxx" -#ifndef _SVX_SVXIDS_HRC -#include <svx/svxids.hrc> -#endif -#include <svx/fmshell.hxx> -#include "fmshimp.hxx" -#ifndef _SVX_FMPROP_HRC -#include "fmprop.hrc" -#endif -#ifndef _SVX_FMHELP_HRC -#include "fmhelp.hrc" -#endif -#include <svx/dialmgr.hxx> -#ifndef _SVX_FMRESIDS_HRC #include "fmresids.hrc" -#endif #include "fmservs.hxx" -#include <svx/svdpagv.hxx> +#include "fmshimp.hxx"
+#include "fmpgeimp.hxx"
+ +#include "svx/dialmgr.hxx"
+#include "svx/fmpage.hxx"
+#include "svx/fmshell.hxx"
+#include "svx/sdrpagewindow.hxx"
+#include "svx/svdpagv.hxx"
+#include "svx/svxids.hrc"
/** === begin UNO includes === **/ #include <com/sun/star/beans/PropertyValue.hpp> @@ -64,24 +61,22 @@ #include <com/sun/star/inspection/XObjectInspectorUI.hpp> #include <com/sun/star/inspection/DefaultHelpProvider.hpp> /** === end UNO includes === **/ + #include <comphelper/processfactory.hxx> +#include <comphelper/property.hxx>
#include <cppuhelper/component_context.hxx> -#include <tools/shl.hxx> -#include <tools/diagnose_ex.h> -#include <vcl/stdtext.hxx> -#include <sfx2/dispatch.hxx> -#include <sfx2/viewfrm.hxx> -#include <tools/debug.hxx> -#include <sfx2/objsh.hxx> #include <sfx2/bindings.hxx> #include <sfx2/childwin.hxx> +#include <sfx2/dispatch.hxx>
#include <sfx2/objitem.hxx> -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ +#include <sfx2/objsh.hxx>
+#include <sfx2/viewfrm.hxx>
#include <toolkit/unohlp.hxx> -#endif -#include <comphelper/property.hxx> +#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/shl.hxx>
#include <unotools/confignode.hxx> -#include <svx/sdrpagewindow.hxx> +#include <vcl/stdtext.hxx>
#include <algorithm> @@ -303,19 +298,24 @@ FmPropBrw::~FmPropBrw() implDetachController(); try { + // remove our own properties from the component context. We cannot ensure that the component context + // is freed (there might be refcount problems :-\), so at least ensure the context itself + // does hold the objects anymore Reference<XNameContainer> xName(m_xInspectorContext,uno::UNO_QUERY); if ( xName.is() ) { const ::rtl::OUString pProps[] = { ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) ) - , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ) - , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlContext" ) )}; - for (size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i) - xName->removeByName(pProps[i]); + , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ) + , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlContext" ) ) + , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlShapeAccess" ) ) }; + for ( size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i ) + xName->removeByName( pProps[i] ); } } - catch(Exception&) - {} - + catch (const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } DBG_DTOR(FmPropBrw,NULL); } @@ -574,6 +574,12 @@ void FmPropBrw::impl_createPropertyBrowser_throw( FmFormShell* _pFormShell ) // the default parent window for message boxes Reference< XWindow > xParentWindow( VCLUnoHelper::GetInterface ( this ) ); + // the mapping from control models to control shapes + Reference< XMap > xControlMap; + FmFormPage* pFormPage = _pFormShell ? _pFormShell->GetCurPage() : NULL; + if ( pFormPage ) + xControlMap = pFormPage->GetImpl().getControlToShapeMap(); + // our own component context Reference< XPropertySet > xFactoryProperties( m_xORB, UNO_QUERY_THROW ); Reference< XComponentContext > xOwnContext( @@ -585,7 +591,8 @@ void FmPropBrw::impl_createPropertyBrowser_throw( FmFormShell* _pFormShell ) { ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) ), makeAny( xDocument ) ), ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ), makeAny( xParentWindow ) ), - ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlContext" ) ), makeAny( xControlContext ) ) + ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlContext" ) ), makeAny( xControlContext ) ), + ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlShapeAccess" ) ), makeAny( xControlMap ) ) }; m_xInspectorContext.set( ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index fd5299fe62d5..f2773b7350fa 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -148,13 +148,17 @@ void FmFormObj::impl_isolateControlModel_nothrow() //------------------------------------------------------------------ void FmFormObj::SetPage(SdrPage* _pNewPage) { - FmFormPage* pNewFormPage = PTR_CAST(FmFormPage, _pNewPage); if ( GetPage() == _pNewPage ) { SdrUnoObj::SetPage(_pNewPage); return; } + FmFormPage* pOldFormPage = PTR_CAST( FmFormPage, GetPage() ); + if ( pOldFormPage ) + pOldFormPage->GetImpl().formObjectRemoved( *this ); + + FmFormPage* pNewFormPage = PTR_CAST( FmFormPage, _pNewPage ); if ( !pNewFormPage ) { // Maybe it makes sense to create an environment history here : if somebody set's our page to NULL, and we have a valid page before, // me may want to remember our place within the old page. For this we could create a new m_xEnvironmentHistory to store it. @@ -202,7 +206,6 @@ void FmFormObj::SetPage(SdrPage* _pNewPage) { // are we a valid part of our current page forms ? Reference< XIndexContainer > xOldForms; - FmFormPage* pOldFormPage = dynamic_cast< FmFormPage* >( GetPage() ); if ( pOldFormPage ) xOldForms.set( pOldFormPage->GetForms(), UNO_QUERY_THROW ); @@ -296,6 +299,9 @@ void FmFormObj::SetPage(SdrPage* _pNewPage) m_xEnvironmentHistory = NULL; m_aEventsHistory.realloc(0); + + if ( pNewFormPage ) + pNewFormPage->GetImpl().formObjectInserted( *this ); } //------------------------------------------------------------------ @@ -584,6 +590,14 @@ const FmFormObj* FmFormObj::GetFormObject( const SdrObject* _pSdrObject ) } //------------------------------------------------------------------ +void FmFormObj::SetUnoControlModel( const Reference< com::sun::star::awt::XControlModel >& _rxModel ) +{ + SdrUnoObj::SetUnoControlModel( _rxModel ); + + // TODO: call something like formObjectInserted at the form page, to tell it the new model +} + +//------------------------------------------------------------------ FASTBOOL FmFormObj::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd ) { bool bResult = SdrUnoObj::EndCreate(rStat, eCmd); @@ -602,11 +616,11 @@ FASTBOOL FmFormObj::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd ) if ( !xParentForm.is() ) { // model is not yet part of a form component hierachy - xParentForm.set( rPage.GetImpl()->findPlaceInFormComponentHierarchy( xContent ), UNO_SET_THROW ); + xParentForm.set( rPage.GetImpl().findPlaceInFormComponentHierarchy( xContent ), UNO_SET_THROW ); xFormToInsertInto.set( xParentForm, UNO_QUERY_THROW ); } - rPage.GetImpl()->setUniqueName( xContent, xParentForm ); + rPage.GetImpl().setUniqueName( xContent, xParentForm ); if ( xFormToInsertInto.is() ) xFormToInsertInto->insertByIndex( xFormToInsertInto->getCount(), makeAny( xContent ) ); diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index fc87ebc37454..0ead41eb87bc 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -95,7 +95,7 @@ TYPEINIT1(FmFormPage, SdrPage); FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, FASTBOOL bMasterPage) :SdrPage(rModel, bMasterPage) #ifndef SVX_LIGHT - ,m_pImpl(new FmFormPageImpl(this)) + ,m_pImpl( new FmFormPageImpl( *this ) ) #else ,m_pImpl(NULL) #endif @@ -108,7 +108,7 @@ FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, FASTBOOL bMaster FmFormPage::FmFormPage(const FmFormPage& rPage) :SdrPage(rPage) #ifndef SVX_LIGHT - ,m_pImpl(new FmFormPageImpl(this, *rPage.GetImpl())) + ,m_pImpl(new FmFormPageImpl( *this, rPage.GetImpl() ) ) #else ,m_pImpl(NULL) #endif diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 41243a41bda2..a2add33b849b 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -30,6 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" + #include "svxerr.hxx" #include "fmpgeimp.hxx" #include "fmundo.hxx" @@ -44,6 +45,8 @@ #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/container/EnumerableMap.hpp> +#include <com/sun/star/drawing/XControlShape.hpp> #include <sfx2/objsh.hxx> #include <svx/fmglob.hxx> @@ -55,6 +58,7 @@ #include <vcl/stdtext.hxx> #include <svx/dialmgr.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/uno3.hxx> #include <comphelper/types.hxx> #include <unotools/streamwrap.hxx> @@ -69,12 +73,15 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::form; using ::com::sun::star::util::XCloneable; using ::com::sun::star::awt::XControlModel; +using ::com::sun::star::container::XMap; +using ::com::sun::star::container::EnumerableMap; +using ::com::sun::star::drawing::XControlShape; using namespace ::svxform; DBG_NAME(FmFormPageImpl) //------------------------------------------------------------------------------ -FmFormPageImpl::FmFormPageImpl(FmFormPage* _pPage) - :pPage(_pPage) +FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage ) + :m_rPage( _rPage ) ,m_bFirstActivation( sal_True ) ,m_bAttemptedFormCreation( false ) ,m_bInFind( false ) @@ -162,13 +169,11 @@ namespace } //------------------------------------------------------------------------------ -FmFormPageImpl::FmFormPageImpl(FmFormPage* _pPage, const FmFormPageImpl& rImpl) - :pPage(_pPage) +FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl ) + :m_rPage( _rPage ) ,m_bFirstActivation( sal_True ) ,m_bAttemptedFormCreation( false ) - ,m_bInFind( false ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::FmFormPageImpl" ); DBG_CTOR(FmFormPageImpl,NULL); // clone the Forms collection @@ -193,8 +198,8 @@ FmFormPageImpl::FmFormPageImpl(FmFormPage* _pPage, const FmFormPageImpl& rImpl) aVisitor.process( FormComponentPair( xCloneable, m_xForms ), aAssignmentProcessor ); // assign the cloned models to their SdrObjects - SdrObjListIter aForeignIter( *rImpl.pPage ); - SdrObjListIter aOwnIter( *pPage ); + SdrObjListIter aForeignIter( rImpl.m_rPage ); + SdrObjListIter aOwnIter( m_rPage ); OSL_ENSURE( aForeignIter.IsMore() == aOwnIter.IsMore(), "FmFormPageImpl::FmFormPageImpl: inconsistent number of objects (1)!" ); while ( aForeignIter.IsMore() && aOwnIter.IsMore() ) @@ -242,6 +247,85 @@ FmFormPageImpl::FmFormPageImpl(FmFormPage* _pPage, const FmFormPageImpl& rImpl) } //------------------------------------------------------------------------------ +Reference< XMap > FmFormPageImpl::getControlToShapeMap() +{ + Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); + if ( xControlShapeMap.is() ) + return xControlShapeMap; + + xControlShapeMap = impl_createControlShapeMap_nothrow(); + m_aControlShapeMap = xControlShapeMap; + return xControlShapeMap; +} + +//------------------------------------------------------------------------------ +namespace +{ + static void lcl_insertFormObject_throw( const FmFormObj& _object, const Reference< XMap >& _map ) + { + // the control model + Reference< XControlModel > xControlModel( _object.GetUnoControlModel(), UNO_QUERY ); + OSL_ENSURE( xControlModel.is(), "lcl_insertFormObject_throw: suspicious: no control model!" ); + if ( !xControlModel.is() ) + return; + + Reference< XControlShape > xControlShape( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ); + OSL_ENSURE( xControlShape.is(), "lcl_insertFormObject_throw: suspicious: no control shape!" ); + if ( !xControlShape.is() ) + return; + + _map->put( makeAny( xControlModel ), makeAny( xControlShape ) ); + } + + static void lcl_removeFormObject( const FmFormObj& _object, const Reference< XMap >& _map ) + { + // the control model + Reference< XControlModel > xControlModel( _object.GetUnoControlModel(), UNO_QUERY ); + OSL_ENSURE( xControlModel.is(), "lcl_removeFormObject: suspicious: no control model!" ); + if ( !xControlModel.is() ) + return; + + #if OSL_DEBUG_LEVEL > 0 + Any aOldAssignment = + #endif + _map->remove( makeAny( xControlModel ) ); + OSL_ENSURE( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ), + "lcl_removeFormObject: map was inconsistent!" ); + } +} + +//------------------------------------------------------------------------------ +Reference< XMap > FmFormPageImpl::impl_createControlShapeMap_nothrow() +{ + Reference< XMap > xMap; + + try + { + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + xMap.set( EnumerableMap::create( aContext.getUNOContext(), + ::cppu::UnoType< XControlModel >::get(), + ::cppu::UnoType< XControlShape >::get() + ).get(), UNO_SET_THROW ); + + SdrObjListIter aPageIter( m_rPage ); + while ( aPageIter.IsMore() ) + { + // only FmFormObjs are what we're interested in + FmFormObj* pCurrent = FmFormObj::GetFormObject( aPageIter.Next() ); + if ( !pCurrent ) + continue; + + lcl_insertFormObject_throw( *pCurrent, xMap ); + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return xMap; +} + +//------------------------------------------------------------------------------ const Reference< XNameContainer >& FmFormPageImpl::getForms( bool _bForceCreate ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::getForms" ); @@ -264,7 +348,7 @@ const Reference< XNameContainer >& FmFormPageImpl::getForms( bool _bForceCreate m_aFormsCreationHdl.Call( this ); } - FmFormModel* pFormsModel = pPage ? PTR_CAST( FmFormModel, pPage->GetModel() ) : NULL; + FmFormModel* pFormsModel = PTR_CAST( FmFormModel, m_rPage.GetModel() ); // give the newly created collection a place in the universe Reference< XChild > xAsChild( m_xForms, UNO_QUERY ); @@ -354,7 +438,7 @@ Reference< XForm > FmFormPageImpl::getDefaultForm() // did not find an existing suitable form -> create a new one if ( !xForm.is() ) { - SdrModel* pModel = pPage->GetModel(); + SdrModel* pModel = m_rPage.GetModel(); if( pModel->IsUndoEnabled() ) { @@ -436,7 +520,7 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo // wenn keine ::com::sun::star::form gefunden, dann eine neue erzeugen if (!xForm.is()) { - SdrModel* pModel = pPage->GetModel(); + SdrModel* pModel = m_rPage.GetModel(); const bool bUndo = pModel->IsUndoEnabled(); @@ -698,3 +782,38 @@ UniString FmFormPageImpl::getDefaultName( sal_Int16 _nClassId, const Reference< return sName; } + +//------------------------------------------------------------------ +void FmFormPageImpl::formObjectInserted( const FmFormObj& _object ) +{ + Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); + if ( !xControlShapeMap.is() ) + // our map does not exist -> not interested in this event + return; + + try + { + lcl_insertFormObject_throw( _object, xControlShapeMap ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +void FmFormPageImpl::formObjectRemoved( const FmFormObj& _object ) +{ + Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); + if ( !xControlShapeMap.is() ) + // our map does not exist -> not interested in this event + return; + + try + { + lcl_removeFormObject( _object, xControlShapeMap ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index b9b381f767cb..87149994839b 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -265,6 +265,7 @@ sal_Int16 nObjectTypes[] = OBJ_FM_NAVIGATIONBAR }; +using namespace ::com::sun::star; using namespace ::com::sun::star::ui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdb; @@ -2065,7 +2066,7 @@ void FmXFormShell::impl_updateCurrentForm( const Reference< XForm >& _rxNewCurFo // propagate to the FormPage(Impl) FmFormPage* pPage = m_pShell->GetCurPage(); if ( pPage ) - pPage->GetImpl()->setCurForm( m_xCurrentForm ); + pPage->GetImpl().setCurForm( m_xCurrentForm ); // ensure the UI which depends on the current form is up-to-date for ( size_t i = 0; i < sizeof( DlgSlotMap ) / sizeof( DlgSlotMap[0] ); ++i ) @@ -3968,10 +3969,10 @@ void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeacti } // remove callbacks at the page - if ( pPage && pPage->GetImpl() ) + if ( pPage ) { OSL_TRACE( "--- FmXFormShell::resetHandler : %p, ........, %p\n", this, pPage ); - pPage->GetImpl()->SetFormsCreationHdl( Link() ); + pPage->GetImpl().SetFormsCreationHdl( Link() ); } UpdateForms( sal_True ); } @@ -4020,9 +4021,9 @@ void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncActi // load forms for the page the current view belongs to if ( pPage ) { - if ( !pPage->GetImpl()->hasEverBeenActivated() ) + if ( !pPage->GetImpl().hasEverBeenActivated() ) loadForms( pPage, FORMS_LOAD | ( _bSyncAction ? FORMS_SYNC : FORMS_ASYNC ) ); - pPage->GetImpl()->setHasBeenActivated( ); + pPage->GetImpl().setHasBeenActivated( ); } // first-time initializations for the views @@ -4037,10 +4038,10 @@ void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncActi } // set callbacks at the page - if ( pPage && pPage->GetImpl() ) + if ( pPage ) { OSL_TRACE( "--- FmXFormShell::setHandler : %p, ........, %p\n", this, pPage ); - pPage->GetImpl()->SetFormsCreationHdl( LINK( this, FmXFormShell, OnFormsCreated ) ); + pPage->GetImpl().SetFormsCreationHdl( LINK( this, FmXFormShell, OnFormsCreated ) ); } UpdateForms( sal_True ); diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index cb8a46cd88a9..f7e59ce41888 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -115,7 +115,6 @@ namespace svx SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_STRIKEOUT, SID_ATTR_CHAR_UNDERLINE, - SID_ATTR_CHAR_OVERLINE, SID_ATTR_CHAR_FONTHEIGHT, SID_ATTR_CHAR_COLOR, SID_ATTR_CHAR_KERNING, @@ -133,6 +132,7 @@ namespace svx SID_ATTR_LRSPACE, /* 48 */ SID_ATTR_ULSPACE, /* 49 */ SID_ATTR_CHAR_AUTOKERN, + SID_ATTR_CHAR_OVERLINE, SID_SET_SUPER_SCRIPT, SID_SET_SUB_SCRIPT, SID_CHAR_DLG, diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index fa339294273d..6f4dff9d7fb3 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -336,12 +336,12 @@ void FmXUndoEnvironment::Inserted(FmFormObj* pObj) } else { - xForm.set( rPage.GetImpl()->findPlaceInFormComponentHierarchy( xContent ), UNO_SET_THROW ); + xForm.set( rPage.GetImpl().findPlaceInFormComponentHierarchy( xContent ), UNO_SET_THROW ); xNewParent.set( xForm, UNO_QUERY_THROW ); nPos = xNewParent->getCount(); } - rPage.GetImpl()->setUniqueName( xContent, xForm ); + rPage.GetImpl().setUniqueName( xContent, xForm ); xNewParent->insertByIndex( nPos, makeAny( xContent ) ); Reference< XEventAttacherManager > xManager( xNewParent, UNO_QUERY_THROW ); diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index db4c7d678dd9..46750d524a4d 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -213,7 +213,7 @@ void FmXPageViewWinRec::dispose() Reference< XChild > xControllerModel( xController->getModel(), UNO_QUERY ); if ( xControllerModel.is() ) { - Reference< XEventAttacherManager > xEventManager( xControllerModel->getParent(), UNO_QUERY ); + Reference< XEventAttacherManager > xEventManager( xControllerModel->getParent(), UNO_QUERY_THROW ); Reference< XInterface > xControllerNormalized( xController, UNO_QUERY_THROW ); xEventManager->detach( i - m_aControllerList.begin(), xControllerNormalized ); } @@ -817,14 +817,20 @@ static Reference< XControl > lcl_firstFocussableControl( const Sequence< Referen { try { + if ( !pControls->is() ) + continue; + + Reference< XPropertySet > xModelProps( (*pControls)->getModel(), UNO_QUERY_THROW ); + + // only enabled controls are allowed to participate + sal_Bool bEnabled = sal_False; + OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled ); + if ( !bEnabled ) + continue; + // check the class id of the control model sal_Int16 nClassId = FormComponentType::CONTROL; - - Reference< XPropertySet > xModelProps; - if ( pControls->is() ) - xModelProps = xModelProps.query( (*pControls)->getModel() ); - if ( xModelProps.is() ) - xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId; + OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId ); // controls which are not focussable if ( ( FormComponentType::CONTROL != nClassId ) @@ -1115,10 +1121,10 @@ namespace Reference< XFormComponent > xFormComponent( _rSdrObj.GetUnoControlModel(), UNO_QUERY_THROW ); Reference< XForm > xTargetForm( - rPage.GetImpl()->findPlaceInFormComponentHierarchy( xFormComponent, _rxDataSource, _rDataSourceName, _rCommand, _nCommandType ), + rPage.GetImpl().findPlaceInFormComponentHierarchy( xFormComponent, _rxDataSource, _rDataSourceName, _rCommand, _nCommandType ), UNO_SET_THROW ); - rPage.GetImpl()->setUniqueName( xFormComponent, xTargetForm ); + rPage.GetImpl().setUniqueName( xFormComponent, xTargetForm ); Reference< XIndexContainer > xFormAsContainer( xTargetForm, UNO_QUERY_THROW ); xFormAsContainer->insertByIndex( xFormAsContainer->getCount(), makeAny( xFormComponent ) ); diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx index 8c9065fe1a46..570fb4df15c3 100644 --- a/svx/source/form/formcontrolfactory.cxx +++ b/svx/source/form/formcontrolfactory.cxx @@ -519,6 +519,7 @@ namespace svxform { sal_Bool bDropDown = !_rControlBoundRect.IsEmpty() && ( _rControlBoundRect.GetWidth() >= 3 * _rControlBoundRect.GetHeight() ); _rxControlModel->setPropertyValue( FM_PROP_DROPDOWN, makeAny( (sal_Bool)bDropDown ) ); + _rxControlModel->setPropertyValue( FM_PROP_LINECOUNT, makeAny( sal_Int16( 20 ) ) ); } break; diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index e2b3992c81a5..b57863ffd5ae 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1538,7 +1538,7 @@ namespace svxform SdrPageView* pPageView = pFormView->GetSdrPageView(); FmFormPage* pPage = (FmFormPage*)pPageView->GetPage(); - ::rtl::OUString sName = pPage->GetImpl()->setUniqueName( xNewComponent, xParentForm ); + ::rtl::OUString sName = pPage->GetImpl().setUniqueName( xNewComponent, xParentForm ); pNewFormControlData->SetText( sName ); diff --git a/svx/source/inc/GraphCtlAccessibleContext.hxx b/svx/source/inc/GraphCtlAccessibleContext.hxx index 906833e81251..0b862e1be691 100644 --- a/svx/source/inc/GraphCtlAccessibleContext.hxx +++ b/svx/source/inc/GraphCtlAccessibleContext.hxx @@ -57,7 +57,7 @@ #include <set> #include <map> -#include <unotools/servicehelper.hxx> +#include <comphelper/servicehelper.hxx> #include <svx/rectenum.hxx> #include <svx/AccessibleShapeTreeInfo.hxx> #include <svx/IAccessibleViewForwarder.hxx> diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx index 236a9d2a67ca..e37b6a32e74e 100644 --- a/svx/source/inc/fmobj.hxx +++ b/svx/source/inc/fmobj.hxx @@ -109,6 +109,8 @@ public: */ sal_Int32 getType() const; + virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& _rxModel ); + protected: virtual FASTBOOL EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd ); virtual void BrkCreate( SdrDragStat& rStat ); diff --git a/svx/source/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx index ac2c573565dc..90a7a4027b46 100644 --- a/svx/source/inc/fmpgeimp.hxx +++ b/svx/source/inc/fmpgeimp.hxx @@ -37,10 +37,12 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XMap.hpp> #include <tools/list.hxx> #include <tools/link.hxx> #include <comphelper/uno3.hxx> +#include <cppuhelper/weakref.hxx> #include "svx/svxdllapi.h" #include <map> @@ -57,8 +59,6 @@ FORWARD_DECLARE_INTERFACE(container,XIndexContainer) class SdrObjList; -DECLARE_LIST(FmObjectList, FmFormObj*) - //================================================================== // FmFormPageImpl // lauscht an allen Containern, um festzustellen, wann Objecte @@ -68,9 +68,11 @@ DECLARE_LIST(FmObjectList, FmFormObj*) class SVX_DLLPRIVATE FmFormPageImpl { ::std::map< ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >,SdrObject* > m_aComponentMap; - ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm> xCurrentForm; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer> m_xForms; - FmFormPage* pPage; + ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > xCurrentForm; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xForms; + ::com::sun::star::uno::WeakReference< ::com::sun::star::container::XMap > m_aControlShapeMap; + + FmFormPage& m_rPage; Link m_aFormsCreationHdl; sal_Bool m_bFirstActivation; @@ -81,8 +83,8 @@ protected: void Init(); public: - FmFormPageImpl(FmFormPage* _pPage); - FmFormPageImpl(FmFormPage* _pPage, const FmFormPageImpl& rImpl); + FmFormPageImpl( FmFormPage& _rPage ); + FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl ); ~FmFormPageImpl(); // nur wichtig fuer den DesignMode @@ -137,6 +139,24 @@ protected: const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject ) const; +public: + + static UniString getDefaultName( + sal_Int16 nClassId, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject + ); + + ::rtl::OUString setUniqueName(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent>& xFormComponent, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm>& xControls); + ::rtl::OUString getUniqueName(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& xNamedSet) const; + + void formObjectInserted( const FmFormObj& _object ); + void formObjectRemoved( const FmFormObj& _object ); + + /** returns an object mapping from control models to drawing shapes. + */ + ::com::sun::star::uno::Reference< ::com::sun::star::container::XMap > + getControlToShapeMap(); + private: /** validates whether <member>xCurrentForm</member> is still valid and to be used @@ -153,16 +173,8 @@ private: */ bool validateCurForm(); -public: - - static UniString getDefaultName( - sal_Int16 nClassId, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject - ); - - ::rtl::OUString setUniqueName(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent>& xFormComponent, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm>& xControls); - ::rtl::OUString getUniqueName(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& xNamedSet) const; - + ::com::sun::star::uno::Reference< ::com::sun::star::container::XMap > + impl_createControlShapeMap_nothrow(); private: FmFormPageImpl(); // never implemented diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 9cc316ae575c..d3e8e8ce0327 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -181,6 +181,7 @@ typedef ::utl::ConfigItem FmXFormShell_CFGBASE; struct SdrViewEvent; class FmFormShell; +class FmFormView; class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE ,public FmXFormShell_CFGBASE ,public ::svxform::OStaticDataAccessTools diff --git a/svx/source/inc/svxrectctaccessiblecontext.hxx b/svx/source/inc/svxrectctaccessiblecontext.hxx index c1a4c5a6ecbc..9479ed15cfc4 100644 --- a/svx/source/inc/svxrectctaccessiblecontext.hxx +++ b/svx/source/inc/svxrectctaccessiblecontext.hxx @@ -55,7 +55,7 @@ //#endif #include <comphelper/broadcasthelper.hxx> #include <cppuhelper/implbase6.hxx> -#include <unotools/servicehelper.hxx> +#include <comphelper/servicehelper.hxx> #include <svx/rectenum.hxx> namespace com { namespace sun { namespace star { namespace awt { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 6ec9c607188b..c1abb3add6b9 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -126,6 +126,7 @@ #include <drawinglayer/processor2d/linegeometryextractor2d.hxx> #include <svx/polysc3d.hxx> #include "svx/svdotable.hxx" +#include "svx/shapepropertynotifier.hxx" using namespace ::com::sun::star; @@ -430,17 +431,18 @@ DBG_NAME(SdrObject); TYPEINIT1(SdrObject,SfxListener); SdrObject::SdrObject() -: mpProperties(0L), - mpViewContact(0L), - pObjList(NULL), - pPage(NULL), - pModel(NULL), - pUserCall(NULL), - pPlusData(NULL), - nOrdNum(0), - mnNavigationPosition(SAL_MAX_UINT32), - mnLayerID(0), - mpSvxShape(0) + :mpProperties(0L) + ,mpViewContact(0L) + ,pObjList(NULL) + ,pPage(NULL) + ,pModel(NULL) + ,pUserCall(NULL) + ,pPlusData(NULL) + ,nOrdNum(0) + ,mnNavigationPosition(SAL_MAX_UINT32) + ,mnLayerID(0) + ,mpSvxShape( NULL ) + ,maWeakUnoShape() { DBG_CTOR(SdrObject,NULL); bVirtObj =FALSE; @@ -488,13 +490,12 @@ SdrObject::~SdrObject() try { - uno::Reference< uno::XInterface > xShape; - SvxShape* pSvxShape = getSvxShape( xShape ); + SvxShape* pSvxShape = getSvxShape(); if ( pSvxShape ) { OSL_ENSURE(!pSvxShape->HasSdrObjectOwnership(),"Please check where this call come from and replace it with SdrObject::Free"); pSvxShape->InvalidateSdrObject(); - uno::Reference< lang::XComponent > xShapeComp( xShape, uno::UNO_QUERY_THROW ); + uno::Reference< lang::XComponent > xShapeComp( getWeakUnoShape(), uno::UNO_QUERY_THROW ); xShapeComp->dispose(); } } @@ -528,8 +529,7 @@ void SdrObject::Free( SdrObject*& _rpObject ) // nothing to do return; - uno::Reference< uno::XInterface > xShape; - SvxShape* pShape = pObject->getSvxShape( xShape ); + SvxShape* pShape = pObject->getSvxShape(); if ( pShape && pShape->HasSdrObjectOwnership() ) // only the shape is allowed to delete me, and will reset the ownership before doing so return; @@ -566,8 +566,7 @@ void SdrObject::SetModel(SdrModel* pNewModel) // update listeners at possible api wrapper object if( pModel != pNewModel ) { - uno::Reference< uno::XInterface > xShapeGuard; - SvxShape* pShape = getSvxShape( xShapeGuard ); + SvxShape* pShape = getSvxShape(); if( pShape ) pShape->ChangeModel( pNewModel ); } @@ -2770,15 +2769,18 @@ void SdrObject::SendUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundR pGroup = NULL; } - if( eUserCall == SDRUSERCALL_CHGATTR ) + // notify our UNO shape listeners + switch ( eUserCall ) { - if( pModel && pModel->IsAllowShapePropertyChangeListener() ) - { - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xShapeGuard; - SvxShape* pShape = const_cast< SdrObject* >(this)->getSvxShape( xShapeGuard ); - if( pShape ) - pShape->onUserCall( eUserCall, rBoundRect ); - } + case SDRUSERCALL_RESIZE: + notifyShapePropertyChange( ::svx::eShapeSize ); + // fall through - RESIZE might also imply a change of the position + case SDRUSERCALL_MOVEONLY: + notifyShapePropertyChange( ::svx::eShapePosition ); + break; + default: + // not interested in + break; } } @@ -2844,30 +2846,26 @@ sal_Bool SdrObject::IsTransparent( BOOL /*bCheckForAlphaChannel*/) const return bRet; } -void SdrObject::setUnoShape( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape, - SdrObject::GrantXShapeAccess /*aGrant*/ -) +void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUnoShape ) { - mxUnoShape = _rxUnoShape; - mpSvxShape = 0; + maWeakUnoShape = _rxUnoShape; + mpSvxShape = SvxShape::getImplementation( _rxUnoShape ); + OSL_ENSURE( mpSvxShape || !_rxUnoShape.is(), + "SdrObject::setUnoShape: not sure it's a good idea to have an XShape which is not implemented by SvxShape ..." ); } /** only for internal use! */ -SvxShape* SdrObject::getSvxShape( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xShapeGuard ) +SvxShape* SdrObject::getSvxShape() const { - xShapeGuard = xShapeGuard.query( mxUnoShape ); - if( xShapeGuard.is() ) - { - if( !mpSvxShape ) - { - mpSvxShape = SvxShape::getImplementation( xShapeGuard ); - } - } - else if( mpSvxShape ) - { - mpSvxShape = NULL; - } + DBG_TESTSOLARMUTEX(); + // retrieving the impl pointer and subsequently using it is not thread-safe, of course, so it needs to be + // guarded by the SolarMutex + +#if OSL_DEBUG_LEVE > 0 + uno::Reference< uno::XInterface > xShape( maWeakUnoShape ); + OSL_ENSURE( !( !xShapeGuard.is() && mpSvxShape ), + "SdrObject::getSvxShape: still having IMPL-Pointer to dead object!" ); +#endif return mpSvxShape; } @@ -2875,12 +2873,12 @@ SvxShape* SdrObject::getSvxShape( ::com::sun::star::uno::Reference< ::com::sun:: ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SdrObject::getUnoShape() { // try weak reference first - uno::Reference< uno::XInterface > xShape( mxUnoShape ); + uno::Reference< uno::XInterface > xShape( getWeakUnoShape() ); if( !xShape.is() ) { + OSL_ENSURE( mpSvxShape == NULL, "SdrObject::getUnoShape: XShape already dead, but still an IMPL pointer!" ); if ( pPage ) { - mpSvxShape = 0; uno::Reference< uno::XInterface > xPage( pPage->getUnoPage() ); if( xPage.is() ) { @@ -2888,20 +2886,39 @@ SvxShape* SdrObject::getSvxShape( ::com::sun::star::uno::Reference< ::com::sun:: if( pDrawPage ) { // create one - mxUnoShape = xShape = pDrawPage->_CreateShape( this ); + xShape = pDrawPage->_CreateShape( this ); + impl_setUnoShape( xShape ); } } } else { mpSvxShape = SvxDrawPage::CreateShapeByTypeAndInventor( GetObjIdentifier(), GetObjInventor(), this, NULL ); - mxUnoShape = xShape = static_cast< ::cppu::OWeakObject* >( mpSvxShape ); + maWeakUnoShape = xShape = static_cast< ::cppu::OWeakObject* >( mpSvxShape ); } } return xShape; } +::svx::PropertyChangeNotifier& SdrObject::getShapePropertyChangeNotifier() +{ + DBG_TESTSOLARMUTEX(); + + SvxShape* pSvxShape = getSvxShape(); + ENSURE_OR_THROW( pSvxShape, "no SvxShape, yet!" ); + return pSvxShape->getShapePropertyChangeNotifier(); +} + +void SdrObject::notifyShapePropertyChange( const ::svx::ShapeProperty _eProperty ) const +{ + DBG_TESTSOLARMUTEX(); + + SvxShape* pSvxShape = const_cast< SdrObject* >( this )->getSvxShape(); + if ( pSvxShape ) + return pSvxShape->getShapePropertyChangeNotifier().notifyPropertyChange( _eProperty ); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// // // transformation interface for StarOfficeAPI. This implements support for diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index d6020908bef0..abf9574f9172 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -579,7 +579,7 @@ void SdrUnoObj::CreateUnoControlModel(const String& rModelName, SetUnoControlModel(xModel); } -void SdrUnoObj::SetUnoControlModel( uno::Reference< awt::XControlModel > xModel) +void SdrUnoObj::SetUnoControlModel( const uno::Reference< awt::XControlModel >& xModel) { if (xUnoControlModel.is()) { diff --git a/svx/source/unodraw/makefile.mk b/svx/source/unodraw/makefile.mk index 3eee2c74f8d5..9b71d644f39d 100644 --- a/svx/source/unodraw/makefile.mk +++ b/svx/source/unodraw/makefile.mk @@ -70,7 +70,8 @@ SLOFILES = \ $(SLO)$/unodtabl.obj \ $(SLO)$/gluepts.obj \ $(SLO)$/recoveryui.obj \ - $(SLO)$/tableshape.obj + $(SLO)$/tableshape.obj \ + $(SLO)$/shapepropertynotifier.obj SRS1NAME=unodraw SRC1FILES = \ diff --git a/svx/source/unodraw/shapeimpl.hxx b/svx/source/unodraw/shapeimpl.hxx index b62167665fe3..131bb087f118 100644 --- a/svx/source/unodraw/shapeimpl.hxx +++ b/svx/source/unodraw/shapeimpl.hxx @@ -63,7 +63,7 @@ public: virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) 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); virtual void SAL_CALL setPropertyValues( 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::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ) throw (); + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ); }; /*********************************************************************** @@ -84,7 +84,7 @@ public: virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) 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); virtual void SAL_CALL setPropertyValues( 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::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ) throw (); + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL ); }; /*********************************************************************** diff --git a/svx/source/unodraw/shapepropertynotifier.cxx b/svx/source/unodraw/shapepropertynotifier.cxx new file mode 100644 index 000000000000..5e6cb2345765 --- /dev/null +++ b/svx/source/unodraw/shapepropertynotifier.cxx @@ -0,0 +1,206 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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. +************************************************************************/ +
+// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svx.hxx" + +#include "svx/shapepropertynotifier.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/beans/XPropertySet.hpp> +/** === end UNO includes === **/ + +#include <comphelper/stl_types.hxx> +#include <cppuhelper/interfacecontainer.hxx> +#include <cppuhelper/weak.hxx> +#include <tools/diagnose_ex.h> + +#include <hash_map> + +namespace +{ + + struct ShapePropertyHash + { + size_t operator()( ::svx::ShapeProperty __x ) const + { + return size_t( __x ); + } + }; +} + +//........................................................................ +namespace svx +{ +//........................................................................ + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::beans::PropertyChangeEvent; + using ::com::sun::star::beans::XPropertyChangeListener; + using ::com::sun::star::lang::EventObject; + using ::com::sun::star::beans::XPropertySet; + /** === end UNO using === **/ + + typedef ::std::hash_map< ShapeProperty, PPropertyValueProvider, ShapePropertyHash > PropertyProviders; + + typedef ::cppu::OMultiTypeInterfaceContainerHelperVar < ::rtl::OUString + , ::comphelper::UStringHash + , ::comphelper::UStringEqual + > PropertyChangeListenerContainer; + + //==================================================================== + //= IPropertyValueProvider + //==================================================================== + IPropertyValueProvider::~IPropertyValueProvider() + { + } + + //==================================================================== + //= PropertyChangeNotifier_Data + //==================================================================== + struct PropertyChangeNotifier_Data + { + ::cppu::OWeakObject& m_rContext; + PropertyProviders m_aProviders; + PropertyChangeListenerContainer m_aPropertyChangeListeners; + + PropertyChangeNotifier_Data( ::cppu::OWeakObject& _rContext, ::osl::Mutex& _rMutex ) + :m_rContext( _rContext ) + ,m_aPropertyChangeListeners( _rMutex ) + { + } + }; + //==================================================================== + //= PropertyValueProvider + //==================================================================== + //-------------------------------------------------------------------- + ::rtl::OUString PropertyValueProvider::getPropertyName() const + { + return m_sPropertyName; + } + + //-------------------------------------------------------------------- + void PropertyValueProvider::getCurrentValue( Any& _out_rValue ) const + { + Reference< XPropertySet > xContextProps( const_cast< PropertyValueProvider* >( this )->m_rContext, UNO_QUERY_THROW ); + _out_rValue = xContextProps->getPropertyValue( getPropertyName() ); + } + + //==================================================================== + //= PropertyChangeNotifier + //==================================================================== + //-------------------------------------------------------------------- + PropertyChangeNotifier::PropertyChangeNotifier( ::cppu::OWeakObject& _rOwner, ::osl::Mutex& _rMutex ) + :m_pData( new PropertyChangeNotifier_Data( _rOwner, _rMutex ) ) + { + } + + //-------------------------------------------------------------------- + PropertyChangeNotifier::~PropertyChangeNotifier() + { + } + + //-------------------------------------------------------------------- + void PropertyChangeNotifier::registerProvider( const ShapeProperty _eProperty, const PPropertyValueProvider _pProvider ) + { + ENSURE_OR_THROW( _eProperty != eInvalidShapeProperty, "Illegal ShapeProperty value!" ); + ENSURE_OR_THROW( !!_pProvider, "NULL factory not allowed." ); + + OSL_ENSURE( m_pData->m_aProviders.find( _eProperty ) == m_pData->m_aProviders.end(), + "PropertyChangeNotifier::registerProvider: factory for this ID already present!" ); + + m_pData->m_aProviders[ _eProperty ] = _pProvider; + } + + //-------------------------------------------------------------------- + void PropertyChangeNotifier::notifyPropertyChange( const ShapeProperty _eProperty ) const + { + ENSURE_OR_THROW( _eProperty != eInvalidShapeProperty, "Illegal ShapeProperty value!" ); + + PropertyProviders::const_iterator provPos = m_pData->m_aProviders.find( _eProperty ); + OSL_ENSURE( provPos != m_pData->m_aProviders.end(), "PropertyChangeNotifier::notifyPropertyChange: no factory!" ); + if ( provPos == m_pData->m_aProviders.end() ) + return; + + ::rtl::OUString sPropertyName( provPos->second->getPropertyName() ); + + ::cppu::OInterfaceContainerHelper* pPropListeners = m_pData->m_aPropertyChangeListeners.getContainer( sPropertyName ); + ::cppu::OInterfaceContainerHelper* pAllListeners = m_pData->m_aPropertyChangeListeners.getContainer( ::rtl::OUString() ); + if ( !pPropListeners && !pAllListeners ) + return; + + try + { + PropertyChangeEvent aEvent; + aEvent.Source = m_pData->m_rContext; + // Handle/OldValue not supported + aEvent.PropertyName = provPos->second->getPropertyName(); + provPos->second->getCurrentValue( aEvent.NewValue ); + + if ( pPropListeners ) + pPropListeners->notifyEach( &XPropertyChangeListener::propertyChange, aEvent ); + if ( pAllListeners ) + pAllListeners->notifyEach( &XPropertyChangeListener::propertyChange, aEvent ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + //-------------------------------------------------------------------- + void PropertyChangeNotifier::addPropertyChangeListener( const ::rtl::OUString& _rPropertyName, const Reference< XPropertyChangeListener >& _rxListener ) + { + m_pData->m_aPropertyChangeListeners.addInterface( _rPropertyName, _rxListener ); + } + + //-------------------------------------------------------------------- + void PropertyChangeNotifier::removePropertyChangeListener( const ::rtl::OUString& _rPropertyName, const Reference< XPropertyChangeListener >& _rxListener ) + { + m_pData->m_aPropertyChangeListeners.removeInterface( _rPropertyName, _rxListener ); + } + + //-------------------------------------------------------------------- + void PropertyChangeNotifier::disposing() + { + EventObject aEvent; + aEvent.Source = m_pData->m_rContext; + m_pData->m_aPropertyChangeListeners.disposeAndClear( aEvent ); + } + +//........................................................................ +} // namespace svx +//........................................................................ diff --git a/svx/source/unodraw/unonrule.cxx b/svx/source/unodraw/unonrule.cxx index da20980e34db..7947cde7e790 100644 --- a/svx/source/unodraw/unonrule.cxx +++ b/svx/source/unodraw/unonrule.cxx @@ -50,7 +50,7 @@ #include <vos/mutex.hxx> #include <vcl/graph.hxx> -#include <unotools/servicehelper.hxx> +#include <comphelper/servicehelper.hxx> #include <toolkit/unohlp.hxx> #include <rtl/uuid.h> #include <rtl/memory.h> diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index d919a7864697..9b68e94239c5 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -111,7 +111,7 @@ SvxShapeGroup::~SvxShapeGroup() throw() } //---------------------------------------------------------------------- -void SvxShapeGroup::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw() +void SvxShapeGroup::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) { SvxShape::Create( pNewObj, pNewPage ); mxPage = pNewPage; @@ -1895,7 +1895,7 @@ SvxCustomShape::~SvxCustomShape() throw() //---------------------------------------------------------------------- -void SvxCustomShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw() +void SvxCustomShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) { SvxShapeText::Create( pNewObj, pNewPage ); } diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx index 1441e2759465..dc24ad21ddca 100644 --- a/svx/source/unodraw/unoshap3.cxx +++ b/svx/source/unodraw/unoshap3.cxx @@ -92,7 +92,7 @@ Svx3DSceneObject::~Svx3DSceneObject() throw() } //---------------------------------------------------------------------- -void Svx3DSceneObject::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw() +void Svx3DSceneObject::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) { SvxShape::Create( pNewObj, pNewPage ); mxPage = pNewPage; diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 6aa9ca7d6363..674cb8fdb24d 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -639,7 +639,7 @@ SvxAppletShape::~SvxAppletShape() throw() { } -void SvxAppletShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw () +void SvxAppletShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) { SvxShape::Create( pNewObj, pNewPage ); const SvGlobalName aAppletClassId( SO3_APPLET_CLASSID ); @@ -712,7 +712,7 @@ SvxPluginShape::~SvxPluginShape() throw() { } -void SvxPluginShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw () +void SvxPluginShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) { SvxShape::Create( pNewObj, pNewPage ); const SvGlobalName aPluginClassId( SO3_PLUGIN_CLASSID ); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 88093d39ea95..3f7f58a1e9ad 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -37,7 +37,6 @@ #include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/drawing/CircleKind.hpp> #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> -#include <cppuhelper/interfacecontainer.hxx> #include <vcl/svapp.hxx> #include <svtools/itemprop.hxx> #include <svtools/fltcall.hxx> @@ -47,6 +46,7 @@ #include <svx/svdoole2.hxx> #include <osl/mutex.hxx> #include <comphelper/extract.hxx> +#include "svx/shapepropertynotifier.hxx" #include <toolkit/unohlp.hxx> @@ -84,6 +84,7 @@ #include "svx/dialogs.hrc" // #include "svx/svdocapt.hxx" #include <svx/obj3d.hxx> +#include <tools/diagnose_ex.h> #include "svx/xflftrit.hxx" #include "svx/xtable.hxx" #include "svx/xbtmpit.hxx" @@ -116,6 +117,8 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; +using ::svx::PropertyValueProvider; +using ::svx::IPropertyValueProvider; #define QUERYINT( xint ) \ if( rType == ::getCppuType((const uno::Reference< xint >*)0) ) \ @@ -156,15 +159,17 @@ sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetSt uno::Reference< uno::XInterface > SAL_CALL SvxUnoGluePointAccess_createInstance( SdrObject* pObject ); /*********************************************************************** -* class SvxShape * +* class SvxShapeImpl * ***********************************************************************/ struct SvxShapeImpl { + SvxShape& mrAntiImpl; SfxItemSet* mpItemSet; sal_uInt32 mnObjId; SvxShapeMaster* mpMaster; bool mbHasSdrObjectOwnership; + bool mbDisposing; /** CL, OD 2005-07-19 #i52126# - this is initially 0 and set when * a SvxShape::Create() call is executed. It is then set to the created @@ -172,58 +177,105 @@ struct SvxShapeImpl * is prohibited. */ SdrObject* mpCreatedObj; + + // for xComponent + ::cppu::OInterfaceContainerHelper maDisposeListeners; + ::svx::PropertyChangeNotifier maPropertyNotifier; + + SvxShapeImpl( SvxShape& _rAntiImpl, ::osl::Mutex& _rMutex ) + :mrAntiImpl( _rAntiImpl ) + ,mpItemSet( NULL ) + ,mnObjId( 0 ) + ,mpMaster( NULL ) + ,mbHasSdrObjectOwnership( false ) + ,mbDisposing( false ) + ,mpCreatedObj( NULL ) + ,maDisposeListeners( _rMutex ) + ,maPropertyNotifier( _rAntiImpl, _rMutex ) + { + } +}; + +/**********************************************************************/ +class ShapePositionProvider : public PropertyValueProvider +{ +public: + ShapePositionProvider( const SvxShapeImpl& _shapeImpl ) + :PropertyValueProvider( _shapeImpl.mrAntiImpl, "Position" ) + { + } + +protected: + virtual void getCurrentValue( Any& _out_rCurrentValue ) const + { + _out_rCurrentValue <<= static_cast< SvxShape& >( getContext() ).getPosition(); + } +}; + +//---------------------------------------------------------------------- +class ShapeSizeProvider : public PropertyValueProvider +{ +public: + ShapeSizeProvider( const SvxShapeImpl& _shapeImpl ) + :PropertyValueProvider( _shapeImpl.mrAntiImpl, "Size" ) + { + } + +protected: + virtual void getCurrentValue( Any& _out_rCurrentValue ) const + { + _out_rCurrentValue <<= static_cast< SvxShape& >( getContext() ).getSize(); + } }; +/*********************************************************************** +* class SvxShape * +***********************************************************************/ + DBG_NAME(SvxShape) SvxShape::SvxShape( SdrObject* pObject ) throw() : maSize(100,100) -, mpImpl(NULL) +, mpImpl( new SvxShapeImpl( *this, maMutex ) ) , mbIsMultiPropertyCall(false) , mpPropSet(aSvxMapProvider.GetPropertySet(SVXMAP_SHAPE)) , maPropMapEntries(aSvxMapProvider.GetMap(SVXMAP_SHAPE)) -, maDisposeListeners( maMutex ) -, mbDisposing( false ) , mpObj(pObject) , mpModel(NULL) , mnLockCount(0) { DBG_CTOR(SvxShape,NULL); - Init(); + impl_construct(); } //---------------------------------------------------------------------- SvxShape::SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries, const SvxItemPropertySet* pPropertySet ) throw() : maSize(100,100) -, mpImpl(NULL) +, mpImpl( new SvxShapeImpl( *this, maMutex ) ) , mbIsMultiPropertyCall(false) , mpPropSet(pPropertySet) , maPropMapEntries(pEntries) -, maDisposeListeners( maMutex ) -, mbDisposing( false ) , mpObj(pObject) , mpModel(NULL) , mnLockCount(0) { DBG_CTOR(SvxShape,NULL); - Init(); + impl_construct(); } //---------------------------------------------------------------------- SvxShape::SvxShape() throw() : maSize(100,100) -, mpImpl(NULL) +, mpImpl( new SvxShapeImpl( *this, maMutex ) ) , mbIsMultiPropertyCall(false) , mpPropSet(aSvxMapProvider.GetPropertySet(SVXMAP_SHAPE)) , maPropMapEntries(aSvxMapProvider.GetMap(SVXMAP_SHAPE)) -, maDisposeListeners( maMutex ) -, mbDisposing( false ) , mpObj(NULL) , mpModel(NULL) , mnLockCount(0) { DBG_CTOR(SvxShape,NULL); - Init(); + impl_construct(); } //---------------------------------------------------------------------- @@ -233,12 +285,15 @@ SvxShape::~SvxShape() throw() DBG_ASSERT( mnLockCount == 0, "Locked shape was disposed!" ); - if( mpModel ) + if ( mpModel ) EndListening( *mpModel ); - if(mpImpl && mpImpl->mpMaster) + if ( mpImpl->mpMaster ) mpImpl->mpMaster->dispose(); + if ( mpObj.is() ) + mpObj->setUnoShape( NULL, SdrObject::GrantXShapeAccess() ); + if( HasSdrObjectOwnership() && mpObj.is() ) { mpImpl->mbHasSdrObjectOwnership = false; @@ -255,18 +310,13 @@ SvxShape::~SvxShape() throw() void SvxShape::TakeSdrObjectOwnership() { - if ( mpImpl ) - mpImpl->mbHasSdrObjectOwnership = true; + mpImpl->mbHasSdrObjectOwnership = true; } //---------------------------------------------------------------------- bool SvxShape::HasSdrObjectOwnership() const { - OSL_PRECOND( mpImpl, "SvxShape::HasSdrObjectOwnership: no impl!?" ); - if ( !mpImpl ) - return false; - if ( !mpImpl->mbHasSdrObjectOwnership ) return false; @@ -278,15 +328,14 @@ bool SvxShape::HasSdrObjectOwnership() const void SvxShape::setShapeKind( sal_uInt32 nKind ) { - if( mpImpl ) - mpImpl->mnObjId = nKind; + mpImpl->mnObjId = nKind; } //---------------------------------------------------------------------- sal_uInt32 SvxShape::getShapeKind() const { - return mpImpl ? mpImpl->mnObjId : (sal_uInt32)OBJ_NONE; + return mpImpl->mnObjId; } //---------------------------------------------------------------------- @@ -298,12 +347,12 @@ void SvxShape::setMaster( SvxShapeMaster* pMaster ) SvxShapeMaster* SvxShape::getMaster() { - return mpImpl ? mpImpl->mpMaster : NULL; + return mpImpl->mpMaster; } const SvxShapeMaster* SvxShape::getMaster() const { - return mpImpl ? mpImpl->mpMaster : NULL; + return mpImpl->mpMaster; } //---------------------------------------------------------------------- @@ -338,7 +387,7 @@ const ::com::sun::star::uno::Sequence< sal_Int8 > & SvxShape::getUnoTunnelId() t } //---------------------------------------------------------------------- -SvxShape* SvxShape::getImplementation( uno::Reference< uno::XInterface > xInt ) throw() +SvxShape* SvxShape::getImplementation( const uno::Reference< uno::XInterface >& xInt ) { uno::Reference< lang::XUnoTunnel > xUT( xInt, ::com::sun::star::uno::UNO_QUERY ); if( xUT.is() ) @@ -366,27 +415,30 @@ SvxShape* SvxShape::GetShapeForSdrObj( SdrObject* pObj ) throw() return getImplementation( pObj->getUnoShape() ); } -void SvxShape::Init() throw() +//---------------------------------------------------------------------- +::svx::PropertyChangeNotifier& SvxShape::getShapePropertyChangeNotifier() { - if( NULL == mpImpl ) - { - mpImpl = new SvxShapeImpl; - mpImpl->mpItemSet = NULL; - mpImpl->mpMaster = NULL; - mpImpl->mnObjId = 0; - mpImpl->mbHasSdrObjectOwnership= false; - // --> CL, OD 2005-07-19 #i52126# - mpImpl->mpCreatedObj = NULL; - // <-- - } + return mpImpl->maPropertyNotifier; +} - mbIsMultiPropertyCall = sal_False; +//---------------------------------------------------------------------- +void SvxShape::impl_construct() +{ + mpImpl->maPropertyNotifier.registerProvider( ::svx::eShapePosition, + ::svx::PPropertyValueProvider( new ShapePositionProvider( *mpImpl ) ) ); + mpImpl->maPropertyNotifier.registerProvider( ::svx::eShapeSize, + ::svx::PPropertyValueProvider( new ShapeSizeProvider( *mpImpl ) ) ); + + if ( mpObj.is() ) + impl_initFromSdrObject(); +} - // only init if we already have an object - // if we get an object later Init() will - // be called again +//---------------------------------------------------------------------- +void SvxShape::impl_initFromSdrObject() +{ DBG_TESTSOLARMUTEX(); - if(!mpObj.is()) + OSL_PRECOND( mpObj.is(), "SvxShape::impl_initFromSdrObject: not to be called without SdrObject!" ); + if ( !mpObj.is() ) return; osl_incrementInterlockedCount( &m_refCount ); @@ -437,14 +489,19 @@ void SvxShape::Init() throw() } //---------------------------------------------------------------------- -void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ ) throw() +void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ ) { - DBG_ASSERT( mpImpl, "svx::SvxShape::Create(), no mpImpl!" ); - DBG_TESTSOLARMUTEX(); + OSL_PRECOND( pNewObj, "SvxShape::Create: invalid new object!" ); + if ( !pNewObj ) + return; + + OSL_ENSURE( ( mpImpl->mpCreatedObj == NULL ) || ( mpImpl->mpCreatedObj == pNewObj ), + "SvxShape::Create: the same shape used for two different objects?! Strange ..." ); + // --> CL, OD 2005-07-19 #i52126# - correct condition - if ( pNewObj && (mpImpl && (mpImpl->mpCreatedObj != pNewObj) ) ) + if ( mpImpl->mpCreatedObj != pNewObj ) // <-- { DBG_ASSERT( pNewObj->GetModel(), "no model for SdrObject?" ); @@ -459,7 +516,11 @@ void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ ) throw() mpObj.reset( pNewObj ); - Init(); + OSL_ENSURE( !mbIsMultiPropertyCall, "SvxShape::Create: hmm?" ); + // this was previously set in impl_initFromSdrObject, but I think it was superfluous + // (it definitely was in the other context where it was called, but I strongly suppose + // it was also superfluous when called from here) + impl_initFromSdrObject(); ObtainSettingsFromPropertySet( *mpPropSet ); @@ -572,7 +633,7 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw() } //---------------------------------------------------------------------- -void SvxShape::ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet) throw() +void SvxShape::ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet) { DBG_TESTSOLARMUTEX(); if(mpObj.is() && rPropSet.AreThereOwnUsrAnys() && mpModel) @@ -973,25 +1034,9 @@ Reference< uno::XInterface > SvxShape_NewInstance() //---------------------------------------------------------------------- -/** called from SdrObject::SendUserCall - Currently only called for SDRUSERCALL_CHILD_CHGATTR -*/ -void SvxShape::onUserCall(SdrUserCallType eUserCall, const Rectangle& ) +void SvxShape::onUserCall(SdrUserCallType /*_eUserCall*/, const Rectangle& /*_rNewBoundRect*/ ) { - switch( eUserCall ) - { - case SDRUSERCALL_CHILD_CHGATTR: - { - beans::PropertyChangeEvent aEvent; - aEvent.Further = sal_False; - aEvent.PropertyHandle = 0; - aEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); - maDisposeListeners.notifyEach( &beans::XPropertyChangeListener::propertyChange, aEvent ); - } - break; - default: - break; - } + // obsolete, not called anymore } //---------------------------------------------------------------------- @@ -1043,9 +1088,7 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw() { if( !HasSdrObjectOwnership() ) mpObj.reset( NULL ); - /*mpImpl->mbHasSdrObjectOwnerhship = false; - mpObj.reset( NULL );*/ - if(!mbDisposing) + if ( !mpImpl->mbDisposing ) dispose(); } } @@ -1287,33 +1330,50 @@ void SAL_CALL SvxShape::dispose() throw(uno::RuntimeException) { OGuard aGuard( Application::GetSolarMutex() ); - if( mbDisposing ) + if( mpImpl->mbDisposing ) return; // caught a recursion - mbDisposing = true; + mpImpl->mbDisposing = true; lang::EventObject aEvt; aEvt.Source = *(OWeakAggObject*) this; - maDisposeListeners.disposeAndClear(aEvt); + mpImpl->maDisposeListeners.disposeAndClear(aEvt); + mpImpl->maPropertyNotifier.disposing(); - if(mpObj.is() && mpObj->IsInserted() && mpObj->GetPage() ) + if ( mpObj.is() ) { - SdrPage* pPage = mpObj->GetPage(); - // SdrObject aus der Page loeschen - sal_uInt32 nCount = pPage->GetObjCount(); - for( sal_uInt32 nNum = 0; nNum < nCount; nNum++ ) + bool bFreeSdrObject = false; + + if ( mpObj->IsInserted() && mpObj->GetPage() ) { - if(pPage->GetObj(nNum) == mpObj.get()) + OSL_ENSURE( HasSdrObjectOwnership(), "SvxShape::dispose: is the below code correct?" ); + // normally, we are allowed to free the SdrObject only if we have its ownership. + // Why isn't this checked here? + + SdrPage* pPage = mpObj->GetPage(); + // SdrObject aus der Page loeschen + sal_uInt32 nCount = pPage->GetObjCount(); + for ( sal_uInt32 nNum = 0; nNum < nCount; ++nNum ) { - OSL_VERIFY( pPage->RemoveObject(nNum) == mpObj.get() ); - // in case we have the ownership of the SdrObject, a Free - // would do nothing. So ensure the ownership is reset. - mpImpl->mbHasSdrObjectOwnership = false; - SdrObject* pObject = mpObj.get(); - SdrObject::Free( pObject ); - break; + if ( pPage->GetObj( nNum ) == mpObj.get() ) + { + OSL_VERIFY( pPage->RemoveObject( nNum ) == mpObj.get() ); + bFreeSdrObject = true; + break; + } } } + + mpObj->setUnoShape( NULL, SdrObject::GrantXShapeAccess() ); + + if ( bFreeSdrObject ) + { + // in case we have the ownership of the SdrObject, a Free + // would do nothing. So ensure the ownership is reset. + mpImpl->mbHasSdrObjectOwnership = false; + SdrObject* pObject = mpObj.get(); + SdrObject::Free( pObject ); + } } if( mpModel ) @@ -1328,14 +1388,14 @@ void SAL_CALL SvxShape::dispose() throw(uno::RuntimeException) void SAL_CALL SvxShape::addEventListener( const Reference< lang::XEventListener >& xListener ) throw(uno::RuntimeException) { - maDisposeListeners.addInterface(xListener); + mpImpl->maDisposeListeners.addInterface(xListener); } //---------------------------------------------------------------------- void SAL_CALL SvxShape::removeEventListener( const Reference< lang::XEventListener >& aListener ) throw(uno::RuntimeException) { - maDisposeListeners.removeInterface(aListener); + mpImpl->maDisposeListeners.removeInterface(aListener); } // XPropertySet @@ -1363,22 +1423,33 @@ Reference< beans::XPropertySetInfo > SAL_CALL //---------------------------------------------------------------------- -void SAL_CALL SvxShape::addPropertyChangeListener( const OUString& , const Reference< beans::XPropertyChangeListener >& xListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SvxShape::addPropertyChangeListener( const OUString& _propertyName, const Reference< beans::XPropertyChangeListener >& _listener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +{ + ::osl::MutexGuard aGuard( maMutex ); + mpImpl->maPropertyNotifier.addPropertyChangeListener( _propertyName, _listener ); +} + +//---------------------------------------------------------------------- + +void SAL_CALL SvxShape::removePropertyChangeListener( const OUString& _propertyName, const Reference< beans::XPropertyChangeListener >& _listener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - maDisposeListeners.addInterface(xListener); + ::osl::MutexGuard aGuard( maMutex ); + mpImpl->maPropertyNotifier.removePropertyChangeListener( _propertyName, _listener ); } //---------------------------------------------------------------------- -void SAL_CALL SvxShape::removePropertyChangeListener( const OUString& , const Reference< beans::XPropertyChangeListener >& xListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SvxShape::addVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - maDisposeListeners.removeInterface(xListener); + OSL_ENSURE( false, "SvxShape::addVetoableChangeListener: don't have any vetoable properties, so why ...?" ); } //---------------------------------------------------------------------- -void SAL_CALL SvxShape::addVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} -void SAL_CALL SvxShape::removeVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} +void SAL_CALL SvxShape::removeVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +{ + OSL_ENSURE( false, "SvxShape::removeVetoableChangeListener: don't have any vetoable properties, so why ...?" ); +} //---------------------------------------------------------------------- @@ -1905,7 +1976,7 @@ void SAL_CALL SvxShape::_setPropertyValue( const OUString& rPropertyName, const uno::Any SAL_CALL SvxShape::getPropertyValue( const OUString& PropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - if( mpImpl && mpImpl->mpMaster ) + if ( mpImpl->mpMaster ) return mpImpl->mpMaster->getPropertyValue( PropertyName ); else return _getPropertyValue( PropertyName ); @@ -4187,7 +4258,7 @@ SvxShapeText::~SvxShapeText() throw () "svx::SvxShapeText::~SvxShapeText(), text shape with living text ranges destroyed!"); } -void SvxShapeText::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw () +void SvxShapeText::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) { if( pNewObj && (NULL == GetEditSource())) SetEditSource( new SvxTextEditSource( pNewObj, 0, static_cast< uno::XWeak* >(this) ) ); diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx index 06c7b5ba55ae..daa7744bb8c8 100644 --- a/svx/source/unoedit/unotext.cxx +++ b/svx/source/unoedit/unotext.cxx @@ -2340,7 +2340,7 @@ const uno::Sequence< sal_Int8 > & SvxUnoTextBase::getUnoTunnelId() throw() return *pSeq; } -SvxUnoTextBase* SvxUnoTextBase::getImplementation( uno::Reference< uno::XInterface > xInt ) throw() +SvxUnoTextBase* SvxUnoTextBase::getImplementation( const uno::Reference< uno::XInterface >& xInt ) { uno::Reference< lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY ); if( xUT.is() ) @@ -2435,7 +2435,7 @@ uno::Sequence< sal_Int8 > SAL_CALL SvxUnoText::getImplementationId( ) throw( un return aId; } -SvxUnoText* SvxUnoText::getImplementation( uno::Reference< uno::XInterface > xInt ) throw() +SvxUnoText* SvxUnoText::getImplementation( const uno::Reference< uno::XInterface >& xInt ) { uno::Reference< lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY ); if( xUT.is() ) diff --git a/svx/util/hidother.src b/svx/util/hidother.src index 9da8c59bcd63..86c0edea64d3 100644 --- a/svx/util/hidother.src +++ b/svx/util/hidother.src @@ -58,109 +58,6 @@ hidspecial HID_TPCOLOR_CMYK_2 { HelpID = HID_TPCOLOR_CMYK_2; }; hidspecial HID_TPCOLOR_CMYK_3 { HelpID = HID_TPCOLOR_CMYK_3; }; hidspecial HID_REDLINING_FILTER_CB_ACTION { HelpID = HID_REDLINING_FILTER_CB_ACTION; }; -hidspecial HID_PROP_GROUPBOX { HelpID = HID_PROP_GROUPBOX; }; -hidspecial HID_PROP_CONTROLSOURCE { HelpID = HID_PROP_CONTROLSOURCE; }; -hidspecial HID_PROP_NAME { HelpID = HID_PROP_NAME; }; -hidspecial HID_PROP_TABINDEX { HelpID = HID_PROP_TABINDEX; }; -hidspecial HID_PROP_MASTERFIELDS { HelpID = HID_PROP_MASTERFIELDS; }; -hidspecial HID_PROP_SLAVEFIELDS { HelpID = HID_PROP_SLAVEFIELDS; }; -hidspecial HID_PROP_DATASOURCE { HelpID = HID_PROP_DATASOURCE; }; -hidspecial HID_PROP_CURSORSOURCE { HelpID = HID_PROP_CURSORSOURCE; }; -hidspecial HID_PROP_CURSORSOURCETYPE { HelpID = HID_PROP_CURSORSOURCETYPE; }; -hidspecial HID_PROP_ESCAPE_PROCESSING { HelpID = HID_PROP_ESCAPE_PROCESSING; }; -hidspecial HID_PROP_IMAGE_ALIGN { HelpID = HID_PROP_IMAGE_ALIGN; }; -hidspecial HID_PROP_CURSORTYPE { HelpID = HID_PROP_CURSORTYPE; }; -hidspecial HID_PROP_READONLY { HelpID = HID_PROP_READONLY; }; -hidspecial HID_PROP_DATAENTRY { HelpID = HID_PROP_DATAENTRY; }; -hidspecial HID_PROP_NAVIGATION { HelpID = HID_PROP_NAVIGATION; }; -hidspecial HID_PROP_CYCLE { HelpID = HID_PROP_CYCLE; }; -hidspecial HID_PROP_ALLOW_ADDITIONS { HelpID = HID_PROP_ALLOW_ADDITIONS ; }; -hidspecial HID_PROP_ALLOW_EDITS { HelpID = HID_PROP_ALLOW_EDITS ; }; -hidspecial HID_PROP_ALLOW_DELETIONS { HelpID = HID_PROP_ALLOW_DELETIONS ; }; -hidspecial HID_PROP_DIRTY { HelpID = HID_PROP_DIRTY; }; -hidspecial HID_PROP_OLDVALUE { HelpID = HID_PROP_OLDVALUE; }; -hidspecial HID_PROP_LOCKED { HelpID = HID_PROP_LOCKED; }; -hidspecial HID_PROP_FORMATKEY { HelpID = HID_PROP_FORMATKEY ; }; -hidspecial HID_PROP_REQUIRED { HelpID = HID_PROP_REQUIRED; }; -hidspecial HID_PROP_SCALE { HelpID = HID_PROP_SCALE; }; -hidspecial HID_PROP_SIZE { HelpID = HID_PROP_SIZE; }; -hidspecial HID_PROP_UNIQUE { HelpID = HID_PROP_UNIQUE; }; -hidspecial HID_PROP_CLASSID { HelpID = HID_PROP_CLASSID; }; -hidspecial HID_PROP_LEFT { HelpID = HID_PROP_LEFT; }; -hidspecial HID_PROP_RIGHT { HelpID = HID_PROP_RIGHT; }; -hidspecial HID_PROP_HEIGHT { HelpID = HID_PROP_HEIGHT; }; -hidspecial HID_PROP_WIDTH { HelpID = HID_PROP_WIDTH; }; -hidspecial HID_PROP_BOUNDCOLUMN { HelpID = HID_PROP_BOUNDCOLUMN; }; -hidspecial HID_PROP_LISTSOURCETYPE { HelpID = HID_PROP_LISTSOURCETYPE; }; -hidspecial HID_PROP_LISTSOURCE { HelpID = HID_PROP_LISTSOURCE; }; -hidspecial HID_PROP_LISTINDEX { HelpID = HID_PROP_LISTINDEX; }; -hidspecial HID_PROP_TEXT { HelpID = HID_PROP_TEXT; }; -hidspecial HID_PROP_LABEL { HelpID = HID_PROP_LABEL; }; -hidspecial HID_PROP_STRINGITEMLIST { HelpID = HID_PROP_STRINGITEMLIST; }; -hidspecial HID_PROP_SEARCHING { HelpID = HID_PROP_SEARCHING; }; -hidspecial HID_PROP_FONT { HelpID = HID_PROP_FONT; }; -hidspecial HID_PROP_ROWHEIGHT { HelpID = HID_PROP_ROWHEIGHT; }; -hidspecial HID_PROP_BACKGROUNDCOLOR { HelpID = HID_PROP_BACKGROUNDCOLOR ; }; -hidspecial HID_PROP_FILLCOLOR { HelpID = HID_PROP_FILLCOLOR; }; -hidspecial HID_PROP_TEXTCOLOR { HelpID = HID_PROP_TEXTCOLOR; }; -hidspecial HID_PROP_LINECOLOR { HelpID = HID_PROP_LINECOLOR; }; -hidspecial HID_PROP_BORDER { HelpID = HID_PROP_BORDER; }; -hidspecial HID_PROP_ALIGN { HelpID = HID_PROP_ALIGN; }; -hidspecial HID_PROP_DROPDOWN { HelpID = HID_PROP_DROPDOWN; }; -hidspecial HID_PROP_MULTILINE { HelpID = HID_PROP_MULTILINE; }; -hidspecial HID_PROP_HSCROLL { HelpID = HID_PROP_HSCROLL; }; -hidspecial HID_PROP_VSCROLL { HelpID = HID_PROP_VSCROLL; }; -hidspecial HID_PROP_TABSTOP { HelpID = HID_PROP_TABSTOP; }; -hidspecial HID_PROP_REFVALUE { HelpID = HID_PROP_REFVALUE; }; -hidspecial HID_PROP_BUTTONTYPE { HelpID = HID_PROP_BUTTONTYPE; }; -hidspecial HID_PROP_SUBMIT_ACTION { HelpID = HID_PROP_SUBMIT_ACTION; }; -hidspecial HID_PROP_SUBMIT_METHOD { HelpID = HID_PROP_SUBMIT_METHOD; }; -hidspecial HID_PROP_SUBMIT_ENCODING { HelpID = HID_PROP_SUBMIT_ENCODING; }; -hidspecial HID_PROP_DEFAULTVALUE { HelpID = HID_PROP_DEFAULTVALUE; }; -hidspecial HID_PROP_SUBMIT_TARGET { HelpID = HID_PROP_SUBMIT_TARGET; }; -hidspecial HID_PROP_DEFAULT_CHECKED { HelpID = HID_PROP_DEFAULT_CHECKED; }; -hidspecial HID_PROP_IMAGE_URL { HelpID = HID_PROP_IMAGE_URL; }; -hidspecial HID_PROP_DEFAULT_SELECT_SEQ { HelpID = HID_PROP_DEFAULT_SELECT_SEQ; }; -hidspecial HID_PROP_MULTISELECTION { HelpID = HID_PROP_MULTISELECTION; }; - -hidspecial HID_PROP_DATE { HelpID = HID_PROP_DATE; }; -hidspecial HID_PROP_DATEMIN { HelpID = HID_PROP_DATEMIN; }; -hidspecial HID_PROP_DATEMAX { HelpID = HID_PROP_DATEMAX; }; -hidspecial HID_PROP_DATEFORMAT { HelpID = HID_PROP_DATEFORMAT; }; -hidspecial HID_PROP_TIME { HelpID = HID_PROP_TIME; }; -hidspecial HID_PROP_TIMEMIN { HelpID = HID_PROP_TIMEMIN; }; -hidspecial HID_PROP_TIMEMAX { HelpID = HID_PROP_TIMEMAX; }; -hidspecial HID_PROP_TIMEFORMAT { HelpID = HID_PROP_TIMEFORMAT; }; -hidspecial HID_PROP_VALUEMIN { HelpID = HID_PROP_VALUEMIN; }; -hidspecial HID_PROP_VALUEMAX { HelpID = HID_PROP_VALUEMAX; }; -hidspecial HID_PROP_VALUESTEP { HelpID = HID_PROP_VALUESTEP; }; -hidspecial HID_PROP_CURRENCYSYMBOL { HelpID = HID_PROP_CURRENCYSYMBOL; }; -hidspecial HID_PROP_EDITMASK { HelpID = HID_PROP_EDITMASK; }; -hidspecial HID_PROP_LITERALMASK { HelpID = HID_PROP_LITERALMASK; }; -hidspecial HID_PROP_ENABLED { HelpID = HID_PROP_ENABLED; }; -hidspecial HID_PROP_AUTOCOMPLETE { HelpID = HID_PROP_AUTOCOMPLETE; }; -hidspecial HID_PROP_LINECOUNT { HelpID = HID_PROP_LINECOUNT; }; -hidspecial HID_PROP_MAXTEXTLEN { HelpID = HID_PROP_MAXTEXTLEN; }; -hidspecial HID_PROP_SPIN { HelpID = HID_PROP_SPIN; }; -hidspecial HID_PROP_STRICTFORMAT { HelpID = HID_PROP_STRICTFORMAT; }; -hidspecial HID_PROP_SHOWTHOUSANDSEP { HelpID = HID_PROP_SHOWTHOUSANDSEP; }; -hidspecial HID_PROP_TARGET_URL { HelpID = HID_PROP_TARGET_URL; }; -hidspecial HID_PROP_TARGET_FRAME { HelpID = HID_PROP_TARGET_FRAME; }; -hidspecial HID_PROP_TAG { HelpID = HID_PROP_TAG; }; -hidspecial HID_PROP_ECHO_CHAR { HelpID = HID_PROP_ECHO_CHAR; }; -hidspecial HID_PROP_EMPTY_IS_NULL { HelpID = HID_PROP_EMPTY_IS_NULL; }; -hidspecial HID_PROP_DECIMAL_ACCURACY { HelpID = HID_PROP_DECIMAL_ACCURACY; }; -hidspecial HID_PROP_DEFAULT_BUTTON { HelpID = HID_PROP_DEFAULT_BUTTON; }; -hidspecial HID_PROP_HIDDEN_VALUE { HelpID = HID_PROP_HIDDEN_VALUE; }; -hidspecial HID_PROP_TRISTATE { HelpID =HID_PROP_TRISTATE; }; -hidspecial HID_PROP_NAVIGATIONBAR { HelpID =HID_PROP_NAVIGATIONBAR; }; -hidspecial HID_PROP_FILTER_CRITERIA { HelpID =HID_PROP_FILTER_CRITERIA; }; -hidspecial HID_PROP_SORT_CRITERIA { HelpID =HID_PROP_SORT_CRITERIA; }; -hidspecial HID_PROP_DEFAULT_LONG_VALUE { HelpID =HID_PROP_DEFAULT_LONG_VALUE; }; -hidspecial HID_PROP_DEFAULT_TIME { HelpID =HID_PROP_DEFAULT_TIME; }; -hidspecial HID_PROP_DEFAULT_DATE { HelpID =HID_PROP_DEFAULT_DATE; }; -hidspecial HID_PROP_HELPTEXT { HelpID = HID_PROP_HELPTEXT ;}; - hidspecial HID_REDLINING_DLG { HelpID = HID_REDLINING_DLG; }; hidspecial HID_REDLINING_EDIT { HelpID = HID_REDLINING_EDIT; }; hidspecial HID_REDLINING_PREV { HelpID = HID_REDLINING_PREV; }; @@ -173,7 +70,6 @@ hidspecial HID_FIELD_SEL { HelpID =HID_FIELD_SEL hidspecial HID_FIELD_SEL_WIN { HelpID =HID_FIELD_SEL_WIN ;}; hidspecial HID_FILTER_NAVIGATOR { HelpID =HID_FILTER_NAVIGATOR ;}; hidspecial HID_FILTER_NAVIGATOR_WIN { HelpID =HID_FILTER_NAVIGATOR_WIN ;}; -hidspecial HID_PROP_PRINTABLE { HelpID =HID_PROP_PRINTABLE ;}; hidspecial HID_FM_PROPDLG_TABCTR { HelpID =HID_FM_PROPDLG_TABCTR ;}; hidspecial HID_FM_PROPDLG_TAB_GENERAL { HelpID =HID_FM_PROPDLG_TAB_GENERAL;}; @@ -185,9 +81,6 @@ hidspecial HID_VALUESET_BULLET { HelpID = HID_VALUESET_BULLET ;}; hidspecial HID_VALUESET_NUM { HelpID = HID_VALUESET_NUM ;}; hidspecial HID_VALUESET_NUMBMP { HelpID = HID_VALUESET_NUMBMP ;}; -hidspecial HID_PROP_HELPURL { HelpID = HID_PROP_HELPURL ;}; -hidspecial HID_PROP_RECORDMARKER { HelpID = HID_PROP_RECORDMARKER ;}; - hidspecial HID_OPTPATH_HEADERBAR { HelpId = HID_OPTPATH_HEADERBAR ;}; hidspecial HID_OPTCOOKIES_HEADERBAR { HelpId = HID_OPTCOOKIES_HEADERBAR ;}; @@ -200,11 +93,6 @@ hidspecial HID_TABORDER_CONTROLS { HelpId = HID_TABORDER_CONTROLS hidspecial HID_POPUP_LINEEND { HelpId = HID_POPUP_LINEEND ;}; hidspecial HID_POPUP_LINEEND_CTRL { HelpId = HID_POPUP_LINEEND_CTRL ;}; -hidspecial HID_PROP_EFFECTIVEMIN { HelpId = HID_PROP_EFFECTIVEMIN ;}; -hidspecial HID_PROP_EFFECTIVEMAX { HelpId = HID_PROP_EFFECTIVEMAX ;}; -hidspecial HID_PROP_EFFECTIVEDEFAULT { HelpId = HID_PROP_EFFECTIVEDEFAULT ;}; -hidspecial HID_PROP_CONTROLLABEL { HelpId = HID_PROP_CONTROLLABEL ;}; - hidspecial HID_GRID_TRAVEL_FIRST { HelpID = HID_GRID_TRAVEL_FIRST ;}; hidspecial HID_GRID_TRAVEL_PREV { HelpID = HID_GRID_TRAVEL_PREV ;}; hidspecial HID_GRID_TRAVEL_NEXT { HelpID = HID_GRID_TRAVEL_NEXT ;}; @@ -224,9 +112,6 @@ hidspecial HID_HYPERDLG_INET_PATH { HelpID = HID_HYPERDLG_INET_PATH ;} hidspecial HID_HYPERDLG_MAIL_PATH { HelpID = HID_HYPERDLG_MAIL_PATH ;}; hidspecial HID_HYPERDLG_DOC_PATH { HelpID = HID_HYPERDLG_DOC_PATH ;}; -hidspecial HID_PROP_FILTERPROPOSAL { HelpID = HID_PROP_FILTERPROPOSAL ;}; -hidspecial HID_PROP_CURRSYM_POSITION { HelpID = HID_PROP_CURRSYM_POSITION ;}; - //HID_AUTOCORR_HELP_START #define HID_AUTOCORR_HELP_WORD HID_AUTOCORR_HELP_START+0 #define HID_AUTOCORR_HELP_SENT HID_AUTOCORR_HELP_START+1 |