From 1fe85161e45d2097e5c3f1e227920d91b8e5d6fe Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Mon, 3 Oct 2011 00:47:44 +0200 Subject: callcatcher: comphelper's unused code --- comphelper/Library_comphelp.mk | 3 - comphelper/Package_inc.mk | 3 - comphelper/inc/comphelper/ChainablePropertySet.hxx | 8 - .../inc/comphelper/ChainablePropertySetInfo.hxx | 2 - comphelper/inc/comphelper/MasterPropertySet.hxx | 2 - .../inc/comphelper/MasterPropertySetInfo.hxx | 4 - .../inc/comphelper/accessiblecontexthelper.hxx | 21 - .../inc/comphelper/accessibleeventbuffer.hxx | 136 ---- comphelper/inc/comphelper/attributelist.hxx | 2 - comphelper/inc/comphelper/composedprops.hxx | 129 ---- comphelper/inc/comphelper/docpasswordhelper.hxx | 15 - comphelper/inc/comphelper/docpasswordrequest.hxx | 2 - .../inc/comphelper/otransactedfilestream.hxx | 138 ---- comphelper/source/misc/accessiblecontexthelper.cxx | 30 - comphelper/source/misc/accessibleeventbuffer.cxx | 113 --- comphelper/source/misc/docpasswordhelper.cxx | 14 - comphelper/source/misc/docpasswordrequest.cxx | 10 - .../source/property/ChainablePropertySet.cxx | 12 - .../source/property/ChainablePropertySetInfo.cxx | 5 - comphelper/source/property/MasterPropertySet.cxx | 11 - .../source/property/MasterPropertySetInfo.cxx | 13 - comphelper/source/property/composedprops.cxx | 359 --------- .../source/streaming/otransactedfilestream.cxx | 826 --------------------- comphelper/source/xml/attributelist.cxx | 19 - unusedcode.easy | 20 - xmloff/inc/xmloff/attrlist.hxx | 1 - xmloff/source/core/attrlist.cxx | 7 - xmloff/source/transform/MutableAttrList.hxx | 1 - 28 files changed, 1906 deletions(-) delete mode 100644 comphelper/inc/comphelper/accessibleeventbuffer.hxx delete mode 100644 comphelper/inc/comphelper/composedprops.hxx delete mode 100644 comphelper/inc/comphelper/otransactedfilestream.hxx delete mode 100644 comphelper/source/misc/accessibleeventbuffer.cxx delete mode 100644 comphelper/source/property/composedprops.cxx delete mode 100644 comphelper/source/streaming/otransactedfilestream.cxx diff --git a/comphelper/Library_comphelp.mk b/comphelper/Library_comphelp.mk index ab67554093a2..23dc13a38781 100644 --- a/comphelper/Library_comphelp.mk +++ b/comphelper/Library_comphelp.mk @@ -70,7 +70,6 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/eventattachermgr/eventattachermgr \ comphelper/source/misc/accessiblecomponenthelper \ comphelper/source/misc/accessiblecontexthelper \ - comphelper/source/misc/accessibleeventbuffer \ comphelper/source/misc/accessibleeventnotifier \ comphelper/source/misc/accessiblekeybindinghelper \ comphelper/source/misc/accessibleselectionhelper \ @@ -126,7 +125,6 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/processfactory/processfactory \ comphelper/source/property/ChainablePropertySet \ comphelper/source/property/ChainablePropertySetInfo \ - comphelper/source/property/composedprops \ comphelper/source/property/genericpropertyset \ comphelper/source/property/MasterPropertySet \ comphelper/source/property/MasterPropertySetInfo \ @@ -145,7 +143,6 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/streaming/basicio \ comphelper/source/streaming/memorystream \ comphelper/source/streaming/oslfile2streamwrap \ - comphelper/source/streaming/otransactedfilestream \ comphelper/source/streaming/seekableinput \ comphelper/source/streaming/seqinputstreamserv \ comphelper/source/streaming/seqoutputstreamserv \ diff --git a/comphelper/Package_inc.mk b/comphelper/Package_inc.mk index df0c6c9b6b9a..87e4a2a8b7b7 100644 --- a/comphelper/Package_inc.mk +++ b/comphelper/Package_inc.mk @@ -43,11 +43,9 @@ $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/scoped_disposing $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/xmltools.hxx,comphelper/xmltools.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/asyncnotification.hxx,comphelper/asyncnotification.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/namedvaluecollection.hxx,comphelper/namedvaluecollection.hxx)) -$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/composedprops.hxx,comphelper/composedprops.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/mediadescriptor.hxx,comphelper/mediadescriptor.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/synchronousdispatch.hxx,comphelper/synchronousdispatch.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessiblecomponenthelper.hxx,comphelper/accessiblecomponenthelper.hxx)) -$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/otransactedfilestream.hxx,comphelper/otransactedfilestream.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propmultiplex.hxx,comphelper/propmultiplex.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/servicehelper.hxx,comphelper/servicehelper.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/servicedecl.hxx,comphelper/servicedecl.hxx)) @@ -63,7 +61,6 @@ $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertystatecon $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertysetinfo.hxx,comphelper/propertysetinfo.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accimplaccess.hxx,comphelper/accimplaccess.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/docpasswordrequest.hxx,comphelper/docpasswordrequest.hxx)) -$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessibleeventbuffer.hxx,comphelper/accessibleeventbuffer.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/regpathhelper.hxx,comphelper/regpathhelper.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/extract.hxx,comphelper/extract.hxx)) $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/interaction.hxx,comphelper/interaction.hxx)) diff --git a/comphelper/inc/comphelper/ChainablePropertySet.hxx b/comphelper/inc/comphelper/ChainablePropertySet.hxx index 1b11005a42c2..913afafea9e8 100644 --- a/comphelper/inc/comphelper/ChainablePropertySet.hxx +++ b/comphelper/inc/comphelper/ChainablePropertySet.hxx @@ -53,12 +53,6 @@ namespace comphelper * _setSingleValue and released after all processing has completed * (including _postSetValues or _postGetValues ) * - * The implementations of getPropertyValues/setPropertyValues call - * lockMutex and _preGetValues/_preSetValues once before calling - * _getSingleValue/_setSingleValue for each property. After each - * property has been dealt with, _postGetValues/_postSetValues - * are called once. - * * Any MasterPropertySet implementations that can include an * implementation of a given ChainablePropertySet must be * declared as a 'friend' in the implementation of the ChainablePropertySet. @@ -76,8 +70,6 @@ namespace comphelper ChainablePropertySetInfo *mpInfo; osl::SolarMutex* mpMutex; ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySetInfo > mxInfo; - void lockMutex(); - void unlockMutex(); virtual void _preSetValues () throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0; diff --git a/comphelper/inc/comphelper/ChainablePropertySetInfo.hxx b/comphelper/inc/comphelper/ChainablePropertySetInfo.hxx index c7e1e88f260e..d419a2f26e64 100644 --- a/comphelper/inc/comphelper/ChainablePropertySetInfo.hxx +++ b/comphelper/inc/comphelper/ChainablePropertySetInfo.hxx @@ -53,8 +53,6 @@ namespace comphelper PropertyInfoHash maMap; com::sun::star::uno::Sequence < com::sun::star::beans::Property > maProperties; public: - ChainablePropertySetInfo() - throw(); ChainablePropertySetInfo( PropertyInfo * pMap ) throw(); diff --git a/comphelper/inc/comphelper/MasterPropertySet.hxx b/comphelper/inc/comphelper/MasterPropertySet.hxx index c5e335d6cf67..6ecf438b6156 100644 --- a/comphelper/inc/comphelper/MasterPropertySet.hxx +++ b/comphelper/inc/comphelper/MasterPropertySet.hxx @@ -73,8 +73,6 @@ namespace comphelper sal_uInt8 mnLastId; SlaveMap maSlaveMap; ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySetInfo > mxInfo; - void lockMutex(); - void unlockMutex(); virtual void _preSetValues () throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0; diff --git a/comphelper/inc/comphelper/MasterPropertySetInfo.hxx b/comphelper/inc/comphelper/MasterPropertySetInfo.hxx index c121289622b0..2ff9c4435e4d 100644 --- a/comphelper/inc/comphelper/MasterPropertySetInfo.hxx +++ b/comphelper/inc/comphelper/MasterPropertySetInfo.hxx @@ -45,8 +45,6 @@ namespace comphelper PropertyDataHash maMap; com::sun::star::uno::Sequence < com::sun::star::beans::Property > maProperties; public: - MasterPropertySetInfo() - throw(); MasterPropertySetInfo( PropertyInfo * pMap ) throw(); virtual ~MasterPropertySetInfo() @@ -55,8 +53,6 @@ namespace comphelper throw(); void add( PropertyInfoHash &rHash, sal_uInt8 nMapId ) throw(); - void remove( const rtl::OUString& aName ) - throw(); // XPropertySetInfo virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties() diff --git a/comphelper/inc/comphelper/accessiblecontexthelper.hxx b/comphelper/inc/comphelper/accessiblecontexthelper.hxx index 310be9321a40..b80805d51776 100644 --- a/comphelper/inc/comphelper/accessiblecontexthelper.hxx +++ b/comphelper/inc/comphelper/accessiblecontexthelper.hxx @@ -227,27 +227,6 @@ namespace comphelper const ::com::sun::star::uno::Any& _rNewValue ); - /** records a certain event so that all AccessibleEventListeners can - be notified later on. - - Can even be called with our mutex locked. - - @param _nEventId - the id of the even. See AccessibleEventType - @param _rOldValue - the old value to be notified - @param _rNewValue - the new value to be notified - @param _rBuffer - the buffer that records the event - */ - virtual void SAL_CALL BufferAccessibleEvent( - const sal_Int16 _nEventId, - const ::com::sun::star::uno::Any& _rOldValue, - const ::com::sun::star::uno::Any& _rNewValue, - AccessibleEventBuffer & _rBuffer - ); - // life time control /// checks whether the object is alive (returns then) or disposed sal_Bool isAlive() const; diff --git a/comphelper/inc/comphelper/accessibleeventbuffer.hxx b/comphelper/inc/comphelper/accessibleeventbuffer.hxx deleted file mode 100644 index 3819651569d7..000000000000 --- a/comphelper/inc/comphelper/accessibleeventbuffer.hxx +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#if !defined INCLUDED_COMPHELPER_ACCESSIBLEEVENTBUFFER_HXX -#define INCLUDED_COMPHELPER_ACCESSIBLEEVENTBUFFER_HXX - -#include "com/sun/star/uno/Reference.hxx" -#include "com/sun/star/uno/Sequence.hxx" - -#include - -namespace com { namespace sun { namespace star { namespace uno { - class XInterface; -} } } } -namespace com { namespace sun { namespace star { - namespace accessibility { struct AccessibleEventObject; } -} } } - -namespace comphelper { - -/** - A buffer for AccessibleEventObjects about to be sent to - XAccessibleEventListeners. - - This buffer records pairs of AccessibleEventObjects and sequences of - XAccessibleEventListeners. At a time when it is safe to do so (e.g., when - no critical mutexes are held), all events can be notified at once. - - This class is not thread-safe in itself, but it is thread-compatible (i.e., - all multi-threaded uses of instances of this class have to ensure proper - mutual exclusion). - */ -class AccessibleEventBuffer -{ -public: - /** - Create an initially empty buffer. - - Internally uses ::std::vector and thus may throw exceptions thrown by - operations on ::std::vector, especially ::std::bad_alloc. - */ - AccessibleEventBuffer(); - - /** - Create a buffer with a copy of another buffer. - - The events from the other buffer are copied, not shared. - - Internally uses ::std::vector and thus may throw exceptions thrown by - operations on ::std::vector, especially ::std::bad_alloc. - */ - AccessibleEventBuffer(AccessibleEventBuffer const & rOther); - - /** - Destroy the buffer. - - If the buffer contains any events that have not yet been sent, those - events are lost. - - Does not throw any exceptions. - */ - ~AccessibleEventBuffer(); - - /** - Copy another buffer into this buffer. - - If this buffer contained any events that had not yet been sent, those - events are lost. The events from the other buffer are copied, not - shared. - - Internally uses ::std::vector and thus may throw exceptions thrown by - operations on ::std::vector, especially ::std::bad_alloc. - */ - AccessibleEventBuffer operator =(AccessibleEventBuffer const & rOther); - - /** - Add an event to the buffer. - - Internally uses ::std::vector and thus may throw exceptions thrown by - operations on ::std::vector, especially ::std::bad_alloc. - */ - void addEvent( - ::com::sun::star::accessibility::AccessibleEventObject const & - rEvent, - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface > > const & rListeners); - - /** - Sends all the events accumulated in the buffer. - - If sending any of the events to a specific XAccessibleListener fails with - a RuntimeException, that exception is ignored and the method carries on - with the rest of the notifications. - - After sending all events, the buffer is cleared. - */ - void sendEvents() const; - -private: - struct Entry; - - typedef ::std::vector< Entry > Entries; - - Entries m_aEntries; -}; - -} - -#endif // INCLUDED_COMPHELPER_ACCESSIBLEEVENTBUFFER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/inc/comphelper/attributelist.hxx b/comphelper/inc/comphelper/attributelist.hxx index d34b32f00ac6..ed5e3972dbf7 100644 --- a/comphelper/inc/comphelper/attributelist.hxx +++ b/comphelper/inc/comphelper/attributelist.hxx @@ -52,8 +52,6 @@ public: // methods that are not contained in any interface void AddAttribute( const ::rtl::OUString &sName , const ::rtl::OUString &sType , const ::rtl::OUString &sValue ); void Clear(); - void RemoveAttribute( const ::rtl::OUString sName ); - void SetAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); void AppendAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); // ::com::sun::star::xml::sax::XAttributeList diff --git a/comphelper/inc/comphelper/composedprops.hxx b/comphelper/inc/comphelper/composedprops.hxx deleted file mode 100644 index 74a9cf30acd1..000000000000 --- a/comphelper/inc/comphelper/composedprops.hxx +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _COMPHELPER_COMPOSEDPROPS_HXX_ -#define _COMPHELPER_COMPOSEDPROPS_HXX_ - -#include -#include -#include -#include -#include -#include -#include -#include "comphelper/comphelperdllapi.h" - -//......................................................................... -namespace comphelper -{ -//......................................................................... - //===================================================================== - //= IPropertySetComposerCallback - //===================================================================== - class IPropertySetComposerCallback - { - public: - /** determines whether or not a property should appear in the composed property set - @param _rPropertyName - the name of the property - */ - virtual sal_Bool isComposeable(const ::rtl::OUString& _rPropertyName) const = 0; - }; - - //===================================================================== - //= OComposedPropertySet - //===================================================================== - class OComposedPropertySetInfo; - typedef ::cppu::WeakImplHelper2 < ::com::sun::star::beans::XPropertySet - , ::com::sun::star::beans::XPropertyState - > OComposedPropertySet_Base; - /** helper class for composing a property set from a sequence of other property sets. -

First: This class is a fast shot, so don't sue me :) (To be honest, it's the migration of an old ugly - implementation. It's still ugly).

-

The property listener mechanisms are not supported (you can't add property listeners).

-

Speaking strictly, the property defaults (getPropertyDefault) do not work correctly, as there's always - an empty Any returned.

- */ - class COMPHELPER_DLLPUBLIC OComposedPropertySet : public OComposedPropertySet_Base - { - private: - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > - m_aProperties; - OComposedPropertySetInfo* m_pInfo; - - protected: - ::osl::Mutex m_aMutex; - DECLARE_STL_VECTOR(::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>, PropertySetArray); - PropertySetArray m_aSingleSets; - - public: - /** constructs a composed property set - - @param _rElements - the single property sets to compose -

The first property set in the sequence is the master set, any properties not present here - are not present in the composed set.
- This may change in the future (as it's just missing implementation), so don't rely on this behaviour.

- - @param _pPropertyMetaData - the callback for retrieving property meta data (namely composeability)
- if not specified, all properties are assumed to be composable - */ - OComposedPropertySet( - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> > & _rElements, - const IPropertySetComposerCallback* _pPropertyMetaData = NULL - ); - - // XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - 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 ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - protected: - ~OComposedPropertySet(); - void compose(const IPropertySetComposerCallback* _pMetaData); - }; - -//......................................................................... -} // namespace comphelper -//......................................................................... - -#endif // _COMPHELPER_COMPOSEDPROPS_HXX_ - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/inc/comphelper/docpasswordhelper.hxx b/comphelper/inc/comphelper/docpasswordhelper.hxx index 51c44d821def..68ebcfe2e58b 100644 --- a/comphelper/inc/comphelper/docpasswordhelper.hxx +++ b/comphelper/inc/comphelper/docpasswordhelper.hxx @@ -164,21 +164,6 @@ public: // ------------------------------------------------------------------------ - /** This helper function generates the hash code based on the algorithm - specified by MS for "Password to modify" feature of Word. - - @param aString - The string for which the hash should be calculated - - @return - The hash represented by sequence of bytes in BigEndian form - */ - - static ::com::sun::star::uno::Sequence< sal_Int8 > GetWordHashAsSequence( - const ::rtl::OUString& aString ); - - // ------------------------------------------------------------------------ - /** This helper function generates the hash code based on the algorithm specified by MS for "Password to modify" and passwords related to table protection of Excel. diff --git a/comphelper/inc/comphelper/docpasswordrequest.hxx b/comphelper/inc/comphelper/docpasswordrequest.hxx index 2d42dcf453c8..2427b50863e3 100644 --- a/comphelper/inc/comphelper/docpasswordrequest.hxx +++ b/comphelper/inc/comphelper/docpasswordrequest.hxx @@ -65,7 +65,6 @@ public: virtual void SAL_CALL acquire( ) throw (); virtual void SAL_CALL release( ) throw (); - sal_Bool isAbort() const; sal_Bool isPassword() const; ::rtl::OUString getPassword() const; @@ -104,7 +103,6 @@ public: virtual void SAL_CALL acquire( ) throw (); virtual void SAL_CALL release( ) throw (); - sal_Bool isAbort() const; sal_Bool isPassword() const; ::rtl::OUString getPassword() const; diff --git a/comphelper/inc/comphelper/otransactedfilestream.hxx b/comphelper/inc/comphelper/otransactedfilestream.hxx deleted file mode 100644 index 248aa22f02eb..000000000000 --- a/comphelper/inc/comphelper/otransactedfilestream.hxx +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _COMPHELPER_OTRANSACTEDFILESTREAM_HXX -#define _COMPHELPER_OTRANSACTEDFILESTREAM_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "comphelper/comphelperdllapi.h" - -namespace comphelper -{ - - -//================================================================== -// OTransactedFileStream -// allows to get transacted stream access to a file -// the file contents are automatically truncated, but the file -// itself is changed only on commit -// after the first commit the stream switches to direct mode -//================================================================== - -struct TTFileStreamData_Impl; -class COMPHELPER_DLLPUBLIC OTruncatedTransactedFileStream - : public ::cppu::WeakImplHelper7 < - ::com::sun::star::io::XStream, - ::com::sun::star::io::XInputStream, - ::com::sun::star::io::XOutputStream, - ::com::sun::star::io::XTruncate, - ::com::sun::star::io::XSeekable, - ::com::sun::star::beans::XPropertySetInfo, - ::com::sun::star::beans::XPropertySet > -{ - ::osl::Mutex m_aMutex; - TTFileStreamData_Impl* m_pStreamData; - - void CommonInit_Impl( - const ::rtl::OUString& aURL, - const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, - sal_Bool bDeleteOptionIsProvided ); - - void CloseAll_Impl(); - -public: - - OTruncatedTransactedFileStream( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); - - OTruncatedTransactedFileStream( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); - - OTruncatedTransactedFileStream( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, sal_Bool bDeleteIfNotCommited ); - - ~OTruncatedTransactedFileStream(); - - void Commit_Impl(); - void Revert_Impl(); - -// com::sun::star::io::XStream - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException); - -// com::sun::star::io::XInputStream - virtual ::sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -// com::sun::star::io::XOutputStream - virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL flush( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeOutput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -// com::sun::star::io::XTruncate - virtual void SAL_CALL truncate( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -// com::sun::star::io::XSeekable - virtual void SAL_CALL seek( ::sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - -// ::com::sun::star::beans::XPropertySetInfo - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const ::rtl::OUString& aName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL hasPropertyByName( const ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException); - -// com::sun::star::beans::XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); - 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 ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - -}; - -} // namespace comphelper - -#endif //_COMPHELPER_OTRANSACTEDFILESTREAM_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/source/misc/accessiblecontexthelper.cxx b/comphelper/source/misc/accessiblecontexthelper.cxx index fb89a0bf86a9..4d2a7d9ebf9f 100644 --- a/comphelper/source/misc/accessiblecontexthelper.cxx +++ b/comphelper/source/misc/accessiblecontexthelper.cxx @@ -29,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_comphelper.hxx" #include -#include #include #include #include @@ -214,35 +213,6 @@ namespace comphelper AccessibleEventNotifier::addEvent( m_pImpl->getClientId( ), aEvent ); } - //--------------------------------------------------------------------- - void SAL_CALL OAccessibleContextHelper::BufferAccessibleEvent( const sal_Int16 _nEventId, - const Any& _rOldValue, const Any& _rNewValue, - AccessibleEventBuffer & _rBuffer ) - { - // TODO: this whole method (as well as the class AccessibleEventBuffer) should be removed - // The reasons why they have been introduces id that we needed to collect a set of events - // before notifying them alltogether (after releasing our mutex). With the other - // NotifyAccessibleEvent being asynchronous now, this should not be necessary anymore - // - clients could use the other version now. - - // copy our current listeners - Sequence< Reference< XInterface > > aListeners; - if ( m_pImpl->getClientId( ) ) - aListeners = AccessibleEventNotifier::getEventListeners( m_pImpl->getClientId( ) ); - - if ( aListeners.getLength() ) - { - AccessibleEventObject aEvent; - aEvent.Source = *this; - OSL_ENSURE( aEvent.Source.is(), "OAccessibleContextHelper::BufferAccessibleEvent: invalid creator!" ); - aEvent.EventId = _nEventId; - aEvent.OldValue = _rOldValue; - aEvent.NewValue = _rNewValue; - - _rBuffer.addEvent( aEvent, aListeners ); - } - } - //--------------------------------------------------------------------- sal_Bool OAccessibleContextHelper::isAlive() const { diff --git a/comphelper/source/misc/accessibleeventbuffer.cxx b/comphelper/source/misc/accessibleeventbuffer.cxx deleted file mode 100644 index 4137f91853f7..000000000000 --- a/comphelper/source/misc/accessibleeventbuffer.cxx +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_comphelper.hxx" - -#include "comphelper/accessibleeventbuffer.hxx" - -#include "com/sun/star/uno/Reference.hxx" -#include "com/sun/star/uno/RuntimeException.hpp" -#include "com/sun/star/uno/Sequence.hxx" -#include "com/sun/star/uno/XInterface.hpp" -#include "com/sun/star/accessibility/AccessibleEventObject.hpp" -#include "com/sun/star/accessibility/XAccessibleEventListener.hpp" -#include "osl/diagnose.h" -#include "rtl/textenc.h" -#include "rtl/ustring.hxx" -#include "sal/types.h" - -namespace css = ::com::sun::star; - -using comphelper::AccessibleEventBuffer; - -struct AccessibleEventBuffer::Entry -{ - inline Entry(::css::accessibility::AccessibleEventObject const & rEvent, - ::css::uno::Sequence< ::css::uno::Reference< - ::css::uno::XInterface > > const & rListeners): - m_aEvent(rEvent), m_aListeners(rListeners) {} - - ::css::accessibility::AccessibleEventObject m_aEvent; - - ::css::uno::Sequence< - ::css::uno::Reference< ::css::uno::XInterface > > m_aListeners; -}; - -AccessibleEventBuffer::AccessibleEventBuffer() -{} - -AccessibleEventBuffer::AccessibleEventBuffer( - AccessibleEventBuffer const & rOther): - m_aEntries(rOther.m_aEntries) -{} - -AccessibleEventBuffer::~AccessibleEventBuffer() -{} - -AccessibleEventBuffer -AccessibleEventBuffer::operator =(AccessibleEventBuffer const & rOther) -{ - m_aEntries = rOther.m_aEntries; - return *this; -} - -void AccessibleEventBuffer::addEvent( - ::css::accessibility::AccessibleEventObject const & rEvent, - ::css::uno::Sequence< ::css::uno::Reference< ::css::uno::XInterface > > - const & rListeners) -{ - m_aEntries.push_back(Entry(rEvent, rListeners)); -} - -void AccessibleEventBuffer::sendEvents() const -{ - for (Entries::const_iterator aIt(m_aEntries.begin()); - aIt != m_aEntries.end(); ++aIt) - for (::sal_Int32 i = 0; i < aIt->m_aListeners.getLength(); ++i) - { - ::css::uno::Reference< - ::css::accessibility::XAccessibleEventListener > xListener( - aIt->m_aListeners[i], ::css::uno::UNO_QUERY); - if (xListener.is()) - try - { - xListener->notifyEvent(aIt->m_aEvent); - } - catch (::css::uno::RuntimeException & rEx) - { - OSL_TRACE( - "comphelper::AccessibleEventBuffer::sendEvents:" - " caught %s\n", - ::rtl::OUStringToOString( - rEx.Message, RTL_TEXTENCODING_UTF8).getStr()); - } - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 36cb3cd15aff..2871a1180c5c 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -220,20 +220,6 @@ sal_uInt32 DocPasswordHelper::GetWordHashAsUINT32( return nResult; } -// ============================================================================ -Sequence< sal_Int8 > DocPasswordHelper::GetWordHashAsSequence( - const ::rtl::OUString& aUString ) -{ - sal_uInt32 nHash = GetWordHashAsUINT32( aUString ); - Sequence< sal_Int8 > aResult( 4 ); - aResult[0] = ( nHash >> 24 ); - aResult[1] = ( ( nHash >> 16 ) & 0xFF ); - aResult[2] = ( ( nHash >> 8 ) & 0xFF ); - aResult[3] = ( nHash & 0xFF ); - - return aResult; -} - // ============================================================================ sal_uInt16 DocPasswordHelper::GetXLHashAsUINT16( const ::rtl::OUString& aUString, diff --git a/comphelper/source/misc/docpasswordrequest.cxx b/comphelper/source/misc/docpasswordrequest.cxx index ec9cf0ca21ed..fc1fe8a2ba7d 100644 --- a/comphelper/source/misc/docpasswordrequest.cxx +++ b/comphelper/source/misc/docpasswordrequest.cxx @@ -138,11 +138,6 @@ void SAL_CALL SimplePasswordRequest::release( ) throw () OWeakObject::release(); } -sal_Bool SimplePasswordRequest::isAbort() const -{ - return mpAbort->isSelected(); -} - sal_Bool SimplePasswordRequest::isPassword() const { return mpPassword->isSelected(); @@ -219,11 +214,6 @@ void SAL_CALL DocPasswordRequest::release( ) throw () OWeakObject::release(); } -sal_Bool DocPasswordRequest::isAbort() const -{ - return mpAbort->isSelected(); -} - sal_Bool DocPasswordRequest::isPassword() const { return mpPassword->isSelected(); diff --git a/comphelper/source/property/ChainablePropertySet.cxx b/comphelper/source/property/ChainablePropertySet.cxx index 2519b8f5edb8..1cde57a7783b 100644 --- a/comphelper/source/property/ChainablePropertySet.cxx +++ b/comphelper/source/property/ChainablePropertySet.cxx @@ -62,18 +62,6 @@ Reference< XPropertySetInfo > SAL_CALL ChainablePropertySet::getPropertySetInfo( return mxInfo; } -void ChainablePropertySet::lockMutex() -{ - if (mpMutex) - mpMutex->acquire(); -} - -void ChainablePropertySet::unlockMutex() -{ - if (mpMutex) - mpMutex->release(); -} - void SAL_CALL ChainablePropertySet::setPropertyValue( const ::rtl::OUString& rPropertyName, const Any& rValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { diff --git a/comphelper/source/property/ChainablePropertySetInfo.cxx b/comphelper/source/property/ChainablePropertySetInfo.cxx index 0f53c6d0260b..9e4b41f140cb 100644 --- a/comphelper/source/property/ChainablePropertySetInfo.cxx +++ b/comphelper/source/property/ChainablePropertySetInfo.cxx @@ -45,11 +45,6 @@ using ::com::sun::star::beans::Property; using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::beans::UnknownPropertyException; -ChainablePropertySetInfo::ChainablePropertySetInfo() - throw() -{ -} - ChainablePropertySetInfo::ChainablePropertySetInfo( PropertyInfo* pMap ) throw() { diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx index fa44c874adf7..c1187583810a 100644 --- a/comphelper/source/property/MasterPropertySet.cxx +++ b/comphelper/source/property/MasterPropertySet.cxx @@ -90,17 +90,6 @@ MasterPropertySet::MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, { } -void MasterPropertySet::lockMutex() -{ - if (mpMutex) - mpMutex->acquire(); -} -void MasterPropertySet::unlockMutex() -{ - if (mpMutex) - mpMutex->release(); -} - MasterPropertySet::~MasterPropertySet() throw() { diff --git a/comphelper/source/property/MasterPropertySetInfo.cxx b/comphelper/source/property/MasterPropertySetInfo.cxx index 46dffe062c03..9a29a29169d6 100644 --- a/comphelper/source/property/MasterPropertySetInfo.cxx +++ b/comphelper/source/property/MasterPropertySetInfo.cxx @@ -45,11 +45,6 @@ using ::com::sun::star::beans::Property; using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::beans::UnknownPropertyException; -MasterPropertySetInfo::MasterPropertySetInfo() - throw() -{ -} - MasterPropertySetInfo::MasterPropertySetInfo( PropertyInfo* pMap ) throw() { @@ -108,14 +103,6 @@ void MasterPropertySetInfo::add( PropertyInfoHash &rHash, sal_uInt8 nMapId ) } } -void MasterPropertySetInfo::remove( const rtl::OUString& aName ) - throw() -{ - maMap.erase ( aName ); - if ( maProperties.getLength() ) - maProperties.realloc( 0 ); -} - Sequence< ::Property > SAL_CALL MasterPropertySetInfo::getProperties() throw(::com::sun::star::uno::RuntimeException) { diff --git a/comphelper/source/property/composedprops.cxx b/comphelper/source/property/composedprops.cxx deleted file mode 100644 index aa864f7ca47f..000000000000 --- a/comphelper/source/property/composedprops.cxx +++ /dev/null @@ -1,359 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_comphelper.hxx" -#include -#include -#include -#include - -//......................................................................... -namespace comphelper -{ -//......................................................................... - - using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::lang; - - //===================================================================== - //= OComposedPropertySetInfo - //===================================================================== - class OComposedPropertySetInfo : public ::cppu::WeakImplHelper1< XPropertySetInfo > - { - private: - Sequence< Property> m_aProperties; - - public: - OComposedPropertySetInfo(const Sequence< Property>& _rProperties); - - virtual Sequence< Property > SAL_CALL getProperties( ) throw(RuntimeException); - virtual Property SAL_CALL getPropertyByName( const ::rtl::OUString& _rName ) throw(UnknownPropertyException, RuntimeException); - virtual sal_Bool SAL_CALL hasPropertyByName( const ::rtl::OUString& _rName ) throw(RuntimeException); - }; - - //===================================================================== - //= OComposedPropertySet - //===================================================================== - //--------------------------------------------------------------------- - OComposedPropertySet::OComposedPropertySet( - const Sequence< Reference< XPropertySet> > & _rElements, - const IPropertySetComposerCallback* _pPropertyMetaData) - :m_pInfo(NULL) - { - // copy the sequence - sal_Int32 nSingleSets = _rElements.getLength(); - if (nSingleSets) - { - m_aSingleSets.resize(nSingleSets); - const Reference< XPropertySet >* pSingleSets = _rElements.getConstArray(); - ::std::copy(pSingleSets, pSingleSets + nSingleSets, m_aSingleSets.begin()); - } - - // impl ctor - compose(_pPropertyMetaData); - } - - //--------------------------------------------------------------------- - OComposedPropertySet::~OComposedPropertySet() - { - if (m_pInfo) - m_pInfo->release(); - } - - //--------------------------------------------------------------------- - void OComposedPropertySet::compose(const IPropertySetComposerCallback* _pMetaData) - { - sal_Int32 nSingleSets = m_aSingleSets.size(); - - if (nSingleSets>0) - { - // get the properties of the first set - Reference< XPropertySet > xMasterSet = m_aSingleSets[0]; - Sequence< Property> aMasterProps; - if (xMasterSet.is()) - aMasterProps = xMasterSet->getPropertySetInfo()->getProperties(); - sal_Int32 nMasterPropsCount = aMasterProps.getLength(); - const Property* pMasterProps = aMasterProps.getConstArray(); - - // check which of the master properties should be included - Sequence aInclusionFlags(nMasterPropsCount); - sal_Bool* pInclusionFlags = aInclusionFlags.getArray(); - - // the states of all these properties - Sequence< PropertyState > aPropertyStates(nMasterPropsCount); - - for (sal_Int32 i=0; i xSecondarySet; - sal_Int32 nSecondaryPropertyCount; - Sequence< Property > aSecondaryProperties; - const Property* pPrimaryProperty = aMasterProps.getConstArray(); - for (sal_Int32 nPrimary=0; nPrimaryisComposeable(pPrimaryProperty->Name)) - // do not include this property - pInclusionFlags[nPrimary] = sal_False; - else - { - // search the property in all secondary sets - for (sal_Int32 i=1; igetPropertySetInfo()->getProperties(); - nSecondaryPropertyCount = aSecondaryProperties.getLength(); - const Property* pSecondaryProperties = aSecondaryProperties.getConstArray(); - - // search the current primary property in the secondary property sequence - sal_Int32 k=0; - while (kName)) - ++k; - - if (k >= nSecondaryPropertyCount) - // not found -> do not include - pInclusionFlags[nPrimary] = sal_False; - } - } - } - - // count what's left .... - sal_Int32 nOverallProperties = 0; - for (sal_Int32 nCounter=0; nCounter(nOverallProperties); - Property* pProperties = m_aProperties.getArray(); - const Property* pMasterProperties = pMasterProps; - sal_Int32 nOwnProperties = 0; - for (sal_Int32 nCopy = 0; nCopy < nMasterPropsCount; ++nCopy, ++pMasterProperties) - { - if (pInclusionFlags[nCopy]) - pProperties[nOwnProperties++] = *pMasterProperties; - } - } - } - - //------------------------------------------------------------------------------ - Reference< XPropertySetInfo > SAL_CALL OComposedPropertySet::getPropertySetInfo( ) throw(RuntimeException) - { - ::osl::MutexGuard aGuard(m_aMutex); - if (!m_pInfo) - { - m_pInfo = new OComposedPropertySetInfo(m_aProperties); - m_pInfo->acquire(); - } - return m_pInfo; - } - - //------------------------------------------------------------------------------ - PropertyState SAL_CALL OComposedPropertySet::getPropertyState( const ::rtl::OUString& _rPropertyName ) throw(UnknownPropertyException, RuntimeException) - { - // assume DIRECT for the moment - PropertyState eState = PropertyState_DIRECT_VALUE; - - sal_Int32 nSingleSets = m_aSingleSets.size(); - if (nSingleSets>0) - { - // check the master state - Reference< XPropertySet > xMasterSet(m_aSingleSets[0]); - Any aPrimaryValue; - if (xMasterSet.is()) - { - Reference< XPropertyState > xMasterState(xMasterSet,UNO_QUERY); - aPrimaryValue = xMasterSet->getPropertyValue(_rPropertyName); - - if (xMasterState.is()) - eState = xMasterState->getPropertyState(_rPropertyName); - } - - // loop through the secondary sets - PropertyState eSecondaryState; - for (sal_Int32 i=1; i xSecondary(m_aSingleSets[i]); - Reference< XPropertyState > xSecondaryState(xSecondary, UNO_QUERY); - - // the secondary state - eSecondaryState = PropertyState_DIRECT_VALUE; - if(xSecondaryState.is()) - eSecondaryState = xSecondaryState->getPropertyState(_rPropertyName); - - // the secondary value - Any aSecondaryValue(xSecondary->getPropertyValue(_rPropertyName)); - - if ( (PropertyState_AMBIGUOUS_VALUE == eSecondaryState) // secondary is ambiguous - || !::comphelper::compare(aPrimaryValue, aSecondaryValue) // unequal values - ) - { - eState = PropertyState_AMBIGUOUS_VALUE; - break; - } - } - } - else - { - throw UnknownPropertyException( _rPropertyName, *this ); - } - - return eState; - } - - //--------------------------------------------------------------------- - Sequence< PropertyState > SAL_CALL OComposedPropertySet::getPropertyStates( const Sequence< ::rtl::OUString >& _rPropertyName ) throw(UnknownPropertyException, RuntimeException) - { - sal_Int32 nCount = _rPropertyName.getLength(); - Sequence< PropertyState > aReturn(nCount); - const ::rtl::OUString* pNames = _rPropertyName.getConstArray(); - PropertyState* pStates = aReturn.getArray(); - for (sal_Int32 i=0; i xState(m_aSingleSets[i], UNO_QUERY); - if(xState.is()) - xState->setPropertyToDefault(_rPropertyName); - } - } - - //--------------------------------------------------------------------- - Any SAL_CALL OComposedPropertySet::getPropertyDefault( const ::rtl::OUString& ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) - { - return Any(); - } - - //------------------------------------------------------------------------------ - void SAL_CALL OComposedPropertySet::setPropertyValue( const ::rtl::OUString& _rPropertyName, const Any& _rValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) - { - sal_Int32 nSingleSets = m_aSingleSets.size(); - for (sal_Int32 i=0; isetPropertyValue(_rPropertyName, _rValue); - } - } - - //------------------------------------------------------------------------------ - Any SAL_CALL OComposedPropertySet::getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) - { - sal_Int32 nSingleSets = m_aSingleSets.size(); - - if ((nSingleSets>0) && (m_aSingleSets[0].is())) - return m_aSingleSets[0]->getPropertyValue(_rPropertyName); - return Any(); - } - - //------------------------------------------------------------------------------ - void SAL_CALL OComposedPropertySet::addPropertyChangeListener( const ::rtl::OUString&, const Reference< XPropertyChangeListener >& ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) - { - // TODO: - // hold the single property sets weak - // be a property change listener on all single property sets (for all composed properties) - // upon property change - // determine the new state/value of the composed property - // broadcast the new composed property value - } - - //------------------------------------------------------------------------------ - void SAL_CALL OComposedPropertySet::removePropertyChangeListener( const ::rtl::OUString&, const Reference< XPropertyChangeListener >& ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) - { - // TODO - } - - //------------------------------------------------------------------------------ - void SAL_CALL OComposedPropertySet::addVetoableChangeListener( const ::rtl::OUString&, const Reference< XVetoableChangeListener >& ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) - { - OSL_FAIL("OComposedPropertySet::addVetoableChangeListener: no implemented (yet)!"); - } - - //------------------------------------------------------------------------------ - void SAL_CALL OComposedPropertySet::removeVetoableChangeListener( const ::rtl::OUString&, const Reference< XVetoableChangeListener >& ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) - { - OSL_FAIL("OComposedPropertySet::removeVetoableChangeListener: no implemented (yet)!"); - } - - //------------------------------------------------------------------------------ - OComposedPropertySetInfo::OComposedPropertySetInfo(const Sequence< Property>& rSeq) - :m_aProperties(rSeq) - { - } - - //------------------------------------------------------------------------------ - Sequence< Property> SAL_CALL OComposedPropertySetInfo::getProperties() throw(RuntimeException) - { - return m_aProperties; - } - - //------------------------------------------------------------------------------ - Property SAL_CALL OComposedPropertySetInfo::getPropertyByName( const ::rtl::OUString& _rName ) throw(UnknownPropertyException, RuntimeException) - { - sal_Int32 nLength = m_aProperties.getLength(); - const Property* pProps = m_aProperties.getConstArray(); - // TODO TODO TODO: this O(n) search really sucks ... - for (sal_Int32 i=0; iName == _rName) - return *pProps; - } - - throw UnknownPropertyException( _rName, *this ); - } - - //------------------------------------------------------------------------------ - sal_Bool SAL_CALL OComposedPropertySetInfo::hasPropertyByName( const ::rtl::OUString& _rName ) throw(RuntimeException) - { - sal_Int32 nLength = m_aProperties.getLength(); - const Property* pProps = m_aProperties.getConstArray(); - // TODO TODO TODO: this O(n) search really sucks ... - for( sal_Int32 i=0; iName == _rName) - return sal_True; - } - - return sal_False; - } - -//......................................................................... -} // namespace comphelper -//......................................................................... - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/source/streaming/otransactedfilestream.cxx b/comphelper/source/streaming/otransactedfilestream.cxx deleted file mode 100644 index 9bcfac5fb66b..000000000000 --- a/comphelper/source/streaming/otransactedfilestream.cxx +++ /dev/null @@ -1,826 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_comphelper.hxx" -#include -#include -#include -#include - -#include -#include -#include - -using namespace ::com::sun::star; - -namespace comphelper -{ - -// ======================================================================== -class OTransactionHelper : public ::cppu::WeakImplHelper1 < embed::XTransactedObject > -{ - OTruncatedTransactedFileStream* m_pFileStream; - uno::Reference< io::XStream > m_xStreamHolder; - -public: - OTransactionHelper( OTruncatedTransactedFileStream* pStream ) - : m_pFileStream( pStream ) - { - m_xStreamHolder = static_cast< io::XStream* >( pStream ); - if ( !m_xStreamHolder.is() ) - throw uno::RuntimeException(); - } - - virtual void SAL_CALL commit( ) throw (io::IOException, lang::WrappedTargetException, uno::RuntimeException); - virtual void SAL_CALL revert( ) throw (io::IOException, lang::WrappedTargetException, uno::RuntimeException); -}; - -// ------------------------------------------------------------------------ -void SAL_CALL OTransactionHelper::commit( ) throw (io::IOException, lang::WrappedTargetException, uno::RuntimeException) -{ - m_pFileStream->Commit_Impl(); -} - -// ------------------------------------------------------------------------ -void SAL_CALL OTransactionHelper::revert( ) throw (io::IOException, lang::WrappedTargetException, uno::RuntimeException) -{ - m_pFileStream->Revert_Impl(); -} - -// ======================================================================== -struct TTFileStreamData_Impl -{ - uno::Reference< ucb::XSimpleFileAccess > m_xFileAccess; - sal_Bool m_bDelete; - ::rtl::OUString m_aURL; - - // the streams below are not visible from outside so there is no need to remember position - - // original stream related members - uno::Reference< io::XStream > m_xOrigStream; - uno::Reference< io::XTruncate > m_xOrigTruncate; - uno::Reference< io::XSeekable > m_xOrigSeekable; - uno::Reference< io::XInputStream > m_xOrigInStream; - uno::Reference< io::XOutputStream > m_xOrigOutStream; - - // temporary stream related members - uno::Reference< io::XStream > m_xTempStream; - uno::Reference< io::XTruncate > m_xTempTruncate; - uno::Reference< io::XSeekable > m_xTempSeekable; - uno::Reference< io::XInputStream > m_xTempInStream; - uno::Reference< io::XOutputStream > m_xTempOutStream; - - sal_Bool m_bInOpen; - sal_Bool m_bOutOpen; - - sal_Bool m_bTransacted; - - - TTFileStreamData_Impl( - const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess, - sal_Bool bDelete, - const ::rtl::OUString& aURL, - const uno::Reference< io::XStream >& xOrigStream, - const uno::Reference< io::XTruncate >& xOrigTruncate, - const uno::Reference< io::XSeekable >& xOrigSeekable, - const uno::Reference< io::XInputStream >& xOrigInStream, - const uno::Reference< io::XOutputStream >& xOrigOutStream, - const uno::Reference< io::XStream >& xTempStream, - const uno::Reference< io::XTruncate >& xTempTruncate, - const uno::Reference< io::XSeekable >& xTempSeekable, - const uno::Reference< io::XInputStream >& xTempInStream, - const uno::Reference< io::XOutputStream >& xTempOutStream ) - : m_xFileAccess( xFileAccess ) - , m_bDelete( bDelete ) - , m_aURL( aURL ) - , m_xOrigStream( xOrigStream ) - , m_xOrigTruncate( xOrigTruncate ) - , m_xOrigSeekable( xOrigSeekable ) - , m_xOrigInStream( xOrigInStream ) - , m_xOrigOutStream( xOrigOutStream ) - , m_xTempStream( xTempStream ) - , m_xTempTruncate( xTempTruncate ) - , m_xTempSeekable( xTempSeekable ) - , m_xTempInStream( xTempInStream ) - , m_xTempOutStream( xTempOutStream ) - , m_bInOpen( sal_False ) - , m_bOutOpen( sal_False ) - , m_bTransacted( sal_True ) - {} - - void NoTransaction() - { - m_bDelete = sal_False; - m_bTransacted = sal_False; - m_xTempStream = uno::Reference< io::XStream >(); - m_xTempTruncate = uno::Reference< io::XTruncate >(); - m_xTempSeekable = uno::Reference< io::XSeekable >(); - m_xTempInStream = uno::Reference< io::XInputStream >(); - m_xTempOutStream = uno::Reference< io::XOutputStream >(); - } - - void FreeOriginal() - { - m_bDelete = sal_False; - m_bTransacted = sal_False; - - m_xOrigStream = m_xTempStream; - m_xTempStream = uno::Reference< io::XStream >(); - - m_xOrigTruncate = m_xTempTruncate; - m_xTempTruncate = uno::Reference< io::XTruncate >(); - - m_xOrigSeekable = m_xTempSeekable; - m_xTempSeekable = uno::Reference< io::XSeekable >(); - - m_xOrigInStream = m_xTempInStream; - m_xTempInStream = uno::Reference< io::XInputStream >(); - - m_xOrigOutStream = m_xTempOutStream; - m_xTempOutStream = uno::Reference< io::XOutputStream >(); - } -}; - -// ======================================================================== -// ------------------------------------------------------------------------ -OTruncatedTransactedFileStream::OTruncatedTransactedFileStream( - const ::rtl::OUString& aURL, - const uno::Reference< lang::XMultiServiceFactory >& xFactory ) -: m_pStreamData( NULL ) -{ - uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess( - xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) ) ), - uno::UNO_QUERY_THROW ); - - CommonInit_Impl( aURL, xSimpleFileAccess, xFactory, sal_False ); -} - -// ------------------------------------------------------------------------ -OTruncatedTransactedFileStream::OTruncatedTransactedFileStream( - const ::rtl::OUString& aURL, - const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess, - const uno::Reference< lang::XMultiServiceFactory >& xFactory ) -: m_pStreamData( NULL ) -{ - CommonInit_Impl( aURL, xFileAccess, xFactory, sal_False ); -} - -// ------------------------------------------------------------------------ -OTruncatedTransactedFileStream::OTruncatedTransactedFileStream( - const ::rtl::OUString& aURL, - const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess, - const uno::Reference< lang::XMultiServiceFactory >& xFactory, - sal_Bool bDeleteIfNotCommited ) -: m_pStreamData( NULL ) -{ - CommonInit_Impl( aURL, xFileAccess, xFactory, sal_True ); - if ( m_pStreamData ) - m_pStreamData->m_bDelete = bDeleteIfNotCommited; -} - -// ------------------------------------------------------------------------ -OTruncatedTransactedFileStream::~OTruncatedTransactedFileStream() -{ - CloseAll_Impl(); -} - -// ------------------------------------------------------------------------ -void OTruncatedTransactedFileStream::CloseAll_Impl() -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( m_pStreamData ) - { - sal_Bool bDelete = m_pStreamData->m_bDelete; - ::rtl::OUString aURL = m_pStreamData->m_aURL; - uno::Reference< ucb::XSimpleFileAccess > xFileAccess = m_pStreamData->m_xFileAccess; - - delete m_pStreamData; - m_pStreamData = NULL; - - if ( bDelete && xFileAccess.is() && aURL.getLength() ) - { - // delete the file - try - { - xFileAccess->kill( aURL ); - } catch( uno::Exception& ) - { - OSL_FAIL( "Could not remove the file!" ); - } - } - } -} - -// ------------------------------------------------------------------------ -void OTruncatedTransactedFileStream::CommonInit_Impl( - const ::rtl::OUString& aURL, - const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess, - const uno::Reference< lang::XMultiServiceFactory >& xFactory, - sal_Bool bDeleteOptionIsProvided ) -{ - sal_Bool bDelete = sal_False; - if ( !bDeleteOptionIsProvided ) - bDelete = !xFileAccess->exists( aURL ); - - uno::Reference< io::XStream > xOrigStream = xFileAccess->openFileReadWrite( aURL ); - uno::Reference< io::XTruncate > xOrigTruncate( xOrigStream, uno::UNO_QUERY_THROW ); - uno::Reference< io::XSeekable > xOrigSeekable( xOrigStream, uno::UNO_QUERY_THROW ); - uno::Reference< io::XInputStream > xOrigInStream = xOrigStream->getInputStream(); - uno::Reference< io::XOutputStream > xOrigOutStream = xOrigStream->getOutputStream(); - if ( !xOrigInStream.is() || !xOrigOutStream.is() ) - throw uno::RuntimeException(); - - // temporary stream related members - uno::Reference< io::XStream > xTempStream( xFactory->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) ) ), - uno::UNO_QUERY_THROW ); - uno::Reference< io::XTruncate > xTempTruncate( xTempStream, uno::UNO_QUERY_THROW ); - uno::Reference< io::XSeekable > xTempSeekable( xTempStream, uno::UNO_QUERY_THROW ); - uno::Reference< io::XInputStream > xTempInStream = xTempStream->getInputStream(); - uno::Reference< io::XOutputStream > xTempOutStream = xTempStream->getOutputStream(); - if ( !xTempInStream.is() || !xTempOutStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData = new TTFileStreamData_Impl( xFileAccess, bDelete, aURL, - xOrigStream, xOrigTruncate, xOrigSeekable, xOrigInStream, xOrigOutStream, - xTempStream, xTempTruncate, xTempSeekable, xTempInStream, xTempOutStream ); -} - -// ------------------------------------------------------------------------ -void OTruncatedTransactedFileStream::Commit_Impl() -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - sal_Int64 nPos = m_pStreamData->m_xTempSeekable->getPosition(); - m_pStreamData->m_xTempSeekable->seek( 0 ); - - // after the following step fails the information might be lost, throw an exception with URL of temporary file - try - { - m_pStreamData->m_xOrigTruncate->truncate(); - OStorageHelper::CopyInputToOutput( m_pStreamData->m_xTempInStream, m_pStreamData->m_xOrigOutStream ); - m_pStreamData->m_xOrigOutStream->flush(); - - // in case the stream is based on a file it will implement the following interface - // the call should be used to be sure that the contents are written to the file system - uno::Reference< io::XAsyncOutputMonitor > asyncOutputMonitor( m_pStreamData->m_xOrigOutStream, uno::UNO_QUERY ); - if ( asyncOutputMonitor.is() ) - asyncOutputMonitor->waitForCompletion(); - } - catch( uno::Exception& ) - { - ::rtl::OUString aTempURL; - try { - uno::Reference< beans::XPropertySet > xTempFile( m_pStreamData->m_xTempStream, uno::UNO_QUERY_THROW ); - uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")) ); - aUrl >>= aTempURL; - xTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveFile")), - uno::makeAny( sal_False ) ); - - m_pStreamData->m_xTempSeekable->seek( nPos ); - } - catch( uno::Exception& ) - { - OSL_FAIL( "These calls are pretty simple, they should not fail!\n" ); - } - - m_pStreamData->FreeOriginal(); - - ::rtl::OUString aErrTxt( RTL_CONSTASCII_USTRINGPARAM ( "Writing file failed!" ) ); - embed::UseBackupException aException( aErrTxt, uno::Reference< uno::XInterface >(), aTempURL ); - throw lang::WrappedTargetException( aErrTxt, - static_cast < OWeakObject * > ( this ), - uno::makeAny ( aException ) ); - } - - m_pStreamData->m_xOrigSeekable->seek( nPos ); - m_pStreamData->NoTransaction(); - } - else - throw io::NotConnectedException(); -} - -// ------------------------------------------------------------------------ -void OTruncatedTransactedFileStream::Revert_Impl() -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - m_pStreamData->m_xTempTruncate->truncate(); - else - throw io::NotConnectedException(); -} - -// com::sun::star::io::XStream -// ------------------------------------------------------------------------ -uno::Reference< io::XInputStream > SAL_CALL OTruncatedTransactedFileStream::getInputStream( ) - throw (uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( m_pStreamData ) - m_pStreamData->m_bInOpen = sal_True; - return static_cast< io::XInputStream* >( this ); -} - - -// ------------------------------------------------------------------------ -uno::Reference< io::XOutputStream > SAL_CALL OTruncatedTransactedFileStream::getOutputStream( ) - throw (uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( m_pStreamData ) - m_pStreamData->m_bOutOpen = sal_True; - return static_cast< io::XOutputStream* >( this ); -} - - - -// com::sun::star::io::XInputStream -// ------------------------------------------------------------------------ -::sal_Int32 SAL_CALL OTruncatedTransactedFileStream::readBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xTempInStream->readBytes( aData, nBytesToRead ); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigInStream->readBytes( aData, nBytesToRead ); - } -} - - -// ------------------------------------------------------------------------ -::sal_Int32 SAL_CALL OTruncatedTransactedFileStream::readSomeBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xTempInStream->readSomeBytes( aData, nMaxBytesToRead ); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigInStream->readSomeBytes( aData, nMaxBytesToRead ); - } -} - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::skipBytes( ::sal_Int32 nBytesToSkip ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempInStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xTempInStream->skipBytes( nBytesToSkip ); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigInStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigInStream->skipBytes( nBytesToSkip ); - } -} - - -// ------------------------------------------------------------------------ -::sal_Int32 SAL_CALL OTruncatedTransactedFileStream::available( ) - throw (io::NotConnectedException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xTempInStream->available(); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigInStream.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigInStream->available(); - } -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::closeInput() - throw (io::NotConnectedException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - m_pStreamData->m_bInOpen = sal_False; - if ( !m_pStreamData->m_bOutOpen ) - CloseAll_Impl(); -} - - - -// com::sun::star::io::XOutputStream -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::writeBytes( const uno::Sequence< ::sal_Int8 >& aData ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempOutStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xTempOutStream->writeBytes( aData ); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigOutStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigOutStream->writeBytes( aData ); - } -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::flush( ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - { - OSL_FAIL( "flush() call on closed stream!\n" ); - return; - // in future throw exception, for now some code might call flush() on closed stream - // since file ucp implementation allows it - // throw io::NotConnectedException(); - } - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempOutStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xTempOutStream->flush(); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigOutStream.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigOutStream->flush(); - } -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::closeOutput( ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - m_pStreamData->m_bOutOpen = sal_False; - if ( !m_pStreamData->m_bInOpen ) - CloseAll_Impl(); -} - - - -// com::sun::star::io::XTruncate -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::truncate( ) - throw (io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempTruncate.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xTempTruncate->truncate(); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigTruncate.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigTruncate->truncate(); - } -} - - - -// com::sun::star::io::XSeekable -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::seek( ::sal_Int64 location ) - throw (lang::IllegalArgumentException, io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempSeekable.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xTempSeekable->seek( location ); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigSeekable.is() ) - throw uno::RuntimeException(); - - m_pStreamData->m_xOrigSeekable->seek( location ); - } -} - - -// ------------------------------------------------------------------------ -::sal_Int64 SAL_CALL OTruncatedTransactedFileStream::getPosition( ) - throw (io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempSeekable.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xTempSeekable->getPosition(); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigSeekable.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigSeekable->getPosition(); - } -} - - -// ------------------------------------------------------------------------ -::sal_Int64 SAL_CALL OTruncatedTransactedFileStream::getLength( ) - throw (io::IOException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - if ( m_pStreamData->m_bTransacted ) - { - // temporary stream data should be provided - if ( !m_pStreamData->m_xTempSeekable.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xTempSeekable->getLength(); - } - else - { - // the original stream data should be provided - if ( !m_pStreamData->m_xOrigSeekable.is() ) - throw uno::RuntimeException(); - - return m_pStreamData->m_xOrigSeekable->getLength(); - } -} - -// com::sun::star::beans::XPropertySetInfo -// ------------------------------------------------------------------------ -uno::Sequence< beans::Property > SAL_CALL OTruncatedTransactedFileStream::getProperties() - throw (uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - uno::Sequence< beans::Property > aProps( 1 ); - aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TransactionSupport" ) ); - aProps[0].Type = getCppuType( static_cast< uno::Reference< beans::XPropertySet >* >( NULL ) ); - aProps[0].Attributes = beans::PropertyAttribute::TRANSIENT | beans::PropertyAttribute::READONLY; - - return aProps; -} - - -// ------------------------------------------------------------------------ -beans::Property SAL_CALL OTruncatedTransactedFileStream::getPropertyByName( const ::rtl::OUString& aName ) - throw (beans::UnknownPropertyException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - ::rtl::OUString aTransactionPropName( RTL_CONSTASCII_USTRINGPARAM( "TransactionSupport" ) ); - - if ( !aName.equals( aTransactionPropName ) ) - throw beans::UnknownPropertyException(); - - beans::Property aProp; - aProp.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TransactionSupport" ) ); - aProp.Type = getCppuType( static_cast< uno::Reference< beans::XPropertySet >* >( NULL ) ); - aProp.Attributes = beans::PropertyAttribute::TRANSIENT | beans::PropertyAttribute::READONLY; - - return aProp; -} - - -// ------------------------------------------------------------------------ -::sal_Bool SAL_CALL OTruncatedTransactedFileStream::hasPropertyByName( const ::rtl::OUString& Name ) - throw (uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - ::rtl::OUString aTransactionPropName( RTL_CONSTASCII_USTRINGPARAM( "TransactionSupport" ) ); - return ( Name.equals( aTransactionPropName ) ); -} - - - -// com::sun::star::beans::XPropertySet -// ------------------------------------------------------------------------ -uno::Reference< beans::XPropertySetInfo > SAL_CALL OTruncatedTransactedFileStream::getPropertySetInfo() - throw (uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - return static_cast< beans::XPropertySetInfo* >( this ); -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& ) - throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - ::rtl::OUString aTransactionPropName( RTL_CONSTASCII_USTRINGPARAM( "TransactionSupport" ) ); - if ( aPropertyName.equals( aTransactionPropName ) ) - throw beans::PropertyVetoException(); - - throw beans::UnknownPropertyException(); -} - - -// ------------------------------------------------------------------------ -uno::Any SAL_CALL OTruncatedTransactedFileStream::getPropertyValue( const ::rtl::OUString& PropertyName ) - throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - - if ( !m_pStreamData ) - throw io::NotConnectedException(); - - ::rtl::OUString aTransactionPropName( RTL_CONSTASCII_USTRINGPARAM( "TransactionSupport" ) ); - if ( PropertyName.equals( aTransactionPropName ) ) - { - uno::Reference< embed::XTransactedObject > xObj; - if ( m_pStreamData->m_bTransacted ) - xObj = static_cast< embed::XTransactedObject* >( new OTransactionHelper( this ) ); - - return uno::makeAny( xObj ); - } - - throw beans::UnknownPropertyException(); -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::addPropertyChangeListener( const ::rtl::OUString&, const uno::Reference< beans::XPropertyChangeListener >& ) - throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) -{ - // not implemented -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::removePropertyChangeListener( const ::rtl::OUString&, const uno::Reference< beans::XPropertyChangeListener >& ) - throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) -{ - // not implemented -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::addVetoableChangeListener( const ::rtl::OUString&, const uno::Reference< beans::XVetoableChangeListener >& ) - throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) -{ - // not implemented -} - - -// ------------------------------------------------------------------------ -void SAL_CALL OTruncatedTransactedFileStream::removeVetoableChangeListener( const ::rtl::OUString&, const uno::Reference< beans::XVetoableChangeListener >& ) - throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) -{ - // not implemented -} - - -} // namespace comphelper - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/source/xml/attributelist.cxx b/comphelper/source/xml/attributelist.cxx index 2442fd69f106..696d6a4d7d19 100644 --- a/comphelper/source/xml/attributelist.cxx +++ b/comphelper/source/xml/attributelist.cxx @@ -140,25 +140,6 @@ void AttributeList::Clear() OSL_ENSURE( ! getLength(), "Length > 0 after AttributeList::Clear!"); } -void AttributeList::RemoveAttribute( const OUString sName ) -{ - ::std::vector::iterator ii = m_pImpl->vecAttribute.begin(); - - for( ; ii != m_pImpl->vecAttribute.end() ; ++ii ) { - if( (*ii).sName == sName ) { - m_pImpl->vecAttribute.erase( ii ); - break; - } - } -} - - -void AttributeList::SetAttributeList( const uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &r ) -{ - Clear(); - AppendAttributeList( r ); -} - void AttributeList::AppendAttributeList( const uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &r ) { OSL_ENSURE( r.is(), "r isn't!" ); diff --git a/unusedcode.easy b/unusedcode.easy index a613b741a93f..751a571c0fb3 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -864,7 +864,6 @@ SvUShorts::Replace(unsigned short const&, unsigned short) SvUShorts::Replace(unsigned short const*, unsigned short, unsigned short) SvUShorts::_ForEach(unsigned short, unsigned short, unsigned char (*)(unsigned short const&, void*), void*) SvUnoAttributeContainer::getImplementation(com::sun::star::uno::Reference) -SvXMLAttributeList::SetAttributeList(com::sun::star::uno::Reference const&) SvXMLAutoStylePoolNamesP_Impl::GetPos(rtl::OUString const*) const SvXMLAutoStylePoolNamesP_Impl::Remove(rtl::OUString*) SvXMLAutoStylePoolParentsP_Impl::GetPos(SvXMLAutoStylePoolParentP_Impl const*) const @@ -2035,16 +2034,6 @@ chelp::Databases::getInstallPathAsSystemPath() cmis::Content::exchangeIdentity(com::sun::star::uno::Reference const&) cmis::Content::queryChildren(std::list, std::allocator > >&) codemaker::cpp::typeToPrefix(TypeManager const&, rtl::OString const&) -comphelper::AccessibleEventBuffer::AccessibleEventBuffer() -comphelper::AccessibleEventBuffer::sendEvents() const -comphelper::AccessibleEventBuffer::~AccessibleEventBuffer() -comphelper::AttributeList::RemoveAttribute(rtl::OUString) -comphelper::AttributeList::SetAttributeList(com::sun::star::uno::Reference const&) -comphelper::ChainablePropertySet::lockMutex() -comphelper::ChainablePropertySet::unlockMutex() -comphelper::ChainablePropertySetInfo::ChainablePropertySetInfo() -comphelper::DocPasswordHelper::GetWordHashAsSequence(rtl::OUString const&) -comphelper::DocPasswordRequest::isAbort() const comphelper::EmbeddedObjectContainer::CopyEmbeddedObject(comphelper::EmbeddedObjectContainer&, com::sun::star::uno::Reference const&, rtl::OUString&) comphelper::EventLogger::addLogHandler(com::sun::star::uno::Reference const&) comphelper::EventLogger::getLogLevel() const @@ -2053,25 +2042,17 @@ comphelper::EventLogger::removeLogHandler(com::sun::star::uno::Reference&) comphelper::MimeConfigurationHelper::GetSequenceClassIDFromObjectName(rtl::OUString const&) comphelper::OAccessibleImplementationAccess::setForeignControlledState(com::sun::star::uno::Reference const&, short, unsigned char) comphelper::OAccessibleSelectionHelper::OAccessibleSelectionHelper() comphelper::OAccessibleTextHelper::OAccessibleTextHelper() -comphelper::OComposedPropertySet::OComposedPropertySet(com::sun::star::uno::Sequence > const&, comphelper::IPropertySetComposerCallback const*) comphelper::OContainerListenerAdapter::lock() comphelper::OContainerListenerAdapter::unlock() comphelper::OInteractionRequest::clearContinuations() comphelper::OPropertyContainerHelper::modifyAttributes(int, int, int) comphelper::OSelectionChangeListener::disposeAdapter() comphelper::OStreamSection::available() -comphelper::OTruncatedTransactedFileStream::OTruncatedTransactedFileStream(rtl::OUString const&, com::sun::star::uno::Reference const&) -comphelper::OTruncatedTransactedFileStream::OTruncatedTransactedFileStream(rtl::OUString const&, com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&) -comphelper::OTruncatedTransactedFileStream::OTruncatedTransactedFileStream(rtl::OUString const&, com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&, unsigned char) comphelper::OfficeResourceBundle::OfficeResourceBundle(com::sun::star::uno::Reference const&, rtl::OUString const&) comphelper::PropertySetHelper::PropertySetHelper() comphelper::PropertySetHelper::setInfo(comphelper::PropertySetInfo*) @@ -2079,7 +2060,6 @@ comphelper::PropertySetInfo::add(comphelper::PropertyMapEntry*, int) comphelper::ResourceBasedEventLogger::ResourceBasedEventLogger(com::sun::star::uno::Reference const&, rtl::OUString const&, rtl::OUString const&) comphelper::SequenceAsHashMap::getAsConstAnyList(unsigned char) const comphelper::ServiceInfoHelper::concatSequences(com::sun::star::uno::Sequence const&, com::sun::star::uno::Sequence const&) -comphelper::SimplePasswordRequest::isAbort() const comphelper::createEventAttacherManager(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&) comphelper::findProperty(com::sun::star::beans::Property&, com::sun::star::uno::Sequence&, rtl::OUString const&) comphelper::getPathToSystemRegistry() diff --git a/xmloff/inc/xmloff/attrlist.hxx b/xmloff/inc/xmloff/attrlist.hxx index 33a2fcb8184b..00ff4a302ea3 100644 --- a/xmloff/inc/xmloff/attrlist.hxx +++ b/xmloff/inc/xmloff/attrlist.hxx @@ -79,7 +79,6 @@ public: void AddAttribute( const ::rtl::OUString &sName , const ::rtl::OUString &sValue ); void Clear(); void RemoveAttribute( const ::rtl::OUString sName ); - void SetAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); void AppendAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); void SetValueByIndex( sal_Int16 i, const ::rtl::OUString& rValue ); void RemoveAttributeByIndex( sal_Int16 i ); diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx index 9216f694bc6b..c717681c2046 100644 --- a/xmloff/source/core/attrlist.cxx +++ b/xmloff/source/core/attrlist.cxx @@ -189,13 +189,6 @@ void SvXMLAttributeList::RemoveAttribute( const OUString sName ) } } - -void SvXMLAttributeList::SetAttributeList( const uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &r ) -{ - Clear(); - AppendAttributeList( r ); -} - void SvXMLAttributeList::AppendAttributeList( const uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &r ) { OSL_ASSERT( r.is() ); diff --git a/xmloff/source/transform/MutableAttrList.hxx b/xmloff/source/transform/MutableAttrList.hxx index ae01037f6b75..1dbd084ac44c 100644 --- a/xmloff/source/transform/MutableAttrList.hxx +++ b/xmloff/source/transform/MutableAttrList.hxx @@ -78,7 +78,6 @@ public: // void Clear(); void RemoveAttributeByIndex( sal_Int16 i ); void RenameAttributeByIndex( sal_Int16 i, const ::rtl::OUString& rNewName ); -// void SetAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); void AppendAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & ); sal_Int16 GetIndexByName( const ::rtl::OUString& rName ) const; -- cgit