diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-07-22 12:23:30 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-07-22 12:23:30 +0000 |
commit | 4590ebabde78a0491582697d437231105f8321cd (patch) | |
tree | 3d1b4547687689bc31b439642659c393c5974735 /oox/inc/oox/helper/containerhelper.hxx | |
parent | cb9af0bdad151bf74c007e1265eb0dec4aa71197 (diff) |
INTEGRATION: CWS xmlfilter06 (1.3.8); FILE MERGED
2008/06/26 14:15:56 dr 1.3.8.2: handle drawing object tables separated for chart import, extended line formatting with own property name sets
2008/06/09 15:16:12 dr 1.3.8.1: more chart line formatting, add line dashs to chart dash container
Diffstat (limited to 'oox/inc/oox/helper/containerhelper.hxx')
-rw-r--r-- | oox/inc/oox/helper/containerhelper.hxx | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx index 564bd926a50e..2444e46b2871 100644 --- a/oox/inc/oox/helper/containerhelper.hxx +++ b/oox/inc/oox/helper/containerhelper.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: containerhelper.hxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -44,6 +44,7 @@ namespace com { namespace sun { namespace star { namespace container { class XIndexContainer; } namespace container { class XNameAccess; } namespace container { class XNameContainer; } + namespace lang { class XMultiServiceFactory; } } } } namespace oox { @@ -326,7 +327,8 @@ public: static bool insertByName( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxNameContainer, const ::rtl::OUString& rName, - const ::com::sun::star::uno::Any& rObject ); + const ::com::sun::star::uno::Any& rObject, + bool bReplaceOldExisting = true ); /** Inserts an object into a name container. @@ -338,10 +340,10 @@ public: @param rxNameContainer com.sun.star.container.XNameContainer interface of the name container. - @param rObject The object to be inserted. - @param rSuggestedName Suggested name for the object. + @param rObject The object to be inserted. + @param bRenameOldExisting Specifies behaviour if an object with the suggested name already exists. If false (default), the new object will be inserted with a name not yet extant in the container (this @@ -356,9 +358,9 @@ public: */ static ::rtl::OUString insertByUnusedName( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxNameContainer, - const ::com::sun::star::uno::Any& rObject, const ::rtl::OUString& rSuggestedName, sal_Unicode cSeparator, + const ::com::sun::star::uno::Any& rObject, bool bRenameOldExisting = false ); // vector and matrix ------------------------------------------------------ @@ -413,6 +415,42 @@ template< typename Type > // ============================================================================ +/** This helper manages named objects in a container, which is created on demand. + */ +class ObjectContainer +{ +public: + explicit ObjectContainer( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory, + const ::rtl::OUString& rServiceName ); + ~ObjectContainer(); + + /** Returns true, if the object with the passed name exists in the container. */ + bool hasObject( const ::rtl::OUString& rObjName ) const; + + /** Returns the object with the passed name from the container. */ + ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const; + + /** Inserts the passed object into the container, returns its final name. */ + ::rtl::OUString insertObject( + const ::rtl::OUString& rObjName, + const ::com::sun::star::uno::Any& rObj, + bool bInsertByUnusedName ); + +private: + void createContainer() const; + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + mxFactory; /// Factory to create the container. + mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > + mxContainer; /// Container for the objects. + ::rtl::OUString maServiceName; /// Service name to create the container. + sal_Int32 mnIndex; /// Index to create unique identifiers. +}; + +// ============================================================================ + } // namespace oox #endif |