mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
developing...
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -51,9 +51,7 @@ ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_i.c
|
||||
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_p.c
|
||||
ASCOfficeXlsFile2/win32/dlldata.c
|
||||
OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
|
||||
X2tConverter/**/Makefile.*
|
||||
X2tConverter/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile
|
||||
X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
|
||||
**/Makefile*
|
||||
*.7z
|
||||
*.obj
|
||||
*.pdb
|
||||
|
||||
@ -24,6 +24,10 @@ core_windows {
|
||||
|
||||
DEFINES += CRYPTOPP_DISABLE_ASM
|
||||
|
||||
core_android {
|
||||
INCLUDEPATH += $$(ANDROID_NDK_ROOT)/sources/android/cpufeatures
|
||||
}
|
||||
|
||||
HEADERS += \
|
||||
../3way.h \
|
||||
../adler32.h \
|
||||
|
||||
@ -189,6 +189,10 @@ core_ios {
|
||||
}
|
||||
core_android {
|
||||
CORE_BUILDS_PLATFORM_PREFIX = $$join(ANDROID_TARGET_ARCH, ANDROID_TARGET_ARCH, "android_", "")
|
||||
|
||||
!core_android_no_unistd {
|
||||
DEFINES += HAVE_UNISTD_H
|
||||
}
|
||||
}
|
||||
|
||||
core_debug {
|
||||
@ -263,3 +267,6 @@ core_windows {
|
||||
|
||||
DEFINES += CRYPTOPP_DISABLE_ASM
|
||||
}
|
||||
|
||||
ADD_INC_PATH = $$(ADDITIONAL_INCLUDE_PATH)
|
||||
!isEmpty(ADD_INC_PATH):INCLUDEPATH += $$ADD_INC_PATH
|
||||
|
||||
@ -10,10 +10,6 @@
|
||||
* Copyright 1997-2007 by Dave Coffin, dcoffin a cybercom o net
|
||||
*/
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <swab.h>
|
||||
#endif
|
||||
|
||||
#include "ximaraw.h"
|
||||
#include "../../common/File.h"
|
||||
|
||||
|
||||
@ -45,9 +45,30 @@
|
||||
#if defined(_LINUX) || defined(__APPLE__)
|
||||
#include <setjmp.h>
|
||||
#include <sys/types.h>
|
||||
#define _swab swab
|
||||
#define _getcwd getcwd
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <unistd.h>
|
||||
#if __ANDROID_API__ < 28
|
||||
static void swab(const char* __src, char* __dst, ssize_t __byte_count)
|
||||
{
|
||||
ssize_t len = __byte_count;
|
||||
if (1 == (len & 1))
|
||||
{
|
||||
__dst[len - 1] = __src[len - 1];
|
||||
len -= 1;
|
||||
}
|
||||
for (ssize_t i = 0; i < len; i++)
|
||||
{
|
||||
__dst[i] = __src[i + 1];
|
||||
__dst[i + 1] = __src[i];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#define _swab swab
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define DCR_VERSION "8.93"
|
||||
|
||||
@ -35,6 +35,9 @@ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter -lkernel -lgraphics
|
||||
core_ios {
|
||||
CONFIG += doct_renderer_empty
|
||||
}
|
||||
core_android {
|
||||
CONFIG += doct_renderer_empty
|
||||
}
|
||||
|
||||
doct_renderer_empty {
|
||||
SOURCES += doctrenderer_empty.cpp
|
||||
|
||||
@ -23,7 +23,7 @@ DEFINES -= \
|
||||
UNICODE \
|
||||
_UNICODE
|
||||
|
||||
core_linux {
|
||||
!core_windows {
|
||||
DEFINES += \
|
||||
HAVE_UNISTD_H \
|
||||
HAVE_MBSTATE_T \
|
||||
@ -33,27 +33,8 @@ core_linux {
|
||||
UNIX \
|
||||
HAVE_STDINCLUDES
|
||||
}
|
||||
|
||||
core_mac {
|
||||
DEFINES += \
|
||||
HAVE_UNISTD_H \
|
||||
HAVE_MBSTATE_T \
|
||||
GCONTAINER_NO_MEMBER_TEMPLATES="1" \
|
||||
HAS_WCHAR \
|
||||
HAVE_WCHAR_H \
|
||||
UNIX \
|
||||
HAVE_STDINCLUDES
|
||||
}
|
||||
|
||||
core_ios {
|
||||
DEFINES += \
|
||||
HAVE_UNISTD_H \
|
||||
HAVE_MBSTATE_T \
|
||||
GCONTAINER_NO_MEMBER_TEMPLATES="1" \
|
||||
HAS_WCHAR \
|
||||
HAVE_WCHAR_H \
|
||||
UNIX \
|
||||
HAVE_STDINCLUDES
|
||||
core_android {
|
||||
DEFINES += HAS_MBSTATE="1"
|
||||
}
|
||||
|
||||
core_windows {
|
||||
|
||||
@ -25,6 +25,9 @@ DEFINES += NOMINMAX
|
||||
core_linux {
|
||||
QMAKE_CXXFLAGS += -Wno-narrowing
|
||||
}
|
||||
core_android {
|
||||
QMAKE_CXXFLAGS += -Wno-narrowing
|
||||
}
|
||||
|
||||
core_windows {
|
||||
DEFINES -= UNICODE
|
||||
|
||||
@ -25,6 +25,12 @@ core_ios {
|
||||
OBJECTIVE_SOURCES += UnicodeConverter_internal_ios.mm
|
||||
}
|
||||
|
||||
core_android {
|
||||
CONFIG += core_disable_icu
|
||||
|
||||
SOURCES += UnicodeConverter_internal_android.cpp
|
||||
}
|
||||
|
||||
!core_disable_icu {
|
||||
include(../Common/3dParty/icu/icu.pri)
|
||||
|
||||
|
||||
126
UnicodeConverter/UnicodeConverter_internal_android.cpp
Normal file
126
UnicodeConverter/UnicodeConverter_internal_android.cpp
Normal file
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "./UnicodeConverter.h"
|
||||
#include "../DesktopEditor/common/File.h"
|
||||
|
||||
namespace NSUnicodeConverter
|
||||
{
|
||||
class CUnicodeConverter_Private
|
||||
{
|
||||
public:
|
||||
CUnicodeConverter_Private()
|
||||
{
|
||||
}
|
||||
~CUnicodeConverter_Private()
|
||||
{
|
||||
}
|
||||
|
||||
std::string SASLprepToUtf8(const wchar_t* sInput, const unsigned int& nInputLen)
|
||||
{
|
||||
// TODO:
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string fromUnicode(const wchar_t* sInput, const unsigned int& nInputLen, const char* converterName)
|
||||
{
|
||||
std::string sRes = "";
|
||||
if (sRes.empty() && nInputLen > 0)
|
||||
{
|
||||
std::wstring ws(sInput, nInputLen);
|
||||
sRes = std::string(ws.begin(), ws.end());
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
|
||||
std::wstring toUnicode(const char* sInput, const unsigned int& nInputLen, int nCodePage, bool isExact)
|
||||
{
|
||||
std::wstring sRes = L"";
|
||||
if (!isExact && sRes.empty() && nInputLen > 0)
|
||||
{
|
||||
std::string ws(sInput, nInputLen);
|
||||
sRes = std::wstring(ws.begin(), ws.end());
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
std::wstring toUnicode(const char* sInput, const unsigned int& nInputLen, const char* converterName, bool isExact)
|
||||
{
|
||||
std::wstring sRes = L"";
|
||||
if (isExact && sRes.empty() && nInputLen > 0)
|
||||
{
|
||||
std::string ws(sInput, nInputLen);
|
||||
sRes = std::wstring(ws.begin(), ws.end());
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
namespace NSUnicodeConverter
|
||||
{
|
||||
CUnicodeConverter::CUnicodeConverter()
|
||||
{
|
||||
m_pInternal = new CUnicodeConverter_Private();
|
||||
}
|
||||
CUnicodeConverter::~CUnicodeConverter()
|
||||
{
|
||||
delete m_pInternal;
|
||||
}
|
||||
|
||||
std::string CUnicodeConverter::fromUnicode(const wchar_t* sInput, const unsigned int& nInputLen, const char* converterName)
|
||||
{
|
||||
return m_pInternal->fromUnicode(sInput, nInputLen, converterName);
|
||||
}
|
||||
std::string CUnicodeConverter::fromUnicode(const std::wstring &sInput, const char *converterName)
|
||||
{
|
||||
return this->fromUnicode(sInput.c_str(), (unsigned int)sInput.size(), converterName);
|
||||
}
|
||||
std::wstring CUnicodeConverter::toUnicode(const char* sInput, const unsigned int& nInputLen, const char* converterName, bool isExact)
|
||||
{
|
||||
return m_pInternal->toUnicode(sInput, nInputLen, converterName, isExact);
|
||||
}
|
||||
std::wstring CUnicodeConverter::toUnicode(const std::string &sInput, const char *converterName, bool isExact)
|
||||
{
|
||||
return this->toUnicode(sInput.c_str(), (unsigned int)sInput.size(), converterName, isExact);
|
||||
}
|
||||
std::wstring CUnicodeConverter::toUnicode(const char* sInput, const unsigned int& nInputLen, int nCodePage, bool isExact)
|
||||
{
|
||||
return m_pInternal->toUnicode(sInput, nInputLen, nCodePage, isExact);
|
||||
}
|
||||
std::wstring CUnicodeConverter::toUnicode(const std::string &sInput, int nCodePage, bool isExact)
|
||||
{
|
||||
return this->toUnicode(sInput.c_str(), (unsigned int)sInput.size(), nCodePage, isExact);
|
||||
}
|
||||
std::string CUnicodeConverter::SASLprepToUtf8(const std::wstring &sSrc)
|
||||
{
|
||||
return m_pInternal->SASLprepToUtf8(sSrc.c_str(), sSrc.length());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user