[Libreoffice-commits] core.git: Branch 'aoo/trunk' - vcl/aqua
Herbert Dürr
hdu at apache.org
Thu Dec 12 06:07:40 PST 2013
vcl/aqua/source/dtrans/DataFlavorMapping.cxx | 23 ++++++++++++-----------
vcl/aqua/source/dtrans/DataFlavorMapping.hxx | 13 +++++++------
vcl/aqua/source/dtrans/aqua_clipboard.cxx | 8 ++++----
vcl/aqua/source/dtrans/aqua_clipboard.hxx | 4 ++--
4 files changed, 25 insertions(+), 23 deletions(-)
New commits:
commit 0801e9b488660e792a09d12717da951d224b26e0
Author: Herbert Dürr <hdu at apache.org>
Date: Thu Dec 12 13:37:51 2013 +0000
#i123841# fix constness issues in OSX 64bit clipboard handling
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index c784602..c3650e5 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -64,7 +64,7 @@ namespace // private
typedef vector<sal_Unicode> UnicodeBuffer;
- OUString NSStringToOUString(NSString* cfString)
+ OUString NSStringToOUString( const NSString* cfString)
{
BOOST_ASSERT(cfString && "Invalid parameter");
@@ -113,7 +113,7 @@ namespace // private
struct FlavorMap
{
- NSString* SystemFlavor;
+ const NSString* SystemFlavor;
const char* OOoFlavor;
const char* HumanPresentableName;
Type DataType;
@@ -121,7 +121,7 @@ namespace // private
/* At the moment it appears as if only MS Office pastes "public.html" to the clipboard.
*/
- FlavorMap flavorMap[] =
+ static const FlavorMap flavorMap[] =
{
{ NSStringPboardType, "text/plain;charset=utf-16", "Unicode Text (UTF-16)", CPPUTYPE_OUSTRING },
{ NSRTFPboardType, "text/richtext", "Rich Text Format", CPPUTYPE_SEQINT8 },
@@ -521,13 +521,13 @@ DataFlavorMapper::~DataFlavorMapper()
}
}
-DataFlavor DataFlavorMapper::systemToOpenOfficeFlavor(NSString* systemDataFlavor) const
+DataFlavor DataFlavorMapper::systemToOpenOfficeFlavor( const NSString* systemDataFlavor) const
{
DataFlavor oOOFlavor;
for (size_t i = 0; i < SIZE_FLAVOR_MAP; i++)
{
- if ([systemDataFlavor caseInsensitiveCompare: flavorMap[i].SystemFlavor] == NSOrderedSame)
+ if ([systemDataFlavor caseInsensitiveCompare:const_cast<NSString*>(flavorMap[i].SystemFlavor)] == NSOrderedSame)
{
oOOFlavor.MimeType = OUString::createFromAscii( flavorMap[i].OOoFlavor);
oOOFlavor.HumanPresentableName = OUString::createFromAscii( flavorMap[i].HumanPresentableName);
@@ -549,9 +549,10 @@ DataFlavor DataFlavorMapper::systemToOpenOfficeFlavor(NSString* systemDataFlavor
return oOOFlavor;
}
-NSString* DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor, bool& rbInternal) const
+const NSString* DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& oOOFlavor, bool& rbInternal) const
{
- NSString* sysFlavor = NULL;
+ const NSString* sysFlavor = NULL;
+ rbInternal = false;
rbInternal = false;
for( size_t i = 0; i < SIZE_FLAVOR_MAP; ++i )
@@ -583,7 +584,7 @@ NSString* DataFlavorMapper::openOfficeImageToSystemFlavor(NSPasteboard* pPastebo
return sysFlavor;
}
-DataProviderPtr_t DataFlavorMapper::getDataProvider(NSString* systemFlavor, Reference<XTransferable> rTransferable) const
+DataProviderPtr_t DataFlavorMapper::getDataProvider( const NSString* systemFlavor, Reference<XTransferable> rTransferable) const
{
DataProviderPtr_t dp;
@@ -639,12 +640,12 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider(NSString* systemFlavor, Refe
return dp;
}
-DataProviderPtr_t DataFlavorMapper::getDataProvider(const NSString* /*systemFlavor*/, NSArray* systemData) const
+DataProviderPtr_t DataFlavorMapper::getDataProvider( const NSString* /*systemFlavor*/, NSArray* systemData) const
{
return DataProviderPtr_t(new FileListDataProvider(systemData));
}
-DataProviderPtr_t DataFlavorMapper::getDataProvider(const NSString* systemFlavor, NSData* systemData) const
+DataProviderPtr_t DataFlavorMapper::getDataProvider( const NSString* systemFlavor, NSData* systemData) const
{
DataProviderPtr_t dp;
@@ -708,7 +709,7 @@ NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const com::sun::star::uno:
}
else
{
- NSString* str = openOfficeToSystemFlavor(flavors[i], bNeedDummyInternalFlavor);
+ const 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 9a9e709..6adf3fb 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.hxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.hxx
@@ -78,14 +78,14 @@ public:
mapping from a system data flavor to a OpenOffice data
flavor.
*/
- com::sun::star::datatransfer::DataFlavor systemToOpenOfficeFlavor(NSString* systemDataFlavor) const;
+ com::sun::star::datatransfer::DataFlavor systemToOpenOfficeFlavor( const NSString* systemDataFlavor) const;
/* Map an OpenOffice data flavor to a system data flavor.
If there is no suiteable mapping available NULL will
be returned.
*/
- NSString* openOfficeToSystemFlavor(const com::sun::star::datatransfer::DataFlavor& oooDataFlavor, bool& rbInternal) const;
+ 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
@@ -96,19 +96,19 @@ public:
/* Get a data provider which is able to provide the data 'rTransferable' offers in a format that can
be put on to the system clipboard.
*/
- DataProviderPtr_t getDataProvider(NSString* systemFlavor,
+ DataProviderPtr_t getDataProvider( const NSString* systemFlavor,
const com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable > rTransferable) const;
/* Get a data provider which is able to provide 'systemData' in the OOo expected format.
*/
- DataProviderPtr_t getDataProvider(const NSString* systemFlavor, NSArray* systemData) const;
+ DataProviderPtr_t getDataProvider( const NSString* systemFlavor, NSArray* systemData) const;
/* Get a data provider which is able to provide 'systemData' in the OOo expected format.
*/
- DataProviderPtr_t getDataProvider(const NSString* systemFlavor, NSData* systemData) const;
+ DataProviderPtr_t getDataProvider( const NSString* systemFlavor, NSData* systemData) const;
/* Translate a sequence of DataFlavors into a NSArray of system types.
@@ -125,7 +125,7 @@ public:
/* Returns an NSArray containing all pasteboard types supported by OOo
*/
- NSArray* DataFlavorMapper::getAllSupportedPboardTypes() const;
+ NSArray* getAllSupportedPboardTypes() const;
private:
/* Determines if the provided Mime content type is valid.
@@ -141,3 +141,4 @@ private:
typedef boost::shared_ptr<DataFlavorMapper> DataFlavorMapperPtr_t;
#endif
+
diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.cxx b/vcl/aqua/source/dtrans/aqua_clipboard.cxx
index d2d6f3b..8e90dd7 100644
--- a/vcl/aqua/source/dtrans/aqua_clipboard.cxx
+++ b/vcl/aqua/source/dtrans/aqua_clipboard.cxx
@@ -57,7 +57,7 @@ using namespace comphelper;
return self;
}
--(void)pasteboard:(NSPasteboard*)sender provideDataForType:(NSString*)type
+-(void)pasteboard:(NSPasteboard*)sender provideDataForType:(const NSString*)type
{
if( pAquaClipboard )
pAquaClipboard->provideDataForType(sender, type);
@@ -316,7 +316,7 @@ void AquaClipboard::fireLostClipboardOwnershipEvent(Reference<XClipboardOwner> o
}
-void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type)
+void AquaClipboard::provideDataForType(NSPasteboard* sender, const NSString* type)
{
if( mXClipboardContent.is() )
{
@@ -326,7 +326,7 @@ void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type)
if (dp.get() != NULL)
{
pBoardData = (NSData*)dp->getSystemData();
- [sender setData: pBoardData forType: type];
+ [sender setData: pBoardData forType:const_cast<NSString*>(type)];
}
}
}
@@ -347,7 +347,7 @@ void SAL_CALL AquaClipboard::flushClipboard()
for (sal_uInt32 i = 0; i < nFlavors; i++)
{
- NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i], bInternal);
+ const NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i], bInternal);
if (sysType != NULL)
{
diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.hxx b/vcl/aqua/source/dtrans/aqua_clipboard.hxx
index 3bf2875..a2f3a92 100644
--- a/vcl/aqua/source/dtrans/aqua_clipboard.hxx
+++ b/vcl/aqua/source/dtrans/aqua_clipboard.hxx
@@ -58,7 +58,7 @@ class AquaClipboard;
- (EventListener*)initWithAquaClipboard: (AquaClipboard*) pcb;
// Promiss resolver function
-- (void)pasteboard:(NSPasteboard*)sender provideDataForType:(NSString *)type;
+- (void)pasteboard:(NSPasteboard*)sender provideDataForType:(const NSString *)type;
-(void)applicationDidBecomeActive:(NSNotification*)aNotification;
@@ -151,7 +151,7 @@ public:
void pasteboardChangedOwner();
- void provideDataForType(NSPasteboard* sender, NSString* type);
+ void provideDataForType(NSPasteboard* sender, const NSString* type);
void applicationDidBecomeActive(NSNotification* aNotification);
More information about the Libreoffice-commits
mailing list