[Libreoffice-commits] core.git: vcl/aqua
Armin Le Grand
alg at apache.org
Sun Jun 16 12:05:44 PDT 2013
vcl/aqua/source/dtrans/DataFlavorMapping.cxx | 30 +++++++++++----------------
vcl/aqua/source/dtrans/DataFlavorMapping.hxx | 4 ---
vcl/aqua/source/dtrans/OSXTransferable.cxx | 3 +-
vcl/aqua/source/dtrans/aqua_clipboard.cxx | 3 +-
4 files changed, 18 insertions(+), 22 deletions(-)
New commits:
commit 3af1951e5568a3d5885f1b75865bffd424d9ec4e
Author: Armin Le Grand <alg at apache.org>
Date: Thu Jun 6 12:10:35 2013 +0000
Resolves: #i122420# Re-activated the internal OpenOfficeToSystemFlavor
(cherry picked from commit 11d6690fddcebec67baba285f87e647241ebfd82)
Change-Id: I23c71470e587f8ece54aa9f2991634211ff3b4b5
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index 6381e4d..4d04f7b 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 3c1ee87..a7ae636 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 89e5c30..5655ada 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 ce14626..285f244 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)
{
More information about the Libreoffice-commits
mailing list