22#include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
23#include <com/sun/star/lang/IllegalArgumentException.hpp>
24#include <com/sun/star/lang/DisposedException.hpp>
25#include <com/sun/star/embed/WrongStateException.hpp>
26#include <com/sun/star/embed/UnreachableStateException.hpp>
27#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
28#include <com/sun/star/beans/XPropertySet.hpp>
29#include <com/sun/star/io/TempFile.hpp>
30#include <com/sun/star/io/XTruncate.hpp>
31#include <com/sun/star/io/IOException.hpp>
32#include <com/sun/star/awt/XRequestCallback.hpp>
40#include <osl/file.hxx>
44#include <systools/win32/comtools.hxx>
59#define MAX_ENUM_ELE 20
65 { CF_ENHMETAFILE,
nullptr, 0, -1, TYMED_ENHMF },
66 { CF_METAFILEPICT,
nullptr, 0, -1, TYMED_MFPICT },
67 { CF_BITMAP,
nullptr, 0, -1, TYMED_GDI } };
71 sal::systools::COMReference< IUnknown >
m_pObj;
83 datatransfer::DataFlavor(
84 "application/x-openoffice-emf;windows_formatname=\"Image EMF\"",
85 "Windows Enhanced Metafile",
88 datatransfer::DataFlavor(
89 "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"",
93 datatransfer::DataFlavor(
94 "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"",
98 datatransfer::DataFlavor(
103 datatransfer::DataFlavor(
104 "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"",
111 const datatransfer::DataFlavor& aFlavor,
122 if ( aFlavor.MimeType.indexOf(
";Aspect=THUMBNAIL" ) != -1 )
123 return DVASPECT_THUMBNAIL;
124 else if ( aFlavor.MimeType.indexOf(
";Aspect=ICON" ) != -1 )
125 return DVASPECT_ICON;
126 else if ( aFlavor.MimeType.indexOf(
";Aspect=DOCPRINT" ) != -1 )
127 return DVASPECT_DOCPRINT;
129 return DVASPECT_CONTENT;
137 if ( nAsp == DVASPECT_THUMBNAIL )
138 aResult =
";Aspect=THUMBNAIL";
139 else if ( nAsp == DVASPECT_ICON )
140 aResult =
";Aspect=ICON";
141 else if ( nAsp == DVASPECT_DOCPRINT )
142 aResult =
";Aspect=DOCPRINT";
152 OSL_ENSURE( ppIStorage,
"The pointer must not be empty!" );
155 if ( !ppIStorage || ::osl::FileBase::getSystemPathFromFileURL(
aURL, aFilePath ) != ::osl::FileBase::E_None )
156 throw uno::RuntimeException();
158 return StgOpenStorage( o3tl::toW(aFilePath.getStr()),
160 STGM_READWRITE | STGM_TRANSACTED,
168 const datatransfer::DataFlavor& aFlavor,
171 bool bAnyIsReady =
false;
174 if ( aFlavor.DataType ==
cppu::UnoType<uno::Sequence< sal_Int8 >>::get() )
178 std::unique_ptr<sal_Int8[]> pBuf;
179 sal_uInt32 nBufSize = 0;
182 if ( aMedium.tymed == TYMED_MFPICT )
184 aFormat =
"image/x-wmf";
185 METAFILEPICT* pMF =
static_cast<METAFILEPICT*
>(GlobalLock( aMedium.hMetaFilePict ));
188 nBufSize = GetMetaFileBitsEx( pMF->hMF, 0,
nullptr ) + 22;
193 *
reinterpret_cast<long*
>( pBuf.get() ) = 0x9ac6cdd7L;
194 *
reinterpret_cast<short*
>( pBuf.get()+6 ) = SHORT(0);
195 *
reinterpret_cast<short*
>( pBuf.get()+8 ) = SHORT(0);
196 *
reinterpret_cast<short*
>( pBuf.get()+10 ) =
static_cast<SHORT
>(pMF->xExt);
197 *
reinterpret_cast<short*
>( pBuf.get()+12 ) =
static_cast<SHORT
>(pMF->yExt);
198 *
reinterpret_cast<short*
>( pBuf.get()+14 ) = USHORT(2540);
201 if ( nBufSize && nBufSize == GetMetaFileBitsEx( pMF->hMF, nBufSize - 22, pBuf.get() + 22 ) )
203 if ( aFlavor.MimeType.matchAsciiL(
"application/x-openoffice-wmf;windows_formatname=\"Image WMF\"", 57 ) )
205 aResult <<= uno::Sequence< sal_Int8 >( pBuf.get(), nBufSize );
210 GlobalUnlock( aMedium.hMetaFilePict );
213 else if ( aMedium.tymed == TYMED_ENHMF )
215 aFormat =
"image/x-emf";
216 nBufSize = GetEnhMetaFileBits( aMedium.hEnhMetaFile, 0,
nullptr );
218 if ( nBufSize && nBufSize == GetEnhMetaFileBits( aMedium.hEnhMetaFile, nBufSize,
reinterpret_cast<LPBYTE
>(pBuf.get()) ) )
220 if ( aFlavor.MimeType.matchAsciiL(
"application/x-openoffice-emf;windows_formatname=\"Image EMF\"", 57 ) )
222 aResult <<= uno::Sequence< sal_Int8 >( pBuf.get(), nBufSize );
227 else if ( aMedium.tymed == TYMED_GDI )
229 aFormat =
"image/x-MS-bmp";
234 GetObjectW(aMedium.hBitmap,
sizeof(aBmp), &aBmp);
235 nBufSize = aBmp.bmWidthBytes * aBmp.bmHeight;
238 if ( nBufSize && nBufSize == sal::static_int_cast< ULONG >( GetBitmapBits( aMedium.hBitmap, nBufSize, pBuf.get() ) ) )
240 if ( aFlavor.MimeType.matchAsciiL(
"application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", 54 ) )
242 aResult <<= uno::Sequence< sal_Int8 >( pBuf.get(), nBufSize );
248 if ( pBuf && !bAnyIsReady )
251 if ( aFlavor.MimeType.match( supportedFormat.MimeType )
252 && aFlavor.DataType == supportedFormat.DataType
253 && aFlavor.DataType ==
cppu::UnoType<uno::Sequence< sal_Int8 >>::get() )
269 if ( aFlavor.MimeType.match( supportedFormat.MimeType )
270 && aFlavor.DataType == supportedFormat.DataType )
279 if (
aSeq.getLength() == 16 )
284 for(
int nInd = 0; nInd < 8; nInd++ )
305 while( *( ++pStr ) ==
'&' );
309 aResult += OUStringChar( *pStr );
320: m_pInterfaceContainer( nullptr )
322, m_bModified( false )
324, m_pUnoOleObject( pUnoOleObject )
325, m_pOleWrapClientSite( nullptr )
326, m_pImplAdviseSink( nullptr )
327, m_nOLEMiscFlags( 0 )
330, m_bOleInitialized( false )
331, m_bWorkaroundActive( false )
335 HRESULT
hr = OleInitialize(
nullptr );
336 if (
hr == S_OK ||
hr == S_FALSE )
340 SAL_WARN(
"embeddedobj.ole",
"OleComponent ctor: OleInitialize() failed with 0x"
341 << OUString::number(
static_cast<sal_uInt32
>(
hr), 16) <<
": "
342 << WindowsErrorStringFromHRESULT(
hr));
357 "The object was not closed successfully! DISASTER is possible!" );
364 }
catch(
const uno::Exception& ) {}
444 if ( !aTempURL.getLength() )
445 throw uno::RuntimeException();
448 OUString aTempFilePath;
449 if ( ::osl::FileBase::getSystemPathFromFileURL( aTempURL, aTempFilePath ) != ::osl::FileBase::E_None )
450 throw uno::RuntimeException();
452 HRESULT
hr = StgCreateDocfile( o3tl::toW(aTempFilePath.getStr()), STGM_CREATE | STGM_READWRITE | STGM_TRANSACTED | STGM_DELETEONRELEASE, 0, &
m_pNativeImpl->
m_pIStorage );
454 throw io::IOException();
460 uno::Sequence< datatransfer::DataFlavor > aResult;
461 for ( sal_uInt32 nAsp = 1; nAsp <= 8; nAsp *= 2 )
462 if ( ( nSupportedAspects & nAsp ) == nAsp )
466 sal_Int32
nLength = aResult.getLength();
468 auto pResult = aResult.getArray();
485 throw embed::WrongStateException();
489 sal::systools::COMReference< IDataObject > pDataObject(
m_pNativeImpl->
m_pObj, sal::systools::COM_QUERY);
492 sal::systools::COMReference< IEnumFORMATETC > pFormatEnum;
493 HRESULT
hr = pDataObject->EnumFormatEtc( DATADIR_GET, &pFormatEnum );
494 if ( SUCCEEDED(
hr ) && pFormatEnum )
501 sal_uInt32 nSupportedAspects = 0;
504 HRESULT hr2 = pFormatEnum->Next(
MAX_ENUM_ELE, pElem, &nNum );
505 if( hr2 == S_OK || hr2 == S_FALSE )
507 for( sal_uInt32 nInd = 0; nInd <
FORMATS_NUM; nInd++ )
511 nSupportedAspects |= pElem[nInd].dwAspect;
548 if ( sal::systools::COMReference< IOleCache > pIOleCache{
m_pNativeImpl->
m_pObj, sal::systools::COM_QUERY } )
550 IEnumSTATDATA* pEnumSD =
nullptr;
551 HRESULT hr2 = pIOleCache->EnumCache( &pEnumSD );
553 if ( SUCCEEDED( hr2 ) && pEnumSD )
558 while( SUCCEEDED( pEnumSD->Next( 1, &aSD, &nNum ) ) && nNum == 1 )
559 hr2 = pIOleCache->Uncache( aSD.dwConnection );
564 FORMATETC aFormat = { 0,
nullptr, DVASPECT_CONTENT, -1, TYMED_MFPICT };
565 hr2 = pIOleCache->Cache( &aFormat, ADVFCACHE_ONSAVE, &nConn );
589 HRESULT OleLoadSeh(LPSTORAGE pIStorage, LPVOID* ppObj)
603 hr = OleLoad(pIStorage, IID_IUnknown,
nullptr, ppObj);
604 } __except( EXCEPTION_EXECUTE_HANDLER ) {
607 if (pIStorage && hr != STG_E_FILENOTFOUND)
608 pIStorage->Release();
616 if ( !aTempURL.getLength() )
617 throw lang::IllegalArgumentException();
620 throw io::IOException();
626 throw io::IOException();
631 throw uno::RuntimeException();
635 throw uno::RuntimeException();
642 throw io::IOException();
646 throw uno::RuntimeException();
648 IDataObject * pDO =
nullptr;
649 HRESULT
hr = OleGetClipboard( &pDO );
650 if( SUCCEEDED(
hr ) && pDO )
652 hr = OleQueryCreateFromData( pDO );
653 if( S_OK == GetScode(
hr ) )
655 hr = OleCreateFromData( pDO,
671 throw uno::RuntimeException();
674 throw uno::RuntimeException();
683 throw lang::IllegalArgumentException();
686 throw io::IOException();
690 throw uno::RuntimeException();
694 HRESULT
hr = OleCreate( aClsID,
703 throw uno::RuntimeException();
706 throw uno::RuntimeException();
726 throw io::IOException();
730 throw uno::RuntimeException();
733 if ( ::osl::FileBase::getSystemPathFromFileURL( aFileURL, aFilePath ) != ::osl::FileBase::E_None )
734 throw uno::RuntimeException();
736 HRESULT
hr = OleCreateFromFile( CLSID_NULL,
737 o3tl::toW(aFilePath.getStr()),
746 throw uno::RuntimeException();
749 throw uno::RuntimeException();
756 throw io::IOException();
760 throw uno::RuntimeException();
763 if ( ::osl::FileBase::getSystemPathFromFileURL( aFileURL, aFilePath ) != ::osl::FileBase::E_None )
764 throw uno::RuntimeException();
766 HRESULT
hr = OleCreateLinkToFile( o3tl::toW(aFilePath.getStr()),
775 throw uno::RuntimeException();
778 throw uno::RuntimeException();
784 if ( !pOleLinkComponent || !pOleLinkComponent->m_pNativeImpl->m_pObj )
785 throw lang::IllegalArgumentException();
788 throw io::IOException();
790 sal::systools::COMReference< IDataObject > pDataObject(pOleLinkComponent->m_pNativeImpl->m_pObj, sal::systools::COM_QUERY);
791 if ( pDataObject && SUCCEEDED( OleQueryCreateFromData( pDataObject ) ) )
796 throw uno::RuntimeException();
798 OleCreateFromData( pDataObject,
809 sal::systools::COMReference< IOleLink > pOleLink(
m_pNativeImpl->
m_pObj, sal::systools::COM_QUERY);
811 throw io::IOException();
813 sal::systools::COMReference< IMoniker > pMoniker;
814 HRESULT
hr = pOleLink->GetSourceMoniker( &pMoniker );
815 if ( FAILED(
hr ) || !pMoniker )
816 throw io::IOException();
820 hr = pMoniker->IsSystemMoniker( &aMonType );
821 if ( SUCCEEDED(
hr ) && aMonType == MKSYS_FILEMONIKER )
823 sal::systools::COMReference< IMalloc > pMalloc;
824 hr = CoGetMalloc( 1, &pMalloc );
825 OSL_ENSURE(SUCCEEDED(
hr) && pMalloc,
"CoGetMalloc() failed!");
827 LPOLESTR pOleStr =
nullptr;
828 hr = pOleLink->GetSourceDisplayName( &pOleStr );
829 if ( SUCCEEDED(
hr ) && pOleStr )
831 std::wstring aFilePath( pOleStr );
833 pMalloc->Free( pOleStr );
835 hr = OleCreateFromFile( CLSID_NULL,
849 sal::systools::COMReference< IBindCtx > pBindCtx;
850 hr = CreateBindCtx( 0, &pBindCtx );
851 if ( SUCCEEDED(
hr ) && pBindCtx )
853 sal::systools::COMReference< IStorage > pObjectStorage;
854 hr = pMoniker->BindToStorage( pBindCtx,
nullptr, IID_IStorage,
reinterpret_cast<void**
>(&pObjectStorage) );
855 if ( SUCCEEDED(
hr ) && pObjectStorage )
858 if ( SUCCEEDED(
hr ) )
867 throw uno::RuntimeException();
870 throw uno::RuntimeException();
878 throw embed::WrongStateException();
886 if (
hr == REGDB_E_CLASSNOTREG )
887 throw embed::UnreachableStateException();
889 throw io::IOException();
896 const awt::Size& aMultiplier,
897 const awt::Size& aDivisor )
901 sal_Int64 nWidth =
static_cast<sal_Int64
>(aSize.Width) *
static_cast<sal_Int64
>(aMultiplier.Width) /
static_cast<sal_Int64
>(aDivisor.Width);
902 sal_Int64 nHeight =
static_cast<sal_Int64
>(aSize.Height) *
static_cast<sal_Int64
>(aMultiplier.Height) /
static_cast<sal_Int64
>(aDivisor.Height);
905 "Unacceptable result size!" );
907 aResult.Width =
static_cast<sal_Int32
>(nWidth);
908 aResult.Height =
static_cast<sal_Int32
>(nHeight);
924 throw embed::WrongStateException();
928 sal::systools::COMReference< IEnumOLEVERB > pEnum;
933 sal_Int32 nSeqSize = 0;
938 if(
hr == S_OK ||
hr == S_FALSE )
942 for( sal_uInt32 nInd = 0; nInd < nNum; nInd++ )
944 pVerbList[nSeqSize-nNum+nInd].VerbID = szEle[ nInd ].lVerb;
945 pVerbList[nSeqSize-nNum+nInd].VerbName =
WinAccToVcl_Impl( o3tl::toU(szEle[ nInd ].lpszVerbName) );
946 pVerbList[nSeqSize-nNum+nInd].VerbFlags = szEle[ nInd ].fuFlags;
947 pVerbList[nSeqSize-nNum+nInd].VerbAttributes = szEle[ nInd ].grfAttribs;
964 throw embed::WrongStateException();
968 throw io::IOException();
975 throw io::IOException();
982 throw embed::WrongStateException();
991 throw embed::WrongStateException();
993 DWORD nMSAspect =
static_cast<DWORD
>(nAspect);
995 SIZEL aSize = { aVisAreaSize.
Width, aVisAreaSize.Height };
1005 throw io::IOException();
1013 throw embed::WrongStateException();
1015 DWORD nMSAspect =
static_cast<DWORD
>(nAspect);
1017 bool bGotSize =
false;
1019 if ( nMSAspect == DVASPECT_CONTENT )
1022 sal::systools::COMReference< IDataObject > pDataObject(
m_pNativeImpl->
m_pObj, sal::systools::COM_QUERY);
1027 aFormat.dwAspect = nMSAspect;
1029 HRESULT
hr = pDataObject->GetData( &aFormat, &aMedium );
1031 if (
hr == RPC_E_WRONG_THREAD)
1038 hr = pDataObject->GetData(&aFormat, &aMedium);
1042 if ( SUCCEEDED(
hr ) && aMedium.tymed == TYMED_MFPICT )
1044 METAFILEPICT* pMF =
static_cast<METAFILEPICT*
>(GlobalLock( aMedium.hMetaFilePict ));
1078 aSize.Width =
static_cast<sal_Int32
>(nX);
1079 aSize.Height =
static_cast<sal_Int32
>(nY);
1083 OSL_FAIL(
"Unexpected size is provided!" );
1086 else if (!SUCCEEDED(
hr))
1088 SAL_WARN(
"embeddedobj.ole",
" OleComponent::GetExtent: GetData() failed");
1091 if ( SUCCEEDED(
hr ) )
1092 ::ReleaseStgMedium(&aMedium);
1097 throw lang::IllegalArgumentException();
1106 throw embed::WrongStateException();
1108 DWORD nMSAspect =
static_cast<DWORD
>(nAspect);
1122 SAL_WARN(
"embeddedobj.ole",
" OleComponent::GetCachedExtent: GetExtent() failed");
1123 throw lang::IllegalArgumentException();
1126 return awt::Size( aSize.cx, aSize.cy );
1133 throw embed::WrongStateException();
1135 DWORD nMSAspect =
static_cast<DWORD
>(nAspect);
1140 SAL_WARN(
"embeddedobj.ole",
" OleComponent::GetRecommendedExtent: GetExtent() failed");
1141 throw lang::IllegalArgumentException();
1144 return awt::Size( aSize.cx, aSize.cy );
1151 throw embed::WrongStateException();
1155 return static_cast<sal_Int64
>(nResult);
1162 throw embed::WrongStateException();
1167 throw io::IOException();
1169 return MimeConfigurationHelper::GetSequenceClassID( aCLSID.Data1, aCLSID.Data2, aCLSID.Data3,
1170 aCLSID.Data4[0], aCLSID.Data4[1],
1171 aCLSID.Data4[2], aCLSID.Data4[3],
1172 aCLSID.Data4[4], aCLSID.Data4[5],
1173 aCLSID.Data4[6], aCLSID.Data4[7] );
1180 throw embed::WrongStateException();
1185 sal::systools::COMReference< IPersistStorage > pPersistStorage(
m_pNativeImpl->
m_pObj, sal::systools::COM_QUERY);
1186 if ( !pPersistStorage )
1187 throw io::IOException();
1189 HRESULT
hr = pPersistStorage->IsDirty();
1190 return (
hr != S_FALSE );
1197 throw embed::WrongStateException();
1199 sal::systools::COMReference< IPersistStorage > pPersistStorage(
m_pNativeImpl->
m_pObj, sal::systools::COM_QUERY);
1200 if ( !pPersistStorage )
1201 throw io::IOException();
1213 SAL_WARN(
"embeddedobj.ole",
"OleComponent::StoreOwnTmpIfNecessary: GetUserClassID() failed");
1214 throw io::IOException();
1219 throw io::IOException();
1232 throw io::IOException();
1234 hr = pPersistStorage->SaveCompleted(
nullptr );
1235 if ( FAILED(
hr ) &&
hr != E_UNEXPECTED )
1236 throw io::IOException();
1244 bool bResult =
false;
1248 osl::MutexGuard aGuard(
m_aMutex );
1252 pLockObject->acquire();
1258 bResult = pLockObject->SaveObject_Impl();
1259 pLockObject->release();
1268 bool bResult =
false;
1272 osl::MutexGuard aGuard(
m_aMutex );
1277 pLockObject->acquire();
1283 bResult = pLockObject->OnShowWindow_Impl( bShow );
1284 pLockObject->release();
1297 osl::MutexGuard aGuard(
m_aMutex );
1302 if ( xLockObject.is() )
1304 uno::Reference < awt::XRequestCallback > xRequestCallback(
1305 m_xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.awt.AsyncCallback",
m_xContext),
1317 osl::MutexGuard aGuard(
m_aMutex );
1322 if ( xLockObject.is() )
1324 uno::Reference < awt::XRequestCallback > xRequestCallback(
1325 m_xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.awt.AsyncCallback",
m_xContext),
1335 uno::Reference< uno::XInterface > xSelfHold;
1339 throw lang::DisposedException();
1348 if (pContainer !=
nullptr)
1355 static_cast<util::XCloseListener*
>(pIterator.
next())
1356 ->queryClosing(aSource, bDeliverOwnership);
1358 catch (
const uno::RuntimeException&)
1367 if (pContainer !=
nullptr)
1374 static_cast<util::XCloseListener*
>(pCloseIterator.
next())
1375 ->notifyClosing(aSource);
1377 catch (
const uno::RuntimeException&)
1392 ::osl::MutexGuard aGuard(
m_aMutex );
1394 throw lang::DisposedException();
1405 ::osl::MutexGuard aGuard(
m_aMutex );
1407 throw lang::DisposedException();
1418 ::osl::MutexGuard aGuard(
m_aMutex );
1420 throw lang::DisposedException();
1423 throw embed::WrongStateException();
1426 bool bSupportedFlavor =
false;
1433 sal::systools::COMReference< IDataObject > pDataObject(
m_pNativeImpl->
m_pObj, sal::systools::COM_QUERY);
1435 throw io::IOException();
1454 for ( sal_Int32 nInd = 0; nInd <
FORMATS_NUM; nInd++ )
1458 aFormat.dwAspect = nRequestedAspect;
1460 HRESULT
hr = pDataObject->GetData( &aFormat, &aMedium );
1461 if ( SUCCEEDED(
hr ) )
1464 ::ReleaseStgMedium(&aMedium);
1465 if ( bSupportedFlavor )
1481 && aFlavor.MimeType ==
"application/x-openoffice-contentstream" )
1484 bSupportedFlavor =
true;
1485 uno::Reference < io::XStream > xTempFileStream(
1487 uno::UNO_QUERY_THROW );
1489 uno::Reference< io::XOutputStream > xTempOutStream = xTempFileStream->getOutputStream();
1490 uno::Reference< io::XInputStream > xTempInStream = xTempFileStream->getInputStream();
1491 if ( !(xTempOutStream.is() && xTempInStream.is()) )
1492 throw io::IOException();
1496 throw uno::RuntimeException();
1500 xTempOutStream->closeOutput();
1501 xTempOutStream.clear();
1503 aResult <<= xTempInStream;
1506 if ( !bSupportedFlavor )
1507 throw datatransfer::UnsupportedFlavorException();
1515 ::osl::MutexGuard aGuard(
m_aMutex );
1517 throw lang::DisposedException();
1520 throw embed::WrongStateException();
1530 ::osl::MutexGuard aGuard(
m_aMutex );
1532 throw lang::DisposedException();
1535 throw embed::WrongStateException();
1542 for (
auto const & supportedFormat : std::as_const(
m_aDataFlavors) )
1543 if ( supportedFormat.MimeType.equals( aFlavor.MimeType ) && supportedFormat.DataType == aFlavor.DataType )
1555 catch (
const uno::Exception& )
1562 ::osl::MutexGuard aGuard(
m_aMutex );
1564 throw lang::DisposedException();
1575 ::osl::MutexGuard aGuard(
m_aMutex );
1577 throw lang::DisposedException();
1588 uno::Sequence < sal_Int8 > aCLSID =
GetCLSID();
1589 if ( MimeConfigurationHelper::ClassIDsEqual( aIdentifier, aCLSID ) )
1593 sal_Int32
nLength = aIdentifier.getLength();
1596 for ( sal_Int32
n=8;
n<16;
n++ )
1597 if ( aIdentifier[
n] != aCLSID[
n] )
1599 if ( aIdentifier[7] == aCLSID[6] &&
1600 aIdentifier[6] == aCLSID[7] &&
1601 aIdentifier[5] == aCLSID[4] &&
1602 aIdentifier[4] == aCLSID[5] &&
1603 aIdentifier[3] == aCLSID[0] &&
1604 aIdentifier[2] == aCLSID[1] &&
1605 aIdentifier[1] == aCLSID[2] &&
1606 aIdentifier[0] == aCLSID[3] )
1610 catch (
const uno::Exception& )
1630 if ( pContainer !=
nullptr )
1637 lang::EventObject
aEvent(
static_cast<util::XModifiable*
>(
this) );
1638 static_cast<util::XModifyListener*
>(pIterator.
next())->modified(
aEvent );
1640 catch(
const uno::RuntimeException& )
1651 ::osl::MutexGuard aGuard(
m_aMutex );
1653 throw lang::DisposedException();
1663 ::osl::MutexGuard aGuard(
m_aMutex );
1665 throw lang::DisposedException();
Reference< XComponentContext > m_xContext
void RetrieveObjectDataFlavors_Impl()
virtual void SAL_CALL close(sal_Bool DeliverOwnership) override
sal_Int64 GetMiscStatus(sal_Int64 nAspect)
virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor &aFlavor) override
void SetExtent(const css::awt::Size &aVisAreaSize, sal_Int64 nAspect)
css::uno::Sequence< sal_Int8 > GetCLSID()
virtual void SAL_CALL removeCloseListener(const css::uno::Reference< css::util::XCloseListener > &Listener) override
void CreateNewIStorage_Impl()
void SetHostName(const OUString &aEmbDocName)
OleComponent(const css::uno::Reference< css::uno::XComponentContext > &xContext, OleEmbeddedObject *pOleObj)
css::uno::Sequence< css::datatransfer::DataFlavor > m_aDataFlavors
void disconnectEmbeddedObject()
css::uno::Sequence< css::embed::VerbDescriptor > m_aVerbList
virtual void SAL_CALL dispose() override
static void CreateObjectFromData(const css::uno::Reference< css::datatransfer::XTransferable > &xTransfer)
virtual void SAL_CALL setModified(sal_Bool bModified) override
OleEmbeddedObject * m_pUnoOleObject
void StoreOwnTmpIfNecessary()
void CreateObjectFromFile(const OUString &aFileName)
OleWrapperClientSite * m_pOleWrapClientSite
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
void LoadEmbeddedObject(const OUString &aTempURL)
virtual sal_Bool SAL_CALL isModified() override
void InitEmbeddedCopyOfLink(rtl::Reference< OleComponent > const &pOleLinkComponent)
css::awt::Size GetExtent(sal_Int64 nAspect)
OleWrapperAdviseSink * m_pImplAdviseSink
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
css::awt::Size GetCachedExtent(sal_Int64 nAspect)
sal_Int32 m_nOLEMiscFlags
static css::awt::Size CalculateWithFactor(const css::awt::Size &aSize, const css::awt::Size &aMultiplier, const css::awt::Size &aDivisor)
bool IsWorkaroundActive() const
css::awt::Size GetRecommendedExtent(sal_Int64 nAspect)
void CreateLinkFromFile(const OUString &aFileName)
bool OnShowWindow_Impl(bool bShow)
virtual ~OleComponent() override
void CreateNewEmbeddedObject(const css::uno::Sequence< sal_Int8 > &aSeqCLSID)
virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor &aFlavor) override
virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override
void CreateObjectFromClipboard()
bool InitializeObject_Impl()
comphelper::OMultiTypeInterfaceContainerHelper2 * m_pInterfaceContainer
OleComponentNative_Impl * m_pNativeImpl
void ExecuteVerb(sal_Int32 nVerbID)
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
virtual void SAL_CALL addCloseListener(const css::uno::Reference< css::util::XCloseListener > &Listener) override
css::uno::Sequence< css::embed::VerbDescriptor > GetVerbList()
css::uno::Reference< css::uno::XComponentContext > m_xContext
void OnViewChange_Impl(sal_uInt32 dwAspect)
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Represents an OLE object that has native data and we try to let an external application handle that d...
void disconnectOleComponent()
void disconnectOleComponent()
constexpr tools::Long Width() const
css::uno::XInterface * next()
bool hasMoreElements() const
OInterfaceContainerHelper2 * getContainer(const css::uno::Type &rKey) const
sal_Int32 removeInterface(const css::uno::Type &rKey, const css::uno::Reference< css::uno::XInterface > &rxIFace)
sal_Int32 addInterface(const css::uno::Type &rKey, const css::uno::Reference< css::uno::XInterface > &r)
void disposeAndClear(const css::lang::EventObject &rEvt)
bool ConvertBufferToFormat(void *pBuf, sal_uInt32 nBufSize, const OUString &aMimeType, uno::Any &aResult)
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
#define OLECOMP_ONVIEWCHANGE
sal_Int64 getSomething_cast(void *p)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
auto syncExecute(FuncT const &func) -> decltype(func())
SwNodeOffset abs(const SwNodeOffset &a)
std::vector< FORMATETC * > FormatEtcList
static HRESULT OpenIStorageFromURL_Impl(const OUString &aURL, IStorage **ppIStorage)
static DWORD GetAspectFromFlavor(const datatransfer::DataFlavor &aFlavor)
static bool GetClassIDFromSequence_Impl(uno::Sequence< sal_Int8 > const &aSeq, CLSID &aResult)
static OUString WinAccToVcl_Impl(const sal_Unicode *pStr)
FORMATETC const pFormatTemplates[FORMATS_NUM]
static OUString GetFlavorSuffixFromAspect(DWORD nAsp)
OUString GetNewTempFileURL_Impl(const uno::Reference< uno::XComponentContext > &xContext)
OleComponentNative_Impl()
sal::systools::COMReference< IOleObject > m_pOleObject
sal::systools::COMReference< IUnknown > m_pObj
sal::systools::COMReference< IViewObject2 > m_pViewObject2
uno::Sequence< datatransfer::DataFlavor > m_aSupportedGraphFormats
bool GraphicalFlavor(const datatransfer::DataFlavor &aFlavor)
FormatEtcList m_aFormatsList
bool ConvertDataForFlavor(const STGMEDIUM &aMedium, const datatransfer::DataFlavor &aFlavor, uno::Any &aResult)
uno::Sequence< datatransfer::DataFlavor > GetFlavorsForAspects(sal_uInt32 nSupportedAspects)
sal::systools::COMReference< IStorage > m_pIStorage