Commits

Anonymous committed a07f375

cmcfixes79: #i114551#: move sfx2 docinfo into msfilter, and add ability to extract PID_HLINKS

Comments (0)

Files changed (5)

sfx2/inc/sfx2/docinf.hxx

-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#ifndef _SFXDOCINF_HXX
-#define _SFXDOCINF_HXX
-
-#include "sal/config.h"
-#include "sfx2/dllapi.h"
-#include "sal/types.h"
-#include <com/sun/star/uno/Reference.hxx>
-
-
-class GDIMetaFile;
-class SotStorage;
-
-namespace com { namespace sun { namespace star {
-    namespace document {
-        class XDocumentProperties;
-    }
-} } }
-
-
-namespace sfx2 {
-
-/** load document meta-data from OLE stream
-
-    @param  i_xDocProps     Document meta-data
-    @param  i_pStorage      OLE Storage
- */
-sal_uInt32 SFX2_DLLPUBLIC LoadOlePropertySet(
-    ::com::sun::star::uno::Reference<
-        ::com::sun::star::document::XDocumentProperties> i_xDocProps,
-    SotStorage* i_pStorage );
-
-/** save document meta-data to OLE stream
-
-    @param  i_xDocProps     Document meta-data
-    @param  i_pStorage      OLE Storage
-    @param  i_pThumb        Thumbnail: preview bitmap
-    @param  i_pGuid         Blob: Guid blob ("_PID_GUID")
-    @param  i_pHyperlinks   Blob: Hyperlink blob ("_PID_HLINKS")
- */
-bool SFX2_DLLPUBLIC SaveOlePropertySet(
-    ::com::sun::star::uno::Reference<
-        ::com::sun::star::document::XDocumentProperties> i_xDocProps,
-    SotStorage* i_pStorage,
-    const ::com::sun::star::uno::Sequence<sal_uInt8> * i_pThumb = 0,
-    const ::com::sun::star::uno::Sequence<sal_uInt8> * i_pGuid = 0,
-    const ::com::sun::star::uno::Sequence<sal_uInt8> * i_pHyperlinks = 0);
-
-
-::com::sun::star::uno::Sequence<sal_uInt8> SFX2_DLLPUBLIC convertMetaFile(
-    GDIMetaFile* i_pThumb);
-
-} // namespace sfx2
-
-#endif
-

sfx2/source/doc/docinf.cxx

-/*************************************************************************
- *
- * 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_sfx2.hxx"
-
-#include <sfx2/docinf.hxx>
-
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertyContainer.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/uno/Exception.hpp>
-
-#include <rtl/ustring.hxx>
-#include <tools/debug.hxx>
-#include <comphelper/string.hxx>
-#include <sot/storage.hxx>
-#include <vcl/gdimtf.hxx>
-
-#include "oleprops.hxx"
-
-// ============================================================================
-
-// stream names
-#define STREAM_SUMMARYINFO      "\005SummaryInformation"
-#define STREAM_DOCSUMMARYINFO   "\005DocumentSummaryInformation"
-
-// usings
-using namespace ::com::sun::star;
-
-
-namespace sfx2 {
-
-sal_uInt32 SFX2_DLLPUBLIC LoadOlePropertySet(
-    uno::Reference< document::XDocumentProperties> i_xDocProps,
-    SotStorage* i_pStorage )
-{
-    // *** global properties from stream "005SummaryInformation" ***
-
-    // load the property set
-    SfxOlePropertySet aGlobSet;
-    ErrCode nGlobError = aGlobSet.LoadPropertySet(i_pStorage,
-        String( RTL_CONSTASCII_USTRINGPARAM( STREAM_SUMMARYINFO ) ) );
-
-    // global section
-    SfxOleSectionRef xGlobSect = aGlobSet.GetSection( SECTION_GLOBAL );
-    if( xGlobSect.get() )
-    {
-        // set supported properties
-        String aStrValue;
-        util::DateTime aDateTime;
-
-        if( xGlobSect->GetStringValue( aStrValue, PROPID_TITLE ) )
-            i_xDocProps->setTitle( aStrValue );
-        if( xGlobSect->GetStringValue( aStrValue, PROPID_SUBJECT ) )
-            i_xDocProps->setSubject( aStrValue );
-        if( xGlobSect->GetStringValue( aStrValue, PROPID_KEYWORDS ) ) {
-            i_xDocProps->setKeywords(
-                ::comphelper::string::convertCommaSeparated(aStrValue) );
-        }
-        if( xGlobSect->GetStringValue( aStrValue, PROPID_TEMPLATE ) )
-            i_xDocProps->setTemplateName( aStrValue );
-        if( xGlobSect->GetStringValue( aStrValue, PROPID_COMMENTS ) )
-            i_xDocProps->setDescription( aStrValue );
-
-		util::DateTime aInvalid;
-        if( xGlobSect->GetStringValue( aStrValue, PROPID_AUTHOR) )
-			i_xDocProps->setAuthor( aStrValue );
-		else
-			i_xDocProps->setAuthor( ::rtl::OUString() );
-        if( xGlobSect->GetFileTimeValue( aDateTime, PROPID_CREATED ) )
-			i_xDocProps->setCreationDate( aDateTime );
-		else
-			i_xDocProps->setCreationDate( aInvalid );
-
-        if( xGlobSect->GetStringValue( aStrValue, PROPID_LASTAUTHOR) )
-			i_xDocProps->setModifiedBy( aStrValue );
-		else
-			i_xDocProps->setModifiedBy( ::rtl::OUString() );
-        if( xGlobSect->GetFileTimeValue( aDateTime, PROPID_LASTSAVED ) )
-			i_xDocProps->setModificationDate( aDateTime );
-		else
-			i_xDocProps->setModificationDate( aInvalid );
-
-		i_xDocProps->setPrintedBy( ::rtl::OUString() );
-        if( xGlobSect->GetFileTimeValue( aDateTime, PROPID_LASTPRINTED ) )
-			i_xDocProps->setPrintDate( aDateTime );
-		else
-			i_xDocProps->setPrintDate( aInvalid );
-
-        if( xGlobSect->GetStringValue( aStrValue, PROPID_REVNUMBER ) )
-        {
-            sal_Int16 nRevision = static_cast< sal_Int16 >( aStrValue.ToInt32() );
-            if ( nRevision > 0 )
-                i_xDocProps->setEditingCycles( nRevision );
-        }
-
-        if( xGlobSect->GetFileTimeValue( aDateTime, PROPID_EDITTIME ) )
-        {
-            // subtract offset 1601-01-01
-            aDateTime.Year  -= 1601;
-            aDateTime.Month -= 1;
-            aDateTime.Day   -= 1;
-            try
-            {
-                i_xDocProps->setEditingDuration(
-                    aDateTime.Day     * 60*60*24 +
-                    aDateTime.Hours   * 60*60    +
-                    aDateTime.Minutes * 60       +
-                    aDateTime.Seconds            );
-            }
-            catch (lang::IllegalArgumentException &)
-            {
-                // ignore
-            }
-        }
-    }
-
-    // *** custom properties from stream "005DocumentSummaryInformation" ***
-
-    // load the property set
-    SfxOlePropertySet aDocSet;
-    ErrCode nDocError = aDocSet.LoadPropertySet(i_pStorage,
-        String( RTL_CONSTASCII_USTRINGPARAM( STREAM_DOCSUMMARYINFO ) ) );
-
-    // custom properties
-    SfxOleSectionRef xCustomSect = aDocSet.GetSection( SECTION_CUSTOM );
-    if( xCustomSect.get() )
-    {
-        uno::Reference < beans::XPropertyContainer > xUserDefined(
-            i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
-        ::std::vector< sal_Int32 > aPropIds;
-        xCustomSect->GetPropertyIds( aPropIds );
-        for( ::std::vector< sal_Int32 >::const_iterator aIt = aPropIds.begin(),
-             aEnd = aPropIds.end(); aIt != aEnd; ++aIt )
-        {
-            ::rtl::OUString aPropName = xCustomSect->GetPropertyName( *aIt );
-            uno::Any aPropValue = xCustomSect->GetAnyValue( *aIt );
-            if( (aPropName.getLength() > 0) && aPropValue.hasValue() ) {
-                try {
-                    xUserDefined->addProperty( aPropName,
-                        beans::PropertyAttribute::REMOVEABLE, aPropValue );
-                } catch ( uno::Exception& ) {
-                    //ignore
-                }
-            }
-        }
-    }
-
-    // return code
-    return (nGlobError != ERRCODE_NONE) ? nGlobError : nDocError;
-}
-
-bool SFX2_DLLPUBLIC SaveOlePropertySet(
-    uno::Reference< document::XDocumentProperties> i_xDocProps,
-    SotStorage* i_pStorage,
-    const uno::Sequence<sal_uInt8> * i_pThumb,
-    const uno::Sequence<sal_uInt8> * i_pGuid,
-    const uno::Sequence<sal_uInt8> * i_pHyperlinks)
-{
-    // *** global properties into stream "005SummaryInformation" ***
-
-    SfxOlePropertySet aGlobSet;
-
-    // set supported properties
-    SfxOleSection& rGlobSect = aGlobSet.AddSection( SECTION_GLOBAL );
-    rGlobSect.SetStringValue( PROPID_TITLE,    i_xDocProps->getTitle() );
-    rGlobSect.SetStringValue( PROPID_SUBJECT,  i_xDocProps->getSubject() );
-    String aStr = ::comphelper::string::convertCommaSeparated(
-        i_xDocProps->getKeywords() );
-    rGlobSect.SetStringValue( PROPID_KEYWORDS, aStr );
-    rGlobSect.SetStringValue( PROPID_TEMPLATE, i_xDocProps->getTemplateName() );
-    rGlobSect.SetStringValue( PROPID_COMMENTS, i_xDocProps->getDescription() );
-    rGlobSect.SetStringValue( PROPID_AUTHOR,   i_xDocProps->getAuthor() );
-    rGlobSect.SetFileTimeValue(PROPID_CREATED, i_xDocProps->getCreationDate());
-    rGlobSect.SetStringValue( PROPID_LASTAUTHOR, i_xDocProps->getModifiedBy() );
-    rGlobSect.SetFileTimeValue(PROPID_LASTSAVED,
-                                i_xDocProps->getModificationDate() );
-    // note: apparently PrintedBy is not supported in file format
-    rGlobSect.SetFileTimeValue(PROPID_LASTPRINTED, i_xDocProps->getPrintDate());
-
-    sal_Int32 dur = i_xDocProps->getEditingDuration();
-    util::DateTime aEditTime;
-    // add offset 1601-01-01
-    aEditTime.Year    = 1601;
-    aEditTime.Month   = 1;
-    aEditTime.Day     = 1;
-    aEditTime.Hours   = static_cast<sal_Int16>(dur / 3600);
-    aEditTime.Minutes = static_cast<sal_Int16>((dur % 3600) / 60);
-    aEditTime.Seconds = static_cast<sal_Int16>(dur % 60);
-    rGlobSect.SetFileTimeValue( PROPID_EDITTIME, aEditTime );
-
-    rGlobSect.SetStringValue( PROPID_REVNUMBER,
-                String::CreateFromInt32( i_xDocProps->getEditingCycles() ) );
-    if ( i_pThumb && i_pThumb->getLength() )
-		rGlobSect.SetThumbnailValue( PROPID_THUMBNAIL, *i_pThumb );
-
-    // save the property set
-    ErrCode nGlobError = aGlobSet.SavePropertySet(i_pStorage,
-        String( RTL_CONSTASCII_USTRINGPARAM( STREAM_SUMMARYINFO ) ) );
-
-    // *** custom properties into stream "005DocumentSummaryInformation" ***
-
-    SfxOlePropertySet aDocSet;
-
-    // set builtin properties
-    aDocSet.AddSection( SECTION_BUILTIN );
-
-    // set custom properties
-    SfxOleSection& rCustomSect = aDocSet.AddSection( SECTION_CUSTOM );
-
-    // write GUID
-    if (i_pGuid) {
-        const sal_Int32 nPropId = rCustomSect.GetFreePropertyId();
-        rCustomSect.SetBlobValue( nPropId, *i_pGuid );
-        rCustomSect.SetPropertyName( nPropId,
-            ::rtl::OUString::createFromAscii("_PID_GUID") );
-    }
-
-    // write hyperlinks
-    if (i_pHyperlinks) {
-        const sal_Int32 nPropId = rCustomSect.GetFreePropertyId();
-        rCustomSect.SetBlobValue( nPropId, *i_pHyperlinks );
-        rCustomSect.SetPropertyName( nPropId,
-            ::rtl::OUString::createFromAscii("_PID_HLINKS") );
-    }
-
-    uno::Reference<beans::XPropertySet> xUserDefinedProps(
-        i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
-    DBG_ASSERT(xUserDefinedProps.is(), "UserDefinedProperties is null");
-    uno::Reference<beans::XPropertySetInfo> xPropInfo =
-        xUserDefinedProps->getPropertySetInfo();
-    DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null");
-    uno::Sequence<beans::Property> props = xPropInfo->getProperties();
-    for (sal_Int32 i = 0; i < props.getLength(); ++i) {
-        try {
-            // skip transient properties
-            if (~props[i].Attributes & beans::PropertyAttribute::TRANSIENT)
-            {
-                const ::rtl::OUString name = props[i].Name;
-                const sal_Int32 nPropId = rCustomSect.GetFreePropertyId();
-                if (rCustomSect.SetAnyValue( nPropId,
-                            xUserDefinedProps->getPropertyValue(name))) {
-                    rCustomSect.SetPropertyName( nPropId, name );
-                }
-            }
-        } catch (uno::Exception &) {
-            // may happen with concurrent modification...
-            DBG_WARNING("SavePropertySet: exception");
-        }
-    }
-
-    // save the property set
-    ErrCode nDocError = aDocSet.SavePropertySet(i_pStorage,
-        String( RTL_CONSTASCII_USTRINGPARAM( STREAM_DOCSUMMARYINFO ) ) );
-
-    // return code
-    return (nGlobError == ERRCODE_NONE) && (nDocError == ERRCODE_NONE);
-}
-
-uno::Sequence<sal_uInt8> SFX2_DLLPUBLIC convertMetaFile(GDIMetaFile* i_pThumb)
-{
-    if (i_pThumb) {
-        BitmapEx aBitmap;
-        SvMemoryStream aStream;
-// magic value 160 taken from GraphicHelper::getThumbnailFormatFromGDI_Impl()
-        if( i_pThumb->CreateThumbnail( 160, aBitmap ) ) {
-            aBitmap.GetBitmap().Write( aStream, FALSE, FALSE );
-//            uno::Sequence<sal_uInt8> aSeq(aStream.GetSize()); // WRONG
-            aStream.Seek(STREAM_SEEK_TO_END);
-            uno::Sequence<sal_uInt8> aSeq(aStream.Tell());
-            const sal_uInt8* pBlob(
-                static_cast<const sal_uInt8*>(aStream.GetData()));
-            for (sal_Int32 j = 0; j < aSeq.getLength(); ++j) {
-                aSeq[j] = pBlob[j];
-            }
-            return aSeq;
-        }
-    }
-    return uno::Sequence<sal_uInt8>();
-}
-
-} // namespace sfx2
-

sfx2/source/doc/makefile.mk

 
 SLOFILES =	\
         $(SLO)$/printhelper.obj \
-        $(SLO)$/docinf.obj \
-        $(SLO)$/oleprops.obj \
         $(SLO)$/iframe.obj \
         $(SLO)$/plugin.obj \
 		$(SLO)$/docfile.obj \

sfx2/source/doc/oleprops.cxx

-/*************************************************************************
- *
- * 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_sfx2.hxx"
-
-#include "oleprops.hxx"
-
-#include <comphelper/types.hxx>
-#include <tools/debug.hxx>
-#include <tools/datetime.hxx>
-#include <rtl/tencinfo.h>
-
-// ============================================================================
-
-
-// ============================================================================
-
-#define VERSION 11
-#define STREAM_BUFFER_SIZE 2048
-
-// usings
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::makeAny;
-
-using namespace ::com::sun::star;
-
-#define TIMESTAMP_INVALID_DATETIME    	( DateTime ( Date ( 1, 1, 1601 ), Time ( 0, 0, 0 ) ) )	/// Invalid value for date and time to create invalid instance of TimeStamp.
-#define TIMESTAMP_INVALID_UTILDATETIME  ( util::DateTime ( 0, 0, 0, 0, 1, 1, 1601 ) )	/// Invalid value for date and time to create invalid instance of TimeStamp.
-
-static
-bool operator==(const util::DateTime &i_rLeft, const util::DateTime &i_rRight)
-{
-    return i_rLeft.Year             == i_rRight.Year
-        && i_rLeft.Month            == i_rRight.Month
-        && i_rLeft.Day              == i_rRight.Day
-        && i_rLeft.Hours            == i_rRight.Hours
-        && i_rLeft.Minutes          == i_rRight.Minutes
-        && i_rLeft.Seconds          == i_rRight.Seconds
-        && i_rLeft.HundredthSeconds == i_rRight.HundredthSeconds;
-}
-
-// ============================================================================
-
-/** Property representing a signed 32-bit integer value. */
-class SfxOleInt32Property : public SfxOlePropertyBase
-{
-public:
-    explicit            SfxOleInt32Property( sal_Int32 nPropId, sal_Int32 nValue = 0 );
-
-    inline sal_Int32    GetValue() const { return mnValue; }
-    inline void         SetValue( sal_Int32 nValue ) { mnValue = nValue; }
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-private:
-    sal_Int32           mnValue;
-};
-
-// ============================================================================
-
-/** Property representing a floating-point value. */
-class SfxOleDoubleProperty : public SfxOlePropertyBase
-{
-public:
-    explicit            SfxOleDoubleProperty( sal_Int32 nPropId, double fValue = 0.0 );
-
-    inline double       GetValue() const { return mfValue; }
-    inline void         SetValue( double fValue ) { mfValue = fValue; }
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-private:
-    double              mfValue;
-};
-
-// ============================================================================
-
-/** Property representing a boolean value. */
-class SfxOleBoolProperty : public SfxOlePropertyBase
-{
-public:
-    explicit            SfxOleBoolProperty( sal_Int32 nPropId, bool bValue = false );
-
-    inline bool         GetValue() const { return mbValue; }
-    inline void         SetValue( bool bValue ) { mbValue = bValue; }
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-private:
-    bool                mbValue;
-};
-
-// ============================================================================
-
-/** Base class for properties that contain a single string value. */
-class SfxOleStringPropertyBase : public SfxOlePropertyBase, public SfxOleStringHelper
-{
-public:
-    explicit            SfxOleStringPropertyBase(
-                            sal_Int32 nPropId, sal_Int32 nPropType,
-                            const SfxOleTextEncoding& rTextEnc );
-    explicit            SfxOleStringPropertyBase(
-                            sal_Int32 nPropId, sal_Int32 nPropType,
-                            const SfxOleTextEncoding& rTextEnc, const String& rValue );
-    explicit            SfxOleStringPropertyBase(
-                            sal_Int32 nPropId, sal_Int32 nPropType,
-                            rtl_TextEncoding eTextEnc );
-    explicit            SfxOleStringPropertyBase(
-                            sal_Int32 nPropId, sal_Int32 nPropType,
-                            rtl_TextEncoding eTextEnc, const String& rValue );
-
-    inline const String& GetValue() const { return maValue; }
-    inline void         SetValue( const String& rValue ) { maValue = rValue; }
-
-private:
-    String              maValue;
-};
-
-// ============================================================================
-
-/** Property representing a bytestring value. */
-class SfxOleString8Property : public SfxOleStringPropertyBase
-{
-public:
-    explicit            SfxOleString8Property(
-                            sal_Int32 nPropId, const SfxOleTextEncoding& rTextEnc );
-    explicit            SfxOleString8Property(
-                            sal_Int32 nPropId, const SfxOleTextEncoding& rTextEnc,
-                            const String& rValue );
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-};
-
-// ============================================================================
-
-/** Property representing a Unicode string value. */
-class SfxOleString16Property : public SfxOleStringPropertyBase
-{
-public:
-    explicit            SfxOleString16Property( sal_Int32 nPropId );
-    explicit            SfxOleString16Property( sal_Int32 nPropId, const String& rValue );
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-};
-
-// ============================================================================
-
-/** Property representing a filetime value as defined by the Windows API. */
-class SfxOleFileTimeProperty : public SfxOlePropertyBase
-{
-public:
-    explicit            SfxOleFileTimeProperty( sal_Int32 nPropId );
-    /** @param rDateTime  Date and time as LOCAL time. */
-    explicit            SfxOleFileTimeProperty( sal_Int32 nPropId, const util::DateTime& rDateTime );
-
-    /** Returns the time value as LOCAL time. */
-    inline const util::DateTime& GetValue() const { return maDateTime; }
-    /** @param rDateTime  Date and time as LOCAL time. */
-    inline void         SetValue( const util::DateTime& rDateTime ) { maDateTime = rDateTime; }
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-private:
-    util::DateTime      maDateTime;
-};
-
-// ============================================================================
-
-/** Property representing a thumbnail picture.
-
-    Currently, only saving this property is implemented.
- */
-class SfxOleThumbnailProperty : public SfxOlePropertyBase
-{
-public:
-    explicit            SfxOleThumbnailProperty( sal_Int32 nPropId,
-                            const uno::Sequence<sal_uInt8> & i_rData);
-
-    inline bool         IsValid() const { return mData.getLength() > 0; }
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-private:
-    uno::Sequence<sal_uInt8>    mData;
-};
-
-// ============================================================================
-
-/** Property representing a BLOB (which presumably stands for binary large
-    object).
-
-    Currently, only saving this property is implemented.
- */
-class SfxOleBlobProperty : public SfxOlePropertyBase
-{
-public:
-    explicit            SfxOleBlobProperty( sal_Int32 nPropId,
-                            const uno::Sequence<sal_uInt8> & i_rData);
-    inline bool         IsValid() const { return mData.getLength() > 0; }
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-private:
-    uno::Sequence<sal_uInt8>    mData;
-};
-
-// ============================================================================
-
-sal_uInt16 SfxOleTextEncoding::GetCodePage() const
-{
-    sal_uInt16 nCodePage = IsUnicode() ? CODEPAGE_UNICODE :
-        static_cast< sal_uInt16 >( rtl_getWindowsCodePageFromTextEncoding( *mxTextEnc ) );
-    return (nCodePage == CODEPAGE_UNKNOWN) ? CODEPAGE_UTF8 : nCodePage;
-}
-
-void SfxOleTextEncoding::SetCodePage( sal_uInt16 nCodePage )
-{
-    if( nCodePage == CODEPAGE_UNICODE )
-        SetUnicode();
-    else
-    {
-        rtl_TextEncoding eTextEnc = rtl_getTextEncodingFromWindowsCodePage( nCodePage );
-        if( eTextEnc != RTL_TEXTENCODING_DONTKNOW )
-            *mxTextEnc = eTextEnc;
-    }
-}
-
-// ----------------------------------------------------------------------------
-
-String SfxOleStringHelper::LoadString8( SvStream& rStrm ) const
-{
-    return IsUnicode() ? ImplLoadString16( rStrm ) : ImplLoadString8( rStrm );
-}
-
-void SfxOleStringHelper::SaveString8( SvStream& rStrm, const String& rValue ) const
-{
-    if( IsUnicode() )
-        ImplSaveString16( rStrm, rValue );
-    else
-        ImplSaveString8( rStrm, rValue );
-}
-
-String SfxOleStringHelper::LoadString16( SvStream& rStrm ) const
-{
-    return ImplLoadString16( rStrm );
-}
-
-void SfxOleStringHelper::SaveString16( SvStream& rStrm, const String& rValue ) const
-{
-    ImplSaveString16( rStrm, rValue );
-}
-
-String SfxOleStringHelper::ImplLoadString8( SvStream& rStrm ) const
-{
-    String aValue;
-    // read size field (signed 32-bit)
-    sal_Int32 nSize;
-    rStrm >> nSize;
-    // size field includes trailing NUL character
-    DBG_ASSERT( (0 < nSize) && (nSize <= 0xFFFF), "SfxOleStringHelper::ImplLoadString8 - invalid string" );
-    if( (0 < nSize) && (nSize <= 0xFFFF) )
-    {
-        // load character buffer
-        ::std::vector< sal_Char > aBuffer( static_cast< size_t >( nSize + 1 ), 0 );
-        rStrm.Read( &aBuffer.front(), static_cast< sal_Size >( nSize ) );
-        // create string from encoded character array
-        aValue = String( &aBuffer.front(), GetTextEncoding() );
-    }
-    return aValue;
-}
-
-String SfxOleStringHelper::ImplLoadString16( SvStream& rStrm ) const
-{
-    String aValue;
-    // read size field (signed 32-bit), may be buffer size or character count
-    sal_Int32 nSize;
-    rStrm >> nSize;
-    DBG_ASSERT( (0 < nSize) && (nSize <= 0xFFFF), "SfxOleStringHelper::ImplLoadString16 - invalid string" );
-    // size field includes trailing NUL character
-    if( (0 < nSize) && (nSize <= 0xFFFF) )
-    {
-        // load character buffer
-        ::std::vector< sal_Unicode > aBuffer;
-        aBuffer.reserve( static_cast< size_t >( nSize + 1 ) );
-        sal_uInt16 cChar;
-        for( sal_Int32 nIdx = 0; nIdx < nSize; ++nIdx )
-        {
-            rStrm >> cChar;
-            aBuffer.push_back( static_cast< sal_Unicode >( cChar ) );
-        }
-        // stream is always padded to 32-bit boundary, skip 2 bytes on odd character count
-        if( (nSize & 1) == 1 )
-            rStrm.SeekRel( 2 );
-        // create string from character array
-        aBuffer.push_back( 0 );
-        aValue = String( &aBuffer.front() );
-    }
-    return aValue;
-}
-
-void SfxOleStringHelper::ImplSaveString8( SvStream& rStrm, const String& rValue ) const
-{
-    // encode to byte string
-    ByteString aEncoded( rValue, GetTextEncoding() );
-    // write size field (including trailing NUL character)
-    sal_Int32 nSize = static_cast< sal_Int32 >( aEncoded.Len() + 1 );
-    rStrm << nSize;
-    // write character array with trailing NUL character
-    rStrm.Write( aEncoded.GetBuffer(), aEncoded.Len() );
-    rStrm << sal_uInt8( 0 );
-}
-
-void SfxOleStringHelper::ImplSaveString16( SvStream& rStrm, const String& rValue ) const
-{
-    // write size field (including trailing NUL character)
-    sal_Int32 nSize = static_cast< sal_Int32 >( rValue.Len() + 1 );
-    rStrm << nSize;
-    // write character array with trailing NUL character
-    for( xub_StrLen nIdx = 0; nIdx < rValue.Len(); ++nIdx )
-        rStrm << static_cast< sal_uInt16 >( rValue.GetChar( nIdx ) );
-    rStrm << sal_uInt16( 0 );
-    // stream is always padded to 32-bit boundary, add 2 bytes on odd character count
-    if( (nSize & 1) == 1 )
-        rStrm << sal_uInt16( 0 );
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleObjectBase::~SfxOleObjectBase()
-{
-}
-
-ErrCode SfxOleObjectBase::Load( SvStream& rStrm )
-{
-    mnErrCode = ERRCODE_NONE;
-    ImplLoad( rStrm );
-    SetError( rStrm.GetErrorCode() );
-    return GetError();
-}
-
-ErrCode SfxOleObjectBase::Save( SvStream& rStrm )
-{
-    mnErrCode = ERRCODE_NONE;
-    ImplSave( rStrm );
-    SetError( rStrm.GetErrorCode() );
-    return GetError();
-}
-
-void SfxOleObjectBase::LoadObject( SvStream& rStrm, SfxOleObjectBase& rObj )
-{
-    SetError( rObj.Load( rStrm ) );
-}
-
-void SfxOleObjectBase::SaveObject( SvStream& rStrm, SfxOleObjectBase& rObj )
-{
-    SetError( rObj.Save( rStrm ) );
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleCodePageProperty::SfxOleCodePageProperty() :
-    SfxOlePropertyBase( PROPID_CODEPAGE, PROPTYPE_INT16 )
-{
-}
-
-void SfxOleCodePageProperty::ImplLoad( SvStream& rStrm )
-{
-    // property type is signed int16, but we use always unsigned int16 for codepages
-    sal_uInt16 nCodePage;
-    rStrm >> nCodePage;
-    SetCodePage( nCodePage );
-}
-
-void SfxOleCodePageProperty::ImplSave( SvStream& rStrm )
-{
-    // property type is signed int16, but we use always unsigned int16 for codepages
-    rStrm << GetCodePage();
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleInt32Property::SfxOleInt32Property( sal_Int32 nPropId, sal_Int32 nValue ) :
-    SfxOlePropertyBase( nPropId, PROPTYPE_INT32 ),
-    mnValue( nValue )
-{
-}
-
-void SfxOleInt32Property::ImplLoad( SvStream& rStrm )
-{
-    rStrm >> mnValue;
-}
-
-void SfxOleInt32Property::ImplSave( SvStream& rStrm )
-{
-    rStrm << mnValue;
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleDoubleProperty::SfxOleDoubleProperty( sal_Int32 nPropId, double fValue ) :
-    SfxOlePropertyBase( nPropId, PROPTYPE_DOUBLE ),
-    mfValue( fValue )
-{
-}
-
-void SfxOleDoubleProperty::ImplLoad( SvStream& rStrm )
-{
-    rStrm >> mfValue;
-}
-
-void SfxOleDoubleProperty::ImplSave( SvStream& rStrm )
-{
-    rStrm << mfValue;
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleBoolProperty::SfxOleBoolProperty( sal_Int32 nPropId, bool bValue ) :
-    SfxOlePropertyBase( nPropId, PROPTYPE_BOOL ),
-    mbValue( bValue )
-{
-}
-
-void SfxOleBoolProperty::ImplLoad( SvStream& rStrm )
-{
-    sal_Int16 nValue;
-    rStrm >> nValue;
-    mbValue = nValue != 0;
-}
-
-void SfxOleBoolProperty::ImplSave( SvStream& rStrm )
-{
-    rStrm << static_cast< sal_Int16 >( mbValue ? -1 : 0 );
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleStringPropertyBase::SfxOleStringPropertyBase(
-        sal_Int32 nPropId, sal_Int32 nPropType, const SfxOleTextEncoding& rTextEnc ) :
-    SfxOlePropertyBase( nPropId, nPropType ),
-    SfxOleStringHelper( rTextEnc )
-{
-}
-
-SfxOleStringPropertyBase::SfxOleStringPropertyBase(
-        sal_Int32 nPropId, sal_Int32 nPropType, const SfxOleTextEncoding& rTextEnc, const String& rValue ) :
-    SfxOlePropertyBase( nPropId, nPropType ),
-    SfxOleStringHelper( rTextEnc ),
-    maValue( rValue )
-{
-}
-
-SfxOleStringPropertyBase::SfxOleStringPropertyBase(
-        sal_Int32 nPropId, sal_Int32 nPropType, rtl_TextEncoding eTextEnc ) :
-    SfxOlePropertyBase( nPropId, nPropType ),
-    SfxOleStringHelper( eTextEnc )
-{
-}
-
-SfxOleStringPropertyBase::SfxOleStringPropertyBase(
-        sal_Int32 nPropId, sal_Int32 nPropType, rtl_TextEncoding eTextEnc, const String& rValue ) :
-    SfxOlePropertyBase( nPropId, nPropType ),
-    SfxOleStringHelper( eTextEnc ),
-    maValue( rValue )
-{
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleString8Property::SfxOleString8Property(
-        sal_Int32 nPropId, const SfxOleTextEncoding& rTextEnc ) :
-    SfxOleStringPropertyBase( nPropId, PROPTYPE_STRING8, rTextEnc )
-{
-}
-
-SfxOleString8Property::SfxOleString8Property(
-        sal_Int32 nPropId, const SfxOleTextEncoding& rTextEnc, const String& rValue ) :
-    SfxOleStringPropertyBase( nPropId, PROPTYPE_STRING8, rTextEnc, rValue )
-{
-}
-
-void SfxOleString8Property::ImplLoad( SvStream& rStrm )
-{
-    SetValue( LoadString8( rStrm ) );
-}
-
-void SfxOleString8Property::ImplSave( SvStream& rStrm )
-{
-    SaveString8( rStrm, GetValue() );
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleString16Property::SfxOleString16Property( sal_Int32 nPropId ) :
-    SfxOleStringPropertyBase( nPropId, PROPTYPE_STRING16, RTL_TEXTENCODING_UCS2 )
-{
-}
-
-SfxOleString16Property::SfxOleString16Property( sal_Int32 nPropId, const String& rValue ) :
-    SfxOleStringPropertyBase( nPropId, PROPTYPE_STRING16, RTL_TEXTENCODING_UCS2, rValue )
-{
-}
-
-void SfxOleString16Property::ImplLoad( SvStream& rStrm )
-{
-    SetValue( LoadString16( rStrm ) );
-}
-
-void SfxOleString16Property::ImplSave( SvStream& rStrm )
-{
-    SaveString16( rStrm, GetValue() );
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleFileTimeProperty::SfxOleFileTimeProperty( sal_Int32 nPropId ) :
-    SfxOlePropertyBase( nPropId, PROPTYPE_FILETIME )
-{
-}
-
-SfxOleFileTimeProperty::SfxOleFileTimeProperty( sal_Int32 nPropId, const util::DateTime& rDateTime ) :
-    SfxOlePropertyBase( nPropId, PROPTYPE_FILETIME ),
-    maDateTime( rDateTime )
-{
-}
-
-void SfxOleFileTimeProperty::ImplLoad( SvStream& rStrm )
-{
-    sal_uInt32 nLower, nUpper;
-    rStrm >> nLower >> nUpper;
-    ::DateTime aDateTime = DateTime::CreateFromWin32FileDateTime( nLower, nUpper );
-    // note: editing duration is stored as offset to TIMESTAMP_INVALID_DATETIME
-    //       of course we should not convert the time zone of a duration!
-    // heuristic to detect editing durations (which we assume to be < 1 year):
-    // check only the year, not the entire date
-	if ( aDateTime.GetYear() != TIMESTAMP_INVALID_DATETIME.GetYear() )
-		aDateTime.ConvertToLocalTime();
-    maDateTime.Year    = aDateTime.GetYear();
-    maDateTime.Month   = aDateTime.GetMonth();
-    maDateTime.Day     = aDateTime.GetDay();
-    maDateTime.Hours   = aDateTime.GetHour();
-    maDateTime.Minutes = aDateTime.GetMin();
-    maDateTime.Seconds = aDateTime.GetSec();
-    maDateTime.HundredthSeconds = aDateTime.Get100Sec();
-}
-
-void SfxOleFileTimeProperty::ImplSave( SvStream& rStrm )
-{
-    DateTime aDateTimeUtc(
-            Date(
-                static_cast< USHORT >( maDateTime.Day ),
-                static_cast< USHORT >( maDateTime.Month ),
-                static_cast< USHORT >( maDateTime.Year ) ),
-            Time(
-                static_cast< ULONG >( maDateTime.Hours ),
-                static_cast< ULONG >( maDateTime.Minutes ),
-                static_cast< ULONG >( maDateTime.Seconds ),
-                static_cast< ULONG >( maDateTime.HundredthSeconds ) ) );
-    // invalid time stamp is not converted to UTC
-    // heuristic to detect editing durations (which we assume to be < 1 year):
-    // check only the year, not the entire date
-    if( aDateTimeUtc.IsValid()
-        && aDateTimeUtc.GetYear() != TIMESTAMP_INVALID_DATETIME.GetYear() ) {
-            aDateTimeUtc.ConvertToUTC();
-    }
-    sal_uInt32 nLower, nUpper;
-    aDateTimeUtc.GetWin32FileDateTime( nLower, nUpper );
-    rStrm << nLower << nUpper;
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleThumbnailProperty::SfxOleThumbnailProperty(
-        sal_Int32 nPropId, const uno::Sequence<sal_uInt8> & i_rData) :
-    SfxOlePropertyBase( nPropId, PROPTYPE_CLIPFMT ),
-    mData(i_rData)
-{
-}
-
-void SfxOleThumbnailProperty::ImplLoad( SvStream& )
-{
-    DBG_ERRORFILE( "SfxOleThumbnailProperty::ImplLoad - not implemented" );
-    SetError( SVSTREAM_INVALID_ACCESS );
-}
-
-void SfxOleThumbnailProperty::ImplSave( SvStream& rStrm )
-{
-    /*  Type        Contents
-        -----------------------------------------------------------------------
-        int32       size of following data
-        int32       clipboard format tag (see below)
-        byte[]      clipboard data (see below)
-
-        Clipboard format tag:
-            -1 = Windows clipboard format
-            -2 = Macintosh clipboard format
-            -3 = GUID that contains a format identifier (FMTID)
-            >0 = custom clipboard format name plus data (see msdn site below)
-            0  = no data
-
-        References:
-        http://msdn.microsoft.com/library/default.asp?url=/library/en-us/stg/stg/propvariant.asp
-        http://jakarta.apache.org/poi/hpsf/thumbnails.html
-        http://linux.com.hk/docs/poi/org/apache/poi/hpsf/Thumbnail.html
-        http://sparks.discreet.com/knowledgebase/public/solutions/ExtractThumbnailImg.htm
-     */
-    if( IsValid() )
-    {
-        // clipboard size: clip_format_tag + data_format_tag + bitmap_len
-        sal_Int32 nClipSize = static_cast< sal_Int32 >( 4 + 4 + mData.getLength() );
-        rStrm << nClipSize << CLIPFMT_WIN << CLIPDATAFMT_DIB;
-        rStrm.Write( mData.getConstArray(), mData.getLength() );
-    }
-    else
-    {
-        DBG_ERRORFILE( "SfxOleThumbnailProperty::ImplSave - invalid thumbnail property" );
-        SetError( SVSTREAM_INVALID_ACCESS );
-    }
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleBlobProperty::SfxOleBlobProperty( sal_Int32 nPropId,
-        const uno::Sequence<sal_uInt8> & i_rData) :
-    SfxOlePropertyBase( nPropId, PROPTYPE_BLOB ),
-    mData(i_rData)
-{
-}
-
-void SfxOleBlobProperty::ImplLoad( SvStream& )
-{
-    DBG_ERRORFILE( "SfxOleBlobProperty::ImplLoad - not implemented" );
-    SetError( SVSTREAM_INVALID_ACCESS );
-}
-
-void SfxOleBlobProperty::ImplSave( SvStream& rStrm )
-{
-    if (IsValid()) {
-        rStrm.Write( mData.getConstArray(), mData.getLength() );
-    } else {
-        DBG_ERRORFILE( "SfxOleBlobProperty::ImplSave - invalid BLOB property" );
-        SetError( SVSTREAM_INVALID_ACCESS );
-    }
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleDictionaryProperty::SfxOleDictionaryProperty( const SfxOleTextEncoding& rTextEnc ) :
-    SfxOlePropertyBase( PROPID_DICTIONARY, 0 ),
-    SfxOleStringHelper( rTextEnc )
-{
-}
-
-const String& SfxOleDictionaryProperty::GetPropertyName( sal_Int32 nPropId ) const
-{
-    SfxOlePropNameMap::const_iterator aIt = maPropNameMap.find( nPropId );
-    return (aIt == maPropNameMap.end()) ? String::EmptyString() : aIt->second;
-}
-
-void SfxOleDictionaryProperty::SetPropertyName( sal_Int32 nPropId, const String& rPropName )
-{
-    maPropNameMap[ nPropId ] = rPropName;
-    // dictionary property contains number of pairs in property type field
-    SetPropType( static_cast< sal_Int32 >( maPropNameMap.size() ) );
-}
-
-void SfxOleDictionaryProperty::ImplLoad( SvStream& rStrm )
-{
-    // dictionary property contains number of pairs in property type field
-    sal_Int32 nNameCount = GetPropType();
-    // read property ID/name pairs
-    maPropNameMap.clear();
-    for( sal_Int32 nIdx = 0; (nIdx < nNameCount) && (rStrm.GetErrorCode() == SVSTREAM_OK) && !rStrm.IsEof(); ++nIdx )
-    {
-        sal_Int32 nPropId;
-        rStrm >> nPropId;
-        // name always stored as byte string
-        maPropNameMap[ nPropId ] = LoadString8( rStrm );
-    }
-}
-
-void SfxOleDictionaryProperty::ImplSave( SvStream& rStrm )
-{
-    // write property ID/name pairs
-    for( SfxOlePropNameMap::const_iterator aIt = maPropNameMap.begin(), aEnd = maPropNameMap.end(); aIt != aEnd; ++aIt )
-    {
-        rStrm << aIt->first;
-        // name always stored as byte string
-        SaveString8( rStrm, aIt->second );
-    }
-}
-
-// ----------------------------------------------------------------------------
-
-SfxOleSection::SfxOleSection( bool bSupportsDict ) :
-    maDictProp( maCodePageProp ),
-    mnStartPos( 0 ),
-    mbSupportsDict( bSupportsDict )
-{
-}
-
-SfxOlePropertyRef SfxOleSection::GetProperty( sal_Int32 nPropId ) const
-{
-    SfxOlePropertyRef xProp;
-    SfxOlePropMap::const_iterator aIt = maPropMap.find( nPropId );
-    if( aIt != maPropMap.end() )
-        xProp = aIt->second;
-    return xProp;
-}
-
-bool SfxOleSection::GetInt32Value( sal_Int32& rnValue, sal_Int32 nPropId ) const
-{
-    SfxOlePropertyRef xProp = GetProperty( nPropId );
-    const SfxOleInt32Property* pProp =
-        dynamic_cast< const SfxOleInt32Property* >( xProp.get() );
-    if( pProp )
-        rnValue = pProp->GetValue();
-    return pProp != 0;
-}
-
-bool SfxOleSection::GetDoubleValue( double& rfValue, sal_Int32 nPropId ) const
-{
-    SfxOlePropertyRef xProp = GetProperty( nPropId );
-    const SfxOleDoubleProperty* pProp =
-        dynamic_cast< const SfxOleDoubleProperty* >( xProp.get() );
-    if( pProp )
-        rfValue = pProp->GetValue();
-    return pProp != 0;
-}
-
-bool SfxOleSection::GetBoolValue( bool& rbValue, sal_Int32 nPropId ) const
-{
-    SfxOlePropertyRef xProp = GetProperty( nPropId );
-    const SfxOleBoolProperty* pProp =
-        dynamic_cast< const SfxOleBoolProperty* >( xProp.get() );
-    if( pProp )
-        rbValue = pProp->GetValue();
-    return pProp != 0;
-}
-
-bool SfxOleSection::GetStringValue( String& rValue, sal_Int32 nPropId ) const
-{
-    SfxOlePropertyRef xProp = GetProperty( nPropId );
-    const SfxOleStringPropertyBase* pProp =
-        dynamic_cast< const SfxOleStringPropertyBase* >( xProp.get() );
-    if( pProp )
-        rValue = pProp->GetValue();
-    return pProp != 0;
-}
-
-bool SfxOleSection::GetFileTimeValue( util::DateTime& rValue, sal_Int32 nPropId ) const
-{
-    SfxOlePropertyRef xProp = GetProperty( nPropId );
-    const SfxOleFileTimeProperty* pProp =
-        dynamic_cast< const SfxOleFileTimeProperty* >( xProp.get() );
-    if( pProp )
-	{
-		if ( pProp->GetValue() == TIMESTAMP_INVALID_UTILDATETIME )
-			rValue = util::DateTime();
-		else
-			rValue = pProp->GetValue();
-	}
-    return pProp != 0;
-}
-
-void SfxOleSection::SetProperty( SfxOlePropertyRef xProp )
-{
-    if( xProp.get() )
-        maPropMap[ xProp->GetPropId() ] = xProp;
-}
-
-void SfxOleSection::SetInt32Value( sal_Int32 nPropId, sal_Int32 nValue )
-{
-    SetProperty( SfxOlePropertyRef( new SfxOleInt32Property( nPropId, nValue ) ) );
-}
-
-void SfxOleSection::SetDoubleValue( sal_Int32 nPropId, double fValue )
-{
-    SetProperty( SfxOlePropertyRef( new SfxOleDoubleProperty( nPropId, fValue ) ) );
-}
-
-void SfxOleSection::SetBoolValue( sal_Int32 nPropId, bool bValue )
-{
-    SetProperty( SfxOlePropertyRef( new SfxOleBoolProperty( nPropId, bValue ) ) );
-}
-
-bool SfxOleSection::SetStringValue( sal_Int32 nPropId, const String& rValue, bool bSkipEmpty )
-{
-    bool bInserted = !bSkipEmpty || (rValue.Len() > 0);
-    if( bInserted )
-        SetProperty( SfxOlePropertyRef( new SfxOleString8Property( nPropId, maCodePageProp, rValue ) ) );
-    return bInserted;
-}
-
-void SfxOleSection::SetFileTimeValue( sal_Int32 nPropId, const util::DateTime& rValue )
-{
-	if ( rValue.Year == 0 || rValue.Month == 0 || rValue.Day == 0 )
-	    SetProperty( SfxOlePropertyRef( new SfxOleFileTimeProperty( nPropId, TIMESTAMP_INVALID_UTILDATETIME ) ) );
-	else
-	    SetProperty( SfxOlePropertyRef( new SfxOleFileTimeProperty( nPropId, rValue ) ) );
-}
-
-void SfxOleSection::SetThumbnailValue( sal_Int32 nPropId,
-    const uno::Sequence<sal_uInt8> & i_rData)
-{
-    SfxOleThumbnailProperty* pThumbnail = new SfxOleThumbnailProperty( nPropId, i_rData );
-    SfxOlePropertyRef xProp( pThumbnail );  // take ownership
-    if( pThumbnail->IsValid() )
-        SetProperty( xProp );
-}
-
-void SfxOleSection::SetBlobValue( sal_Int32 nPropId,
-    const uno::Sequence<sal_uInt8> & i_rData)
-{
-    SfxOleBlobProperty* pBlob( new SfxOleBlobProperty( nPropId, i_rData ) );
-    SfxOlePropertyRef xProp( pBlob );
-    if( pBlob->IsValid() ) {
-        SetProperty( xProp );
-    }
-}
-
-Any SfxOleSection::GetAnyValue( sal_Int32 nPropId ) const
-{
-    Any aValue;
-    sal_Int32 nInt32 = 0;
-    double fDouble = 0.0;
-    bool bBool = false;
-    String aString;
-    ::com::sun::star::util::DateTime aApiDateTime;
-
-    if( GetInt32Value( nInt32, nPropId ) )
-        aValue <<= nInt32;
-    else if( GetDoubleValue( fDouble, nPropId ) )
-        aValue <<= fDouble;
-    else if( GetBoolValue( bBool, nPropId ) )
-        ::comphelper::setBOOL( aValue, bBool ? sal_True : sal_False );
-    else if( GetStringValue( aString, nPropId ) )
-        aValue <<= OUString( aString );
-    else if( GetFileTimeValue( aApiDateTime, nPropId ) )
-    {
-        aValue <<= aApiDateTime;
-    }
-    return aValue;
-}
-
-bool SfxOleSection::SetAnyValue( sal_Int32 nPropId, const Any& rValue )
-{
-    bool bInserted = true;
-    sal_Int32 nInt32 = 0;
-    double fDouble = 0.0;
-    OUString aString;
-    ::com::sun::star::util::DateTime aApiDateTime;
-
-    if( rValue.getValueType() == ::getBooleanCppuType() )
-        SetBoolValue( nPropId, ::comphelper::getBOOL( rValue ) == sal_True );
-    else if( rValue >>= nInt32 )
-        SetInt32Value( nPropId, nInt32 );
-    else if( rValue >>= fDouble )
-        SetDoubleValue( nPropId, fDouble );
-    else if( rValue >>= aString )
-        bInserted = SetStringValue( nPropId, aString );
-    else if( rValue >>= aApiDateTime )
-    {
-        SetFileTimeValue( nPropId, aApiDateTime );
-    }
-    else
-        bInserted = false;
-    return bInserted;
-}
-
-const String& SfxOleSection::GetPropertyName( sal_Int32 nPropId ) const
-{
-    return maDictProp.GetPropertyName( nPropId );
-}
-
-void SfxOleSection::SetPropertyName( sal_Int32 nPropId, const String& rPropName )
-{
-    maDictProp.SetPropertyName( nPropId, rPropName );
-}
-
-void SfxOleSection::GetPropertyIds( ::std::vector< sal_Int32 >& rPropIds ) const
-{
-    rPropIds.clear();
-    for( SfxOlePropMap::const_iterator aIt = maPropMap.begin(), aEnd = maPropMap.end(); aIt != aEnd; ++aIt )
-        rPropIds.push_back( aIt->first );
-}
-
-sal_Int32 SfxOleSection::GetFreePropertyId() const
-{
-    return maPropMap.empty() ? PROPID_FIRSTCUSTOM : (maPropMap.rbegin()->first + 1);
-}
-
-void SfxOleSection::ImplLoad( SvStream& rStrm )
-{
-    // read section header
-    mnStartPos = rStrm.Tell();
-    sal_uInt32 nSize;
-    sal_Int32 nPropCount;
-    rStrm >> nSize >> nPropCount;
-
-    // read property ID/position pairs
-    typedef ::std::map< sal_Int32, sal_uInt32 > SfxOlePropPosMap;
-    SfxOlePropPosMap aPropPosMap;
-    for( sal_Int32 nPropIdx = 0; (nPropIdx < nPropCount) && (rStrm.GetErrorCode() == SVSTREAM_OK) && !rStrm.IsEof(); ++nPropIdx )
-    {
-        sal_Int32 nPropId;
-        sal_uInt32 nPropPos;
-        rStrm >> nPropId >> nPropPos;
-        aPropPosMap[ nPropId ] = nPropPos;
-    }
-
-    // read codepage property
-    SfxOlePropPosMap::iterator aCodePageIt = aPropPosMap.find( PROPID_CODEPAGE );
-    if( (aCodePageIt != aPropPosMap.end()) && SeekToPropertyPos( rStrm, aCodePageIt->second ) )
-    {
-        // codepage property must be of type signed int-16
-        sal_Int32 nPropType;
-        rStrm >> nPropType;
-        if( nPropType == PROPTYPE_INT16 )
-            LoadObject( rStrm, maCodePageProp );
-        // remove property position
-        aPropPosMap.erase( aCodePageIt );
-    }
-
-    // read dictionary property
-    SfxOlePropPosMap::iterator aDictIt = aPropPosMap.find( PROPID_DICTIONARY );
-    if( (aDictIt != aPropPosMap.end()) && SeekToPropertyPos( rStrm, aDictIt->second ) )
-    {
-        // #i66214# #i66428# applications may write broken dictionary properties in wrong sections
-        if( mbSupportsDict )
-        {
-            // dictionary property contains number of pairs in property type field
-            sal_Int32 nNameCount;
-            rStrm >> nNameCount;
-            maDictProp.SetNameCount( nNameCount );
-            LoadObject( rStrm, maDictProp );
-        }
-        // always remove position of dictionary property (do not try to read it again below)
-        aPropPosMap.erase( aDictIt );
-    }
-
-    // read other properties
-    maPropMap.clear();
-    for( SfxOlePropPosMap::const_iterator aIt = aPropPosMap.begin(), aEnd = aPropPosMap.end(); aIt != aEnd; ++aIt )
-        if( SeekToPropertyPos( rStrm, aIt->second ) )
-            LoadProperty( rStrm, aIt->first );
-}
-
-void SfxOleSection::ImplSave( SvStream& rStrm )
-{
-    /*  Always export with UTF-8 encoding. All dependent properties (bytestring
-        and dictionary) will be updated automatically. */
-    maCodePageProp.SetTextEncoding( RTL_TEXTENCODING_UTF8 );
-
-    // write section header
-    mnStartPos = rStrm.Tell();
-    sal_Int32 nPropCount = static_cast< sal_Int32 >( maPropMap.size() + 1 );
-    if( maDictProp.HasPropertyNames() )
-        ++nPropCount;
-    rStrm << sal_uInt32( 0 ) << nPropCount;
-
-    // write placeholders for property ID/position pairs
-    sal_Size nPropPosPos = rStrm.Tell();
-    rStrm.SeekRel( static_cast< sal_sSize >( 8 * nPropCount ) );
-
-    // write dictionary property
-    if( maDictProp.HasPropertyNames() )
-        SaveProperty( rStrm, maDictProp, nPropPosPos );
-    // write codepage property
-    SaveProperty( rStrm, maCodePageProp, nPropPosPos );
-    // write other properties
-    for( SfxOlePropMap::const_iterator aIt = maPropMap.begin(), aEnd = maPropMap.end(); aIt != aEnd; ++aIt )
-        SaveProperty( rStrm, *aIt->second, nPropPosPos );
-
-    // write section size (first field in section header)
-    rStrm.Seek( STREAM_SEEK_TO_END );
-    sal_uInt32 nSectSize = static_cast< sal_uInt32 >( rStrm.Tell() - mnStartPos );
-    rStrm.Seek( mnStartPos );
-    rStrm << nSectSize;
-}
-
-bool SfxOleSection::SeekToPropertyPos( SvStream& rStrm, sal_uInt32 nPropPos ) const
-{
-    rStrm.Seek( static_cast< sal_Size >( mnStartPos + nPropPos ) );
-    return rStrm.GetErrorCode() == SVSTREAM_OK;
-}
-
-void SfxOleSection::LoadProperty( SvStream& rStrm, sal_Int32 nPropId )
-{
-    // property data type
-    sal_Int32 nPropType;
-    rStrm >> nPropType;
-    // create empty property object
-    SfxOlePropertyRef xProp;
-    switch( nPropType )
-    {
-        case PROPTYPE_INT32:
-            xProp.reset( new SfxOleInt32Property( nPropId ) );
-        break;
-        case PROPTYPE_DOUBLE:
-            xProp.reset( new SfxOleDoubleProperty( nPropId ) );
-        break;
-        case PROPTYPE_BOOL:
-            xProp.reset( new SfxOleBoolProperty( nPropId ) );
-        break;
-        case PROPTYPE_STRING8:
-            xProp.reset( new SfxOleString8Property( nPropId, maCodePageProp ) );
-        break;
-        case PROPTYPE_STRING16:
-            xProp.reset( new SfxOleString16Property( nPropId ) );
-        break;
-        case PROPTYPE_FILETIME:
-            xProp.reset( new SfxOleFileTimeProperty( nPropId ) );
-        break;
-    }
-    // load property contents
-    if( xProp.get() )
-    {
-        SetError( xProp->Load( rStrm ) );
-        maPropMap[ nPropId ] = xProp;
-    }
-}
-
-void SfxOleSection::SaveProperty( SvStream& rStrm, SfxOlePropertyBase& rProp, sal_Size& rnPropPosPos )
-{
-    rStrm.Seek( STREAM_SEEK_TO_END );
-    sal_uInt32 nPropPos = static_cast< sal_uInt32 >( rStrm.Tell() - mnStartPos );
-    // property data type
-    rStrm << rProp.GetPropType();
-    // write property contents
-    SaveObject( rStrm, rProp );
-    // align to 32-bit
-    while( (rStrm.Tell() & 3) != 0 )
-        rStrm << sal_uInt8( 0 );
-    // write property ID/position pair
-    rStrm.Seek( rnPropPosPos );
-    rStrm << rProp.GetPropId() << nPropPos;
-    rnPropPosPos = rStrm.Tell();
-}
-
-// ----------------------------------------------------------------------------
-
-ErrCode SfxOlePropertySet::LoadPropertySet( SotStorage* pStrg, const String& rStrmName )
-{
-    if( pStrg )
-    {
-        SotStorageStreamRef xStrm = pStrg->OpenSotStream( rStrmName, STREAM_STD_READ );
-        if( xStrm.Is() && (xStrm->GetError() == SVSTREAM_OK) )
-        {
-            xStrm->SetBufferSize( STREAM_BUFFER_SIZE );
-            Load( *xStrm );
-        }
-        else
-            SetError( ERRCODE_IO_ACCESSDENIED );
-    }
-    else
-        SetError( ERRCODE_IO_ACCESSDENIED );
-    return GetError();
-}
-
-ErrCode SfxOlePropertySet::SavePropertySet( SotStorage* pStrg, const String& rStrmName )
-{
-    if( pStrg )
-    {
-        SotStorageStreamRef xStrm = pStrg->OpenSotStream( rStrmName, STREAM_TRUNC | STREAM_STD_WRITE );
-        if( xStrm.Is() )
-            Save( *xStrm );
-        else
-            SetError( ERRCODE_IO_ACCESSDENIED );
-    }
-    else
-        SetError( ERRCODE_IO_ACCESSDENIED );
-    return GetError();
-}
-
-SfxOleSectionRef SfxOlePropertySet::GetSection( SfxOleSectionType eSection ) const
-{
-    return GetSection( GetSectionGuid( eSection ) );
-}
-
-SfxOleSectionRef SfxOlePropertySet::GetSection( const SvGlobalName& rSectionGuid ) const
-{
-    SfxOleSectionRef xSection;
-    SfxOleSectionMap::const_iterator aIt = maSectionMap.find( rSectionGuid );
-    if( aIt != maSectionMap.end() )
-        xSection = aIt->second;
-    return xSection;
-}
-
-SfxOleSection& SfxOlePropertySet::AddSection( SfxOleSectionType eSection )
-{
-    return AddSection( GetSectionGuid( eSection ) );
-}
-
-SfxOleSection& SfxOlePropertySet::AddSection( const SvGlobalName& rSectionGuid )
-{
-    SfxOleSectionRef xSection = GetSection( rSectionGuid );
-    if( !xSection )
-    {
-        // #i66214# #i66428# applications may write broken dictionary properties in wrong sections
-        bool bSupportsDict = rSectionGuid == GetSectionGuid( SECTION_CUSTOM );
-        xSection.reset( new SfxOleSection( bSupportsDict ) );
-        maSectionMap[ rSectionGuid ] = xSection;
-    }
-    return *xSection;
-}
-
-void SfxOlePropertySet::ImplLoad( SvStream& rStrm )
-{
-    // read property set header
-    sal_uInt16 nByteOrder;
-    sal_uInt16 nVersion;
-    sal_uInt16 nOsMinor;
-    sal_uInt16 nOsType;
-    SvGlobalName aGuid;
-    sal_Int32 nSectCount;
-    rStrm >> nByteOrder >> nVersion >> nOsMinor >> nOsType >> aGuid >> nSectCount;
-
-    // read sections
-    sal_Size nSectPosPos = rStrm.Tell();
-    for( sal_Int32 nSectIdx = 0; (nSectIdx < nSectCount) && (rStrm.GetErrorCode() == SVSTREAM_OK) && !rStrm.IsEof(); ++nSectIdx )
-    {
-        // read section guid/position pair
-        rStrm.Seek( nSectPosPos );
-        SvGlobalName aSectGuid;
-        sal_uInt32 nSectPos;
-        rStrm >> aSectGuid >> nSectPos;
-        nSectPosPos = rStrm.Tell();
-        // read section
-        rStrm.Seek( static_cast< sal_Size >( nSectPos ) );
-        if( rStrm.GetErrorCode() == SVSTREAM_OK )
-            LoadObject( rStrm, AddSection( aSectGuid ) );
-    }
-}
-
-void SfxOlePropertySet::ImplSave( SvStream& rStrm )
-{
-    // write property set header
-    SvGlobalName aGuid;
-    sal_Int32 nSectCount = static_cast< sal_Int32 >( maSectionMap.size() );
-    rStrm   << sal_uInt16( 0xFFFE )     // byte order
-            << sal_uInt16( 0 )          // version
-            << sal_uInt16( 1 )          // OS minor version
-            << sal_uInt16( 2 )          // OS type always windows for text encoding
-            << aGuid                    // unused guid
-            << nSectCount;              // number of sections
-
-    // write placeholders for section guid/position pairs
-    sal_Size nSectPosPos = rStrm.Tell();
-    rStrm.SeekRel( static_cast< sal_sSize >( 20 * nSectCount ) );
-
-    // write sections
-    for( SfxOleSectionMap::const_iterator aIt = maSectionMap.begin(), aEnd = maSectionMap.end(); aIt != aEnd; ++aIt )
-    {
-        SfxOleSection& rSection = *aIt->second;
-        rStrm.Seek( STREAM_SEEK_TO_END );
-        sal_uInt32 nSectPos = static_cast< sal_uInt32 >( rStrm.Tell() );
-        // write the section
-        SaveObject( rStrm, rSection );
-        // write section guid/position pair
-        rStrm.Seek( nSectPosPos );
-        rStrm << aIt->first << nSectPos;
-        nSectPosPos = rStrm.Tell();
-    }
-}
-
-const SvGlobalName& SfxOlePropertySet::GetSectionGuid( SfxOleSectionType eSection )
-{
-    static const SvGlobalName saGlobalGuid(  0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 );
-    static const SvGlobalName saBuiltInGuid( 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE );
-    static const SvGlobalName saCustomGuid(  0xD5CDD505, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE );
-    static const SvGlobalName saEmptyGuid;
-    switch( eSection )
-    {
-        case SECTION_GLOBAL:    return saGlobalGuid;
-        case SECTION_BUILTIN:   return saBuiltInGuid;
-        case SECTION_CUSTOM:    return saCustomGuid;
-        default:    DBG_ERRORFILE( "SfxOlePropertySet::GetSectionGuid - unknown section type" );
-    }
-    return saEmptyGuid;
-}
-
-// ============================================================================
-
-//} // namespace

sfx2/source/doc/oleprops.hxx

-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-#include <map>
-#include <boost/shared_ptr.hpp>
-#include <sot/storage.hxx>
-#include <vcl/bitmapex.hxx>
-
-#include <com/sun/star/util/DateTime.hpp>
-
-
-// ============================================================================
-
-//namespace {
-
-// ============================================================================
-// property type IDs
-const sal_Int32 PROPTYPE_INT16          = 2;
-const sal_Int32 PROPTYPE_INT32          = 3;
-const sal_Int32 PROPTYPE_FLOAT          = 4;
-const sal_Int32 PROPTYPE_DOUBLE         = 5;
-const sal_Int32 PROPTYPE_DATE           = 7;
-const sal_Int32 PROPTYPE_STRING         = 8;
-const sal_Int32 PROPTYPE_STATUS         = 10;
-const sal_Int32 PROPTYPE_BOOL           = 11;
-const sal_Int32 PROPTYPE_VARIANT        = 12;
-const sal_Int32 PROPTYPE_INT8           = 16;
-const sal_Int32 PROPTYPE_UINT8          = 17;
-const sal_Int32 PROPTYPE_UINT16         = 18;
-const sal_Int32 PROPTYPE_UINT32         = 19;
-const sal_Int32 PROPTYPE_INT64          = 20;
-const sal_Int32 PROPTYPE_UINT64         = 21;
-const sal_Int32 PROPTYPE_STRING8        = 30;
-const sal_Int32 PROPTYPE_STRING16       = 31;
-const sal_Int32 PROPTYPE_FILETIME       = 64;
-const sal_Int32 PROPTYPE_BLOB           = 65;
-const sal_Int32 PROPTYPE_CLIPFMT        = 71;
-
-// static property IDs
-const sal_Int32 PROPID_DICTIONARY       = 0;
-const sal_Int32 PROPID_CODEPAGE         = 1;
-const sal_Int32 PROPID_FIRSTCUSTOM      = 2;
-
-// property IDs for GlobalDocPropertySet
-const sal_Int32 PROPID_TITLE            = 2;
-const sal_Int32 PROPID_SUBJECT          = 3;
-const sal_Int32 PROPID_AUTHOR           = 4;
-const sal_Int32 PROPID_KEYWORDS         = 5;
-const sal_Int32 PROPID_COMMENTS         = 6;
-const sal_Int32 PROPID_TEMPLATE         = 7;
-const sal_Int32 PROPID_LASTAUTHOR       = 8;
-const sal_Int32 PROPID_REVNUMBER        = 9;
-const sal_Int32 PROPID_EDITTIME         = 10;
-const sal_Int32 PROPID_LASTPRINTED      = 11;
-const sal_Int32 PROPID_CREATED          = 12;
-const sal_Int32 PROPID_LASTSAVED        = 13;
-const sal_Int32 PROPID_THUMBNAIL        = 17;
-
-// predefined codepages
-const sal_uInt16 CODEPAGE_UNKNOWN       = 0;
-const sal_uInt16 CODEPAGE_UNICODE       = 1200;
-const sal_uInt16 CODEPAGE_UTF8          = 65001;
-
-// predefined clipboard format IDs
-const sal_Int32 CLIPFMT_WIN             = -1;
-
-// predefined clipboard data format IDs
-const sal_Int32 CLIPDATAFMT_DIB         = 8;
-
-// ============================================================================
-// ============================================================================
-
-/** Helper for classes that need text encoding settings.
-
-    Classes derived from this class will include functions to store and use
-    text encoding settings and to convert Windows codepage constants.
- */
-class SfxOleTextEncoding
-{
-public:
-    inline explicit     SfxOleTextEncoding() :
-                            mxTextEnc( new rtl_TextEncoding( gsl_getSystemTextEncoding() ) ) {}
-    inline explicit     SfxOleTextEncoding( rtl_TextEncoding eTextEnc ) :
-                            mxTextEnc( new rtl_TextEncoding( eTextEnc ) ) {}
-    inline explicit     SfxOleTextEncoding( sal_Int16 nCodePage ) :
-                            mxTextEnc( new rtl_TextEncoding ) { SetCodePage( nCodePage ); }
-
-    /** Returns the current text encoding identifier. */
-    inline rtl_TextEncoding GetTextEncoding() const { return *mxTextEnc; }
-    /** Sets the passed text encoding. */
-    inline void         SetTextEncoding( rtl_TextEncoding eTextEnc ) { *mxTextEnc = eTextEnc; }
-
-    /** Returns true, if this object contains Unicode text encoding. */
-    inline bool         IsUnicode() const { return GetTextEncoding() == RTL_TEXTENCODING_UCS2; }
-    /** Sets Unicode text encoding to this object. */
-    inline void         SetUnicode() { SetTextEncoding( RTL_TEXTENCODING_UCS2 ); }
-
-    /** Converts the current settings to a Windows codepage identifier. */
-    sal_uInt16          GetCodePage() const;
-    /** Sets the current text encoding from a Windows codepage identifier. */
-    void                SetCodePage( sal_uInt16 nCodePage );
-
-private:
-    typedef ::boost::shared_ptr< rtl_TextEncoding > TextEncRef;
-    TextEncRef          mxTextEnc;
-};
-
-// ============================================================================
-
-/** Helper for classes that need to load or save string values.
-
-    Classes derived from this class contain functions to load and save string
-    values with the text encoding passed in the constructor.
- */
-class SfxOleStringHelper : public SfxOleTextEncoding
-{
-public:
-    /** Creates a string helper object depending on an external text encoding. */
-    inline explicit     SfxOleStringHelper( const SfxOleTextEncoding& rTextEnc ) :
-                            SfxOleTextEncoding( rTextEnc ) {}
-    /** Creates a string helper object with own text encoding. */
-    inline explicit     SfxOleStringHelper( rtl_TextEncoding eTextEnc ) :
-                            SfxOleTextEncoding( eTextEnc ) {}
-
-    /** Loads a string from the passed stream with current encoding (maybe Unicode). */
-    String              LoadString8( SvStream& rStrm ) const;
-    /** Saves a string to the passed stream with current encoding (maybe Unicode). */
-    void                SaveString8( SvStream& rStrm, const String& rValue ) const;
-
-    /** Loads a Unicode string from the passed stream, ignores own encoding. */
-    String              LoadString16( SvStream& rStrm ) const;
-    /** Saves a Unicode string to the passed stream, ignores own encoding. */
-    void                SaveString16( SvStream& rStrm, const String& rValue ) const;
-
-private:
-    String              ImplLoadString8( SvStream& rStrm ) const;
-    String              ImplLoadString16( SvStream& rStrm ) const;
-    void                ImplSaveString8( SvStream& rStrm, const String& rValue ) const;
-    void                ImplSaveString16( SvStream& rStrm, const String& rValue ) const;
-};
-
-
-// ============================================================================
-// ============================================================================
-
-/** Base class for all classes related to OLE property sets.
-
-    Derived calsses have to implement the pure virtual functions ImplLoad() and
-    ImplSave().
- */
-class SfxOleObjectBase
-{
-public:
-    inline explicit     SfxOleObjectBase() : mnErrCode( ERRCODE_NONE ) {}
-    virtual             ~SfxOleObjectBase();
-
-    /** Returns true, if an error code (other than ERRCODE_NONE) is set. */
-    inline bool         HasError() const { return mnErrCode != ERRCODE_NONE; }
-    /** Returns the current error code. */
-    inline ErrCode      GetError() const { return mnErrCode; }
-
-    /** Loads this object from the passed stream. Calls virtual ImplLoad(). */
-    ErrCode             Load( SvStream& rStrm );
-    /** Saves this object to the passed stream. Calls virtual ImplSave(). */
-    ErrCode             Save( SvStream& rStrm );
-
-protected:
-    /** Sets the passed error code. Will be returned by Load() and Save() functions.
-        Always the first error code is stored. Multiple calls have no effect. */
-    inline void         SetError( ErrCode nErrCode ) { if( !HasError() ) mnErrCode = nErrCode; }
-    /** Loads the passed object from the stream. Sets returned error code as own error. */
-    void                LoadObject( SvStream& rStrm, SfxOleObjectBase& rObj );
-    /** Saves the passed object to the stream. Sets returned error code as own error. */
-    void                SaveObject( SvStream& rStrm, SfxOleObjectBase& rObj );
-
-private:
-    /** Derived classes implement loading the object from the passed steam. */
-    virtual void        ImplLoad( SvStream& rStrm ) = 0;
-    /** Derived classes implement saving the object to the passed steam. */
-    virtual void        ImplSave( SvStream& rStrm ) = 0;
-
-private:
-    ErrCode             mnErrCode;      /// Current error code.
-};
-
-// ============================================================================
-// ============================================================================
-
-/** Base class for all OLE property objects. */
-class SfxOlePropertyBase : public SfxOleObjectBase
-{
-public:
-    inline explicit     SfxOlePropertyBase( sal_Int32 nPropId, sal_Int32 nPropType ) :
-                            mnPropId( nPropId ), mnPropType( nPropType ) {}
-
-    inline sal_Int32    GetPropId() const { return mnPropId; }
-    inline sal_Int32    GetPropType() const { return mnPropType; }
-
-protected:
-    inline void         SetPropId( sal_Int32 nPropId ) { mnPropId = nPropId; }
-    inline void         SetPropType( sal_Int32 nPropType ) { mnPropType = nPropType; }
-
-private:
-    sal_Int32           mnPropId;
-    sal_Int32           mnPropType;
-};
-
-typedef ::boost::shared_ptr< SfxOlePropertyBase > SfxOlePropertyRef;
-
-// ============================================================================
-/** Property representing the codepage used to encode bytestrings in the entire property set. */
-class SfxOleCodePageProperty : public SfxOlePropertyBase, public SfxOleTextEncoding
-{
-public:
-    explicit            SfxOleCodePageProperty();
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-};
-
-// ============================================================================
-// ============================================================================
-
-/** Property containing custom names for other properties in the property set. */
-class SfxOleDictionaryProperty : public SfxOlePropertyBase, public SfxOleStringHelper
-{
-public:
-    explicit            SfxOleDictionaryProperty( const SfxOleTextEncoding& rTextEnc );
-
-    /** Returns true, if the property contains at least one custom property name. */
-    inline bool         HasPropertyNames() const { return !maPropNameMap.empty(); }
-    /** Prepares the property for loading. Does not affect contained names for its own. */
-    inline void         SetNameCount( sal_Int32 nNameCount ) { SetPropType( nNameCount ); }
-
-    /** Returns the custom name for the passed property ID, or an empty string, if name not found. */
-    const String&       GetPropertyName( sal_Int32 nPropId ) const;
-    /** Sets a custom name for the passed property ID. */
-    void                SetPropertyName( sal_Int32 nPropId, const String& rPropName );
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-private:
-    typedef ::std::map< sal_Int32, String > SfxOlePropNameMap;
-    SfxOlePropNameMap   maPropNameMap;
-};
-
-// ============================================================================
-// ============================================================================
-
-/** A section in a property set. Contains properties with unique identifiers. */
-class SfxOleSection : public SfxOleObjectBase
-{
-private:
-    typedef ::std::map< sal_Int32, SfxOlePropertyRef > SfxOlePropMap;
-
-public:
-    explicit            SfxOleSection( bool bSupportsDict );
-
-    /** Returns the property with the passed ID, or an empty reference, if nothing found. */
-    SfxOlePropertyRef   GetProperty( sal_Int32 nPropId ) const;
-    /** Returns the value of a signed int32 property with the passed ID in rnValue.
-        @return  true = Property found, rnValue is valid; false = Property not found. */
-    bool                GetInt32Value( sal_Int32& rnValue, sal_Int32 nPropId ) const;
-    /** Returns the value of a floating-point property with the passed ID in rfValue.
-        @return  true = Property found, rfValue is valid; false = Property not found. */
-    bool                GetDoubleValue( double& rfValue, sal_Int32 nPropId ) const;
-    /** Returns the value of a boolean property with the passed ID in rbValue.
-        @return  true = Property found, rbValue is valid; false = Property not found. */
-    bool                GetBoolValue( bool& rbValue, sal_Int32 nPropId ) const;
-    /** Returns the value of a string property with the passed ID in rValue.
-        @return  true = Property found, rValue is valid; false = Property not found. */
-    bool                GetStringValue( String& rValue, sal_Int32 nPropId ) const;
-    /** Returns the value of a time stamp property with the passed ID in rValue.
-        @return  true = Property found, rValue is valid; false = Property not found. */
-    bool                GetFileTimeValue( ::com::sun::star::util::DateTime& rValue, sal_Int32 nPropId ) const;
-
-    /** Adds the passed property to the property set. Drops an existing old property. */
-    void                SetProperty( SfxOlePropertyRef xProp );
-    /** Inserts a signed int32 property with the passed value. */
-    void                SetInt32Value( sal_Int32 nPropId, sal_Int32 nValue );
-    /** Inserts a foating-point property with the passed value. */
-    void                SetDoubleValue( sal_Int32 nPropId, double fValue );
-    /** Inserts a boolean property with the passed value. */
-    void                SetBoolValue( sal_Int32 nPropId, bool bValue );
-    /** Inserts a string property with the passed value.
-        @return  true = Property inserted; false = String was empty, property not inserted. */
-    bool                SetStringValue( sal_Int32 nPropId, const String& rValue, bool bSkipEmpty = true );
-    /** Inserts a time stamp property with the passed value. */
-    void                SetFileTimeValue( sal_Int32 nPropId, const ::com::sun::star::util::DateTime& rValue );
-    /** Inserts a thumbnail property from the passed meta file. */
-    void                SetThumbnailValue( sal_Int32 nPropId,
-                            const ::com::sun::star::uno::Sequence<sal_uInt8> & i_rData);
-    /** Inserts a BLOB property with the passed data. */
-    void                SetBlobValue( sal_Int32 nPropId,
-                            const ::com::sun::star::uno::Sequence<sal_uInt8> & i_rData);
-
-    /** Returns the value of the property with the passed ID in a UNO any. */
-    com::sun::star::uno::Any GetAnyValue( sal_Int32 nPropId ) const;
-    /** Inserts a property created from the passed any.
-        @return  true = Property converted and inserted; false = Property type not supported. */
-    bool                SetAnyValue( sal_Int32 nPropId, const com::sun::star::uno::Any& rValue );
-
-    /** Returns the custom name for the passed property ID, or an empty string, if name not found. */
-    const String&       GetPropertyName( sal_Int32 nPropId ) const;
-    /** Sets a custom name for the passed property ID. */
-    void                SetPropertyName( sal_Int32 nPropId, const String& rPropName );
-
-    /** Returns the identifiers of all existing properties in the passed vector. */
-    void                GetPropertyIds( ::std::vector< sal_Int32 >& rPropIds ) const;
-    /** Returns a property identifier not used in this section. */
-    sal_Int32           GetFreePropertyId() const;
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-    bool                SeekToPropertyPos( SvStream& rStrm, sal_uInt32 nPropPos ) const;
-    void                LoadProperty( SvStream& rStrm, sal_Int32 nPropId );
-    void                SaveProperty( SvStream& rStrm, SfxOlePropertyBase& rProp, sal_Size& rnPropPosPos );
-
-private:
-    SfxOlePropMap       maPropMap;              /// All properties in this section, by identifier.
-    SfxOleCodePageProperty maCodePageProp;      /// The codepage property.
-    SfxOleDictionaryProperty maDictProp;        /// The dictionary property.
-    sal_Size            mnStartPos;             /// Start stream position of the section.
-    bool                mbSupportsDict;         /// true = section supports dictionary.
-};
-
-typedef ::boost::shared_ptr< SfxOleSection > SfxOleSectionRef;
-
-// ============================================================================
-// ============================================================================
-
-/** Enumerates different section types in OLE property sets. */
-enum SfxOleSectionType
-{
-    SECTION_GLOBAL,         /// Globally defined properties.
-    SECTION_BUILTIN,        /// Properties built into MS Office.
-    SECTION_CUSTOM          /// Custom properties.
-};
-
-// ============================================================================
-
-/** Represents a complete property set, may consist of several property sections. */
-class SfxOlePropertySet : public SfxOleObjectBase
-{
-public:
-    inline explicit     SfxOlePropertySet() {}
-
-    /** Loads this object from the passed storage. */
-    ErrCode             LoadPropertySet( SotStorage* pStrg, const String& rStrmName );
-    /** Saves this object to the passed storage. */
-    ErrCode             SavePropertySet( SotStorage* pStrg, const String& rStrmName );
-
-    /** Returns the specified section, or an empty reference, if nothing found. */
-    SfxOleSectionRef    GetSection( SfxOleSectionType eSection ) const;
-    /** Returns the specified section, or an empty reference, if nothing found. */
-    SfxOleSectionRef    GetSection( const SvGlobalName& rSectionGuid ) const;
-
-    /** Creates and returns the specified section, or just returns it if it already exists. */
-    SfxOleSection&      AddSection( SfxOleSectionType eSection );
-    /** Creates and returns the specified section, or just returns it if it already exists. */
-    SfxOleSection&      AddSection( const SvGlobalName& rSectionGuid );
-
-private:
-    virtual void        ImplLoad( SvStream& rStrm );
-    virtual void        ImplSave( SvStream& rStrm );
-
-    /** Returns the GUID for the specified section. */
-    static const SvGlobalName& GetSectionGuid( SfxOleSectionType eSection );
-
-private:
-    typedef ::std::map< SvGlobalName, SfxOleSectionRef > SfxOleSectionMap;
-    SfxOleSectionMap    maSectionMap;
-};
-
-//};