summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Library_vcl.mk6
-rw-r--r--vcl/Package_inc.mk1
-rw-r--r--vcl/aqua/source/dtrans/DataFlavorMapping.cxx47
-rw-r--r--vcl/aqua/source/dtrans/OSXTransferable.cxx7
-rw-r--r--vcl/inc/vcl/vclmain.hxx27
-rw-r--r--vcl/ios/source/dtrans/iOSTransferable.cxx7
-rw-r--r--vcl/source/salmain/salmain.cxx2
-rw-r--r--vcl/source/uipreviewer/previewer.cxx6
8 files changed, 61 insertions, 42 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 004325af146f..18592d4e146d 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -661,12 +661,6 @@ $(eval $(call gb_Library_add_ldflags,vcl,\
endif
endif
-ifneq ($(OS),IOS)
-$(eval $(call gb_Library_use_static_libraries,vcl,\
- vclmain \
-))
-endif
-
# Runtime dependency for unit-tests
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,vcl)) :| \
$(call gb_AllLangResTarget_get_target,vcl)
diff --git a/vcl/Package_inc.mk b/vcl/Package_inc.mk
index 1c488bed8cb0..3f37b7442ad2 100644
--- a/vcl/Package_inc.mk
+++ b/vcl/Package_inc.mk
@@ -156,6 +156,7 @@ $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/unohelp.hxx,vcl/unohelp.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/unowrap.hxx,vcl/unowrap.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/vclenum.hxx,vcl/vclenum.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/vclevent.hxx,vcl/vclevent.hxx))
+$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/vclmain.hxx,vcl/vclmain.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/vclmedit.hxx,vcl/vclmedit.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/virdev.hxx,vcl/virdev.hxx))
$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/waitobj.hxx,vcl/waitobj.hxx))
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index 47fad6bd38f3..80ec5c35a6eb 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -48,16 +48,13 @@ using ::rtl::OString;
namespace // private
{
- const Type CPPUTYPE_SEQINT8 = getCppuType((Sequence<sal_Int8>*)0);
- const Type CPPUTYPE_OUSTRING = getCppuType( (OUString*)0 );
-
/* Determine whether or not a DataFlavor is valid.
*/
bool isValidFlavor(const DataFlavor& aFlavor)
{
size_t len = aFlavor.MimeType.getLength();
Type dtype = aFlavor.DataType;
- return ((len > 0) && ((dtype == CPPUTYPE_SEQINT8) || (dtype == CPPUTYPE_OUSTRING)));
+ return ((len > 0) && ((dtype == getCppuType((Sequence<sal_Int8>*)0)) || (dtype == getCppuType( (OUString*)0 ))));
}
NSString* PBTYPE_SODX = @"application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"";
@@ -92,7 +89,7 @@ namespace // private
NSString* SystemFlavor;
const char* OOoFlavor;
const char* HumanPresentableName;
- Type DataType;
+ bool DataTypeOUString; // sequence<byte> otherwise
};
// NSPICTPboardType is deprecated in 10.6 and later
@@ -113,23 +110,23 @@ namespace // private
*/
FlavorMap flavorMap[] =
{
- { NSStringPboardType, "text/plain;charset=utf-16", "Unicode Text (UTF-16)", CPPUTYPE_OUSTRING },
- { NSRTFPboardType, "text/richtext", "Rich Text Format", CPPUTYPE_SEQINT8 },
- { NSTIFFPboardType, "image/bmp", "Windows Bitmap", CPPUTYPE_SEQINT8 },
- { NSPICTPboardType, "image/bmp", "Windows Bitmap", CPPUTYPE_SEQINT8 },
- { NSHTMLPboardType, "text/html", "Plain Html", CPPUTYPE_SEQINT8 },
- { NSFilenamesPboardType, "application/x-openoffice-filelist;windows_formatname=\"FileList\"", "FileList", CPPUTYPE_SEQINT8 },
- { PBTYPE_SESX, FLAVOR_SESX, "Star Embed Source (XML)", CPPUTYPE_SEQINT8 },
- { PBTYPE_SLSDX, FLAVOR_SLSDX, "Star Link Source Descriptor (XML)", CPPUTYPE_SEQINT8 },
- { PBTYPE_ESX, FLAVOR_ESX, "Star Embed Source (XML)", CPPUTYPE_SEQINT8 },
- { PBTYPE_LSX, FLAVOR_LSX, "Star Link Source (XML)", CPPUTYPE_SEQINT8 },
- { PBTYPE_EOX, FLAVOR_EOX, "Star Embedded Object (XML)", CPPUTYPE_SEQINT8 },
- { PBTYPE_SVXB, FLAVOR_SVXB, "SVXB (StarView Bitmap/Animation", CPPUTYPE_SEQINT8 },
- { PBTYPE_GDIMF, FLAVOR_GDIMF, "GDIMetaFile", CPPUTYPE_SEQINT8 },
- { PBTYPE_WMF, FLAVOR_WMF, "Windows MetaFile", CPPUTYPE_SEQINT8 },
- { PBTYPE_EMF, FLAVOR_EMF, "Windows Enhanced MetaFile", CPPUTYPE_SEQINT8 },
- { PBTYPE_SODX, FLAVOR_SODX, "Star Object Descriptor (XML)", CPPUTYPE_SEQINT8 },
- { PBTYPE_DUMMY_INTERNAL, FLAVOR_DUMMY_INTERNAL, "internal data",CPPUTYPE_SEQINT8 }
+ { NSStringPboardType, "text/plain;charset=utf-16", "Unicode Text (UTF-16)", true },
+ { NSRTFPboardType, "text/richtext", "Rich Text Format", false },
+ { NSTIFFPboardType, "image/bmp", "Windows Bitmap", false },
+ { NSPICTPboardType, "image/bmp", "Windows Bitmap", false },
+ { NSHTMLPboardType, "text/html", "Plain Html", false },
+ { NSFilenamesPboardType, "application/x-openoffice-filelist;windows_formatname=\"FileList\"", "FileList", false },
+ { PBTYPE_SESX, FLAVOR_SESX, "Star Embed Source (XML)", false },
+ { PBTYPE_SLSDX, FLAVOR_SLSDX, "Star Link Source Descriptor (XML)", false },
+ { PBTYPE_ESX, FLAVOR_ESX, "Star Embed Source (XML)", false },
+ { PBTYPE_LSX, FLAVOR_LSX, "Star Link Source (XML)", false },
+ { PBTYPE_EOX, FLAVOR_EOX, "Star Embedded Object (XML)", false },
+ { PBTYPE_SVXB, FLAVOR_SVXB, "SVXB (StarView Bitmap/Animation", false },
+ { PBTYPE_GDIMF, FLAVOR_GDIMF, "GDIMetaFile", false },
+ { PBTYPE_WMF, FLAVOR_WMF, "Windows MetaFile", false },
+ { PBTYPE_EMF, FLAVOR_EMF, "Windows Enhanced MetaFile", false },
+ { PBTYPE_SODX, FLAVOR_SODX, "Star Object Descriptor (XML)", false },
+ { PBTYPE_DUMMY_INTERNAL, FLAVOR_DUMMY_INTERNAL, "internal data",false }
};
@@ -138,12 +135,12 @@ namespace // private
inline bool isByteSequenceType(const Type& theType)
{
- return (theType == CPPUTYPE_SEQINT8);
+ return (theType == getCppuType((Sequence<sal_Int8>*)0));
}
inline bool isOUStringType(const Type& theType)
{
- return (theType == CPPUTYPE_OUSTRING);
+ return (theType == getCppuType( (OUString*)0 ));
}
} // namespace private
@@ -519,7 +516,7 @@ DataFlavor DataFlavorMapper::systemToOpenOfficeFlavor(NSString* systemDataFlavor
{
oOOFlavor.MimeType = OUString::createFromAscii(flavorMap[i].OOoFlavor);
oOOFlavor.HumanPresentableName = OUString(RTL_CONSTASCII_USTRINGPARAM(flavorMap[i].HumanPresentableName));
- oOOFlavor.DataType = flavorMap[i].DataType;
+ oOOFlavor.DataType = flavorMap[i].DataTypeOUString ? getCppuType( (OUString*)0 ) : getCppuType((Sequence<sal_Int8>*)0);
return oOOFlavor;
}
} // for
diff --git a/vcl/aqua/source/dtrans/OSXTransferable.cxx b/vcl/aqua/source/dtrans/OSXTransferable.cxx
index ec393b0d54cc..0f6c57d06ef7 100644
--- a/vcl/aqua/source/dtrans/OSXTransferable.cxx
+++ b/vcl/aqua/source/dtrans/OSXTransferable.cxx
@@ -34,16 +34,13 @@ using namespace com::sun::star::container;
using ::rtl::OUString;
-const Type CPPUTYPE_SEQINT8 = getCppuType((Sequence<sal_Int8>*)0);
-const Type CPPUTYPE_OUSTRING = getCppuType((OUString*)0);
-
namespace // private
{
bool isValidFlavor( const DataFlavor& aFlavor )
{
size_t len = aFlavor.MimeType.getLength();
Type dtype = aFlavor.DataType;
- return ((len > 0) && ((dtype == CPPUTYPE_SEQINT8) || (dtype == CPPUTYPE_OUSTRING)));
+ return ((len > 0) && ((dtype == getCppuType((Sequence<sal_Int8>*)0)) || (dtype == getCppuType((OUString*)0))));
}
} // namespace private
@@ -106,7 +103,7 @@ Any SAL_CALL OSXTransferable::getTransferData( const DataFlavor& aFlavor )
bool OSXTransferable::isUnicodeText(const DataFlavor& flavor)
{
- return (flavor.DataType == CPPUTYPE_OUSTRING);
+ return (flavor.DataType == getCppuType((OUString*)0));
}
diff --git a/vcl/inc/vcl/vclmain.hxx b/vcl/inc/vcl/vclmain.hxx
new file mode 100644
index 000000000000..1b60cfba42ce
--- /dev/null
+++ b/vcl/inc/vcl/vclmain.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_VCL_VCLMAIN_HXX
+#define INCLUDED_VCL_VCLMAIN_HXX
+
+#include "sal/config.h"
+
+namespace vclmain {
+
+// Function called from vclmain's implementation of main, needs to be
+// implemented by the application and needs to instantiate a (static, derived)
+// instance of Application (where the Application constructor takes care to link
+// that instance to ImplSVData.mpApp):
+void createApplication();
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/dtrans/iOSTransferable.cxx b/vcl/ios/source/dtrans/iOSTransferable.cxx
index 603b6b949f0d..1f335403d1ff 100644
--- a/vcl/ios/source/dtrans/iOSTransferable.cxx
+++ b/vcl/ios/source/dtrans/iOSTransferable.cxx
@@ -32,16 +32,13 @@ using namespace com::sun::star::container;
using ::rtl::OUString;
-const Type CPPUTYPE_SEQINT8 = getCppuType((Sequence<sal_Int8>*)0);
-const Type CPPUTYPE_OUSTRING = getCppuType((OUString*)0);
-
namespace // private
{
bool isValidFlavor( const DataFlavor& aFlavor )
{
size_t len = aFlavor.MimeType.getLength();
Type dtype = aFlavor.DataType;
- return ((len > 0) && ((dtype == CPPUTYPE_SEQINT8) || (dtype == CPPUTYPE_OUSTRING)));
+ return ((len > 0) && ((dtype == getCppuType((Sequence<sal_Int8>*)0)) || (dtype == getCppuType((OUString*)0))));
}
} // namespace private
@@ -82,7 +79,7 @@ Any SAL_CALL iOSTransferable::getTransferData( const DataFlavor& aFlavor )
bool iOSTransferable::isUnicodeText(const DataFlavor& flavor)
{
- return (flavor.DataType == CPPUTYPE_OUSTRING);
+ return (flavor.DataType == getCppuType((OUString*)0));
}
diff --git a/vcl/source/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx
index 0718260e4e42..13cd13fe4f99 100644
--- a/vcl/source/salmain/salmain.cxx
+++ b/vcl/source/salmain/salmain.cxx
@@ -23,11 +23,13 @@
#include "sal/main.h"
#include "tools/extendapplicationenvironment.hxx"
+#include "vcl/vclmain.hxx"
#include "salinst.hxx"
SAL_IMPLEMENT_MAIN() {
tools::extendApplicationEnvironment();
+ vclmain::createApplication();
return SVMain();
}
diff --git a/vcl/source/uipreviewer/previewer.cxx b/vcl/source/uipreviewer/previewer.cxx
index 7abb9def5c3b..939c55342744 100644
--- a/vcl/source/uipreviewer/previewer.cxx
+++ b/vcl/source/uipreviewer/previewer.cxx
@@ -18,6 +18,7 @@
#include <vcl/dialog.hxx>
#include <vcl/help.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/vclmain.hxx>
class UIPreviewApp : public Application
{
@@ -88,6 +89,9 @@ int UIPreviewApp::Main()
return EXIT_SUCCESS;
}
-UIPreviewApp aApp;
+void vclmain::createApplication()
+{
+ static UIPreviewApp aApp;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */