Compare commits

...

20 Commits

Author SHA1 Message Date
4fc6511b37 . (#235) 2020-03-31 19:00:41 +03:00
52ff8af2be Feature/year (#234)
* Correct year detect on windows

* Remove qmake message
2020-03-31 15:15:17 +03:00
d29475b6fb Update base.pri (#233) 2020-03-30 17:45:42 +03:00
32e7193212 [x2t] Fix bug 44934 (#232) 2020-03-28 19:39:47 +03:00
23fc146eca Fix wget/curl parameters injection 2020-03-24 13:38:10 +03:00
7fd9e52bc3 Merge pull request #230 from ONLYOFFICE/feature/fix_bug_v5.5.1
fix bug in zip
2020-03-19 18:22:53 +03:00
dd13f9f24c fix bug in zip 2020-03-19 18:21:00 +03:00
0fe3c3ece5 Merge pull request #228 from ONLYOFFICE/feature/fix_bug_v5.5.1
XlsxFormat - fix bug #44840
2020-03-19 12:56:48 +03:00
5d148a6d0d Set htmlfileinternal path to doctrenderer.config 2020-03-18 18:28:56 +03:00
d7af2cb41d Remove path to HtmlFileInternal from x2t xml params 2020-03-18 18:09:52 +03:00
ed5bfb7b27 Add gitignore file 2020-03-18 16:33:25 +03:00
b81e988da5 XlsxFormat - fix bug #44840 2020-03-18 15:15:26 +03:00
a7c868d3d1 Remove unused files 2020-03-18 09:55:30 +03:00
bb022c49bd Fix xp build 2020-03-16 17:54:21 +03:00
31e8a1cbdd Fix previous commit 2020-03-16 17:27:31 +03:00
a19074993d Fix xp artifacts 2020-03-16 17:23:27 +03:00
0a1c718cc0 Refactoring 2020-03-13 17:49:15 +03:00
fb5da5e4ff Extend event types for native 2020-03-11 11:37:54 +03:00
61a157a3c4 Update gitignore 2020-03-11 09:23:06 +03:00
a7ba4c471e [x2t] For bug 44756
Fixed opening docx with special tblpPr values
2020-03-10 14:42:50 +03:00
39 changed files with 303 additions and 4495 deletions

2
.gitignore vendored
View File

@ -11,6 +11,8 @@ Common/3dParty/icu/win_32
Common/3dParty/icu/linux_64
Common/3dParty/icu/linux_32
Common/3dParty/icu/mac_64
Common/3dParty/icu/ios
Common/3dParty/icu/mac-build
Common/3dParty/cef/win_64
Common/3dParty/cef/win_32
Common/3dParty/cef/linux_64

View File

@ -261,13 +261,13 @@ std::wstring RtfFont::RenderToOOX(RenderParameter oRenderParameter)
break;
}
sResult += L"<w:rFonts w:ascii=\"";
sResult += sFontName;
sResult += XmlUtils::EncodeXmlString( sFontName, true );
sResult += L"\" w:eastAsia=\"";
sResult += sFontName;
sResult += XmlUtils::EncodeXmlString( sFontName, true );
sResult += L"\" w:hAnsi=\"";
sResult += sFontName;
sResult += XmlUtils::EncodeXmlString( sFontName, true );
sResult += L"\" w:cs=\"";
sResult += sFontName;
sResult += XmlUtils::EncodeXmlString( sFontName, true );
sResult += L"\"";
sResult += sHint;
sResult += L"/>";

View File

@ -1,50 +1,16 @@
INCLUDEPATH += $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/include
MSVC = vc140
CORE_BOOST_LIBS = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib
core_boost_libs {
core_windows {
core_debug {
LIBS += -L$$CORE_BOOST_LIBS -llibboost_system-$$MSVC-mt-gd-1_58 -llibboost_filesystem-$$MSVC-mt-gd-1_58
}
core_release {
LIBS += -L$$CORE_BOOST_LIBS -llibboost_system-$$MSVC-mt-1_58 -llibboost_filesystem-$$MSVC-mt-1_58
}
BOOST_POSTFIX = vc140
core_debug:BOOST_POSTFIX=$$BOOST_POSTFIX-mt-gd-1_58
core_release:BOOST_POSTFIX=$$BOOST_POSTFIX-mt-1_58
core_boost_libs:LIBS += -L$$CORE_BOOST_LIBS -llibboost_system-$$BOOST_POSTFIX -llibboost_filesystem-$$BOOST_POSTFIX
core_boost_regex:LIBS += -L$$CORE_BOOST_LIBS -llibboost_regex-$$BOOST_POSTFIX
core_boost_date_time:LIBS += -L$$CORE_BOOST_LIBS -llibboost_date_time-$$BOOST_POSTFIX
} else {
LIBS += -L$$CORE_BOOST_LIBS -lboost_system -lboost_filesystem
}
}
core_boost_regex {
core_windows {
core_debug {
LIBS += -L$$CORE_BOOST_LIBS -llibboost_regex-$$MSVC-mt-gd-1_58
}
core_release {
LIBS += -L$$CORE_BOOST_LIBS -llibboost_regex-$$MSVC-mt-1_58
}
} else {
LIBS += -L$$CORE_BOOST_LIBS -lboost_regex
}
}
core_boost_date_time {
core_windows {
core_debug {
LIBS += -L$$CORE_BOOST_LIBS -llibboost_date_time-$$MSVC-mt-gd-1_58
}
core_release {
LIBS += -L$$CORE_BOOST_LIBS -llibboost_date_time-$$MSVC-mt-1_58
}
} else {
LIBS += -L$$CORE_BOOST_LIBS -lboost_date_time
}
core_boost_libs:LIBS += -L$$CORE_BOOST_LIBS -lboost_system -lboost_filesystem
core_boost_regex:LIBS += -L$$CORE_BOOST_LIBS -lboost_regex
core_boost_date_time:LIBS += -L$$CORE_BOOST_LIBS -lboost_date_time
}

View File

@ -1,73 +0,0 @@
SET SCRIPTPATH=%~dp0
CD /D %~dp0
SET outputdir=%SCRIPTPATH%boost_1_58_0\build\%platform%
echo "%outputdir%"
SET TOOLSET=msvc-14.0
CD "%SCRIPTPATH%\boost_1_58_0"
call .\bootstrap.bat
if exist "stage" (
RMDIR "stage" /S /Q
)
md build
SET folder=build/win_32
if not exist "%folder%" (
echo "x86..."
md %folder%
md %folder%\static
md %folder%\static_fpic
md %folder%\shared
.\b2.exe --clean
.\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET% || goto :error
XCOPY /Y stage\lib\* "%folder%\static\"
.\b2.exe --clean
.\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET% || goto :error
XCOPY /Y stage\lib\* "%folder%\static_fpic\"
.\b2.exe --clean
.\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET% || goto :error
XCOPY /Y stage\lib\* "%folder%\shared\"
)
SET folder=build/win_64
if not exist "%folder%" (
echo "x64..."
if exist "stage" (
RMDIR "stage" /S /Q
)
md %folder%
md %folder%\static
md %folder%\static_fpic
md %folder%\shared
.\b2.exe --clean
.\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET% || goto :error
XCOPY /Y stage\lib\* "%folder%\static\"
.\b2.exe --clean
.\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET% || goto :error
XCOPY /Y stage\lib\* "%folder%\static_fpic\"
.\b2.exe --clean
.\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET% || goto :error
XCOPY /Y stage\lib\* "%folder%\shared\"
)
exit /b 0
:error
echo "Failed with error #%errorlevel%."
exit /b %errorlevel%

View File

@ -1,61 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
os=$(uname -s)
platform=""
case "$os" in
Linux*) platform="linux" ;;
Darwin*) platform="mac" ;;
*) exit ;;
esac
architecture=$(uname -m)
arch=""
case "$architecture" in
x86_64*) arch="_64" ;;
*) arch="_32" ;;
esac
outputdir="$SCRIPTPATH/boost_1_58_0/build/$platform$arch"
echo $outputdir
cd "$SCRIPTPATH/boost_1_58_0"
folder="build/$platform$arch"
if [ ! -d $folder ]; then
./bootstrap.sh --with-libraries=filesystem,system,date_time,regex
stage="stage"
if [ -d $stage ]; then
rm -R $stage
fi
mkdir -p "$folder"
mkdir -p "$folder/static"
mkdir -p "$folder/static_fpic"
mkdir -p "$folder/shared"
./b2 --clean
./bjam link=static
cp stage/lib/* "$folder/static/"
./b2 --clean
./bjam link=static cxxflags=-fPIC
cp stage/lib/* "$folder/static_fpic/"
./b2 --clean
./bjam link=shared
cp stage/lib/* "$folder/shared/"
fi
if [[ "$OO_PLATFORM" == *"ios"* ]]
then
if [ ! -d "$SCRIPTPATH/boost_1_58_0/build/ios" ]; then
cd "$SCRIPTPATH"
./boost_ios.sh
fi
fi

View File

@ -1,20 +0,0 @@
SET SCRIPTPATH=%~dp0
CD /D %~dp0
if exist "%SCRIPTPATH%boost_1_58_0.7z" (
echo "boost already downloaded"
) else (
Powershell.exe Invoke-WebRequest -OutFile boost_1_58_0.7z https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox
)
SET UNSIP_PROGRAMM="C:\Program Files\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="C:\Program Files (x86)\7-Zip\7z.exe"
if exist %UNSIP_PROGRAMM2% (
SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
)
if exist "%SCRIPTPATH%boost_1_58_0/" (
echo "boost already extracted"
) else (
call %UNSIP_PROGRAMM% x "%SCRIPTPATH%/boost_1_58_0.7z" -o"%SCRIPTPATH%/"
)

View File

@ -1,30 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BOOST_URL=https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z
os=$(uname -s)
platform=""
case "$os" in
Linux*) platform="linux" ;;
Darwin*) platform="mac" ;;
*) exit ;;
esac
if [[ -f "$SCRIPTPATH/boost_1_58_0.7z" ]]
then
echo "boost already downloaded"
else
wget $BOOST_URL || curl -O -L $BOOST_URL
fi
if [ -d "$SCRIPTPATH/boost_1_58_0" ]; then
echo "boost already extracted"
else
if [[ "$platform" == *"linux"* ]]
then
7z x -y "$SCRIPTPATH/boost_1_58_0.7z" -o"$SCRIPTPATH/"
else
7za x "$SCRIPTPATH/boost_1_58_0.7z" -o"$SCRIPTPATH/"
fi
fi

4
Common/3dParty/cef/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1 +0,0 @@
echo "build: OK!"

View File

@ -1,3 +0,0 @@
#!/bin/bash
echo "build: OK!"

View File

@ -1,62 +0,0 @@
Add-Type -AssemblyName System.IO.Compression.FileSystem
# ----------------------------------------------------------------------------------------------
# download a file
# ----------------------------------------------------------------------------------------------
function Download-File
{
param ([string]$url,[string]$file)
$downloadRequired = $true
if (Test-Path $file)
{
$localModified = (Get-Item $file).CreationTime
$webRequest = [System.Net.HttpWebRequest]::Create($url)
$webRequest.Method = "HEAD"
$webResponse = $webRequest.GetResponse()
$remoteLastModified = ($webResponse.LastModified) -as [DateTime]
$webResponse.Close()
if ($remoteLastModified -gt $localModified)
{
Write-Host "$file is out of date"
}
else
{
$downloadRequired = $false
}
}
if ($downloadRequired)
{
$clnt = new-object System.Net.WebClient
Write-Host "Downloading from $url to $file"
$clnt.DownloadFile($url, $file)
}
else
{
Write-Host "$file is up to date."
}
return $downloadRequired
}
# ----------------------------------------------------------------------------------------------
# unzip a file
# ----------------------------------------------------------------------------------------------
function RemoveCef
{
param([string]$outpath)
if (Test-Path $outpath)
{
Write-Host "Remove folder $outpath"
Remove-Item $outpath -Force -Recurse
}
}
$output = Download-File -url $args[0] -file $args[1]
if ($output)
{
RemoveCef -outpath $args[2]
}

View File

@ -1,58 +0,0 @@
@echo off
SET SCRIPTPATH=%~dp0
CD /D %~dp0
setlocal
SET UNSIP_PROGRAMM="%ProgramFiles%\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="%ProgramFiles(x86)%\7-Zip\7z.exe"
if exist %UNSIP_PROGRAMM2% (
SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
)
if defined BUILD_PLATFORM (
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:xp=%" (
SET "BUILD_PLATFORMS=win_64 win_32 winxp_64 winxp_32"
GOTO :found
)
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:all=%" (
SET "BUILD_PLATFORMS=win_64 win_32"
GOTO :found
)
)
SET "BUILD_PLATFORMS=win_32"
if defined ProgramFiles(x86) (
SET "BUILD_PLATFORMS=win_64"
GOTO :found
)
if defined TARGET (
SET "BUILD_PLATFORMS=%TARGET%"
GOTO :found
)
echo "error"
GOTO :end
:found
for %%a in (%BUILD_PLATFORMS%) do (
echo "platform: %%a"
mkdir "%SCRIPTPATH%%%a"
cd "%SCRIPTPATH%%%a"
Powershell.exe -executionpolicy remotesigned -file %SCRIPTPATH%download.ps1 http://d2ettrnqo7v976.cloudfront.net/cef/3163/%%a/cef_binary.7z cef_binary.7z cef_binary
if exist "cef_binary" (
echo "cef_binary.7z already extracted"
) else (
call %UNSIP_PROGRAMM% x "cef_binary.7z"
mkdir build
xcopy /Y /S cef_binary\Release\* build\
xcopy /Y /S cef_binary\Resources\* build\
)
)
:end
endlocal
@echo on

View File

@ -1,88 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
os=$(uname -s)
platform=""
case "$os" in
Linux*) platform="linux" ;;
Darwin*) platform="mac" ;;
*) exit ;;
esac
architecture=$(uname -m)
arch=""
case "$architecture" in
x86_64*) arch="_64" ;;
*) arch="_32" ;;
esac
if [[ -d "$SCRIPTPATH/$platform$arch" ]]
then
echo
else
mkdir "$SCRIPTPATH/$platform$arch"
fi
cd "$SCRIPTPATH/$platform$arch"
if [ -d "build" ]
then
echo ""
else
mkdir "build"
fi
cef_binary=cef_binary
cef_arch=$cef_binary.7z
cef_version="3163"
if [[ "$platform" == *"linux"* ]]
then
cef_version="3202"
cef_url=http://d2ettrnqo7v976.cloudfront.net/cef/$cef_version/$platform$arch/$cef_arch
else
cef_url=http://d2ettrnqo7v976.cloudfront.net/cef/$cef_version/$platform/$cef_arch
fi
if [[ "$platform" == *"linux"* ]]
then
if [[ -f $cef_arch ]]
then
cef_mod_time=$(date -d"$(curl -sI $cef_url | awk '/Last-Modified/ {print ($3, $4, $5, $6, $7, $8)}')" +"%s")
local_mod_time=$(stat -c %Y $cef_arch)
if [[ $cef_mod_time -eq $local_mod_time ]]
then
echo "cef_binary already downloaded"
else
wget $cef_url -O $cef_arch
rm -fr $cef_binary/
fi
else
wget $cef_url
rm -fr $cef_binary/
fi
if [ -d $cef_binary ]
then
echo "cef_binary already extracted"
else
7z x -y $cef_arch
fi
cp -r -t build/ ./$cef_binary/Release/* ./$cef_binary/Resources/*
chmod a+xr build/locales
fi
if [[ "$platform" == *"mac"* ]]
then
if [ -d "build/Chromium Embedded Framework.framework" ]
then
echo "cef_binary already extracted"
else
wget $cef_url || curl -O $cef_url
7za x $cef_arch
mv "$cef_binary" "build/Chromium Embedded Framework.framework"
fi
fi

View File

@ -1 +0,0 @@
echo "build: OK!"

View File

@ -1,3 +0,0 @@
#!/bin/bash
echo "build: OK!"

View File

@ -1,84 +0,0 @@
@echo off
SET SCRIPTPATH=%~dp0
CD /D %~dp0
setlocal
SET ICU_MAJOR_VER=58
SET ICU_MINOR_VER=2
SET VC=%ProgramFiles%\Microsoft Visual Studio 14.0\VC
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC
if exist %VC64% (
SET VC=%VC64%
)
SET UNSIP_PROGRAMM="%ProgramFiles%\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="%ProgramFiles(x86)%\7-Zip\7z.exe"
if exist %UNSIP_PROGRAMM2% (
SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
)
if defined BUILD_PLATFORM (
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:all=%" (
SET "BUILD_PLATFORMS=win_64 win_32"
GOTO :found
)
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:xp=%" (
SET "BUILD_PLATFORMS=win_64 win_32"
GOTO :found
)
)
SET "BUILD_PLATFORMS=win_32"
if defined ProgramFiles(x86) (
SET "BUILD_PLATFORMS=win_64"
GOTO :found
)
if defined TARGET (
SET "BUILD_PLATFORMS=%TARGET%"
GOTO :found
)
echo "error"
GOTO :end
:found
for %%a in (%BUILD_PLATFORMS%) do (
cd "%SCRIPTPATH%"
if not exist "%%a" (
md "%%a"
)
if not exist "%%a\build" (
md "%%a\build"
)
cd "%SCRIPTPATH%%%a"
if exist "icu" (
echo "icu already exported"
) else (
svn export https://github.com/unicode-org/icu/tags/release-%ICU_MAJOR_VER%-%ICU_MINOR_VER%/icu4c ./icu
)
if "%%a" == "win_64" (
call "%VC%\vcvarsall.bat" x64
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="X64"
XCOPY /Y "icu\bin64\icudt%ICU_MAJOR_VER%.dll" "build\"
XCOPY /Y "icu\bin64\icuuc%ICU_MAJOR_VER%.dll" "build\"
XCOPY /Y "icu\lib64\icudt.lib" "build\"
XCOPY /Y "icu\lib64\icuuc.lib" "build\"
) else (
call "%VC%\vcvarsall.bat" x86
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="Win32"
XCOPY /Y "icu\bin\icudt%ICU_MAJOR_VER%.dll" "build\"
XCOPY /Y "icu\bin\icuuc%ICU_MAJOR_VER%.dll" "build\"
XCOPY /Y "icu\lib\icudt.lib" "build\"
XCOPY /Y "icu\lib\icuuc.lib" "build\"
)
)
cd "%SCRIPTPATH%"
:end
endlocal
@echo on

View File

@ -1,91 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ICU_MAJOR_VER=58
ICU_MINOR_VER=2
SHARED_LIB_VER=$ICU_MAJOR_VER.$ICU_MINOR_VER
os=$(uname -s)
platform=""
case "$os" in
Linux*)
platform="linux"
BUILD_PLATFORM=Linux
SHARED_LIB_EXT=.so.$SHARED_LIB_VER
SHARED_LIB_SHORT_EXT=.so.$ICU_MAJOR_VER
;;
Darwin*)
platform="mac"
BUILD_PLATFORM=MacOSX
SHARED_LIB_EXT=.$SHARED_LIB_VER.dylib
SHARED_LIB_SHORT_EXT=.$ICU_MAJOR_VER.dylib
;;
*) exit ;;
esac
architecture=$(uname -m)
arch=""
case "$architecture" in
x86_64*) arch="_64" ;;
*) arch="_32" ;;
esac
if [[ -d "$SCRIPTPATH/$platform$arch" ]]
then
echo
else
mkdir "$SCRIPTPATH/$platform$arch"
fi
cd "$SCRIPTPATH/$platform$arch"
if [ -d "build" ]
then
echo ""
else
mkdir "build"
fi
if [ -d "./icu" ]
then
echo "icu already exported"
else
svn export https://github.com/unicode-org/icu/tags/release-$ICU_MAJOR_VER-$ICU_MINOR_VER/icu4c ./icu
fi
if [[ "$platform" == *"linux"* ]]
then
# Workaround for building icu older than 60.0
# on systems without xlocale.h (removed from glibc since 2.26)
# See https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
# See https://bugs.archlinux.org/task/55246
sed -i 's/xlocale/locale/' ./icu/source/i18n/digitlst.cpp
fi
if [[ "$platform" == *"mac"* ]]
then
sed -i -e 's/cmd\, \"%s %s -o %s%s %s %s%s %s %s\"\,/cmd\, \"%s %s -o %s%s %s %s %s %s %s\"\,/' ./icu/source/tools/pkgdata/pkgdata.cpp
fi
cd ./icu/source/
if [ ! -f "./Makefile" ]
then
./runConfigureICU $BUILD_PLATFORM
fi
make
if [ ! -d "$SCRIPTPATH/$platform$arch/usr/local" ]
then
DESTDIR="$SCRIPTPATH/$platform$arch" make install
fi
cd ../../
cp "./icu/source/lib/libicudata$SHARED_LIB_EXT" "build/libicudata$SHARED_LIB_SHORT_EXT"
cp "./icu/source/lib/libicuuc$SHARED_LIB_EXT" "build/libicuuc$SHARED_LIB_SHORT_EXT"

View File

@ -1,35 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$SCRIPTPATH"/openssl
os=$(uname -s)
platform=""
case "$os" in
Linux*) platform="linux" ;;
Darwin*) platform="darwin64-x86_64-cc" ;;
*) exit ;;
esac
platformLinux=""
architecture=$(uname -m)
arch=""
if [[ "$platform" == "linux" ]]
then
case "$architecture" in
x86_64*) arch="-64" ;;
*) arch="-32" ;;
esac
fi
echo "$platform$arch"
if [ ! -f Makefile ]; then
#perl ./Configure $platform$arch
./config no-shared no-asm
fi
make build_libs

View File

@ -1,8 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$SCRIPTPATH"
if [ ! -d openssl ]; then
git clone --depth=1 https://github.com/openssl/openssl.git
fi

View File

@ -1,33 +0,0 @@
SET SCRIPTPATH=%~dp0
CD /D %~dp0
SET PATH=%SCRIPTPATH%depot_tools;%PATH%
SET DEPOT_TOOLS_WIN_TOOLCHAIN=0
SET GYP_MSVS_VERSION=2015
call powershell -File .\fix-static_crt.ps1
cd v8
call gn gen out.gn/win_64/release --args="is_debug=false target_cpu=\"x64\" v8_target_cpu=\"x64\" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false"
call ninja -C out.gn/win_64/release || goto :error
call gn gen out.gn/win_64/debug --args="is_debug=true target_cpu=\"x64\" v8_target_cpu=\"x64\" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false"
call ninja -C out.gn/win_64/debug || goto :error
call gn gen out.gn/win_32/release --args="is_debug=false target_cpu=\"x86\" v8_target_cpu=\"x86\" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false"
call ninja -C out.gn/win_32/release || goto :error
call gn gen out.gn/win_32/debug --args="is_debug=true target_cpu=\"x86\" v8_target_cpu=\"x86\" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false"
call ninja -C out.gn/win_32/debug || goto :error
rem v8_use_snapshot=true v8_use_external_startup_data=true
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:xp=%" (
call %~dp0v8_xp\build.bat || goto :error
cd %~dp0
)
exit /b 0
:error
echo "Failed with error #%errorlevel%."
exit /b %errorlevel%

View File

@ -1,45 +0,0 @@
#!/bin/bash
export PATH=`pwd`/depot_tools:"$PATH"
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
os=$(uname -s)
platform=""
case "$os" in
Linux*) platform="linux" ;;
Darwin*) platform="mac" ;;
*) exit ;;
esac
architecture=$(uname -m)
arch=""
case "$architecture" in
x86_64*) arch="_64" ;;
*) arch="_32" ;;
esac
cd "$SCRIPTPATH/v8"
if [[ "$platform$arch" == "linux_64" ]]
then
gn gen out.gn/linux_64 --args='is_debug=false target_cpu="x64" v8_target_cpu="x64" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false use_sysroot=false'
ninja -C out.gn/linux_64
fi
if [[ "$platform$arch" == "linux_32" ]]
then
gn gen out.gn/linux_32 --args='is_debug=false target_cpu="x86" v8_target_cpu="x86" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false use_sysroot=false'
ninja -C out.gn/linux_32
fi
if [[ "$platform" == "mac" ]]
then
sed -i -e "s/if (mac_sdk_version != mac_sdk_min_build_override/if (false \&\& mac_sdk_version != mac_sdk_min_build_override/g" build/config/mac/mac_sdk.gni
# for new macOS!!!
#sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
gn gen out.gn/mac_64 --args='is_debug=false target_cpu="x64" v8_static_library=true is_component_build=false v8_use_snapshot=false'
ninja -C out.gn/mac_64
fi

View File

@ -1,28 +0,0 @@
SET SCRIPTPATH=%~dp0
CD /D %~dp0
SET DEPOT_TOOLS_WIN_TOOLCHAIN=0
SET GYP_MSVS_VERSION=2015
if exist "depot_tools" (
echo "depot_tools already fetched"
) else (
call git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
call powershell -File .\fix-depot_tools.ps1
)
SET PATH=%SCRIPTPATH%depot_tools;%PATH%
call gclient
call ./depot_tools/fetch v8
cd v8
call git checkout -b 6.0 -t branch-heads/6.0
cd ../
call gclient sync --no-history
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:xp=%" (
call v8_xp\fetch.bat
cd %~dp0
)

View File

@ -1,49 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$SCRIPTPATH"
if [ ! -d "depot_tools" ]
then
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
fi
export PATH=`pwd`/depot_tools:"$PATH"
gclient
#detect gcc version
currentver="$(gcc -dumpversion)"
requiredver="6.0.0"
v8_version="6.0"
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]
then
v8_version="7.0"
fi
echo "v8 version: $v8_version"
if [ ! -d "./v8" ]
then
fetch v8
cd v8
git checkout -b $v8_version -t branch-heads/$v8_version
else
cd v8
fi
gclient sync --no-history
os=$(uname -s)
platform=""
case "$os" in
Linux*) platform="linux" ;;
*) exit ;;
esac
cd "$SCRIPTPATH"
if [[ "$platform" == "linux" ]]
then
./fetch_linux_correct.sh
fi

View File

@ -1,40 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export PATH=`pwd`/depot_tools:"$PATH"
if [ -d "$SCRIPTPATH/v8/third_party/binutils/Linux_x64/Release" ]; then
rm -rf "$SCRIPTPATH/v8/third_party/binutils/Linux_x64/Release"
fi
if [ -d "$SCRIPTPATH/v8/third_party/binutils/Linux_ia32/Release" ]; then
rm -rf "$SCRIPTPATH/v8/third_party/binutils/Linux_ia32/Release"
fi
cd "$SCRIPTPATH/v8"
gclient sync --no-history
if [ -d "$SCRIPTPATH/v8/third_party/binutils/Linux_x64/Release/bin" ]; then
cd "$SCRIPTPATH/v8/third_party/binutils/Linux_x64/Release/bin"
for file in *
do
echo $file
if [ $file != "ld.gold" ]
then
mv "$file" "old_${file}"
ln -s /usr/bin/"$file" ./"$file"
fi
done
fi
if [ -d "$SCRIPTPATH/v8/third_party/binutils/Linux_ia32/Release/bin" ]; then
cd "$SCRIPTPATH/v8/third_party/binutils/Linux_ia32/Release/bin"
for file in *
do
echo $file
if [ $file != "ld.gold" ]
then
mv "$file" "old_${file}"
ln -s /usr/bin/"$file" ./"$file"
fi
done
fi

View File

@ -1,4 +0,0 @@
$gclient_path = "depot_tools\gclient.bat"
$fetch_path = "depot_tools\fetch.bat"
(Get-Content $gclient_path) | ForEach-Object { $_ -replace "^(`"%~dp0python`")", "call $&" } | Set-Content $gclient_path
(Get-Content $fetch_path) | ForEach-Object { $_ -replace "^(%~dp0python)", "call $&" } | Set-Content $fetch_path

View File

@ -1,2 +0,0 @@
$gn_path = "v8\build\config\win\BUILD.gn"
(Get-Content $gn_path) | ForEach-Object { $_ -replace ":static_crt", ":dynamic_crt" } | Set-Content $gn_path

View File

@ -438,15 +438,87 @@ namespace ComplexTypes
m_oVertAnchor.Init();
m_oVertAnchor->SetValue(SimpleTypes::vanchorMargin);
}
if(false == m_oTblpX.IsInit() && false == m_oTblpXSpec.IsInit())
if(false == m_oTblpXSpec.IsInit())
{
m_oTblpXSpec.Init();
m_oTblpXSpec->SetValue(SimpleTypes::xalignLeft);
if(false == m_oTblpX.IsInit())
{
m_oTblpX.Init();
m_oTblpX->FromTwips(0);
}
//Several values of sprmTDxaAbs have special meanings as specified by
//[ECMA-376] Part 4, Section 2.18.114. These values are specified as
//follows.
switch(m_oTblpX->ToTwips())
{
case 0:
m_oTblpX.reset(NULL);
m_oTblpXSpec.Init();
m_oTblpXSpec->SetValue(SimpleTypes::xalignLeft);
break;
case -4:
m_oTblpX.reset(NULL);
m_oTblpXSpec.Init();
m_oTblpXSpec->SetValue(SimpleTypes::xalignCenter);
break;
case -8:
m_oTblpX.reset(NULL);
m_oTblpXSpec.Init();
m_oTblpXSpec->SetValue(SimpleTypes::xalignRight);
break;
case -12:
m_oTblpX.reset(NULL);
m_oTblpXSpec.Init();
m_oTblpXSpec->SetValue(SimpleTypes::xalignInside);
break;
case -16:
m_oTblpX.reset(NULL);
m_oTblpXSpec.Init();
m_oTblpXSpec->SetValue(SimpleTypes::xalignOutside);
break;
}
}
if(false == m_oTblpY.IsInit() && false == m_oTblpYSpec.IsInit())
if(false == m_oTblpYSpec.IsInit())
{
m_oTblpY.Init();
m_oTblpY->FromTwips(0);
if(false == m_oTblpY.IsInit())
{
m_oTblpY.Init();
m_oTblpY->FromTwips(0);
}
//The meanings that are provided correspond to
//values that are defined in [ECMA-376] Part 4, Section 2.18.115 ST_YAlign
//(Vertical Alignment Location).
switch(m_oTblpY->ToTwips())
{
case 0:
m_oVertAnchor.Init();
m_oVertAnchor->SetValue(SimpleTypes::vanchorText);
break;
case -4:
m_oTblpY.reset(NULL);
m_oTblpYSpec.Init();
m_oTblpYSpec->SetValue(SimpleTypes::yalignTop);
break;
case -8:
m_oTblpY.reset(NULL);
m_oTblpYSpec.Init();
m_oTblpYSpec->SetValue(SimpleTypes::yalignCenter);
break;
case -12:
m_oTblpY.reset(NULL);
m_oTblpYSpec.Init();
m_oTblpYSpec->SetValue(SimpleTypes::yalignBottom);
break;
case -16:
m_oTblpY.reset(NULL);
m_oTblpYSpec.Init();
m_oTblpYSpec->SetValue(SimpleTypes::yalignInside);
break;
case -20:
m_oTblpY.reset(NULL);
m_oTblpYSpec.Init();
m_oTblpYSpec->SetValue(SimpleTypes::yalignOutside);
break;
}
}
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)

View File

@ -2267,6 +2267,8 @@ xmlns:xr16=\"http://schemas.microsoft.com/office/spreadsheetml/2017/revision16\"
m_oReadPath = oPath;
IFileContainer::Read( oRootPath, oPath );
return;// todooo option read
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )

View File

@ -47,6 +47,18 @@
#include <unistd.h>
#include <sys/wait.h>
std::string wget_url_validate(const std::string& url)
{
std::string::size_type pos = 0;
const char* url_ptr = url.c_str();
while ('-' == *url_ptr++) // '\0' => break
++pos;
if (*url_ptr == '\0')
return "";
return url.substr(pos);
}
int download_external(const std::wstring& sUrl, const std::wstring& sOutput)
{
int nReturnCode = -1;
@ -68,13 +80,14 @@ int download_external(const std::wstring& sUrl, const std::wstring& sOutput)
case 0: // child process
{
const char* nargs[6];
const char* nargs[7];
nargs[0] = "/usr/bin/curl";
nargs[1] = sUrlA.c_str();
nargs[2] = "--output";
nargs[3] = sOutputA.c_str();
nargs[4] = "--silent";
nargs[5] = NULL;
nargs[1] = "--url";
nargs[2] = sUrlA.c_str();
nargs[3] = "--output";
nargs[4] = sOutputA.c_str();
nargs[5] = "--silent";
nargs[6] = NULL;
const char* nenv[3];
nenv[0] = "LD_PRELOAD=";
@ -97,6 +110,8 @@ int download_external(const std::wstring& sUrl, const std::wstring& sOutput)
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/wget"))
{
std::string sUrlValidateA = wget_url_validate(sUrlA);
pid_t pid = fork(); // create child process
int status;
@ -109,7 +124,7 @@ int download_external(const std::wstring& sUrl, const std::wstring& sOutput)
{
const char* nargs[6];
nargs[0] = "/usr/bin/wget";
nargs[1] = sUrlA.c_str();
nargs[1] = sUrlValidateA.c_str();
nargs[2] = "-O";
nargs[3] = sOutputA.c_str();
nargs[4] = "-q";

View File

@ -17,7 +17,11 @@ isEmpty(PUBLISHER_NAME){
}
win32 {
CURRENT_YEAR = $$system("echo %Date:~6,4%")
CURRENT_YEAR = $$system(wmic PATH Win32_LocalTime GET ^Year /FORMAT:VALUE | find \"=\")
CURRENT_YEAR = $$replace(CURRENT_YEAR, "Year=", "")
CURRENT_YEAR = $$replace(CURRENT_YEAR, "\r", "")
CURRENT_YEAR = $$replace(CURRENT_YEAR, "\n", "")
CURRENT_YEAR = $$replace(CURRENT_YEAR, "\t", "")
}
!win32 {
@ -286,6 +290,12 @@ OBJECTS_DIR = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUI
MOC_DIR = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/moc
RCC_DIR = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/rcc
UI_DIR = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/ui
build_xp {
OBJECTS_DIR = $$OBJECTS_DIR/xp
MOC_DIR = $$MOC_DIR/xp
RCC_DIR = $$RCC_DIR/xp
UI_DIR = $$UI_DIR/xp
}
}
CORE_BUILDS_LIBRARIES_PATH = $$CORE_ROOT_DIR/build/lib/$$CORE_BUILDS_PLATFORM_PREFIX

View File

@ -791,4 +791,42 @@
#define ASC_EVENT_TYPE_SPELLCHECK_MESSAGE 22004
#define ASC_EVENT_TYPE_SPELLCHECK_TURN_ON 22005
#define ASC_MENU_EVENT_TYPE_DO_NONPRINTING_DISPLAY 22006
// Comments
#define ASC_MENU_EVENT_TYPE_ADD_COMMENT 23001
#define ASC_MENU_EVENT_TYPE_ADD_COMMENTS 23002
#define ASC_MENU_EVENT_TYPE_REMOVE_COMMENT 23003
#define ASC_MENU_EVENT_TYPE_CHANGE_COMMENTS 23004
#define ASC_MENU_EVENT_TYPE_REMOVE_COMMENTS 23005
#define ASC_MENU_EVENT_TYPE_CHANGE_COMMENT_DATA 23006
#define ASC_MENU_EVENT_TYPE_LOCK_COMMENT 23007
#define ASC_MENU_EVENT_TYPE_UNLOCK_COMMENT 23008
#define ASC_MENU_EVENT_TYPE_SHOW_COMMENT 23009
#define ASC_MENU_EVENT_TYPE_HIDE_COMMENT 23010
#define ASC_MENU_EVENT_TYPE_UPDATE_COMMENT_POSITION 23011
#define ASC_MENU_EVENT_TYPE_DOCUMENT_PLACE_CHANGED 23012
#define ASC_MENU_EVENT_TYPE_DO_SELECT_COMMENT 23101
#define ASC_MENU_EVENT_TYPE_DO_SHOW_COMMENT 23102
#define ASC_MENU_EVENT_TYPE_DO_SELECT_COMMENTS 23103
#define ASC_MENU_EVENT_TYPE_DO_DESELECT_COMMENTS 23104
#define ASC_MENU_EVENT_TYPE_DO_ADD_COMMENT 23105
#define ASC_MENU_EVENT_TYPE_DO_REMOVE_COMMENT 23106
#define ASC_MENU_EVENT_TYPE_DO_REMOVE_ALL_COMMENTS 23107
#define ASC_MENU_EVENT_TYPE_DO_CHANGE_COMMENT 23108
// Track reviews
#define ASC_MENU_EVENT_TYPE_SHOW_REVISIONS_CHANGE 24001
#define ASC_MENU_EVENT_TYPE_DO_SET_TRACK_REVISIONS 24101
#define ASC_MENU_EVENT_TYPE_DO_BEGIN_VIEWMODE_IN_REVIEW 24102
#define ASC_MENU_EVENT_TYPE_DO_END_VIEWMODE_IN_REVIEW 24103
#define ASC_MENU_EVENT_TYPE_DO_ACCEPT_ALL_CHANGES 24104
#define ASC_MENU_EVENT_TYPE_DO_REJECT_ALL_CHANGES 24105
#define ASC_MENU_EVENT_TYPE_DO_GET_PREV_REVISIONS_CHANGE 24106
#define ASC_MENU_EVENT_TYPE_DO_GET_NEXT_REVISIONS_CHANGE 24107
#define ASC_MENU_EVENT_TYPE_DO_ACCEPT_CHANGES 24108
#define ASC_MENU_EVENT_TYPE_DO_REJECT_CHANGES 24109
#define ASC_MENU_EVENT_TYPE_DO_FOLLOW_REVISION_MOVE 24110
#endif //_BUILD_EDITOR_DEFINES_CROSSPLATFORM_H_

View File

@ -50,11 +50,13 @@
#define FILE_SEPARATOR
#define FILE_SEPARATOR_CHAR '\\'
#define FILE_SEPARATOR_STR L"\\"
#else
#define FILE_SEPARATOR_STRA "\\"
#else
#define FILE_SEPARATOR
#define FILE_SEPARATOR_CHAR '/'
#define FILE_SEPARATOR_STR L"/"
#endif
#define FILE_SEPARATOR_STRA "/"
#endif
#endif
#include "../../Common/kernel_config.h"

View File

@ -25,10 +25,6 @@ ADD_DEPENDENCY(graphics, kernel, UnicodeConverter)
} else {
DEFINES += V8_OS_XP
DESTDIR=$$DESTDIR/xp
OBJECTS_DIR = $$OBJECTS_DIR/xp
MOC_DIR = $$MOC_DIR/xp
RCC_DIR = $$RCC_DIR/xp
UI_DIR = $$UI_DIR/xp
include(../../Common/3dParty/v8/v8_xp/v8.pri)
}

View File

@ -55,11 +55,30 @@ class CHtmlFile_Private
{
public:
bool m_bIsEpub;
std::wstring m_sHtmlFileInternal;
public:
CHtmlFile_Private()
{
m_bIsEpub = false;
m_sHtmlFileInternal = L"";
std::wstring sProcessPath = NSFile::GetProcessDirectory();
std::wstring sPathConfig = sProcessPath + L"/DoctRenderer.config";
if (NSFile::CFileBinary::Exists(sPathConfig))
{
XmlUtils::CXmlNode oNode;
if (oNode.FromXmlFile(sPathConfig))
{
std::wstring sPath = oNode.ReadValueString(L"htmlfileinternal");
if (!sPath.empty())
{
if (0 == sPath.find(L"./"))
sPath = sProcessPath + sPath.substr(1);
m_sHtmlFileInternal = sPath;
}
}
}
}
};
@ -224,9 +243,9 @@ static void GetScriptsPath(NSStringUtils::CStringBuilder& oBuilder)
}
}
int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstring& sDstfolder, const std::wstring& sPathInternal)
int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstring& sDstfolder)
{
std::wstring sInternal = sPathInternal;
std::wstring sInternal = m_internal->m_sHtmlFileInternal;
if (sInternal.empty())
sInternal = NSFile::GetProcessDirectory() + L"/HtmlFileInternal/";
@ -635,7 +654,7 @@ static std::vector<std::wstring> ParseEpub(const std::wstring& sPackagePath, std
return arHtmls;
}
int CHtmlFile::ConvertEpub(const std::wstring& sFolder, std::wstring& sMetaInfo, const std::wstring& sDstfolder, const std::wstring& sPathInternal)
int CHtmlFile::ConvertEpub(const std::wstring& sFolder, std::wstring& sMetaInfo, const std::wstring& sDstfolder)
{
std::wstring sFolderWithSlash = sFolder;
NSStringExt::Replace(sFolderWithSlash, L"\\", L"/");
@ -691,7 +710,7 @@ int CHtmlFile::ConvertEpub(const std::wstring& sFolder, std::wstring& sMetaInfo,
return 1;
m_internal->m_bIsEpub = true;
int nErr = this->Convert(arHtmls, sDstfolder, sPathInternal);
int nErr = this->Convert(arHtmls, sDstfolder);
m_internal->m_bIsEpub = false;
return nErr;
}
@ -1399,7 +1418,7 @@ namespace NSMht
};
}
int CHtmlFile::ConvertMht(const std::wstring& sFile, const std::wstring& sDstfolder, const std::wstring& sPathInternal)
int CHtmlFile::ConvertMht(const std::wstring& sFile, const std::wstring& sDstfolder)
{
NSMht::CMhtFile oFile;
oFile.Parse(sFile);
@ -1408,5 +1427,5 @@ int CHtmlFile::ConvertMht(const std::wstring& sFile, const std::wstring& sDstfol
std::vector<std::wstring> arFiles;
arFiles.push_back(sFileMht);
return this->Convert(arFiles, sDstfolder, sPathInternal);
return this->Convert(arFiles, sDstfolder);
}

View File

@ -56,9 +56,9 @@ public:
/// \param sPathInternal - path (subprocesspath = path + HtmlFileInternal.exe) ("" -> GetProcessDirectory()/HtmlFileInternal/HtmlFileInternal.exe)
/// \return 1 error, 0 - success
int Convert(const std::vector<std::wstring>& arFiles, const std::wstring& sDstfolder, const std::wstring& sPathInternal = L"");
int ConvertEpub(const std::wstring& sFolder, std::wstring& sMetaInfo, const std::wstring& sDstfolder, const std::wstring& sPathInternal = L"");
int ConvertMht(const std::wstring& sFile, const std::wstring& sDstfolder, const std::wstring& sPathInternal = L"");
int Convert(const std::vector<std::wstring>& arFiles, const std::wstring& sDstfolder);
int ConvertEpub(const std::wstring& sFolder, std::wstring& sMetaInfo, const std::wstring& sDstfolder);
int ConvertMht(const std::wstring& sFile, const std::wstring& sDstfolder);
};
#endif // _HTMLFILE_HTMLFILE_H_

View File

@ -207,6 +207,75 @@ namespace ZLibZipUtils
/*========================================================================================================*/
static std::string normalize_path(const std::string &path)
{
const char* pData = path.c_str();
int nLen = (int) path.length();
char* pDataNorm = new char[nLen + 1];
int* pSlashPoints = new int[nLen + 1];
int nStart = 0;
int nCurrent = 0;
int nCurrentSlash = -1;
int nCurrentW = 0;
bool bIsUp = false;
#if !defined(_WIN32) && !defined (_WIN64)
if (pData[nCurrent] == FILE_SEPARATOR_CHAR)
pDataNorm[nCurrentW++] = pData[nCurrent];
#endif
while (nCurrent < nLen)
{
if (pData[nCurrent] == FILE_SEPARATOR_CHAR)
{
if (nStart < nCurrent)
{
bIsUp = false;
if ((nCurrent - nStart) == 2)
{
if (pData[nStart] == (char)'.' && pData[nStart + 1] == (char)'.')
{
if (nCurrentSlash > 0)
{
--nCurrentSlash;
nCurrentW = pSlashPoints[nCurrentSlash];
bIsUp = true;
}
}
}
if (!bIsUp)
{
pDataNorm[nCurrentW++] = (char) FILE_SEPARATOR_CHAR;
++nCurrentSlash;
pSlashPoints[nCurrentSlash] = nCurrentW;
}
}
nStart = nCurrent + 1;
++nCurrent;
continue;
}
pDataNorm[nCurrentW++] = pData[nCurrent];
++nCurrent;
}
pDataNorm[nCurrentW] = (char)'\0';
std::string result = std::string(pDataNorm, nCurrentW);
delete []pDataNorm;
return result;
}
static void replace_all(std::string& subject, const std::string& search, const std::string& replace)
{
size_t pos = 0;
while ((pos = subject.find(search, pos)) != std::string::npos)
{
subject.replace(pos, search.length(), replace);
pos += replace.length();
}
}
static int do_extract_currentfile( unzFile uf, const int* popt_extract_without_path, int* popt_overwrite, const char* password )
{
char filename_inzipA[256];
@ -289,12 +358,39 @@ namespace ZLibZipUtils
if ((fout==NULL) && ((*popt_extract_without_path)==0) &&
(filename_withoutpath!=(wchar_t*)filename_inzip))
{
char* current_directory = getcwd(NULL, 0);
if (current_directory)
{
std::string current_path(current_directory);
free(current_directory);
current_path += FILE_SEPARATOR_STRA;
replace_all(current_path, "/", FILE_SEPARATOR_STRA);
replace_all(current_path, "\\", FILE_SEPARATOR_STRA);
std::string filename_inzip(filename_inzipA);
replace_all(filename_inzip, "/", FILE_SEPARATOR_STRA);
replace_all(filename_inzip, "\\", FILE_SEPARATOR_STRA);
std::string norm_path = normalize_path(current_path + filename_inzip);
std::string norm_current_path = normalize_path(current_path);
if (std::string::npos == norm_path.find(norm_current_path))
{
return UNZ_INTERNALERROR;
}
}
char c=*(filename_withoutpath-1);
*(filename_withoutpath-1)='\0';
makedir(write_filename);
*(filename_withoutpath-1)=c;
if(oFile.CreateFileW(write_filename))
{
fout = oFile.GetFileNative();
}
}
}

View File

@ -2759,8 +2759,7 @@ namespace NExtractTools
arFiles.push_back(sFrom);
CHtmlFile oHtmlFile;
std::wstring sPathInternal = NULL != params.m_sHtmlFileInternalPath ? *params.m_sHtmlFileInternalPath : L"";
return 0 == oHtmlFile.Convert(arFiles, sTo, sPathInternal) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
return 0 == oHtmlFile.Convert(arFiles, sTo) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
//html in container
_UINT32 html_zip2doct_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
@ -2795,15 +2794,13 @@ namespace NExtractTools
{
}
CHtmlFile oHtmlFile;
std::wstring sPathInternal = NULL != params.m_sHtmlFileInternalPath ? *params.m_sHtmlFileInternalPath : L"";
return 0 == oHtmlFile.Convert(arFiles, sTo, sPathInternal) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
return 0 == oHtmlFile.Convert(arFiles, sTo) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
//mht
_UINT32 mht2doct_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
CHtmlFile oHtmlFile;
std::wstring sPathInternal = NULL != params.m_sHtmlFileInternalPath ? *params.m_sHtmlFileInternalPath : L"";
return 0 == oHtmlFile.ConvertMht(sFrom, sTo, sPathInternal) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
return 0 == oHtmlFile.ConvertMht(sFrom, sTo) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
_UINT32 epub2doct_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
@ -2814,8 +2811,7 @@ namespace NExtractTools
{
CHtmlFile oHtmlFile;
std::wstring sMetaInfo;
std::wstring sPathInternal = NULL != params.m_sHtmlFileInternalPath ? *params.m_sHtmlFileInternalPath : L"";
nRes = 0 == oHtmlFile.ConvertEpub(sEpubDir, sMetaInfo, sTo, sPathInternal) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
nRes = 0 == oHtmlFile.ConvertEpub(sEpubDir, sMetaInfo, sTo) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
}

File diff suppressed because it is too large Load Diff

View File

@ -409,7 +409,6 @@ namespace NExtractTools
InputParamsMailMerge* m_oMailMergeSend;
InputParamsThumbnail* m_oThumbnail;
std::wstring* m_sJsonParams;
std::wstring* m_sHtmlFileInternalPath;
std::wstring* m_sPassword;
std::wstring* m_sSavePassword;
std::wstring* m_sDocumentID;
@ -440,7 +439,6 @@ namespace NExtractTools
m_oMailMergeSend = NULL;
m_oThumbnail = NULL;
m_sJsonParams = NULL;
m_sHtmlFileInternalPath = NULL;
m_sPassword = NULL;
m_sSavePassword = NULL;
m_sDocumentID = NULL;
@ -470,7 +468,6 @@ namespace NExtractTools
RELEASEOBJECT(m_oMailMergeSend);
RELEASEOBJECT(m_oThumbnail);
RELEASEOBJECT(m_sJsonParams);
RELEASEOBJECT(m_sHtmlFileInternalPath);
RELEASEOBJECT(m_sPassword);
RELEASEOBJECT(m_sSavePassword);
RELEASEOBJECT(m_sDocumentID);
@ -615,11 +612,6 @@ namespace NExtractTools
RELEASEOBJECT(m_sJsonParams);
m_sJsonParams = new std::wstring(sValue);
}
else if(_T("m_sHtmlFileInternalPath") == sName)
{
RELEASEOBJECT(m_sHtmlFileInternalPath);
m_sHtmlFileInternalPath = new std::wstring(sValue);
}
else if(_T("m_sPassword") == sName)
{
RELEASEOBJECT(m_sPassword);