Compare commits

..

17 Commits

Author SHA1 Message Date
4b0ce196e8 [x2t] Fxi bug 44611 (#223) 2020-02-25 22:53:48 +03:00
b96189c213 [android][xt2] Fix overwrite document 2020-02-21 11:45:11 +03:00
987e6b6e76 [android][xt2] Open password odf document 2020-02-21 11:45:11 +03:00
aefef93e21 icu for ios (#221)
Co-authored-by: Alexey.Musinov <alexey.musinov@gmail.com>
2020-02-19 19:05:23 +03:00
2c04e9fb57 Fix windows flags (#220) 2020-02-13 19:41:15 +03:00
e6007815a2 [x2t] Fix bug 44466 (#219)
Move m_oFirstLine, m_oHanging from CTwipsMeasure(unsigned) to CSignedTwipsMeasure
2020-02-07 18:39:20 +03:00
56482f0524 Feature/build ios (#218)
* Fix build on ios in debug mode

* Fix ios build
2020-01-28 14:19:20 +03:00
b901073171 Remove travis build (#216)
This speed up PR process (requested by @K0R0L)
This build is deprecated, since build of project is moved
to another tool - `build_tool` since v5.5.0
And this config is never worked
See:
https://github.com/ONLYOFFICE/core/pull/29#issuecomment-306773327
2020-01-20 14:39:07 +03:00
03404d74a4 Merge pull request #215 from ONLYOFFICE/feature/fixBoost
Feature/fix boost
2020-01-20 14:21:13 +03:00
2154cb1dba Update boost build script for ios 2020-01-20 13:58:57 +03:00
f3fb3f7ca7 Fix build 2020-01-20 12:07:31 +03:00
20090072ae Add new method (#214) 2020-01-16 18:17:27 +03:00
bd85ec1b10 Add functionality to base.pri (#212) 2020-01-15 16:55:09 +03:00
cee502b855 Add CopyDirectory method (#210) 2020-01-15 15:45:18 +03:00
524eac388e [x2t] For bug 38945 (#209)
For comments without author
2020-01-14 16:12:55 +03:00
0daaf560ae [x2t] For bug 44039 (#208)
Abs negative comment coordinates and offset as Excel does
2020-01-09 17:01:20 +03:00
e7c87085a7 Fix metafile to raster sizes (#207) 2020-01-09 15:37:39 +03:00
24 changed files with 694 additions and 88 deletions

View File

@ -1,14 +0,0 @@
language: cpp
compiler: gcc
dist: trusty
addons:
apt:
packages:
- p7zip-full
script:
- exit 0
# Build fails anyway. See explanation in
# https://github.com/ONLYOFFICE/core/pull/29#issuecomment-306773327
- cd Common/3dParty && ./make.sh
- cd ../../
- make

View File

@ -43,7 +43,12 @@ namespace PPTX
{
public:
WritingElement_AdditionConstructors(TextFont)
PPTX_LOGIC_BASE2(TextFont)
TextFont()
{
m_eType = OOX::et_Unknown;
}
virtual ~TextFont() {}
TextFont(const TextFont& oSrc) { *this = oSrc; }
virtual OOX::EElementType getType () const
{

View File

@ -338,5 +338,13 @@ namespace PPTX
return 0; //return 0; - заменить на просмотр настроек по умолчанию
}
void UniColor::SetRGBColor(const BYTE& R, const BYTE& G, const BYTE& B)
{
Logic::SrgbClr* rgbColor = new Logic::SrgbClr();
rgbColor->SetRGB(R, G, B);
Color.reset(rgbColor);
}
} // namespace Logic
} // namespace PPTX

View File

@ -75,6 +75,8 @@ namespace PPTX
return Color->GetRGBColor(_oTheme,_oClrMap, ARGB);
return 0;
}
void SetRGBColor(const BYTE& R, const BYTE& G, const BYTE& B);
virtual std::wstring toXML() const;
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const

View File

@ -79,6 +79,7 @@ namespace PPTX
node1 = node.ReadNode(_T("a:folHlink"));
lColor.GetColorFrom(node1); Scheme.insert(std::pair<std::wstring,Logic::UniColor>(_T("folHlink"), lColor));
FillWithDefaults();
FillParentPointersForChilds();
}
@ -233,7 +234,85 @@ namespace PPTX
return *this;
}
void FillWithDefaults()
{
Logic::UniColor lColor;
std::map<std::wstring, Logic::UniColor>::iterator it;
it = Scheme.find(L"dk1");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0,0,0);
Scheme[L"dk1"] = lColor;
}
it = Scheme.find(L"lt1");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(255,255,255);
Scheme[L"lt1"] = lColor;
}
it = Scheme.find(L"dk2");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0x1F,0x49, 0x7D);
Scheme[L"dk2"] = lColor;
}
it = Scheme.find(L"lt2");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0xEE,0xEC,0xE1);
Scheme[L"lt2"] = lColor;
}
it = Scheme.find(L"accent1");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0x4F, 0x81, 0xBD);
Scheme[L"accent1"] = lColor;
}
it = Scheme.find(L"accent2");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0xC0,0x50,0x4D);
Scheme[L"accent2"] = lColor;
}
it = Scheme.find(L"accent3");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0x9B,0xBB,0x59);
Scheme[L"accent3"] = lColor;
}
it = Scheme.find(L"accent4");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0x80,0x64,0xA2);
Scheme[L"accent4"] = lColor;
}
it = Scheme.find(L"accent5");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0x4B,0xAC,0xC6);
Scheme[L"accent5"] = lColor;
}
it = Scheme.find(L"accent6");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0xF7,0x96,0x46);
Scheme[L"accent6"] = lColor;
}
it = Scheme.find(L"hlink");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0x00,0x00,0xFF);
Scheme[L"hlink"] = lColor;
}
it = Scheme.find(L"folHlink");
if (Scheme.end() == it || !it->second.is_init())
{
lColor.SetRGBColor(0x80, 0x00, 0x80);
Scheme[L"folHlink"] = lColor;
}
FillParentPointersForChilds();
}
protected:
virtual void FillParentPointersForChilds()
{

View File

@ -35,6 +35,7 @@
#include "./../WrapperWritingElement.h"
#include "./../Logic/UniFill.h"
#include "./../Logic/Colors/SchemeClr.h"
#include "./../Logic/Ln.h"
#include "./../Logic/EffectStyle.h"
@ -84,6 +85,7 @@ namespace PPTX
XmlUtils::CXmlNode oNode4 = node.ReadNode(_T("a:bgFillStyleLst"));
XmlMacroLoadArray(oNode4, _T("*"), bgFillStyleLst, Logic::UniFill);
FillWithDefaults();
FillParentPointersForChilds();
}
@ -251,6 +253,113 @@ namespace PPTX
pReader->Seek(_end_rec);
}
void FillWithDefaults()
{
Logic::SolidFill* pSolidFill = NULL;
Logic::SchemeClr* pSchemeClr = NULL;
// -------------- fill styles -------------------------
if (fillStyleLst.size() < 3)
{
fillStyleLst.clear();
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSchemeClr = new Logic::SchemeClr();
pSchemeClr->val.set(L"phClr");
pSolidFill->Color.Color.reset(pSchemeClr);
fillStyleLst.push_back(Logic::UniFill());
fillStyleLst.back().m_type = Logic::UniFill::solidFill;
fillStyleLst.back().Fill.reset(pSolidFill);
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSolidFill->Color.SetRGBColor(0,0,0);
fillStyleLst.push_back(Logic::UniFill());
fillStyleLst.back().m_type = Logic::UniFill::solidFill;
fillStyleLst.back().Fill.reset(pSolidFill);
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSolidFill->Color.SetRGBColor(0,0,0);
fillStyleLst.push_back(Logic::UniFill());
fillStyleLst.back().m_type = Logic::UniFill::solidFill;
fillStyleLst.back().Fill.reset(pSolidFill);
}
// -------------- back styles -------------------------
if (bgFillStyleLst.size() < 3)
{
bgFillStyleLst.clear();
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSchemeClr = new Logic::SchemeClr();
pSchemeClr->val.set(L"phClr");
pSolidFill->Color.Color.reset(pSchemeClr);
bgFillStyleLst.push_back(Logic::UniFill());
bgFillStyleLst.back().m_type = Logic::UniFill::solidFill;
bgFillStyleLst.back().Fill.reset(pSolidFill);
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSolidFill->Color.SetRGBColor(0,0,0);
bgFillStyleLst.push_back(Logic::UniFill());
bgFillStyleLst.back().m_type = Logic::UniFill::solidFill;
bgFillStyleLst.back().Fill.reset(pSolidFill);
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSolidFill->Color.SetRGBColor(0,0,0);
bgFillStyleLst.push_back(Logic::UniFill());
bgFillStyleLst.back().m_type = Logic::UniFill::solidFill;
bgFillStyleLst.back().Fill.reset(pSolidFill);
}
// -------------- line styles -------------------------
if (lnStyleLst.size() < 3)
{
lnStyleLst.clear();
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSchemeClr = new Logic::SchemeClr();
pSchemeClr->val.set(L"phClr");
pSchemeClr->Modifiers.push_back(Logic::ColorModifier());
pSchemeClr->Modifiers.back().name = L"shade";
pSchemeClr->Modifiers.back().val = 95000;
pSchemeClr->Modifiers.push_back(Logic::ColorModifier());
pSchemeClr->Modifiers.back().name = L"satMod";
pSchemeClr->Modifiers.back().val = 105000;
pSolidFill->Color.Color.reset(pSchemeClr);
lnStyleLst.push_back(Logic::Ln());
lnStyleLst.back().w = 9525;
lnStyleLst.back().Fill.m_type = Logic::UniFill::solidFill;
lnStyleLst.back().Fill.Fill.reset(pSolidFill);
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSchemeClr = new Logic::SchemeClr();
pSchemeClr->val.set(L"phClr");
pSolidFill->Color.Color.reset(pSchemeClr);
lnStyleLst.push_back(Logic::Ln());
lnStyleLst.back().w = 25400;
lnStyleLst.back().Fill.m_type = Logic::UniFill::solidFill;
lnStyleLst.back().Fill.Fill.reset(pSolidFill);
pSolidFill = new Logic::SolidFill();
pSolidFill->m_namespace = L"a";
pSchemeClr = new Logic::SchemeClr();
pSchemeClr->val.set(L"phClr");
pSolidFill->Color.Color.reset(pSchemeClr);
lnStyleLst.push_back(Logic::Ln());
lnStyleLst.back().w = 38100;
lnStyleLst.back().Fill.m_type = Logic::UniFill::solidFill;
lnStyleLst.back().Fill.Fill.reset(pSolidFill);
}
FillParentPointersForChilds();
}
public:
std::wstring name;
std::vector<Logic::UniFill> fillStyleLst;

View File

@ -52,6 +52,7 @@ namespace PPTX
majorFont = node.ReadNode(_T("a:majorFont"));
minorFont = node.ReadNode(_T("a:minorFont"));
FillWithDefaults();
FillParentPointersForChilds();
}
virtual std::wstring toXML() const
@ -133,6 +134,20 @@ namespace PPTX
pReader->Seek(_end_rec);
}
void FillWithDefaults()
{
if (OOX::et_Unknown == majorFont.latin.m_eType)
{
majorFont.latin.m_name = _T("a:latin");
majorFont.latin.typeface = L"Arial";
}
if (OOX::et_Unknown == minorFont.latin.m_eType)
{
minorFont.latin.m_name = _T("a:latin");
minorFont.latin.typeface = L"Arial";
}
FillParentPointersForChilds();
}
std::wstring name;
Logic::FontCollection majorFont;

View File

@ -1,8 +1,8 @@
INCLUDEPATH += $$PWD/boost_1_58_0
INCLUDEPATH += $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/include
MSVC = vc140
CORE_BOOST_LIBS = $$PWD/boost_1_58_0/build/$$CORE_BUILDS_PLATFORM_PREFIX/static
CORE_BOOST_LIBS = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib
core_boost_libs {

View File

@ -51,7 +51,7 @@ SRCDIR=$TARBALLDIR
BOOST_TARBALL=$TARBALLDIR/boost_$BOOST_VERSION2.tar.bz2
BOOST_SRC=$SRCDIR/boost_${BOOST_VERSION2}
PREFIXDIR=$BOOST_SRC/prefix
PREFIXDIR=$SRCDIR/build/ios
#===============================================================================
# Functions
@ -244,6 +244,7 @@ bootstrapBoost()
BOOST_LIBS_COMMA=$(echo $BOOST_LIBS | sed -e "s/ /,/g")
echo "Bootstrapping (with libs $BOOST_LIBS_COMMA)"
./bootstrap.sh --with-libraries=$BOOST_LIBS_COMMA
./b2 headers
doneSection
}
@ -285,12 +286,13 @@ generateOut()
echo Generate Boost for iPhone
mkdir -p $BOOST_SRC/build/ios/static
for NAME in $BOOST_LIBS; do
rm -f $SRCDIR/build/ios/lib/libboost_${NAME}.a
lipo -create $BOOST_SRC/iphone-build/stage/lib/libboost_${NAME}.a \
$BOOST_SRC/iphonesim-build/stage/lib/libboost_${NAME}.a \
-o $BOOST_SRC/build/ios/static/libboost_${NAME}.a
-o $SRCDIR/build/ios/lib/libboost_${NAME}.a
lipo $BOOST_SRC/build/ios/static/libboost_${NAME}.a -remove i386 -o $BOOST_SRC/build/ios/static/libboost_${NAME}.a
lipo $BOOST_SRC/build/ios/static/libboost_${NAME}.a -remove armv4t -o $BOOST_SRC/build/ios/static/libboost_${NAME}.a
lipo $SRCDIR/build/ios/lib/libboost_${NAME}.a -remove i386 -o $SRCDIR/build/ios/lib/libboost_${NAME}.a
lipo $SRCDIR/build/ios/lib/libboost_${NAME}.a -remove armv4t -o $SRCDIR/build/ios/lib/libboost_${NAME}.a
done
doneSection

View File

@ -11,16 +11,10 @@ PWD_ROOT_DIR = $$PWD
include(../../../../Common/base.pri)
core_linux {
DEFINES -= NDEBUG
}
core_mac {
DEFINES -= MAC
}
core_windows {
DEFINES -= UNICODE _UNICODE
}
core_linux:DEFINES -= NDEBUG
core_mac:DEFINES -= MAC
core_ios:DEFINES -= MAC
core_windows:DEFINES -= UNICODE _UNICODE
DEFINES += CRYPTOPP_DISABLE_ASM

View File

@ -23,3 +23,11 @@ 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 {
INCLUDEPATH += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/build/include
LIBS += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/build/libicudata.a
LIBS += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/build/libicui18n.a
LIBS += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/build/libicuuc.a
}

272
Common/3dParty/icu/icu_ios.sh Executable file
View File

@ -0,0 +1,272 @@
#!/bin/bash
ICU_VERSION="58"
ICU_DIR="$PWD/icu"
ICU_SOURCE="${ICU_DIR}/source"
PREBUILD="$PWD/ios/icu_build"
CONFIG_PREFIX=" --enable-extras=yes \
--enable-tools=yes \
--enable-icuio=yes \
--enable-strict=no \
--enable-static \
--enable-shared=no \
--enable-tests=yes \
--disable-renaming \
--enable-samples=no \
--enable-dyload=no \
--with-data-packaging=static"
CFLAGS="-O3 -D__STDC_INT64__ -fno-exceptions -fno-short-wchar -fno-short-enums -fembed-bitcode"
CXXFLAGS="${CFLAGS} -std=c++11 -fembed-bitcode"
#will set value to 1
defines_config_set_1=(
"UCONFIG_NO_BREAK_ITERATION"
"UCONFIG_NO_FORMATTING"
"UCONFIG_NO_REGULAR_EXPRESSIONS"
"CONFIG_NO_CONVERSION"
"U_DISABLE_RENAMING"
)
#will set value to 0
defines_config_set_0=(
"U_HAVE_NL_LANGINFO_CODESET"
"UCONFIG_NO_TRANSLITERATION"
"U_USING_ICU_NAMESPACE"
)
#will set value to 1
defines_utypes=(
"U_CHARSET_IS_UTF8"
)
function prebuild() {
svn export http://source.icu-project.org/repos/icu/tags/release-${ICU_VERSION}/icu4c/ ${ICU_DIR} --native-eol LF
echo "===== REMOVING data from bundle ====="
#Data bundle reduction
{
echo "GENRB_CLDR_VERSION = 32.0.1"
echo "GENRB_SYNTHETIC_ALIAS = "
echo "GENRB_ALIAS_SOURCE = \$(GENRB_SYNTHETIC_ALIAS) "
echo "GENRB_SOURCE = "
} >"${ICU_SOURCE}/data/locales/reslocal.mk"
{
echo "LANG_CLDR_VERSION = 32.0.1"
echo "LANG_SYNTHETIC_ALIAS = "
echo "LANG_ALIAS_SOURCE = \$(LANG_SYNTHETIC_ALIAS) "
echo "LANG_SOURCE = "
} >"${ICU_SOURCE}/data/lang/reslocal.mk"
{
echo "CURR_CLDR_VERSION = 32.0.1"
echo "CURR_SYNTHETIC_ALIAS = "
echo "CURR_ALIAS_SOURCE = \$(CURR_SYNTHETIC_ALIAS) "
echo "CURR_SOURCE = "
} >"${ICU_SOURCE}/data/curr/reslocal.mk"
{
echo "REGION_CLDR_VERSION = 32.0.1"
echo "REGION_SYNTHETIC_ALIAS = "
echo "REGION_ALIAS_SOURCE = \$(REGION_SYNTHETIC_ALIAS) "
echo "REGION_SOURCE = "
} >"${ICU_SOURCE}/data/region/reslocal.mk"
{
echo "UNIT_CLDR_VERSION = 32.0.1"
echo "UNIT_SYNTHETIC_ALIAS = "
echo "UNIT_ALIAS_SOURCE = \$(UNIT_SYNTHETIC_ALIAS) "
echo "UNIT_SOURCE = "
} >"${ICU_SOURCE}/data/unit/reslocal.mk"
{
echo "ZONE_CLDR_VERSION = 32.0.1"
echo "ZONE_SYNTHETIC_ALIAS = "
echo "ZONE_ALIAS_SOURCE = \$(ZONE_SYNTHETIC_ALIAS) "
echo "ZONE_SOURCE = "
} >"${ICU_SOURCE}/data/zone/reslocal.mk"
#find "${ICU_SOURCES}/data/mappings/" -name '*.mk' ! -name 'ucmcore.mk' -type f -exec rm -f {} +
mv "${ICU_SOURCE}/data/mappings/ucmcore.mk" "${ICU_SOURCE}/data/mappings/ucmcore.not_used" 2>/dev/null
mv "${ICU_SOURCE}/data/mappings/ucmfiles.mk" "${ICU_SOURCE}/data/mappings/ucmfiles.not_used" 2>/dev/null
mv "${ICU_SOURCE}/data/mappings/ucmebcdic.mk" "${ICU_SOURCE}/data/mappings/ucmebcdic.not_used" 2>/dev/null
mv "${ICU_SOURCE}/data/mappings/ucmlocal.mk" "${ICU_SOURCE}/data/mappings/ucmlocal.not_used" 2>/dev/null
echo "===== Modify icu/source/common/unicode/uconfig.h ====="
cp "${ICU_SOURCE}/common/unicode/uconfig" "${ICU_SOURCE}/common/unicode/uconfig.h" 2>/dev/null
cp "${ICU_SOURCE}/common/unicode/uconfig.h" "${ICU_SOURCE}/common/unicode/uconfig" 2>/dev/null
for var in "${defines_config_set_1[@]}"; do
sed "/define __UCONFIG_H__/a \\
#ifndef ${var} \\
#define ${var} 1 \\
#endif \\
" "${ICU_SOURCE}/common/unicode/uconfig.h" >"${ICU_SOURCE}/common/unicode/uconfig.tmp"
mv "${ICU_SOURCE}/common/unicode/uconfig.tmp" "${ICU_SOURCE}/common/unicode/uconfig.h"
done
for var in "${defines_config_set_0[@]}"; do
sed "/define __UCONFIG_H__/a \\
#ifndef ${var} \\
#define ${var} 0 \\
#endif \\
" "${ICU_SOURCE}/common/unicode/uconfig.h" >"${ICU_SOURCE}/common/unicode/uconfig.tmp"
mv "${ICU_SOURCE}/common/unicode/uconfig.tmp" "${ICU_SOURCE}/common/unicode/uconfig.h"
done
echo "===== Modify icu/source/common/unicode/utypes.h ====="
cp "${ICU_SOURCE}/common/unicode/utypes" "${ICU_SOURCE}/common/unicode/utypes.h" 2>/dev/null
cp "${ICU_SOURCE}/common/unicode/utypes.h" "${ICU_SOURCE}/common/unicode/utypes" 2>/dev/null
for var in "${defines_utypes[@]}"; do
sed "/define UTYPES_H/a \\
#ifndef ${var} \\
#define ${var} 1 \\
#endif \\
" "${ICU_SOURCE}/common/unicode/utypes.h" >"${ICU_SOURCE}/common/unicode/utypes.tmp"
mv "${ICU_SOURCE}/common/unicode/utypes.tmp" "${ICU_SOURCE}/common/unicode/utypes.h"
done
echo "===== Patching icu/source/tools/pkgdata/pkgdata.cpp for iOS ====="
cp "${ICU_SOURCE}/tools/pkgdata/pkgdata" "${ICU_SOURCE}/tools/pkgdata/pkgdata.cpp" 2>/dev/null
cp "${ICU_SOURCE}/tools/pkgdata/pkgdata.cpp" "${ICU_SOURCE}/tools/pkgdata/pkgdata" 2>/dev/null
sed "s/int result = system(cmd);/ \\
#if defined(IOS_SYSTEM_FIX) \\
pid_t pid; \\
char * argv[2]; argv[0] = cmd; argv[1] = NULL; \\
posix_spawn(\&pid, argv[0], NULL, NULL, argv, environ); \\
waitpid(pid, NULL, 0); \\
int result = 0; \\
#else \\
int result = system(cmd); \\
#endif \\
/g" "${ICU_SOURCE}/tools/pkgdata/pkgdata.cpp" >"${ICU_SOURCE}/tools/pkgdata/pkgdata.tmp"
sed "/#include <stdlib.h>/a \\
#if defined(IOS_SYSTEM_FIX) \\
#include <spawn.h> \\
extern char **environ; \\
#endif \\
" "${ICU_SOURCE}/tools/pkgdata/pkgdata.tmp" >"${ICU_SOURCE}/tools/pkgdata/pkgdata.cpp"
#mv "${ICU_SOURCE}/tools/pkgdata/pkgdata.tmp" "${ICU_SOURCE}/tools/pkgdata/pkgdata.cpp"
echo "==============================="
echo "===== Run build for MacOS ====="
echo "==============================="
export PLATFORM_PREFIX="${PWD}/mac-build"
export CPPFLAGS=${CFLAGS}
mkdir -p ${PREBUILD}
cd ${PREBUILD}
sh ${ICU_SOURCE}/runConfigureICU MacOSX --prefix=${PLATFORM_PREFIX} ${CONFIG_PREFIX}
make clean
make -j4
make install
cd ..
}
function build() {
unset CXX
unset CC
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
echo "preparing $1 toolchain"
export BUILD_DIR="${PWD}/build-${2}"
DEVELOPER="$(xcode-select --print-path)"
SDKROOT="$(xcodebuild -version -sdk $4 | grep -E '^Path' | sed 's/Path: //')"
ARCH=$2
ICU_FLAGS="-I$ICU_SOURCE/common/ -I$ICU_SOURCE/tools/tzcode/ "
export ADDITION_FLAG="-DIOS_SYSTEM_FIX"
export CXX="$DEVELOPER/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
export CC="$DEVELOPER/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
export CFLAGS="-fembed-bitcode -isysroot $SDKROOT -I$SDKROOT/usr/include/ -I./include/ -arch $ARCH -miphoneos-version-min=9.0 $ICU_FLAGS $CFLAGS ${ADDITION_FLAG}"
export CXXFLAGS="${CXXFLAGS} -fembed-bitcode -stdlib=libc++ -isysroot $SDKROOT -I$SDKROOT/usr/include/ -I./include/ -arch $ARCH -miphoneos-version-min=9.0 $ICU_FLAGS ${ADDITION_FLAG}"
export LDFLAGS="-fembed-bitcode -stdlib=libc++ -L$SDKROOT/usr/lib/ -isysroot $SDKROOT -Wl,-dead_strip -miphoneos-version-min=9.0 -lstdc++ ${ADDITION_FLAG}"
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
sh ${ICU_SOURCE}/configure --host=$3 --with-library-suffix=${2} --with-cross-build=${PREBUILD} ${CONFIG_PREFIX}
make clean
make -j4
make install
cd ..
}
prebuild
echo "------------------------------------------------------"
echo " ICU build armv7 libraries"
echo "------------------------------------------------------"
build "armv7" "armv7" "armv7-apple-darwin" "iphoneos"
echo "------------------------------------------------------"
echo " ICU build arm64 libraries"
echo "------------------------------------------------------"
build "arm64" "arm64" "aarch64-apple-darwin" "iphoneos"
echo "------------------------------------------------------"
echo " ICU combining x86_64 libraries"
echo "------------------------------------------------------"
build "x86_64" "x86_64" "x86_64-apple-darwin" "iphonesimulator"
cd ..
echo "------------------------------------------------------"
echo " ICU combining x86_64, armv7 and arm64 libraries"
echo "------------------------------------------------------"
function buildUniversal() {
lipo -create -output "${PWD}/ios/build/$1.a" \
"${PWD}/ios/build-x86_64/lib/$1x86_64.a" \
"${PWD}/ios/build-arm64/lib/$1arm64.a" \
"${PWD}/ios/build-armv7/lib/$1armv7.a"
}
mkdir -p build
mkdir -p ios/build
mkdir -p ios/build/include
mkdir -p ios/build/include/unicode
cp ${ICU_SOURCE}/common/unicode/*.h ios/build/include/unicode
buildUniversal "libicuuc"
buildUniversal "libicui18n"
buildUniversal "libicudata"

View File

@ -391,9 +391,9 @@ namespace ComplexTypes
nullable<SimpleTypes::CSignedTwipsMeasure > m_oEnd;
nullable<SimpleTypes::CDecimalNumber<> > m_oEndChars;
nullable<SimpleTypes::CTwipsMeasure > m_oFirstLine;
nullable<SimpleTypes::CSignedTwipsMeasure > m_oFirstLine;
nullable<SimpleTypes::CDecimalNumber<> > m_oFirstLineChars;
nullable<SimpleTypes::CTwipsMeasure > m_oHanging;
nullable<SimpleTypes::CSignedTwipsMeasure > m_oHanging;
nullable<SimpleTypes::CDecimalNumber<> > m_oHangingChars;
nullable<SimpleTypes::CSignedTwipsMeasure > m_oStart;
nullable<SimpleTypes::CDecimalNumber<> > m_oStartChars;

View File

@ -399,14 +399,14 @@ namespace OOX
pClientData->getAnchorArray(m_aAnchor);
if(8 <= m_aAnchor.size())
{
pCommentItem->m_nLeft = m_aAnchor[0];
pCommentItem->m_nLeftOffset = m_aAnchor[1];
pCommentItem->m_nTop = m_aAnchor[2];
pCommentItem->m_nTopOffset = m_aAnchor[3];
pCommentItem->m_nRight = m_aAnchor[4];
pCommentItem->m_nRightOffset = m_aAnchor[5];
pCommentItem->m_nBottom = m_aAnchor[6];
pCommentItem->m_nBottomOffset = m_aAnchor[7];
pCommentItem->m_nLeft = abs(m_aAnchor[0]);
pCommentItem->m_nLeftOffset = abs(m_aAnchor[1]);
pCommentItem->m_nTop = abs(m_aAnchor[2]);
pCommentItem->m_nTopOffset = abs(m_aAnchor[3]);
pCommentItem->m_nRight = abs(m_aAnchor[4]);
pCommentItem->m_nRightOffset = abs(m_aAnchor[5]);
pCommentItem->m_nBottom = abs(m_aAnchor[6]);
pCommentItem->m_nBottomOffset =abs( m_aAnchor[7]);
}
pCommentItem->m_bMove = pClientData->m_oMoveWithCells;
pCommentItem->m_bSize = pClientData->m_oSizeWithCells;

View File

@ -65,7 +65,7 @@ isEqual(QT_MAJOR_VERSION, 5) {
ios {
CONFIG += core_ios
DEFINES += _IOS IOS LINUX _LINUX _MAC _XCODE
DEFINES += _IOS IOS LINUX _LINUX MAC _MAC _XCODE
}
android {
CONFIG += core_android
@ -139,6 +139,22 @@ core_windows {
QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
QMAKE_CXXFLAGS -= -Zc:strictStrings
QMAKE_CXXFLAGS += /MP
equals(TEMPLATE, app) {
console {
core_win_64:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.02
core_win_32:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
} else {
core_win_64:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWS,5.02
core_win_32:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWS,5.01
}
}
}
core_linux {
equals(TEMPLATE, app) {
QMAKE_LFLAGS += -Wl,--rpath=./:./system
}
}
core_win_32 {
@ -205,10 +221,12 @@ core_ios {
#QMAKE_MAC_XCODE_SETTINGS += Q_ENABLE_BITCODE
#QMAKE_MAC_XCODE_SETTINGS += Q_BITCODE_GENERATION_MODE
# for libraries§
QMAKE_LFLAGS += -Xlinker -bitcode_verify
QMAKE_LFLAGS += -Xlinker -bitcode_hide_symbols
#QMAKE_LFLAGS += -Xlinker -bitcode_symbol_map -Xlinker $$CORE_BUILDS_LIBRARIES_PATH
# for libraries
!core_debug {
QMAKE_LFLAGS += -Xlinker -bitcode_verify
QMAKE_LFLAGS += -Xlinker -bitcode_hide_symbols
#QMAKE_LFLAGS += -Xlinker -bitcode_symbol_map -Xlinker $$CORE_BUILDS_LIBRARIES_PATH
}
}
}

View File

@ -365,6 +365,118 @@ namespace NSDirectory
#endif
return false;
}
bool CopyDirectory(const std::wstring& strSrc, const std::wstring& strDst, bool bIsRecursion)
{
if (!NSDirectory::Exists(strDst))
NSDirectory::CreateDirectory(strDst);
#ifdef WIN32
WIN32_FIND_DATAW oFD;
std::wstring sSpec = strSrc + L"\\*.*";
HANDLE hRes = FindFirstFileW( sSpec.c_str(), &oFD );
if( INVALID_HANDLE_VALUE == hRes )
return false;
do
{
sSpec = oFD.cFileName;
if (sSpec != L"." && sSpec != L"..")
{
if( !( oFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) )
{
NSFile::CFileBinary::Copy(strSrc + L"/" + sSpec, strDst + L"/" + sSpec);
}
else if (bIsRecursion)
{
CopyDirectory(strSrc + L"/" + sSpec, strDst + L"/" + sSpec, bIsRecursion);
}
}
} while( FindNextFileW( hRes, &oFD ) );
FindClose( hRes );
return true;
#endif
#ifdef __linux__
BYTE* pUtf8 = NULL;
LONG lLen = 0;
NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strSrc.c_str(), strSrc.length(), pUtf8, lLen, false);
DIR *dp;
struct dirent *dirp;
if((dp = opendir((char*)pUtf8)) != NULL)
{
while ((dirp = readdir(dp)) != NULL)
{
int nType = 0;
if(DT_REG == dirp->d_type)
nType = 2;
else if (DT_DIR == dirp->d_type)
nType = 1;
else if (DT_UNKNOWN == dirp->d_type)
{
// XFS problem
struct stat buff;
std::string sTmp = std::string((char*)pUtf8) + "/" + std::string(dirp->d_name);
stat(sTmp.c_str(), &buff);
if (S_ISREG(buff.st_mode))
nType = 2;
else if (S_ISDIR(buff.st_mode))
nType = 1;
}
if (2 == nType)
{
std::wstring sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)dirp->d_name, strlen(dirp->d_name));
NSFile::CFileBinary::Copy(strSrc + L"/" + sName, strDst + L"/" + sName);
}
if (bIsRecursion && (1 == nType))
{
if(dirp->d_name[0] != '.')
{
std::wstring sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)dirp->d_name, strlen(dirp->d_name));
CopyDirectory(strSrc + L"/" + sName, strDst + L"/" + sName, bIsRecursion);
}
}
}
closedir(dp);
}
delete [] pUtf8;
return true;
#endif
#if defined(MAC) || defined (_IOS)
BYTE* pUtf8 = NULL;
LONG lLen = 0;
NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strSrc.c_str(), strSrc.length(), pUtf8, lLen, false);
DIR *dp;
struct dirent *dirp;
if((dp = opendir((char*)pUtf8)) != NULL)
{
while ((dirp = readdir(dp)) != NULL)
{
if(DT_REG == dirp->d_type)
{
std::wstring sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)dirp->d_name, strlen(dirp->d_name));
NSFile::CFileBinary::Copy(strSrc + L"/" + sName, strDst + L"/" + sName);
}
if (bIsRecursion && DT_DIR == dirp->d_type)
{
if(dirp->d_name[0] != '.')
{
std::wstring sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)dirp->d_name, strlen(dirp->d_name));
CopyDirectory(strSrc + L"/" + sName, strDst + L"/" + sName, bIsRecursion);
}
}
}
closedir(dp);
}
delete [] pUtf8;
return true;
#endif
return false;
}
void DeleteDirectory(const std::wstring& strDirectory, bool deleteRoot)
{
std::vector<std::wstring> aFiles = GetFiles(strDirectory);

View File

@ -33,6 +33,9 @@
#if defined(CreateDirectory)
#undef CreateDirectory
#endif
#if defined(CopyDirectory)
#undef CopyDirectory
#endif
#ifndef _BUILD_DIRECTORY_CROSSPLATFORM_H_
#define _BUILD_DIRECTORY_CROSSPLATFORM_H_
@ -67,6 +70,7 @@ namespace NSDirectory
KERNEL_DECL bool Exists(const std::wstring& strDirectory);
KERNEL_DECL bool CreateDirectory(const std::wstring& strDirectory);
KERNEL_DECL bool CreateDirectories(const std::wstring& strDirectory);
KERNEL_DECL bool CopyDirectory(const std::wstring& strSrc, const std::wstring& strDst, bool bIsRecursion = true);
KERNEL_DECL void DeleteDirectory(const std::wstring& strDirectory, bool deleteRoot = true);
KERNEL_DECL std::wstring GetFolderPath(const std::wstring& wsFolderPath);
KERNEL_DECL std::wstring CreateTempFileWithUniqueName (const std::wstring & strFolderPathRoot, std::wstring Prefix);

View File

@ -26,17 +26,6 @@ PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
include($$CORE_ROOT_DIR/Common/3dParty/icu/icu.pri)
core_linux {
QMAKE_LFLAGS += -Wl,--rpath=./:./system
}
core_win_64 {
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.02
}
core_win_32 {
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
}
CUSTOM_VERSION_PATH = $$(DOCBUILDER_VERSION_PATH)
isEmpty(CUSTOM_VERSION_PATH){
CUSTOM_VERSION_PATH=.

View File

@ -145,6 +145,12 @@ void _SetFilePath(const v8::FunctionCallbackInfo<v8::Value>& args)
CNativeControl* pNative = unwrap_nativeobject(args.This());
pNative->SetFilePath(CV8Convert::ToString(args[0]));
}
void _GetImagesPath(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CNativeControl* pNative = unwrap_nativeobject(args.This());
std::string sReturn = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(pNative->m_strImagesDirectory);
args.GetReturnValue().Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sReturn.c_str()));
}
void _GetFontsDirectory(const v8::FunctionCallbackInfo<v8::Value>& args)
{
@ -554,6 +560,7 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplate(v8::Isolate* isolate)
result->Set(current, "ZipClose", v8::FunctionTemplate::New(current, _zipCloseFile));
result->Set(current, "getImageUrl", v8::FunctionTemplate::New(current, _GetImageUrl));
result->Set(current, "getImagesDirectory", v8::FunctionTemplate::New(current, _GetImagesPath));
// возвращаем временный хэндл хитрым образом, который переносит наш хэндл в предыдущий HandleScope и не дает ему
// уничтожиться при уничтожении "нашего" HandleScope - handle_scope
@ -604,6 +611,7 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplateBuilder(v8::Isolate* i
result->Set(current, "ZipClose", v8::FunctionTemplate::New(current, _zipCloseFile));
result->Set(current, "getImageUrl", v8::FunctionTemplate::New(current, _GetImageUrl));
result->Set(current, "getImagesDirectory", v8::FunctionTemplate::New(current, _GetImagesPath));
// возвращаем временный хэндл хитрым образом, который переносит наш хэндл в предыдущий HandleScope и не дает ему
// уничтожиться при уничтожении "нашего" HandleScope - handle_scope

View File

@ -461,6 +461,7 @@ CNativeControl* unwrap_nativeobject(v8::Handle<v8::Object> obj);
void _GetFilePath(const v8::FunctionCallbackInfo<v8::Value>& args);
void _SetFilePath(const v8::FunctionCallbackInfo<v8::Value>& args);
void _GetImagesPath(const v8::FunctionCallbackInfo<v8::Value>& args);
void _GetFontsDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
void _GetEditorType(const v8::FunctionCallbackInfo<v8::Value>& args);

View File

@ -259,16 +259,12 @@ namespace MetaFile
if (dH < 0)
dH = -dH;
if (nWidth < 0) nWidth = dW;
if (nWidth < 0) nWidth = (int)(dW * 96 / 25.4);
nHeight = (int)((double)nWidth * dH / dW);
}
//double dDpiX, dDpiY;
//oRenderer.get_DpiX(&dDpiX);
//oRenderer.get_DpiX(&dDpiY);
double dWidth = nWidth ;//* 72 / 25.4 / dDpiX;
double dHeight = nHeight ;//* 72 / 25.4 / dDpiY;
double dWidth = 25.4 * nWidth / 96;
double dHeight = 25.4 * nHeight / 96;
BYTE* pBgraData = new BYTE[nWidth * nHeight * 4];
if (!pBgraData)
@ -283,7 +279,7 @@ namespace MetaFile
}
CBgraFrame oFrame;
oFrame.put_Data(pBgraData);
oFrame.put_Width(nWidth);
oFrame.put_Width(nWidth);
oFrame.put_Height(nHeight);
oFrame.put_Stride(-4 * nWidth);

View File

@ -432,7 +432,7 @@ class X2t private constructor() {
if (File(mInputParams.to).exists()) {
if (mIsOverwrite) {
FileUtils.deletePath(result.root!!)
FileUtils.deletePath(result.to!!)
} else {
result.code = CONVERTER_CODE_EXIST
return@let
@ -555,6 +555,7 @@ class X2t private constructor() {
this.to = cache1.to
this.temp = cache1.temp
this.theme = inputParams.theme
this.password = inputParams.password
}
var code = first.invoke(inputTemp)
@ -565,6 +566,7 @@ class X2t private constructor() {
this.to = inputParams.to
this.temp = cache2.temp
this.theme = "${cache2.root}/theme"
this.password = inputParams.password
}
if (!FileUtils.createPath(inputResult.theme!!)) {

View File

@ -18,21 +18,10 @@ include(../../../Common/3dParty/icu/icu.pri)
core_windows {
QMAKE_LFLAGS += /INCREMENTAL:NO
contains(QMAKE_TARGET.arch, x86_64):{
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.02
} else {
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
}
} else {
QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
}
core_linux {
QMAKE_LFLAGS += -Wl,--rpath=./:./system
}
DEFINES += UNICODE \
_UNICODE \
#DISABLE_FILE_DOWNLOADER \

View File

@ -3118,21 +3118,21 @@ int BinaryCommentReader::ReadComment(BYTE type, long length, void* poResult)
READ1_DEF(length, res, this->ReadCommentDatas, pNewComment);
}
else if ( c_oSer_Comments::Left == type )
pNewComment->m_nLeft = m_oBufferedStream.GetLong();
pNewComment->m_nLeft = abs(m_oBufferedStream.GetLong());
else if ( c_oSer_Comments::Top == type )
pNewComment->m_nTop = m_oBufferedStream.GetLong();
pNewComment->m_nTop = abs(m_oBufferedStream.GetLong());
else if ( c_oSer_Comments::Right == type )
pNewComment->m_nRight = m_oBufferedStream.GetLong();
pNewComment->m_nRight = abs( m_oBufferedStream.GetLong());
else if ( c_oSer_Comments::Bottom == type )
pNewComment->m_nBottom = m_oBufferedStream.GetLong();
pNewComment->m_nBottom = abs(m_oBufferedStream.GetLong());
else if ( c_oSer_Comments::LeftOffset == type )
pNewComment->m_nLeftOffset = m_oBufferedStream.GetLong();
pNewComment->m_nLeftOffset = abs(m_oBufferedStream.GetLong());
else if ( c_oSer_Comments::TopOffset == type )
pNewComment->m_nTopOffset = m_oBufferedStream.GetLong();
pNewComment->m_nTopOffset = abs(m_oBufferedStream.GetLong());
else if ( c_oSer_Comments::RightOffset == type )
pNewComment->m_nRightOffset = m_oBufferedStream.GetLong();
pNewComment->m_nRightOffset = abs(m_oBufferedStream.GetLong());
else if ( c_oSer_Comments::BottomOffset == type )
pNewComment->m_nBottomOffset = m_oBufferedStream.GetLong();
pNewComment->m_nBottomOffset = abs(m_oBufferedStream.GetLong());
else if ( c_oSer_Comments::LeftMM == type )
pNewComment->m_dLeftMM = m_oBufferedStream.GetDoubleReal();
else if ( c_oSer_Comments::TopMM == type )
@ -3299,8 +3299,15 @@ void BinaryCommentReader::parseCommentData(SerializeCommon::CommentData* pCommen
{
if(NULL != pCommentData && false == pCommentData->sText.empty())
{
addCommentRun(oSi, pCommentData->sUserName + _T(":"), true);
addCommentRun(oSi, _T("\n") + pCommentData->sText, false);
if (pCommentData->sUserName.empty())
{
addCommentRun(oSi, pCommentData->sText, false);
}
else
{
addCommentRun(oSi, pCommentData->sUserName + _T(":"), true);
addCommentRun(oSi, _T("\n") + pCommentData->sText, false);
}
}
}
void BinaryCommentReader::addCommentRun(OOX::Spreadsheet::CSi& oSi, const std::wstring& text, bool isBold)