summaryrefslogtreecommitdiff
path: root/dtrans/source/win32
diff options
context:
space:
mode:
Diffstat (limited to 'dtrans/source/win32')
-rw-r--r--dtrans/source/win32/clipb/exports.dxp1
-rw-r--r--dtrans/source/win32/clipb/wcbentry.cxx29
-rw-r--r--dtrans/source/win32/dnd/dndentry.cxx33
-rw-r--r--dtrans/source/win32/dnd/exports.dxp1
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/DOTransferable.cxx9
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/FmtFilter.cxx43
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/FmtFilter.hxx6
-rw-r--r--dtrans/source/win32/ftransl/exports.dxp1
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/ftransl/ftransl.cxx1
-rw-r--r--dtrans/source/win32/ftransl/ftranslentry.cxx29
10 files changed, 59 insertions, 94 deletions
diff --git a/dtrans/source/win32/clipb/exports.dxp b/dtrans/source/win32/clipb/exports.dxp
index f72beb0fcb31..926e49f5f1a5 100644
--- a/dtrans/source/win32/clipb/exports.dxp
+++ b/dtrans/source/win32/clipb/exports.dxp
@@ -1,4 +1,3 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/clipb/wcbentry.cxx b/dtrans/source/win32/clipb/wcbentry.cxx
index 579872c8eead..16c6bba65c94 100644
--- a/dtrans/source/win32/clipb/wcbentry.cxx
+++ b/dtrans/source/win32/clipb/wcbentry.cxx
@@ -98,35 +98,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( WINCLIPBOARD_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx
index 34bc550d46c3..05de69261094 100644
--- a/dtrans/source/win32/dnd/dndentry.cxx
+++ b/dtrans/source/win32/dnd/dndentry.cxx
@@ -73,39 +73,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( DNDSOURCE_REGKEY_NAME ) ) );
- bRetVal = sal_True;
-
- pXNewKey= static_cast< XRegistryKey* >( pRegistryKey );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( DNDTARGET_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/win32/dnd/exports.dxp b/dtrans/source/win32/dnd/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/win32/dnd/exports.dxp
+++ b/dtrans/source/win32/dnd/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx
index a8360095683b..bdbf09546a9c 100644..100755
--- a/dtrans/source/win32/dtobj/DOTransferable.cxx
+++ b/dtrans/source/win32/dtobj/DOTransferable.cxx
@@ -348,6 +348,15 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor
byteStream = WinENHMFPictToOOMFPict( stgmedium.hEnhMetaFile );
else if (CF_HDROP == aFormatEtc.getClipformat())
byteStream = CF_HDROPToFileList(stgmedium.hGlobal);
+ else if ( CF_BITMAP == aFormatEtc.getClipformat() )
+ {
+ byteStream = WinBITMAPToOOBMP(stgmedium.hBitmap);
+ if( aFormatEtc.getTymed() == TYMED_GDI &&
+ ! stgmedium.pUnkForRelease )
+ {
+ DeleteObject(stgmedium.hBitmap);
+ }
+ }
else
{
clipDataToByteStream( aFormatEtc.getClipformat( ), stgmedium, byteStream );
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx
index 235c63e298f9..5c7cc51485cb 100644..100755
--- a/dtrans/source/win32/dtobj/FmtFilter.cxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.cxx
@@ -535,4 +535,47 @@ ByteSequence_t CF_HDROPToFileList(HGLOBAL hGlobal)
return FileListToByteSequence(files);
}
+//------------------------------------------------------------------------
+// convert a windows bitmap handle into a openoffice bitmap
+//------------------------------------------------------------------------
+
+Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP aHBMP )
+{
+ Sequence< sal_Int8 > ooBmpStream;
+
+ SIZE aBmpSize;
+ if( GetBitmapDimensionEx( aHBMP, &aBmpSize ) )
+ {
+ // fill bitmap info header
+ size_t nDataBytes = 4 * aBmpSize.cy * aBmpSize.cy;
+ Sequence< sal_Int8 > aBitmapStream(
+ sizeof(BITMAPINFO) +
+ nDataBytes
+ );
+ PBITMAPINFOHEADER pBmp = (PBITMAPINFOHEADER)aBitmapStream.getArray();
+ pBmp->biSize = sizeof( BITMAPINFOHEADER );
+ pBmp->biWidth = aBmpSize.cx;
+ pBmp->biHeight = aBmpSize.cy;
+ pBmp->biPlanes = 1;
+ pBmp->biBitCount = 32;
+ pBmp->biCompression = BI_RGB;
+ pBmp->biSizeImage = (DWORD)nDataBytes;
+ pBmp->biXPelsPerMeter = 1000;
+ pBmp->biYPelsPerMeter = 1000;
+ pBmp->biClrUsed = 0;
+ pBmp->biClrImportant = 0;
+ if( GetDIBits( 0, // DC, 0 is a default GC, basically that of the desktop
+ aHBMP,
+ 0, aBmpSize.cy,
+ aBitmapStream.getArray() + sizeof(BITMAPINFO),
+ (LPBITMAPINFO)pBmp,
+ DIB_RGB_COLORS ) )
+ {
+ ooBmpStream = WinDIBToOOBMP( aBitmapStream );
+ }
+ }
+
+ return ooBmpStream;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dtrans/source/win32/dtobj/FmtFilter.hxx b/dtrans/source/win32/dtobj/FmtFilter.hxx
index 0e91710729fc..a484a4d3df65 100644..100755
--- a/dtrans/source/win32/dtobj/FmtFilter.hxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.hxx
@@ -66,6 +66,12 @@ com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinDIBToOOBMP( const com::sun
/*------------------------------------------------------------------------
input:
+ aWinDIB - sequence of bytes containing a windows bitmap handle
+------------------------------------------------------------------------*/
+com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP );
+
+/*------------------------------------------------------------------------
+ input:
aOOBmp - sequence of bytes containing a openoffice bitmap
------------------------------------------------------------------------*/
com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OOBmpToWinDIB( com::sun::star::uno::Sequence< sal_Int8 >& aOOBmp );
diff --git a/dtrans/source/win32/ftransl/exports.dxp b/dtrans/source/win32/ftransl/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/win32/ftransl/exports.dxp
+++ b/dtrans/source/win32/ftransl/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx
index ca2d29448d7d..456510145ab5 100644..100755
--- a/dtrans/source/win32/ftransl/ftransl.cxx
+++ b/dtrans/source/win32/ftransl/ftransl.cxx
@@ -278,6 +278,7 @@ void SAL_CALL CDataFormatTranslator::initTranslationTable()
m_TranslTable.push_back(FormatEntry("application/x-openoffice-dif;windows_formatname=\"DIF\"", "DIF", "DIF", CF_DIF, CPPUTYPE_DEFAULT));
// SOT_FORMAT_BITMAP
m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_DIB, CPPUTYPE_DEFAULT));
+ m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_BITMAP, CPPUTYPE_DEFAULT));
// SOT_FORMAT_STRING
m_TranslTable.push_back(FormatEntry("text/plain;charset=utf-16", "Unicode-Text", "", CF_UNICODETEXT, CppuType_String));
// Format Locale - for internal use
diff --git a/dtrans/source/win32/ftransl/ftranslentry.cxx b/dtrans/source/win32/ftransl/ftranslentry.cxx
index 3d5bd247a199..b8491fbb0481 100644
--- a/dtrans/source/win32/ftransl/ftranslentry.cxx
+++ b/dtrans/source/win32/ftransl/ftranslentry.cxx
@@ -101,35 +101,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services