summaryrefslogtreecommitdiff
path: root/dtrans/source/win32/dtobj/XTDataObject.cxx
diff options
context:
space:
mode:
authorTino Rachui <tra@openoffice.org>2001-07-24 06:55:54 +0000
committerTino Rachui <tra@openoffice.org>2001-07-24 06:55:54 +0000
commitf0e3a1c990ba805389379063cc0b6b73ac2739c6 (patch)
tree1acfc0562ff1d7ddb03c9fffcc6f93b54795a928 /dtrans/source/win32/dtobj/XTDataObject.cxx
parentee9f84599b0315f6cebbc9022a246786cf37d7c9 (diff)
#90028#initialization of formatetc container moved to enumformatetc and querygetdata
Diffstat (limited to 'dtrans/source/win32/dtobj/XTDataObject.cxx')
-rw-r--r--dtrans/source/win32/dtobj/XTDataObject.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx
index aa9c3ea0f27e..880174b2b698 100644
--- a/dtrans/source/win32/dtobj/XTDataObject.cxx
+++ b/dtrans/source/win32/dtobj/XTDataObject.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XTDataObject.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: tra $ $Date: 2001-03-22 14:16:09 $
+ * last change: $Author: tra $ $Date: 2001-07-24 07:55:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -130,10 +130,9 @@ CXTDataObject::CXTDataObject( const Reference< XMultiServiceFactory >& aServiceM
m_SrvMgr( aServiceManager ),
m_XTransferable( aXTransferable ),
m_DataFormatTranslator( aServiceManager ),
+ m_bFormatEtcContainerInitialized( sal_False ),
m_FormatRegistrar( m_SrvMgr, m_DataFormatTranslator )
{
- m_FormatRegistrar.RegisterFormats( m_XTransferable,
- m_FormatEtcContainer );
}
//------------------------------------------------------------------------
@@ -537,6 +536,8 @@ STDMETHODIMP CXTDataObject::EnumFormatEtc(
*ppenumFormatetc = NULL;
+ InitializeFormatEtcContainer( );
+
HRESULT hr;
if ( DATADIR_GET == dwDirection )
{
@@ -561,6 +562,8 @@ STDMETHODIMP CXTDataObject::QueryGetData( LPFORMATETC pFormatetc )
if ( (NULL == pFormatetc) || IsBadReadPtr( pFormatetc, sizeof( FORMATETC ) ) )
return E_INVALIDARG;
+ InitializeFormatEtcContainer( );
+
return m_FormatEtcContainer.hasFormatEtc( *pFormatetc ) ? S_OK : S_FALSE;
}
@@ -747,6 +750,19 @@ HRESULT SAL_CALL CXTDataObject::translateStgExceptionCode( HRESULT hr ) const
return hrTransl;
}
+//------------------------------------------------------------------------
+//
+//------------------------------------------------------------------------
+
+inline void SAL_CALL CXTDataObject::InitializeFormatEtcContainer( )
+{
+ if ( !m_bFormatEtcContainerInitialized )
+ {
+ m_FormatRegistrar.RegisterFormats( m_XTransferable, m_FormatEtcContainer );
+ m_bFormatEtcContainerInitialized = sal_True;
+ }
+}
+
//============================================================================
// CEnumFormatEtc
//============================================================================