summaryrefslogtreecommitdiff
path: root/comphelper/source
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2011-10-03 00:47:44 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2011-10-03 16:11:11 +0200
commit1fe85161e45d2097e5c3f1e227920d91b8e5d6fe (patch)
tree2844b2e0c69ad627ad3a0d3bf189ac9c834c2fc7 /comphelper/source
parent84e2f8ff43f2b59cd93a7df9ededdffa8bb87ef5 (diff)
callcatcher: comphelper's unused code
Diffstat (limited to 'comphelper/source')
-rw-r--r--comphelper/source/misc/accessiblecontexthelper.cxx30
-rw-r--r--comphelper/source/misc/accessibleeventbuffer.cxx113
-rw-r--r--comphelper/source/misc/docpasswordhelper.cxx14
-rw-r--r--comphelper/source/misc/docpasswordrequest.cxx10
-rw-r--r--comphelper/source/property/ChainablePropertySet.cxx12
-rw-r--r--comphelper/source/property/ChainablePropertySetInfo.cxx5
-rw-r--r--comphelper/source/property/MasterPropertySet.cxx11
-rw-r--r--comphelper/source/property/MasterPropertySetInfo.cxx13
-rw-r--r--comphelper/source/property/composedprops.cxx359
-rw-r--r--comphelper/source/streaming/otransactedfilestream.cxx826
-rw-r--r--comphelper/source/xml/attributelist.cxx19
11 files changed, 0 insertions, 1412 deletions
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 <comphelper/accessiblecontexthelper.hxx>
-#include <comphelper/accessibleeventbuffer.hxx>
#include <osl/diagnose.h>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
@@ -215,35 +214,6 @@ namespace comphelper
}
//---------------------------------------------------------------------
- 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
{
return !GetBroadcastHelper().bDisposed && !GetBroadcastHelper().bInDispose;
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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_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
@@ -221,20 +221,6 @@ sal_uInt32 DocPasswordHelper::GetWordHashAsUINT32(
}
// ============================================================================
-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,
rtl_TextEncoding nEnc )
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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_comphelper.hxx"
-#include <comphelper/composedprops.hxx>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-//.........................................................................
-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<sal_Bool> aInclusionFlags(nMasterPropsCount);
- sal_Bool* pInclusionFlags = aInclusionFlags.getArray();
-
- // the states of all these properties
- Sequence< PropertyState > aPropertyStates(nMasterPropsCount);
-
- for (sal_Int32 i=0; i<nMasterPropsCount; ++i)
- pInclusionFlags[i] = sal_True;
-
- Reference< XPropertySet > xSecondarySet;
- sal_Int32 nSecondaryPropertyCount;
- Sequence< Property > aSecondaryProperties;
- const Property* pPrimaryProperty = aMasterProps.getConstArray();
- for (sal_Int32 nPrimary=0; nPrimary<nMasterPropsCount; ++nPrimary, ++pPrimaryProperty)
- {
- if (_pMetaData && !_pMetaData->isComposeable(pPrimaryProperty->Name))
- // do not include this property
- pInclusionFlags[nPrimary] = sal_False;
- else
- {
- // search the property in all secondary sets
- for (sal_Int32 i=1; i<nSingleSets; ++i)
- {
- xSecondarySet = m_aSingleSets[i];
- aSecondaryProperties = xSecondarySet->getPropertySetInfo()->getProperties();
- nSecondaryPropertyCount = aSecondaryProperties.getLength();
- const Property* pSecondaryProperties = aSecondaryProperties.getConstArray();
-
- // search the current primary property in the secondary property sequence
- sal_Int32 k=0;
- while (k<nSecondaryPropertyCount && (pSecondaryProperties[k].Name != pPrimaryProperty->Name))
- ++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<nMasterPropsCount; ++nCounter)
- {
- if (pInclusionFlags[nCounter])
- ++nOverallProperties;
- }
-
- // and finally construct our sequence
- m_aProperties = Sequence< Property >(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<nSingleSets; ++i)
- {
- Reference< XPropertySet > 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<nCount; ++i, ++pNames, ++pStates)
- *pStates = getPropertyState(*pNames);
- return aReturn;
- }
-
- //---------------------------------------------------------------------
- void SAL_CALL OComposedPropertySet::setPropertyToDefault( const ::rtl::OUString& _rPropertyName ) throw(UnknownPropertyException, RuntimeException)
- {
- sal_Int32 nSingleSets = m_aSingleSets.size();
- for (sal_Int32 i=0; i<nSingleSets; ++i)
- {
- Reference< XPropertyState > 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; i<nSingleSets; ++i)
- {
- if (m_aSingleSets[i].is())
- m_aSingleSets[i]->setPropertyValue(_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; i<nLength; ++i, ++pProps)
- {
- if (pProps->Name == _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; i<nLength; ++i,++pProps )
- {
- if(pProps->Name == _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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_comphelper.hxx"
-#include <osl/diagnose.h>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/io/XAsyncOutputMonitor.hpp>
-#include <com/sun/star/embed/UseBackupException.hpp>
-
-#include <comphelper/otransactedfilestream.hxx>
-#include <comphelper/storagehelper.hxx>
-#include <cppuhelper/implbase1.hxx>
-
-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<struct TagAttribute_Impl>::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!" );