diff options
author | Armin Le Grand <alg@apache.org> | 2013-06-06 12:10:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-16 20:04:16 +0100 |
commit | 3af1951e5568a3d5885f1b75865bffd424d9ec4e (patch) | |
tree | f22832b2f31fb9e6d481ecae24ea9e0b920edb1e /vcl/aqua | |
parent | 5aee0c13cc62a81a38d4132db7972dc301c21b3d (diff) |
Resolves: #i122420# Re-activated the internal OpenOfficeToSystemFlavor
(cherry picked from commit 11d6690fddcebec67baba285f87e647241ebfd82)
Change-Id: I23c71470e587f8ece54aa9f2991634211ff3b4b5
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/source/dtrans/DataFlavorMapping.cxx | 30 | ||||
-rw-r--r-- | vcl/aqua/source/dtrans/DataFlavorMapping.hxx | 4 | ||||
-rw-r--r-- | vcl/aqua/source/dtrans/OSXTransferable.cxx | 3 | ||||
-rw-r--r-- | vcl/aqua/source/dtrans/aqua_clipboard.cxx | 3 |
4 files changed, 18 insertions, 22 deletions
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx index 6381e4d83c63..4d04f7b89e5e 100644 --- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx +++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx @@ -544,9 +544,10 @@ DataFlavor DataFlavorMapper::systemToOpenOfficeFlavor(NSString* systemDataFlavor return oOOFlavor; } -NSString* DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor) const +NSString* DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor, bool& rbInternal) const { NSString* sysFlavor = NULL; + rbInternal = false; for( size_t i = 0; i < SIZE_FLAVOR_MAP; ++i ) { @@ -556,17 +557,16 @@ NSString* DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor } } - return sysFlavor; -} + if(!sysFlavor) + { + rbInternal = true; + OfficeOnlyTypes::const_iterator it = maOfficeOnlyTypes.find( oOOFlavor.MimeType ); -NSString* DataFlavorMapper::internalOpenOfficeToSystemFlavor(const DataFlavor& oOOFlavor) const -{ - NSString* sysFlavor = NULL; - OfficeOnlyTypes::const_iterator it = maOfficeOnlyTypes.find( oOOFlavor.MimeType ); - if( it == maOfficeOnlyTypes.end() ) - sysFlavor = maOfficeOnlyTypes[ oOOFlavor.MimeType ] = OUStringToNSString( oOOFlavor.MimeType ); - else - sysFlavor = it->second; + if( it == maOfficeOnlyTypes.end() ) + sysFlavor = maOfficeOnlyTypes[ oOOFlavor.MimeType ] = OUStringToNSString( oOOFlavor.MimeType ); + else + sysFlavor = it->second; + } return sysFlavor; } @@ -694,7 +694,7 @@ NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const com::sun::star::uno: sal_uInt32 nFlavors = flavors.getLength(); NSMutableArray* array = [[NSMutableArray alloc] initWithCapacity: 1]; - bool bNeedDummyInternalFlavor (true); + bool bNeedDummyInternalFlavor(false); for (sal_uInt32 i = 0; i < nFlavors; i++) { @@ -705,11 +705,7 @@ NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const com::sun::star::uno: } else { - NSString* str = openOfficeToSystemFlavor(flavors[i]); - if (str == NULL) - str = internalOpenOfficeToSystemFlavor(flavors[i]); - else - bNeedDummyInternalFlavor = false; + NSString* str = openOfficeToSystemFlavor(flavors[i], bNeedDummyInternalFlavor); if (str != NULL) { diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.hxx b/vcl/aqua/source/dtrans/DataFlavorMapping.hxx index 3c1ee87b7c6f..a7ae636c8748 100644 --- a/vcl/aqua/source/dtrans/DataFlavorMapping.hxx +++ b/vcl/aqua/source/dtrans/DataFlavorMapping.hxx @@ -81,7 +81,7 @@ public: If there is no suiteable mapping available NULL will be returned. */ - NSString* openOfficeToSystemFlavor(const com::sun::star::datatransfer::DataFlavor& oooDataFlavor) const; + NSString* openOfficeToSystemFlavor(const com::sun::star::datatransfer::DataFlavor& oooDataFlavor, bool& rbInternal) const; /* Select the best available image data type If there is no suiteable mapping available NULL will @@ -128,8 +128,6 @@ private: */ bool isValidMimeContentType(const OUString& contentType) const; - NSString* internalOpenOfficeToSystemFlavor(const com::sun::star::datatransfer::DataFlavor& oooDataFlavor) const; - private: ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XMimeContentTypeFactory> mrXMimeCntFactory; typedef boost::unordered_map< OUString, NSString*, OUStringHash > OfficeOnlyTypes; diff --git a/vcl/aqua/source/dtrans/OSXTransferable.cxx b/vcl/aqua/source/dtrans/OSXTransferable.cxx index 89e5c304c598..5655ada94ab0 100644 --- a/vcl/aqua/source/dtrans/OSXTransferable.cxx +++ b/vcl/aqua/source/dtrans/OSXTransferable.cxx @@ -73,10 +73,11 @@ Any SAL_CALL OSXTransferable::getTransferData( const DataFlavor& aFlavor ) static_cast<XTransferable*>(this)); } + bool bInternal(false); NSString* sysFormat = (aFlavor.MimeType.startsWith("image/png")) ? mDataFlavorMapper->openOfficeImageToSystemFlavor( mPasteboard ) - : mDataFlavorMapper->openOfficeToSystemFlavor(aFlavor); + : mDataFlavorMapper->openOfficeToSystemFlavor(aFlavor, bInternal); DataProviderPtr_t dp; if ([sysFormat caseInsensitiveCompare: NSFilenamesPboardType] == NSOrderedSame) diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.cxx b/vcl/aqua/source/dtrans/aqua_clipboard.cxx index ce1462612edb..285f2447c25f 100644 --- a/vcl/aqua/source/dtrans/aqua_clipboard.cxx +++ b/vcl/aqua/source/dtrans/aqua_clipboard.cxx @@ -326,10 +326,11 @@ void SAL_CALL AquaClipboard::flushClipboard() { Sequence<DataFlavor> flavorList = mXClipboardContent->getTransferDataFlavors(); sal_uInt32 nFlavors = flavorList.getLength(); + bool bInternal(false); for (sal_uInt32 i = 0; i < nFlavors; i++) { - NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i]); + NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i], bInternal); if (sysType != NULL) { |