diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-08-30 17:59:59 +0200 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-08-30 17:59:59 +0200 |
commit | 1cf116aef28525ff236cd0cf51ba2b1a725afc6c (patch) | |
tree | afc7d1c3ab17a7d68ab53347483533eecc80710c /vcl/aqua | |
parent | 56c272afef2b8b2e281eb1ca65b8effc5f5cbb8d (diff) |
vcl115: #163153# we need to release the clipboard after flush and ignore further requests for data.
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/source/dtrans/aqua_clipboard.cxx | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.cxx b/vcl/aqua/source/dtrans/aqua_clipboard.cxx index 52fb13e1e11f..abffeebcb6c1 100644 --- a/vcl/aqua/source/dtrans/aqua_clipboard.cxx +++ b/vcl/aqua/source/dtrans/aqua_clipboard.cxx @@ -322,14 +322,17 @@ void AquaClipboard::fireLostClipboardOwnershipEvent(Reference<XClipboardOwner> o void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type) { - DataProviderPtr_t dp = mpDataFlavorMapper->getDataProvider(type, mXClipboardContent); - NSData* pBoardData = NULL; - - if (dp.get() != NULL) - { - pBoardData = (NSData*)dp->getSystemData(); - [sender setData: pBoardData forType: type]; - } + if( mXClipboardContent.is() ) + { + DataProviderPtr_t dp = mpDataFlavorMapper->getDataProvider(type, mXClipboardContent); + NSData* pBoardData = NULL; + + if (dp.get() != NULL) + { + pBoardData = (NSData*)dp->getSystemData(); + [sender setData: pBoardData forType: type]; + } + } } @@ -340,20 +343,21 @@ void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type) void SAL_CALL AquaClipboard::flushClipboard() throw(RuntimeException) { - if (mXClipboardContent.is()) + if (mXClipboardContent.is()) { Sequence<DataFlavor> flavorList = mXClipboardContent->getTransferDataFlavors(); sal_uInt32 nFlavors = flavorList.getLength(); for (sal_uInt32 i = 0; i < nFlavors; i++) - { + { NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i]); if (sysType != NULL) - { + { provideDataForType(mPasteboard, sysType); - } - } + } + } + mXClipboardContent.clear(); } } |