From c7308f421105fd84ce9181aadbcb971cba9d33d6 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Fri, 18 Oct 2019 23:49:21 +0300 Subject: [PATCH] developing... --- Common/3dParty/icu/icu.pri | 4 +++ Common/base.pri | 6 ++-- DesktopEditor/cximage/CxImage/tif_xfile.cpp | 8 +++-- DesktopEditor/doctrenderer/doctrenderer.pro | 15 ++++++-- DesktopEditor/graphics/pro/graphics.pro | 5 +++ UnicodeConverter/UnicodeConverter.cpp | 38 +++++++++++++++++++++ 6 files changed, 69 insertions(+), 7 deletions(-) diff --git a/Common/3dParty/icu/icu.pri b/Common/3dParty/icu/icu.pri index 44036da204..318413dee6 100644 --- a/Common/3dParty/icu/icu.pri +++ b/Common/3dParty/icu/icu.pri @@ -26,3 +26,7 @@ core_mac { LIBS += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/build/libicuuc.$${ICU_MAJOR_VER}.dylib LIBS += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/build/libicudata.$${ICU_MAJOR_VER}.dylib } + +core_ios { + DEFINES += DISABLE_ICU +} diff --git a/Common/base.pri b/Common/base.pri index 29b41d26af..6265f333e3 100644 --- a/Common/base.pri +++ b/Common/base.pri @@ -57,7 +57,7 @@ isEqual(QT_MAJOR_VERSION, 5) { ios { CONFIG += core_ios - DEFINES += _IOS IOS LINUX _LINUX MAC _MAC _XCODE + DEFINES += _IOS IOS LINUX _LINUX _MAC _XCODE } win32:contains(QMAKE_TARGET.arch, x86_64): { @@ -118,7 +118,7 @@ core_linux { core_mac { DEFINES += LINUX _LINUX MAC _MAC - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11 + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11 } # PREFIXES @@ -160,7 +160,7 @@ core_ios { CONFIG += core_ios_main_arch CONFIG += core_ios_nomain_arch } else { - CONFIG += core_ios_nomain_arch + CONFIG += core_ios_main_arch } core_ios_main_arch { diff --git a/DesktopEditor/cximage/CxImage/tif_xfile.cpp b/DesktopEditor/cximage/CxImage/tif_xfile.cpp index 32e2282115..6cadaeb0aa 100644 --- a/DesktopEditor/cximage/CxImage/tif_xfile.cpp +++ b/DesktopEditor/cximage/CxImage/tif_xfile.cpp @@ -119,7 +119,6 @@ extern char* realloc(); #define DbgMsgBox MessageBoxA #endif -#ifndef _IOS tdata_t _TIFFmalloc(tsize_t s) { @@ -156,6 +155,7 @@ _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) return (memcmp(p1, p2, (size_t) c)); } +#ifndef _IOS static void Win32WarningHandler(const char* module, const char* fmt, va_list ap) { @@ -214,7 +214,11 @@ Win32ErrorHandler(const char* module, const char* fmt, va_list ap) #endif } TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; - +#else +static void Win32WarningHandler(const char* module, const char* fmt, va_list ap) {} +static void Win32ErrorHandler(const char* module, const char* fmt, va_list ap) {} +TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler; +TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; #endif #endif diff --git a/DesktopEditor/doctrenderer/doctrenderer.pro b/DesktopEditor/doctrenderer/doctrenderer.pro index aa76992dc0..76dd7bd1c6 100644 --- a/DesktopEditor/doctrenderer/doctrenderer.pro +++ b/DesktopEditor/doctrenderer/doctrenderer.pro @@ -32,6 +32,17 @@ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter -lkernel -lgraphics include(../../Common/3dParty/v8/v8_xp/v8.pri) } +core_ios { + CONFIG += doct_renderer_empty +} + +doct_renderer_empty { +SOURCES += doctrenderer_empty.cpp +} else { +HEADERS += \ + doctrenderer.h \ + docbuilder.h + SOURCES += \ memorystream.cpp \ nativecontrol.cpp \ @@ -43,11 +54,11 @@ SOURCES += \ ../../Common/3dParty/pole/pole.cpp \ ../../Common/DocxFormat/Source/Base/unicode_util.cpp -HEADERS += doctrenderer.h \ - docbuilder.h \ +HEADERS += \ docbuilder_p.h \ memorystream.h \ nativecontrol.h +} # downloader DEFINES += BUIDLER_OPEN_DOWNLOAD_ENABLED diff --git a/DesktopEditor/graphics/pro/graphics.pro b/DesktopEditor/graphics/pro/graphics.pro index dc74041ca2..473b4a03d1 100644 --- a/DesktopEditor/graphics/pro/graphics.pro +++ b/DesktopEditor/graphics/pro/graphics.pro @@ -469,3 +469,8 @@ SOURCES += \ $$LIB_GRAPHICS_PRI_PATH/raster/JBig2/source/LeptonLib/sel1.cpp \ $$LIB_GRAPHICS_PRI_PATH/raster/JBig2/source/LeptonLib/sel2.cpp \ $$LIB_GRAPHICS_PRI_PATH/raster/JBig2/source/LeptonLib/skew.cpp + +core_ios { +OBJECTIVE_SOURCES += ./../../fontengine/ApplicationFonts_ios.mm +LIBS += -framework Foundation +} diff --git a/UnicodeConverter/UnicodeConverter.cpp b/UnicodeConverter/UnicodeConverter.cpp index f83d0ba4c2..beb105300f 100644 --- a/UnicodeConverter/UnicodeConverter.cpp +++ b/UnicodeConverter/UnicodeConverter.cpp @@ -31,10 +31,12 @@ */ #include "./UnicodeConverter.h" +#ifndef DISABLE_ICU #include "unicode/utypes.h" #include "unicode/ustring.h" #include "unicode/ucnv.h" /* C Converter API */ #include "unicode/usprep.h" +#endif #include "../DesktopEditor/common/File.h" @@ -82,6 +84,7 @@ namespace NSUnicodeConverter std::string SASLprepToUtf8(const wchar_t* sInput, const unsigned int& nInputLen) { +#ifndef DISABLE_ICU std::string sRes; UErrorCode status = U_ZERO_ERROR; @@ -135,10 +138,16 @@ namespace NSUnicodeConverter delete []pUChar; } return sRes; +#else + std::wstring strInput(sInput, nInputLen); + std::string sRes(strInput.begin(), strInput.end()); + return sRes; +#endif } std::string fromUnicode(const wchar_t* sInput, const unsigned int& nInputLen, const char* converterName) { +#ifndef DISABLE_ICU std::string sRes = ""; UErrorCode status = U_ZERO_ERROR; UConverter* conv = ucnv_open(converterName, &status); @@ -183,6 +192,11 @@ namespace NSUnicodeConverter sRes = std::string(ws.begin(), ws.end()); } return sRes; +#else + std::wstring strInput(sInput, nInputLen); + std::string sRes(strInput.begin(), strInput.end()); + return sRes; +#endif } std::string fromUnicode(const std::wstring& sInput, const char* converterName) @@ -192,6 +206,7 @@ namespace NSUnicodeConverter std::wstring toUnicode(const char* sInput, const unsigned int& nInputLen, int nCodePage) { +#ifndef DISABLE_ICU std::wstring sRes = L""; UErrorCode status = U_ZERO_ERROR; UConverter* conv = ucnv_openCCSID(nCodePage, UCNV_UNKNOWN, &status); @@ -243,9 +258,15 @@ namespace NSUnicodeConverter sRes = std::wstring(ws.begin(), ws.end()); } return sRes; +#else + std::string strInput(sInput, nInputLen); + std::wstring sRes(strInput.begin(), strInput.end()); + return sRes; +#endif } std::wstring toUnicode(const char* sInput, const unsigned int& nInputLen, const char* converterName) { +#ifndef DISABLE_ICU std::wstring sRes = L""; UErrorCode status = U_ZERO_ERROR; UConverter* conv = ucnv_open(converterName, &status); @@ -297,10 +318,16 @@ namespace NSUnicodeConverter sRes = std::wstring(ws.begin(), ws.end()); } return sRes; +#else + std::string strInput(sInput, nInputLen); + std::wstring sRes(strInput.begin(), strInput.end()); + return sRes; +#endif } std::wstring toUnicodeExact(const char* sInput, const unsigned int& nInputLen, const char* converterName) { +#ifndef DISABLE_ICU std::wstring sRes = L""; UErrorCode status = U_ZERO_ERROR; UConverter* conv = ucnv_open(converterName, &status); @@ -347,9 +374,15 @@ namespace NSUnicodeConverter } return sRes; +#else + std::string strInput(sInput, nInputLen); + std::wstring sRes(strInput.begin(), strInput.end()); + return sRes; +#endif } std::wstring toUnicodeExact(const char* sInput, const unsigned int& nInputLen, int nCodePage) { +#ifndef DISABLE_ICU std::wstring sRes = L""; UErrorCode status = U_ZERO_ERROR; UConverter* conv = ucnv_openCCSID(nCodePage, UCNV_UNKNOWN, &status); @@ -396,6 +429,11 @@ namespace NSUnicodeConverter } return sRes; +#else + std::string strInput(sInput, nInputLen); + std::wstring sRes(strInput.begin(), strInput.end()); + return sRes; +#endif } inline std::wstring toUnicode(const std::string& sInput, const char* converterName) {