Compare commits

..

140 Commits

Author SHA1 Message Date
7448a331e9 Merge pull request #1194 from ONLYOFFICE/feature/pluginsmanager
Fixes 62704, 62727
2023-05-26 13:53:39 +03:00
940bb840be minors 2023-05-26 13:42:27 +03:00
967b0aec72 autorename options 2023-05-26 11:31:27 +03:00
852989d0c9 fix bug 62704
checking permissions for the working folder
2023-05-25 17:39:52 +03:00
c733399b88 fix bug #60467 2023-05-25 16:32:33 +03:00
8c92a944ad Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-05-25 14:32:33 +03:00
0456f9b362 fix bug #62728 2023-05-25 14:32:03 +03:00
4ec7942649 Fix typo 2023-05-25 13:49:46 +03:00
13410416a5 fix bud 62727 2023-05-25 13:30:46 +03:00
b4d00a7a47 fix bug #62498 2023-05-24 15:40:33 +03:00
9d497e48c9 Merge pull request #1193 from ONLYOFFICE/feature/pluginsmanager
Restore error description
2023-05-23 17:47:36 +05:00
759a159005 bug fix #62707 2023-05-23 15:36:36 +03:00
92e6fa06b5 Merge branch 'release/v7.4.0' into feature/pluginsmanager 2023-05-23 15:26:57 +03:00
7b93de3e8a bug fix #62707 2023-05-23 15:26:46 +03:00
ca3e65468b fix bug #62712 2023-05-22 21:55:39 +03:00
5d378ddb41 minor 2023-05-22 20:03:57 +03:00
ba05993073 settings folder tolower 2023-05-22 19:42:33 +03:00
6438c1cd4b For bug 62605 2023-05-22 12:49:06 +03:00
07ad714d3a Merge pull request #1191 from ONLYOFFICE/fix/build-linux
linux fix build debug
2023-05-21 00:42:16 +05:00
1c87c34db9 Add flags for convertation to images 2023-05-20 21:57:38 +03:00
8f4956102a Fix bug 62696 2023-05-20 20:09:56 +03:00
0d8fcd1bef linux fix build debug 2023-05-20 09:22:38 +03:00
4db5c55544 Merge pull request #1190 from ONLYOFFICE/fix/pm-linux
Refactoring config parsing
2023-05-20 01:24:55 +05:00
709ac0b868 Merge branch 'release/v7.4.0' into fix/pm-linux 2023-05-19 21:53:57 +03:00
dd73d3347f Fix build 2023-05-19 11:55:43 +03:00
e98f981a46 fix bug #59026 2023-05-18 18:49:08 +03:00
d6b7aefe51 bullshit off 2023-05-17 23:31:07 +03:00
f612ca64e0 Merge pull request #1189 from ONLYOFFICE/fix/pm-linux
minor fixes
2023-05-18 01:08:00 +05:00
e3a582ee67 minor 2023-05-17 21:57:15 +03:00
fa68ba2f0d fix config spaces 2023-05-17 21:07:49 +03:00
3387f67f7e Merge pull request #1187 from ONLYOFFICE/fix/pm-linux
linux fixes
2023-05-17 22:32:28 +05:00
383e9bc971 speedup 2023-05-17 20:15:33 +03:00
c67aea9543 fix bug #62630 2023-05-17 19:53:56 +03:00
0e64e3467b linux: fix plugin version 2023-05-17 19:49:38 +03:00
cc2027edab For bug 62654 2023-05-17 19:33:08 +03:00
da3739942f Merge pull request #1186 from ONLYOFFICE/fix/pm-linux
linux fix: args
2023-05-17 21:06:58 +05:00
80d5783b3b linux fix: args 2023-05-17 16:21:31 +03:00
dbd5aeadd2 fix bug #62634 2023-05-17 13:49:04 +03:00
d57b69731b fix bug #62610 2023-05-16 15:44:33 +03:00
248f9a5362 fix bug #62498 2023-05-16 12:22:50 +03:00
204ef06b1a . 2023-05-16 10:30:06 +03:00
f9171cb342 small optimization 2023-05-16 08:55:25 +03:00
6d80b8537f fix bug #62174 2023-05-15 19:40:02 +03:00
c5a09b75d6 fix bug #62115 2023-05-15 18:44:55 +03:00
1c8687e07f Fix build with c++11 2023-05-15 17:58:19 +05:00
28745ae49f Refacroring work with arraybuffer for support new v8 versions 2023-05-15 15:33:35 +03:00
d6b5523406 Merge pull request #1185 from ONLYOFFICE/fix/metafile_bugs
Fix metafile bugs
2023-05-15 16:17:09 +05:00
358903d331 Fix typo 2023-05-14 01:41:32 +05:00
46e8d03eeb fix bug #62579 2023-05-12 18:29:52 +03:00
554ad261cf fix bug #62572 2023-05-12 18:15:49 +03:00
78c662ea55 Merge pull request #1183 from ONLYOFFICE/feature/pluginsmanager
pluginsmanager - update on server
2023-05-12 12:29:48 +05:00
98a02441de [server] update by config
- update if plugin exists
- install if plugin is not installed and not removed before
2023-05-12 10:27:14 +03:00
efb3075e0e removing by config 2023-05-12 09:43:48 +03:00
da703d88ca Merge pull request #1182 from ONLYOFFICE/feature/pluginsmanager
pluginsmanager
2023-05-12 11:02:24 +05:00
dc73c8b2b6 minor 2023-05-12 08:33:20 +03:00
1404829b68 change settings folder 2023-05-12 08:18:48 +03:00
be9f8ba8e6 minor 2023-05-11 22:46:50 +03:00
f858b76fd4 minors
--print-removed option
2023-05-11 22:26:20 +03:00
3914b9a9d5 fix update 2023-05-11 20:47:41 +03:00
e19d1c6735 fix bug #62530 2023-05-11 19:11:43 +03:00
041d8a3dc4 install/remove settings feature 2023-05-11 18:42:12 +03:00
31ee203b92 Fix bugs in metafile to svg conversion 2023-05-11 18:03:56 +03:00
3d7eefcd3d Merge pull request #1179 from ONLYOFFICE/feature/shape-vertical-text-align
Feature/shape vertical text align
2023-05-11 16:24:19 +03:00
82db1cd0d1 fix bug #62327 2023-05-11 15:25:49 +03:00
14ea99e880 fix bug #32006 2023-05-11 14:55:17 +03:00
7363c995dd fix bug #62527 2023-05-10 21:04:26 +03:00
66a2edf5d2 fix bug #62525 2023-05-10 20:38:35 +03:00
36e5cada88 Fix bug 62353 2023-05-10 18:21:38 +03:00
01e9bb8cef Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-05-10 18:04:49 +03:00
9887883626 Fix build for macos/ios 2023-05-10 18:03:56 +03:00
3d828f9683 fix bug #62512 2023-05-10 17:29:57 +03:00
2d890247ab fix bug #62443 2023-05-10 16:40:07 +03:00
5acc2513c8 . 2023-05-10 11:02:18 +03:00
d3dc902f23 Fix export methods 2023-05-09 11:40:02 +05:00
11ae76f9f0 Fix build 2023-05-07 10:29:50 +03:00
7340469a8c Fix bug 61386 2023-05-07 00:23:47 +03:00
92e03fd7b6 Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-05-06 17:16:40 +03:00
7a12a4d43e Fix typo 2023-05-06 17:15:49 +03:00
c59f679043 Merge pull request #1177 from ONLYOFFICE/feature/pmutility
Bug fix #62372
2023-05-06 18:35:43 +05:00
3cb1503632 Disable ssl in wget commands on old macos 2023-05-05 22:17:49 +03:00
b2b0c74cd4 unknown param check 2023-05-05 21:44:20 +03:00
a1376d647f help changes 2023-05-05 20:06:02 +03:00
dc17f5fe2e Fix bug #62372 2023-05-05 19:44:50 +03:00
6d45b90ac0 Add info class to export 2023-05-05 15:41:54 +03:00
7130c2d1bb fix bug #62358 2023-05-04 15:54:22 +03:00
e19db2847f Merge pull request #1176 from ONLYOFFICE/fix/bug62184
Fix bugs 62184, 61326, 59302
2023-05-04 15:49:08 +05:00
2e8bb7177c Fix NSImageReSaver::CorrectImage 2023-05-04 13:43:21 +03:00
c8ca57ea40 fix bug #62360 2023-05-03 20:20:02 +03:00
e7931e73d1 fix bug #62379 2023-05-03 19:54:46 +03:00
b096ce8098 Correction of font selection in metafile to svg conversion 2023-05-03 14:05:44 +03:00
ffc3149d4b Fixed a bug with font size in metafile to svg conversion 2023-05-03 12:07:58 +03:00
f4cc9ec38a Fix bug #62404 2023-05-03 12:07:19 +03:00
5c3760a907 Merge pull request #1175 from ONLYOFFICE/fix/swscanf
fix swscanf
2023-05-03 13:16:59 +05:00
6320c543c0 fix build linux 2023-05-03 11:14:29 +03:00
324dd2de49 . 2023-05-03 10:24:49 +03:00
e07fd5ed24 Merge pull request #1174 from ONLYOFFICE/feature/pmutility
pluginsmanager: fix sync names
2023-05-03 12:17:27 +05:00
19295c1037 minor 2023-05-02 21:51:52 +03:00
7ad0e7e9fe minor 2023-05-02 20:52:23 +03:00
ce9ede6820 fix: sync plugins names 2023-05-02 20:38:43 +03:00
379f474739 fix bug #60760 2023-05-02 20:03:33 +03:00
a2662a6f2b Merge pull request #1173 from ONLYOFFICE/feature/pmutility
Feature/pmutility
2023-05-02 21:23:31 +05:00
c52893306d minors 2023-05-02 19:05:41 +03:00
3a9a2b5ee7 Merge branch 'release/v7.4.0' into feature/pmutility 2023-05-02 19:00:31 +03:00
8df04c48ad update plugins feature 2023-05-02 18:57:45 +03:00
f7b0565233 odf chart 2023-05-02 11:06:56 +03:00
ef7fb15efe Fix build android on macos 2023-04-29 01:49:50 +05:00
e32b53d662 Merge pull request #1171 from ONLYOFFICE/feature/pmutility
Feature/pmutility
2023-04-28 21:34:23 +05:00
0b683226e9 Fix linux/macos build 2023-04-28 19:33:15 +03:00
73924f3ae0 restore plugin feature 2023-04-28 18:33:22 +03:00
e8ecef51dd fix locale 2023-04-28 16:58:47 +03:00
5bf730e1d6 minors 2023-04-28 16:23:57 +03:00
091f3a3a8e fix search 2023-04-28 14:11:40 +03:00
ffa8467c9e default init, backup feature 2023-04-28 13:28:17 +03:00
398c69c01e odf chart refactoring 2023-04-28 12:39:29 +03:00
a48ed74102 Merge pull request #1170 from ONLYOFFICE/fix/bug62143
Fix bug #62143
2023-04-28 13:29:11 +05:00
45628154d9 Fix bug #62143 2023-04-28 11:23:02 +03:00
2921e476c3 remove all plugins feature 2023-04-28 09:47:00 +03:00
e97fd44489 plugin manager utility 2023-04-27 21:52:38 +03:00
1dba0723c7 Add settings for disable all warnings 2023-04-27 14:34:26 +03:00
217ec901ed Merge pull request #1169 from ONLYOFFICE/fix/bug62305
Fix bug 62305
2023-04-27 13:51:17 +05:00
68723a5e81 Fix bug 62305 2023-04-27 11:28:10 +03:00
53810c07ac Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-04-27 10:47:04 +03:00
14fcc4dfac fix bug #62269 2023-04-27 10:46:43 +03:00
b4b1cae18e Fix typo 2023-04-27 10:41:12 +03:00
ab74e3fce7 Add test for font picker 2023-04-26 23:57:40 +03:00
4f48287d28 Fix font select (use unicode names for symbols > 128) 2023-04-26 23:40:15 +03:00
3b20ac3825 fix bug #62155 2023-04-26 23:08:57 +03:00
3f782ab389 odf chart refactoring 2023-04-26 20:35:23 +03:00
c22d4c60c0 Merge pull request #1166 from ONLYOFFICE/fix/bug62304
Fix bug 62304
2023-04-26 20:55:12 +05:00
9349ddf604 Fix bug 62304 2023-04-26 18:50:15 +03:00
70c4f045ea Fix build 2023-04-26 20:34:11 +05:00
d955de5bdb Merge pull request #1165 from ONLYOFFICE/fix/metafile_bugs
Fix metafile bugs
2023-04-26 18:46:14 +05:00
0bd9cead65 Revert previous commits and just export CHash class. 2023-04-26 16:23:18 +03:00
c282e86832 Fix build hash wasm module 2023-04-26 16:16:10 +03:00
cd91baaabe Refactoring and move hash algs outside js embeds engine 2023-04-26 16:15:02 +03:00
aa56efb495 Fix bug #62144 2023-04-25 13:50:31 +03:00
44016b4ccc Merge branch 'release/v7.4.0' into feature/shape-vertical-text-align 2023-04-25 14:08:12 +07:00
11b59048cd Fix bug #62176 2023-04-20 13:32:42 +03:00
6b0513cd81 Fix bug #62178 2023-04-20 13:21:27 +03:00
01f01ec85f vertical text align 2023-04-20 08:15:05 +03:00
265 changed files with 12912 additions and 8860 deletions

View File

@ -1,38 +0,0 @@
OPENSSL_LIBS_DIRECTORY = $$PWD/../openssl/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib
core_android {
OPENSSL_ABI_PATH = $$replace(CORE_BUILDS_PLATFORM_PREFIX, "android_", "")
contains(OPENSSL_ABI_PATH, "armv7" ) {
OPENSSL_ABI_PATH = $$replace(OPENSSL_ABI_PATH, "armv7", "armeabi-v7a")
}
contains(OPENSSL_ABI_PATH, "arm64_v8a" ) {
OPENSSL_ABI_PATH = $$replace(OPENSSL_ABI_PATH, "arm64_v8a", "arm64-v8a")
}
OPENSSL_LIBS_DIRECTORY = $$PWD/../openssl/build/android/$$OPENSSL_ABI_PATH/lib
}
core_ios {
OPENSSL_LIBS_DIRECTORY = $$PWD/../openssl/build/ios/openssl-universal/lib
bundle_xcframeworks {
xcframework_platform_ios_simulator {
OPENSSL_LIBS_DIRECTORY = $$PWD/../openssl/build/ios/openssl-xc/simulator/lib
} else {
OPENSSL_LIBS_DIRECTORY = $$PWD/../openssl/build/ios/openssl-xc/lib
}
}
}
core_windows {
LIBS += $$OPENSSL_LIBS_DIRECTORY/libssl.lib
LIBS += $$OPENSSL_LIBS_DIRECTORY/libcrypto.lib
} else {
LIBS += $$OPENSSL_LIBS_DIRECTORY/libssl.a
LIBS += $$OPENSSL_LIBS_DIRECTORY/libcrypto.a
}
INCLUDEPATH += $$OPENSSL_LIBS_DIRECTORY/../include

View File

@ -83,19 +83,19 @@ function configure_make() {
if [[ "${ARCH}" == "x86_64" ]]; then
./Configure android-x86_64 --prefix="${PREFIX_DIR}" enable-ssl3 enable-ssl3-method enable-md2
./Configure android-x86_64 --prefix="${PREFIX_DIR}" no-shared no-tests enable-ssl3 enable-ssl3-method enable-md2 no-asm
elif [[ "${ARCH}" == "x86" ]]; then
./Configure android-x86 --prefix="${PREFIX_DIR}" enable-ssl3 enable-ssl3-method enable-md2
./Configure android-x86 --prefix="${PREFIX_DIR}" no-shared no-tests enable-ssl3 enable-ssl3-method enable-md2 no-asm
elif [[ "${ARCH}" == "arm" ]]; then
./Configure android-arm --prefix="${PREFIX_DIR}" enable-ssl3 enable-ssl3-method enable-md2
./Configure android-arm --prefix="${PREFIX_DIR}" no-shared no-tests enable-ssl3 enable-ssl3-method enable-md2 no-asm
elif [[ "${ARCH}" == "arm64" ]]; then
./Configure android-arm64 --prefix="${PREFIX_DIR}" enable-ssl3 enable-ssl3-method enable-md2
./Configure android-arm64 --prefix="${PREFIX_DIR}" no-shared no-tests enable-ssl3 enable-ssl3-method enable-md2 no-asm
else
log_error "not support" && exit 1
@ -103,6 +103,9 @@ function configure_make() {
log_info "make $ABI start..."
sed -ie 's/LIB_CFLAGS=/LIB_CFLAGS=-fvisibility=hidden /g' ./Makefile
sed -ie 's/LIB_CXXFLAGS=/LIB_CXXFLAGS=-fvisibility=hidden /g' ./Makefile
make clean >"${OUTPUT_ROOT}/log/${ABI}.log"
if make -j$(get_cpu_count) >>"${OUTPUT_ROOT}/log/${ABI}.log" 2>&1; then
make install_sw >>"${OUTPUT_ROOT}/log/${ABI}.log" 2>&1

View File

@ -1,14 +1,48 @@
OPEN_SSL_PLATFORM=$$CORE_BUILDS_PLATFORM_PREFIX
build_xp:OPEN_SSL_PLATFORM=$$join(OPEN_SSL_PLATFORM, OPEN_SSL_PLATFORM, "", "_xp")
INCLUDEPATH += $$PWD/build/$$OPEN_SSL_PLATFORM/include
core_windows:LIBS += -L$$PWD/build/$$OPEN_SSL_PLATFORM/lib -llibcrypto -llibssl
!core_windows:LIBS += -L$$PWD/build/$$OPEN_SSL_PLATFORM/lib -lcrypto -lssl
open_ssl_common {
DEFINES += COMMON_OPENSSL_BUILDING
HEADERS += $$PWD/common/common_openssl.h
SOURCES += $$PWD/common/common_openssl.cpp
}
OPENSSL_LIBS_DIRECTORY = $$PWD/build/$$OPEN_SSL_PLATFORM/lib
core_android {
OPENSSL_ABI_PATH = $$replace(CORE_BUILDS_PLATFORM_PREFIX, "android_", "")
contains(OPENSSL_ABI_PATH, "armv7" ) {
OPENSSL_ABI_PATH = $$replace(OPENSSL_ABI_PATH, "armv7", "armeabi-v7a")
}
contains(OPENSSL_ABI_PATH, "arm64_v8a" ) {
OPENSSL_ABI_PATH = $$replace(OPENSSL_ABI_PATH, "arm64_v8a", "arm64-v8a")
}
OPENSSL_LIBS_DIRECTORY = $$PWD/build/android/$$OPENSSL_ABI_PATH/lib
}
core_ios {
OPENSSL_LIBS_DIRECTORY = $$PWD/ios/openssl-universal/lib
bundle_xcframeworks {
xcframework_platform_ios_simulator {
OPENSSL_LIBS_DIRECTORY = $$PWD/build/ios/openssl-xc/simulator/lib
} else {
OPENSSL_LIBS_DIRECTORY = $$PWD/build/ios/openssl-xc/lib
}
}
}
core_windows {
LIBS += $$OPENSSL_LIBS_DIRECTORY/libssl.lib
LIBS += $$OPENSSL_LIBS_DIRECTORY/libcrypto.lib
} else {
LIBS += $$OPENSSL_LIBS_DIRECTORY/libssl.a
LIBS += $$OPENSSL_LIBS_DIRECTORY/libcrypto.a
}
INCLUDEPATH += $$OPENSSL_LIBS_DIRECTORY/../include

View File

@ -48,7 +48,7 @@ restore_build_gn()
if [ ! -d "v8" ]
then
fetch v8
./depot_tools/fetch v8
cd v8
git checkout -b 6.0 branch-heads/6.0

View File

@ -10,6 +10,7 @@ for image in $(docker images --format "{{.ID}}"); do
done
docker rm v8docker
docker build . -t v8_docker --build-arg CACHEBUST=0 --no-cache=true
#add --progress=plain for full logs from build.sh
docker build . -t v8_docker --build-arg CACHEBUST=0 --no-cache=true --platform linux/amd64
docker run -d --name v8docker v8_docker:latest
docker cp v8docker:/home/docker/v8/build.zip .

View File

@ -24,6 +24,8 @@ core_linux {
SOURCES += $$PWD/src/FileTransporter_curl.cpp
}
core_mac {
use_v8:DEFINES += OLD_MACOS_SYSTEM
OBJECTIVE_SOURCES += $$PWD/src/FileTransporter_mac.mm
LIBS += -framework AppKit
}

View File

@ -49,323 +49,350 @@
namespace NSNetwork
{
namespace NSFileTransport
{
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 "";
namespace NSFileTransport
{
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);
}
return url.substr(pos);
}
int download_external(const std::wstring& sUrl, const std::wstring& sOutput, std::function<void(int)> func_onProgress = nullptr, std::function<bool(void)> func_checkAborted = nullptr)
{
pid_t pid;
int nReturnCode = -1;
std::string sUrlA = U_TO_UTF8(sUrl);
//sUrlA =("\"" + sUrlA + "\"");
std::string sOutputA = U_TO_UTF8(sOutput);
//sOutputA =("\"" + sOutputA + "\"");
int download_external(const std::wstring& sUrl, const std::wstring& sOutput, std::function<void(int)> func_onProgress = nullptr, std::function<bool(void)> func_checkAborted = nullptr)
{
pid_t pid;
int nReturnCode = -1;
std::string sUrlA = U_TO_UTF8(sUrl);
//sUrlA =("\"" + sUrlA + "\"");
std::string sOutputA = U_TO_UTF8(sOutput);
//sOutputA =("\"" + sOutputA + "\"");
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/curl"))
{
int pipefd[2];
if(func_onProgress)
pipe(pipefd);
std::wstring sCurlBin = L"";
if (NSFile::CFileBinary::Exists(L"/usr/bin/curl"))
sCurlBin = L"/usr/bin/curl";
if (NSFile::CFileBinary::Exists(L"/usr/local/bin/curl"))
sCurlBin = L"/usr/local/bin/curl";
pid = fork(); // create child process
int status;
if (0 != nReturnCode && !sCurlBin.empty())
{
int pipefd[2];
if(func_onProgress)
pipe(pipefd);
switch (pid)
{
case -1: // error
break;
pid = fork(); // create child process
int status;
case 0: // child process
{
const char* nargs[10];
nargs[0] = "/usr/bin/curl";
nargs[1] = "--url";
nargs[2] = sUrlA.c_str();
nargs[3] = "--output";
nargs[4] = sOutputA.c_str();
func_onProgress == NULL ? nargs[5] = "--silent" : nargs[5] = "--progress-bar";
nargs[6] = "-L";
nargs[7] = "--connect-timeout";
nargs[8] = "10";
nargs[9] = NULL;
switch (pid)
{
case -1: // error
break;
const char* nenv[3];
nenv[0] = "LD_PRELOAD=";
nenv[1] = "LD_LIBRARY_PATH=";
nenv[2] = NULL;
case 0: // child process
{
std::string sProgramBinA = U_TO_UTF8(sCurlBin);
if(func_onProgress)
{
close(pipefd[0]); // close reading end in the child
const char* nargs[10];
nargs[0] = sProgramBinA.c_str();
nargs[1] = "--url";
nargs[2] = sUrlA.c_str();
nargs[3] = "--output";
nargs[4] = sOutputA.c_str();
func_onProgress == NULL ? nargs[5] = "--silent" : nargs[5] = "--progress-bar";
nargs[6] = "-L";
nargs[7] = "--connect-timeout";
nargs[8] = "10";
nargs[9] = NULL;
dup2(pipefd[1], 1); // send stdout to the pipe
dup2(pipefd[1], 2); // send stderr to the pipe
const char* nenv[3];
nenv[0] = "LD_PRELOAD=";
nenv[1] = "LD_LIBRARY_PATH=";
nenv[2] = NULL;
close(pipefd[1]); // this descriptor is no longer needed
}
if(func_onProgress)
{
close(pipefd[0]); // close reading end in the child
execve("/usr/bin/curl", (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
if(func_onProgress)
{
close(pipefd[1]);
// close the write end of the pipe in the parent
size_t size = 81;
char buffer[size];
std::string str;
ssize_t res = 1;
std::regex r(R"(\d+(?:\.\d+)?%)");
std::smatch sm;
std::string percentFull;
std::string percent;
int percentInt;
dup2(pipefd[1], 1); // send stdout to the pipe
dup2(pipefd[1], 2); // send stderr to the pipe
while (1)
{
if(func_checkAborted && func_checkAborted())
{
kill(pid, SIGTERM);
//while (-1 == waitpid(pid, &status, 0)); // wait for child to complete
return nReturnCode;
}
close(pipefd[1]); // this descriptor is no longer needed
}
str.clear();
res = read(pipefd[0], buffer, sizeof(buffer));
execve(sProgramBinA.c_str(), (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
if(func_onProgress)
{
close(pipefd[1]);
// close the write end of the pipe in the parent
size_t size = 81;
char buffer[size];
std::string str;
ssize_t res = 1;
std::regex r(R"(\d+(?:\.\d+)?%)");
std::smatch sm;
std::string percentFull;
std::string percent;
int percentInt;
if(res == 0)
break;
while (1)
{
if(func_checkAborted && func_checkAborted())
{
kill(pid, SIGTERM);
//while (-1 == waitpid(pid, &status, 0)); // wait for child to complete
return nReturnCode;
}
str.append(buffer);
str.clear();
res = read(pipefd[0], buffer, sizeof(buffer));
if(regex_search(str, sm, r))
{
percentFull = sm.str();
percent = percentFull.substr(0, percentFull.find("."));
percentInt = std::stoi(percent);
if(res == 0)
break;
if(percentInt >= 0 && percentInt <= 100)
func_onProgress(percentInt);
}
str.append(buffer);
if(str.find("100.0%") != std::string::npos)
break;
if(regex_search(str, sm, r))
{
percentFull = sm.str();
percent = percentFull.substr(0, percentFull.find("."));
percentInt = std::stoi(percent);
}
}
else {
int waitres;
while (1) // wait for child to complete
{
if(func_checkAborted && func_checkAborted())
{
kill(pid, SIGTERM);
return nReturnCode;
}
else if((waitres = waitpid(pid, &status, WNOHANG)) > 0)
{
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
}
}
}
if(percentInt >= 0 && percentInt <= 100)
func_onProgress(percentInt);
}
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/wget"))
{
std::string sUrlValidateA = wget_url_validate(sUrlA);
if(str.find("100.0%") != std::string::npos)
break;
pid = fork(); // create child process
int status;
}
}
else {
int waitres;
while (1) // wait for child to complete
{
if(func_checkAborted && func_checkAborted())
{
kill(pid, SIGTERM);
return nReturnCode;
}
else if((waitres = waitpid(pid, &status, WNOHANG)) > 0)
{
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
}
}
}
switch (pid)
{
case -1: // error
break;
std::wstring sWgetBin = L"";
if (NSFile::CFileBinary::Exists(L"/usr/bin/wget"))
sWgetBin = L"/usr/bin/wget";
if (NSFile::CFileBinary::Exists(L"/usr/local/bin/wget"))
sWgetBin = L"/usr/local/bin/wget";
case 0: // child process
{
const char* nargs[8];
nargs[0] = "/usr/bin/wget";
nargs[1] = sUrlValidateA.c_str();
nargs[2] = "-O";
nargs[3] = sOutputA.c_str();
nargs[4] = "-q";
nargs[5] = "--connect-timeout=10";
nargs[6] = "--tries=2";
nargs[7] = NULL;
if (0 != nReturnCode && !sWgetBin.empty())
{
std::string sUrlValidateA = wget_url_validate(sUrlA);
const char* nenv[2];
nenv[0] = "LD_PRELOAD=";
nenv[1] = NULL;
pid = fork(); // create child process
int status;
execve("/usr/bin/wget", (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
int waitres;
while (1) // wait for child to complete
{
if(func_checkAborted && func_checkAborted())
{
kill(pid, SIGTERM);
return nReturnCode;
}
else if((waitres = waitpid(pid, &status, WNOHANG)) > 0)
{
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
}
}
switch (pid)
{
case -1: // error
break;
if (0 == nReturnCode)
{
if (!NSFile::CFileBinary::Exists(sOutput))
nReturnCode = -1;
}
case 0: // child process
{
std::string sProgramBinA = U_TO_UTF8(sWgetBin);
return nReturnCode;
}
#ifndef OLD_MACOS_SYSTEM
const char* nargs[8];
#else
const char* nargs[9];
#endif
int uploaddata_external(const std::wstring &sUploadUrl, const unsigned char* cData, const int nSize)
{
int nReturnCode = -1;
NSFile::CFileBinary oFileData;
std::wstring tempFileName = NSFile::CFileBinary::GetTempPath() + L"/tmpFileForUpload";
oFileData.CreateFileW(tempFileName);
oFileData.WriteFile(cData, nSize);
oFileData.CloseFile();
nargs[0] = sProgramBinA.c_str();
nargs[1] = sUrlValidateA.c_str();
nargs[2] = "-O";
nargs[3] = sOutputA.c_str();
nargs[4] = "-q";
nargs[5] = "--connect-timeout=10";
nargs[6] = "--tries=2";
std::string sUploadUrlA = U_TO_UTF8(sUploadUrl);
#ifndef OLD_MACOS_SYSTEM
nargs[7] = NULL;
#else
nargs[7] = "--no-check-certificate";
nargs[8] = NULL;
#endif
const char* nenv[2];
nenv[0] = "LD_PRELOAD=";
nenv[1] = NULL;
execve(sProgramBinA.c_str(), (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
int waitres;
while (1) // wait for child to complete
{
if(func_checkAborted && func_checkAborted())
{
kill(pid, SIGTERM);
return nReturnCode;
}
else if((waitres = waitpid(pid, &status, WNOHANG)) > 0)
{
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
}
}
if (0 == nReturnCode)
{
if (!NSFile::CFileBinary::Exists(sOutput))
nReturnCode = -1;
}
return nReturnCode;
}
int uploaddata_external(const std::wstring &sUploadUrl, const unsigned char* cData, const int nSize)
{
int nReturnCode = -1;
NSFile::CFileBinary oFileData;
std::wstring tempFileName = NSFile::CFileBinary::GetTempPath() + L"/tmpFileForUpload";
oFileData.CreateFileW(tempFileName);
oFileData.WriteFile(cData, nSize);
oFileData.CloseFile();
std::string sUploadUrlA = U_TO_UTF8(sUploadUrl);
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/curl"))
{
pid_t pid = fork(); // create child process
int status;
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/curl"))
{
pid_t pid = fork(); // create child process
int status;
switch (pid)
{
case -1: // error
break;
switch (pid)
{
case -1: // error
break;
case 0: // child process
{
//curl --request POST --data-binary "@template_entry.xml" $URL
auto pathTofile(std::string("@") + std::string(tempFileName.begin(), tempFileName.end()));
const char* nargs[9];
nargs[0] = "/usr/bin/curl";
nargs[1] = "--request";
nargs[2] = "POST";
nargs[3] = "--data-binary";
nargs[4] = pathTofile.c_str();
nargs[5] = sUploadUrlA.c_str();
nargs[6] = "--connect-timeout";
nargs[7] = "10";
nargs[8] = NULL;
case 0: // child process
{
//curl --request POST --data-binary "@template_entry.xml" $URL
auto pathTofile(std::string("@") + std::string(tempFileName.begin(), tempFileName.end()));
const char* nargs[9];
nargs[0] = "/usr/bin/curl";
nargs[1] = "--request";
nargs[2] = "POST";
nargs[3] = "--data-binary";
nargs[4] = pathTofile.c_str();
nargs[5] = sUploadUrlA.c_str();
nargs[6] = "--connect-timeout";
nargs[7] = "10";
nargs[8] = NULL;
const char* nenv[3];
nenv[0] = "LD_PRELOAD=";
nenv[1] = "LD_LIBRARY_PATH=";
nenv[2] = NULL;
const char* nenv[3];
nenv[0] = "LD_PRELOAD=";
nenv[1] = "LD_LIBRARY_PATH=";
nenv[2] = NULL;
execve("/usr/bin/curl", (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
while (-1 == waitpid(pid, &status, 0)); // wait for child to complete
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
NSFile::CFileBinary::Remove(tempFileName);
execve("/usr/bin/curl", (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
while (-1 == waitpid(pid, &status, 0)); // wait for child to complete
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
NSFile::CFileBinary::Remove(tempFileName);
return nReturnCode;
}
return nReturnCode;
}
int uploadfile_external(const std::wstring &sUploadUrl, const std::wstring &sUploadFilePath)
{
int nReturnCode = -1;
int uploadfile_external(const std::wstring &sUploadUrl, const std::wstring &sUploadFilePath)
{
int nReturnCode = -1;
std::string sUploadUrlA = U_TO_UTF8(sUploadUrl);
std::string sUploadFilePathA = U_TO_UTF8(sUploadFilePath);
std::string sUploadFileNameA = U_TO_UTF8(NSFile::GetFileName(sUploadFilePath));
std::string sUploadUrlA = U_TO_UTF8(sUploadUrl);
std::string sUploadFilePathA = U_TO_UTF8(sUploadFilePath);
std::string sUploadFileNameA = U_TO_UTF8(NSFile::GetFileName(sUploadFilePath));
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/curl"))
{
pid_t pid = fork(); // create child process
int status;
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/curl"))
{
pid_t pid = fork(); // create child process
int status;
switch (pid)
{
case -1: // error
break;
switch (pid)
{
case -1: // error
break;
case 0: // child process
{
//curl -v -F filename=image.jpg -F upload=@/home/vladimir/Pictures/Test.png $URL
auto filename(std::string("filename=") + sUploadFileNameA);
auto upload(std::string("upload=@") + sUploadFilePathA);
const char* nargs[10];
nargs[0] = "/usr/bin/curl";
nargs[1] = "-v";
nargs[2] = "-F";
nargs[3] = filename.c_str();
nargs[4] = "-F";
nargs[5] = upload.c_str();
nargs[6] = sUploadUrlA.c_str();
nargs[7] = "--connect-timeout";
nargs[8] = "10";
nargs[9] = NULL;
case 0: // child process
{
//curl -v -F filename=image.jpg -F upload=@/home/vladimir/Pictures/Test.png $URL
auto filename(std::string("filename=") + sUploadFileNameA);
auto upload(std::string("upload=@") + sUploadFilePathA);
const char* nargs[10];
nargs[0] = "/usr/bin/curl";
nargs[1] = "-v";
nargs[2] = "-F";
nargs[3] = filename.c_str();
nargs[4] = "-F";
nargs[5] = upload.c_str();
nargs[6] = sUploadUrlA.c_str();
nargs[7] = "--connect-timeout";
nargs[8] = "10";
nargs[9] = NULL;
const char* nenv[3];
nenv[0] = "LD_PRELOAD=";
nenv[1] = "LD_LIBRARY_PATH=";
nenv[2] = NULL;
const char* nenv[3];
nenv[0] = "LD_PRELOAD=";
nenv[1] = "LD_LIBRARY_PATH=";
nenv[2] = NULL;
execve("/usr/bin/curl", (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
while (-1 == waitpid(pid, &status, 0)); // wait for child to complete
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
execve("/usr/bin/curl", (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
while (-1 == waitpid(pid, &status, 0)); // wait for child to complete
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
return nReturnCode;
}
}
return nReturnCode;
}
}
}
#endif

View File

@ -11,7 +11,7 @@ libsocketio:CONFIG += use_openssl
ixwebsocket:CONFIG += use_openssl
use_openssl {
include($$PWD/../../3dParty/ixwebsocket/openssl.pri)
include($$PWD/../../3dParty/openssl/openssl.pri)
}
libsocketio {

View File

@ -388,28 +388,34 @@ core_static_link_libstd {
message(core_static_link_libstd)
}
plugin {
QMAKE_CXXFLAGS += -fvisibility=hidden
QMAKE_CFLAGS += -fvisibility=hidden
TARGET_EXT = .so
}
}
core_mac {
plugin {
QMAKE_CXXFLAGS += -fvisibility=hidden
QMAKE_CFLAGS += -fvisibility=hidden
}
}
core_windows {
plugin {
TARGET_EXT = .dll
}
}
core_disable_all_warnings {
CONFIG += warn_off
!core_windows {
plugin:CONFIG += config_hidden_symbols
staticlib:CONFIG += config_hidden_symbols
}
config_hidden_symbols {
QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
QMAKE_CFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
core_mac:CONFIG += clang_no_exclude_libs
core_ios:CONFIG += clang_no_exclude_libs
!clang_no_exclude_libs {
plugin:QMAKE_LFLAGS += -Wl,--exclude-libs,ALL
equals(TEMPLATE, app) {
QMAKE_LFLAGS += -Wl,--exclude-libs,ALL
}
}
}
# BUILD_PATHS
@ -546,3 +552,11 @@ defineTest(ADD_DEPENDENCY) {
ADD_INC_PATH = $$(ADDITIONAL_INCLUDE_PATH)
!isEmpty(ADD_INC_PATH):INCLUDEPATH += $$ADD_INC_PATH
!core_enable_all_warnings {
core_disable_all_warnings {
QMAKE_CXXFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_WARN_OFF = -w
CONFIG += warn_off
}
}

View File

@ -18,14 +18,7 @@ DEFINES += GRAPHICS_USE_DYNAMIC_LIBRARY
ADD_DEPENDENCY(graphics, kernel, UnicodeConverter)
core_windows {
DEFINES += \
JAS_WIN_MSVC_BUILD \
WIN32
DEFINES -= UNICODE
DEFINES -= _DEBUG
message(windows)
LIBS += -lAdvapi32
LIBS += -lShell32

View File

@ -1070,6 +1070,8 @@ namespace NSEditorApi
js_wrapper<int> m_nInsertPageNum;
js_wrapper<CAscShadow> m_oShadow;
js_wrapper<int> m_nVerticalTextAlign;
public:
CAscShapeProp()
@ -1094,6 +1096,8 @@ namespace NSEditorApi
LINK_PROPERTY_INT_JS(InsertPageNum)
LINK_PROPERTY_OBJECT_JS(CAscShadow, Shadow)
LINK_PROPERTY_INT_JS(VerticalTextAlign)
};

File diff suppressed because it is too large Load Diff

View File

@ -230,11 +230,11 @@ namespace NSStringExt
}
static inline void ToLower(std::string& wsString)
{
std::transform(wsString.begin(), wsString.end(), wsString.begin(), ::towlower);
std::transform(wsString.begin(), wsString.end(), wsString.begin(), ::tolower);
}
static inline void ToUpper(std::string& wsString)
{
std::transform(wsString.begin(), wsString.end(), wsString.begin(), ::towupper);
std::transform(wsString.begin(), wsString.end(), wsString.begin(), ::toupper);
}
static inline void ToLower(std::wstring& wsString)
{

View File

@ -155,7 +155,7 @@ _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
return (memcmp(p1, p2, (size_t) c));
}
#ifndef _IOS
#if !defined(_IOS) && !defined(DISABLE_IMAGE_EXCEPTIONS)
static void
Win32WarningHandler(const char* module, const char* fmt, va_list ap)
{

View File

@ -50,32 +50,32 @@ void parse_args(NSDoctRenderer::CDocBuilder* builder, int argc, wchar_t *argv[])
void parse_args(NSDoctRenderer::CDocBuilder* builder, int argc, char *argv[])
#endif
{
for (int i = 0; i < argc; ++i)
{
for (int i = 0; i < argc; ++i)
{
#ifdef WIN32
std::wstring sW(argv[i]);
std::string sParam = U_TO_UTF8(sW);
std::wstring sW(argv[i]);
std::string sParam = U_TO_UTF8(sW);
#else
std::string sParam(argv[i]);
std::string sParam(argv[i]);
#endif
if (sParam.find("--") == 0)
{
std::string::size_type _pos = sParam.find('=');
if (std::string::npos == _pos)
builder->SetProperty(sParam.c_str(), L"");
else
{
std::string sName = sParam.substr(0, _pos);
std::string sValue = sParam.substr(_pos + 1);
if (sParam.find("--") == 0)
{
std::string::size_type _pos = sParam.find('=');
if (std::string::npos == _pos)
builder->SetProperty(sParam.c_str(), L"");
else
{
std::string sName = sParam.substr(0, _pos);
std::string sValue = sParam.substr(_pos + 1);
std::wstring sValueW = UTF8_TO_U(sValue);
builder->SetProperty(sName.c_str(), sValueW.c_str());
}
}
else
continue;
}
std::wstring sValueW = UTF8_TO_U(sValue);
builder->SetProperty(sName.c_str(), sValueW.c_str());
}
}
else
continue;
}
}
#ifdef WIN32
@ -84,102 +84,84 @@ int wmain(int argc, wchar_t *argv[])
int main(int argc, char *argv[])
#endif
{
if (argc <= 0)
return 0;
if (argc <= 0)
return 0;
bool bIsHelp = false;
bool bIsFonts = false;
for (int i = 0; i < argc; ++i)
{
bool bIsHelp = false;
bool bIsFonts = false;
for (int i = 0; i < argc; ++i)
{
#ifdef WIN32
std::wstring sW(argv[i]);
std::string sParam(sW.begin(), sW.end());
std::wstring sW(argv[i]);
std::string sParam(sW.begin(), sW.end());
#else
std::string sParam(argv[i]);
std::string sParam(argv[i]);
#endif
if (sParam == "-v" || sParam == "-version")
{
std::cout << "v" VALUE(INTVER) << std::endl;
NSDoctRenderer::CDocBuilder oBuilder;
oBuilder.ExecuteCommand(L"checkL");
if (sParam == "-v" || sParam == "-version")
{
std::cout << "v" VALUE(INTVER) << std::endl;
NSDoctRenderer::CDocBuilder oBuilder;
oBuilder.ExecuteCommand(L"checkL");
char* sSdkVer = oBuilder.GetVersion();
if (NULL != sSdkVer)
{
std::string sSdkVerStd(sSdkVer);
std::cout << "sdk version: " << sSdkVerStd << std::endl;
delete [] sSdkVer;
}
char* sSdkVer = oBuilder.GetVersion();
if (NULL != sSdkVer)
{
std::string sSdkVerStd(sSdkVer);
std::cout << "sdk version: " << sSdkVerStd << std::endl;
delete [] sSdkVer;
}
return 0;
}
if (sParam == "-h" || sParam == "-help")
{
bIsHelp = true;
}
else if (sParam == "-f" || sParam == "-fonts")
{
bIsFonts = true;
}
}
return 0;
}
if (sParam == "-h" || sParam == "-help")
{
bIsHelp = true;
}
else if (sParam == "-f" || sParam == "-fonts")
{
bIsFonts = true;
}
}
if (bIsFonts)
{
NSDoctRenderer::CDocBuilder oBuilder;
parse_args(&oBuilder, argc, argv);
if (bIsFonts)
{
NSDoctRenderer::CDocBuilder oBuilder;
parse_args(&oBuilder, argc, argv);
oBuilder.ExecuteCommand(L"checkL");
return 0;
}
oBuilder.ExecuteCommand(L"checkL");
return 0;
}
if (argc < 2 || bIsHelp)
{
std::cout << "USAGE: documentbuilder \"path_to_script_file\"" << std::endl;
NSDoctRenderer::CDocBuilder oBuilder;
oBuilder.ExecuteCommand(L"checkL");
return 0;
}
if (argc < 2 || bIsHelp)
{
std::cout << "USAGE: documentbuilder \"path_to_script_file\"" << std::endl;
NSDoctRenderer::CDocBuilder oBuilder;
oBuilder.ExecuteCommand(L"checkL");
return 0;
}
#ifdef WIN32
std::wstring sBuildFile(argv[argc - 1]);
std::wstring sBuildFile(argv[argc - 1]);
#else
std::string sBuildFileA(argv[argc - 1]);
std::wstring sBuildFile = UTF8_TO_U(sBuildFileA);
std::string sBuildFileA(argv[argc - 1]);
std::wstring sBuildFile = UTF8_TO_U(sBuildFileA);
#endif
if (true)
{
NSDoctRenderer::CDocBuilder::Initialize(L"/home/mihail/main/build_tools/out/linux_64/onlyoffice/documentbuilder");
NSDoctRenderer::CDocBuilder oBuilder;
if (true)
{
NSDoctRenderer::CDocBuilder oBuilder;
// если отключена эта опция - то она отключится на parse_args
// если отключена эта опция - то она отключится на parse_args
oBuilder.SetProperty("--check-fonts", L"");
oBuilder.SetProperty("--cache-scripts", L"false");
oBuilder.SetTmpFolder(L"tmp");
//oBuilder.SetProperty("--use-doctrenderer-scheme", L"");
//oBuilder.SetProperty("--work-directory", L"builder");
parse_args(&oBuilder, argc - 1, argv);
parse_args(&oBuilder, argc - 1, argv);
// oBuilder.WriteData(L"result.log", L"Alert!", false);
// формируем документ SampleTetxt2.docx - с одним вырезанным из SampleDocument.docx абзаца
oBuilder.Run(sBuildFile.c_str());
// включаем вторую схему сохранения
oBuilder.SetProperty("--use-doctrenderer-scheme", L"");
// перекрашиваем абзац в красный цвет
oBuilder.Run(L"/home/mihail/script2.docbuilder");
// oBuilder.OpenFile(L"SampleText2.docx", L"");
// oBuilder.ExecuteCommand(L"var oParagraph = Api.GetDocument().GetElement(1);\n"
// L"oParagraph.SetColor(255, 0, 0);\n"
// L"\n");
// // сохраняем
// oBuilder.SaveFile(OFFICESTUDIO_FILE_DOCUMENT_DOCX, L"SampleText2.docx");
// oBuilder.CloseFile();
}
}
NSDoctRenderer::CDocBuilder::Dispose();
return 0;
NSDoctRenderer::CDocBuilder::Dispose();
return 0;
}

View File

@ -33,6 +33,15 @@
#ifndef _BUILDER_COMMON_H
#define _BUILDER_COMMON_H
#include "./../common/base_export.h"
#ifdef DOCTRENDERER_NO_USE_DYNAMIC_LIBRARY
#define BUILDER_DECL
#else
#include "../common/base_export.h"
#ifdef DOCTRENDERER_USE_DYNAMIC_LIBRARY_BUILDING
#define BUILDER_DECL Q_DECL_EXPORT
#else
#define BUILDER_DECL Q_DECL_IMPORT
#endif
#endif
#endif // _BUILDER_COMMON_H
#endif // _BUILDER_COMMON_H

View File

@ -41,7 +41,7 @@ namespace NSDoctRenderer
* The string class with the wchar_t* property.
*/
class CString_Private;
class Q_DECL_EXPORT CString
class BUILDER_DECL CString
{
public:
CString();
@ -61,7 +61,7 @@ namespace NSDoctRenderer
* It represents a wrapper for a JS object.
*/
class CDocBuilderValue_Private;
class Q_DECL_EXPORT CDocBuilderValue
class BUILDER_DECL CDocBuilderValue
{
public:
CDocBuilderValue();
@ -238,7 +238,7 @@ namespace NSDoctRenderer
* All opened scopes will be closed automatically when the builder CloseFile method is called.
*/
class CDocBuilderContextScope_Private;
class Q_DECL_EXPORT CDocBuilderContextScope
class BUILDER_DECL CDocBuilderContextScope
{
public:
CDocBuilderContextScope();
@ -261,7 +261,7 @@ namespace NSDoctRenderer
* Class for getting JS context for working.
*/
class CDocBuilderContext_Private;
class Q_DECL_EXPORT CDocBuilderContext
class BUILDER_DECL CDocBuilderContext
{
public:
CDocBuilderContext();
@ -333,7 +333,7 @@ namespace NSDoctRenderer
* Base class used by ONLYOFFICE Document Builder for the document file (text document, spreadsheet, presentation, form document, PDF) to be generated.
*/
class CDocBuilder_Private;
class Q_DECL_EXPORT CDocBuilder
class BUILDER_DECL CDocBuilder
{
public:
CDocBuilder();

View File

@ -254,8 +254,10 @@ bool CV8RealTimeWorker::SaveFileWithChanges(int type, const std::wstring& _path,
_formatDst = NSDoctRenderer::DoctRendererFormat::PPTT;
else if (type & AVS_OFFICESTUDIO_FILE_SPREADSHEET)
_formatDst = NSDoctRenderer::DoctRendererFormat::XLST;
else if ((type & AVS_OFFICESTUDIO_FILE_CROSSPLATFORM) || (type & AVS_OFFICESTUDIO_FILE_IMAGE))
else if (type & AVS_OFFICESTUDIO_FILE_CROSSPLATFORM)
_formatDst = NSDoctRenderer::DoctRendererFormat::PDF;
else if (type & AVS_OFFICESTUDIO_FILE_IMAGE)
_formatDst = NSDoctRenderer::DoctRendererFormat::IMAGE;
CJSContextScope scope(m_context);
JSSmart<CJSTryCatch> try_catch = m_context->GetExceptions();
@ -280,7 +282,12 @@ bool CV8RealTimeWorker::SaveFileWithChanges(int type, const std::wstring& _path,
if (pNative == NULL)
return false;
if (_formatDst == NSDoctRenderer::DoctRendererFormat::PDF)
bool bIsSilentMode = false;
if (_formatDst == NSDoctRenderer::DoctRendererFormat::PDF ||
_formatDst == NSDoctRenderer::DoctRendererFormat::IMAGE)
bIsSilentMode = true;
if (bIsSilentMode)
this->ExecuteCommand(L"Api.asc_SetSilentMode(false);");
std::wstring strError;
@ -292,7 +299,7 @@ bool CV8RealTimeWorker::SaveFileWithChanges(int type, const std::wstring& _path,
strError,
sJsonParams);
if (_formatDst == NSDoctRenderer::DoctRendererFormat::PDF)
if (bIsSilentMode)
this->ExecuteCommand(L"Api.asc_SetSilentMode(true);");
return bIsError;

View File

@ -391,6 +391,7 @@ namespace NSDoctRenderer
}
case DoctRendererFormat::PDF:
case DoctRendererFormat::PPTX_THEME_THUMBNAIL:
case DoctRendererFormat::IMAGE:
{
// CALCULATE
if (pParams->m_sJsonParams.empty())
@ -423,14 +424,28 @@ namespace NSDoctRenderer
}
// RENDER
if (!bIsBreak && DoctRendererFormat::PDF == pParams->m_eDstFormat)
if (!bIsBreak &&
(DoctRendererFormat::PDF == pParams->m_eDstFormat || DoctRendererFormat::IMAGE == pParams->m_eDstFormat))
{
if (pParams->m_sJsonParams.empty())
args[0] = CJSContext::createNull();
{
if (DoctRendererFormat::IMAGE == pParams->m_eDstFormat)
{
args[0] = context->JSON_Parse("{ \"saveFormat\" : \"image\" }");
}
else
args[0] = CJSContext::createNull();
}
else
{
std::string sTmp = U_TO_UTF8((pParams->m_sJsonParams));
args[0] = context->JSON_Parse(sTmp.c_str());
if (DoctRendererFormat::IMAGE == pParams->m_eDstFormat)
{
JSSmart<CJSObject> argObj = args[0]->toObject();
argObj->set("saveFormat", CJSContext::createString("image"));
}
}
JSSmart<CJSValue> js_result2 = js_objectApi->call_func("asc_nativeGetPDF", 1, args);
@ -886,6 +901,7 @@ namespace NSDoctRenderer
{
case DoctRendererFormat::DOCT:
case DoctRendererFormat::PDF:
case DoctRendererFormat::IMAGE:
case DoctRendererFormat::HTML:
{
arSdkFiles = &m_pInternal->m_arDoctSDK;
@ -903,6 +919,7 @@ namespace NSDoctRenderer
{
case DoctRendererFormat::PPTT:
case DoctRendererFormat::PDF:
case DoctRendererFormat::IMAGE:
case DoctRendererFormat::PPTX_THEME_THUMBNAIL:
{
arSdkFiles = &m_pInternal->m_arPpttSDK;
@ -920,6 +937,7 @@ namespace NSDoctRenderer
{
case DoctRendererFormat::XLST:
case DoctRendererFormat::PDF:
case DoctRendererFormat::IMAGE:
{
arSdkFiles = &m_pInternal->m_arXlstSDK;
m_pInternal->m_strEditorType = L"spreadsheet";

View File

@ -34,7 +34,7 @@
#include <string>
#include <vector>
#include "../common/base_export.h"
#include "./common.h"
namespace NSDoctRenderer
{
@ -48,6 +48,7 @@ namespace NSDoctRenderer
PDF = 3,
HTML = 4,
PPTX_THEME_THUMBNAIL = 5,
IMAGE = 6,
INVALID = 255
};
@ -57,7 +58,7 @@ namespace NSDoctRenderer
namespace NSDoctRenderer
{
class CDoctRenderer_Private;
class Q_DECL_EXPORT CDoctrenderer
class BUILDER_DECL CDoctrenderer
{
public:
CDoctrenderer(const std::wstring& sAllFontsPath = L"");

View File

@ -29,7 +29,7 @@ SOURCES += \
docbuilder.cpp \
docbuilder_p.cpp \
graphics.cpp \
hash.cpp
hash.cpp
SOURCES += \
../../Common/OfficeFileFormatChecker2.cpp \

View File

@ -5,7 +5,7 @@
namespace NSJSBase
{
void Q_DECL_EXPORT CreateDefaults(JSSmart<CJSContext>& context);
void JS_DECL CreateDefaults(JSSmart<CJSContext>& context);
}
#endif // _BUILD_NATIVE_DEFAULT_EMBED_H_

View File

@ -13,6 +13,7 @@
#include <cstring>
#include <memory>
#include <stdlib.h>
int CHash::getDigestLength(HashAlgs alg)
{

View File

@ -2,8 +2,15 @@
#define NSHASH_H
#include <functional>
#include "./common.h"
class CHash
// hide algs into lib
namespace NSHash
{
void BUILDER_DECL hash_internal(const unsigned char* src, unsigned char* dst, size_t size, int alg);
}
class BUILDER_DECL CHash
{
public:
enum HashAlgs

View File

@ -7,13 +7,13 @@
#include "../../graphics/BaseThread.h"
// disable export (ios/android problem (external embed objects))
#define DOCTRENDERER_NO_USE_DYNAMIC_LIBRARY
#define JSBASE_NO_USE_DYNAMIC_LIBRARY
#ifdef DOCTRENDERER_NO_USE_DYNAMIC_LIBRARY
#ifdef JSBASE_NO_USE_DYNAMIC_LIBRARY
#define JS_DECL
#else
#include "../../common/base_export.h"
#ifdef DOCTRENDERER_USE_DYNAMIC_LIBRARY_BUILDING
#ifdef JSBASE_USE_DYNAMIC_LIBRARY_BUILDING
#define JS_DECL Q_DECL_EXPORT
#else
#define JS_DECL Q_DECL_IMPORT

View File

@ -642,6 +642,17 @@ namespace NSJSBase
}
};
#ifdef V8_VERSION_89_PLUS
#define V8_ARRAY_BUFFER_USE_BACKING_STORE
#endif
#ifdef V8_ARRAY_BUFFER_USE_BACKING_STORE
static void V8AllocatorDeleter(void* data, size_t length, void*)
{
NSAllocator::Free((unsigned char*)data, length);
}
#endif
class CJSTypedArrayV8 : public CJSValueV8Template<v8::Uint8Array, CJSTypedArray>
{
public:
@ -649,9 +660,18 @@ namespace NSJSBase
{
if (0 < count)
{
#ifdef V8_ARRAY_BUFFER_USE_BACKING_STORE
std::shared_ptr<v8::BackingStore> backing_store =
v8::ArrayBuffer::NewBackingStore((void*)data, (size_t)count,
isExternalize ? v8::BackingStore::EmptyDeleter : V8AllocatorDeleter,
nullptr);
v8::Local<v8::ArrayBuffer> oArrayBuffer = v8::ArrayBuffer::New(CV8Worker::GetCurrent(), backing_store);
value = v8::Uint8Array::New(oArrayBuffer, 0, (size_t)count);
#else
v8::Local<v8::ArrayBuffer> _buffer = v8::ArrayBuffer::New(CV8Worker::GetCurrent(), (void*)data, (size_t)count,
isExternalize ? v8::ArrayBufferCreationMode::kExternalized : v8::ArrayBufferCreationMode::kInternalized);
value = v8::Uint8Array::New(_buffer, 0, (size_t)count);
#endif
}
}
virtual ~CJSTypedArrayV8()
@ -666,10 +686,16 @@ namespace NSJSBase
virtual CJSDataBuffer getData()
{
v8::ArrayBuffer::Contents contents = value->Buffer()->GetContents();
CJSDataBuffer buffer;
#ifdef V8_ARRAY_BUFFER_USE_BACKING_STORE
std::shared_ptr<v8::BackingStore> contents = value->Buffer()->GetBackingStore();
buffer.Data = (BYTE*)contents->Data();
buffer.Len = contents->ByteLength();
#else
v8::ArrayBuffer::Contents contents = value->Buffer()->GetContents();
buffer.Data = (BYTE*)contents.Data();
buffer.Len = contents.ByteLength();
#endif
buffer.IsExternalize = false;
return buffer;
}

View File

@ -50,7 +50,8 @@ namespace NSFontDictionary
for (int i = 0; i < nNameLen; ++i)
{
if (pName[i] > 255 || pName[i] < 0)
// not 255
if (pName[i] > 128 || pName[i] < 0)
{
bIsAscii = false;
break;
@ -75,19 +76,19 @@ namespace NSFontDictionary
bool bIsEqual = true;
for (int j = 1; j < nNameLen; ++j)
{
if ('\0' == _name[j]) // короче чем нужно
{
bIsEqual = false;
break;
}
if (pName[j] != (wchar_t)_name[j])
if ('\0' == _name[j]) // короче чем нужно
{
bIsEqual = false;
break;
}
if (pName[j] != (wchar_t)_name[j])
{
bIsEqual = false;
break;
}
}
if (bIsEqual && _name[nNameLen] == '\0') // чтобы не длиннее, чем нужно
if (bIsEqual && _name[nNameLen] == '\0') // чтобы не длиннее, чем нужно
{
nIndex = i;
break;
@ -108,54 +109,54 @@ namespace NSFontDictionary
switch (nStyle)
{
case 1:
{
if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else
nFontIndex = pRec->m_index_b;
break;
}
{
if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else
nFontIndex = pRec->m_index_b;
break;
}
case 2:
{
if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else
nFontIndex = pRec->m_index_i;
break;
}
{
if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else
nFontIndex = pRec->m_index_i;
break;
}
case 3:
{
if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else
nFontIndex = pRec->m_index_r;
break;
}
{
if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else
nFontIndex = pRec->m_index_r;
break;
}
case 0:
default:
{
if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else
nFontIndex = pRec->m_index_bi;
break;
}
{
if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else
nFontIndex = pRec->m_index_bi;
break;
}
}
if (nFontIndex != -1)
@ -175,7 +176,7 @@ namespace NSFontDictionary
bool bIsEqual = true;
for (int j = 1; j < nNameLen; ++j)
{
if ('\0' == _name[j]) // короче чем нужно
if ('\0' == _name[j]) // короче чем нужно
{
bIsEqual = false;
break;
@ -187,7 +188,7 @@ namespace NSFontDictionary
}
}
if (bIsEqual && _name[nNameLen] == '\0') // чтобы не длиннее, чем нужно
if (bIsEqual && _name[nNameLen] == '\0') // чтобы не длиннее, чем нужно
{
nIndex = i;
break;
@ -208,54 +209,54 @@ namespace NSFontDictionary
switch (nStyle)
{
case 1:
{
if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else
nFontIndex = pRec->m_index_b;
break;
}
{
if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else
nFontIndex = pRec->m_index_b;
break;
}
case 2:
{
if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else
nFontIndex = pRec->m_index_i;
break;
}
{
if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else
nFontIndex = pRec->m_index_i;
break;
}
case 3:
{
if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else
nFontIndex = pRec->m_index_r;
break;
}
{
if (pRec->m_index_bi != -1)
nFontIndex = pRec->m_index_bi;
else if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else
nFontIndex = pRec->m_index_r;
break;
}
case 0:
default:
{
if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else
nFontIndex = pRec->m_index_bi;
break;
}
{
if (pRec->m_index_r != -1)
nFontIndex = pRec->m_index_r;
else if (pRec->m_index_i != -1)
nFontIndex = pRec->m_index_i;
else if (pRec->m_index_b != -1)
nFontIndex = pRec->m_index_b;
else
nFontIndex = pRec->m_index_bi;
break;
}
}
if (nFontIndex != -1)

View File

@ -37,6 +37,8 @@ var AscFonts = window['AscFonts'];
if (window["NATIVE_EDITOR_ENJINE"])
window.setImmediate = function(fn) { fn(); };
var setImmediate = window.setImmediate;
//desktop_fetch
//polyfill

View File

@ -495,9 +495,11 @@ static const int FD_Ascii_Names_Offsets[256] =
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
#define FONTS_DICT_UNICODE_NAMES_COUNT 91
static const FD_FontMapRecW FD_Unicode_Names[FONTS_DICT_UNICODE_NAMES_COUNT] =
#define FONTS_DICT_UNICODE_NAMES_COUNT 93
static const FD_FontMapRecW FD_Unicode_Names[FONTS_DICT_UNICODE_NAMES_COUNT] =
{
{ L"@ËÎÌå", 579, -1, -1, -1 },
{ L"ËÎÌå", 579, -1, -1, -1 },
{ L"HGP創英角ゴシックUB", 336, -1, -1, -1 },
{ L"HGP創英角ポップ体", 330, -1, -1, -1 },
{ L"HGP創英プレゼンスEB", 333, -1, -1, -1 },
@ -588,7 +590,7 @@ static const FD_FontMapRecW FD_Unicode_Names[FONTS_DICT_UNICODE_NAMES_COUNT] =
{ L" ゴシック", 452, -1, -1, -1 },
{ L" 明朝", 459, -1, -1, -1 },
{ L" Pゴシック", 454, -1, -1, -1 },
{ L" P明朝", 460, -1, -1, -1 },
{ L" P明朝", 460, -1, -1, -1 }
};
typedef struct FD_Font_Rec
@ -1320,4 +1322,4 @@ static const FD_Font FD_Ascii_Files[FONTS_DICT_ASCII_FONTS_COUNT] =
// error : 0
#endif /* _FONT_DICTIONARY_H */
#endif /* _FONT_DICTIONARY_H */

View File

@ -125,222 +125,227 @@ const long c_nHtmlRendrerer3 = 0x0011;
const long c_nHtmlRendrererText = 0x0012;
const long c_nQRenderer = 0x0013;
const int c_nAdditionalParamBreak = 0x00;
// типы команд
const long c_nCommandLongTypeOnlyText = 0x1000;
class IFormField
{
public:
IFormField() {}
virtual ~IFormField() {}
IFormField() {}
virtual ~IFormField() {}
};
// IRenderer
class IRenderer : public IGrObject
{
public:
bool m_bUseTransformCoordsToIdentity;
bool m_bUseTransformCoordsToIdentity;
public:
IRenderer()
{
m_bUseTransformCoordsToIdentity = false;
}
IRenderer()
{
m_bUseTransformCoordsToIdentity = false;
}
public:
// тип рендерера-----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType) = 0;
//-------- Функции для работы со страницей --------------------------------------------------
virtual HRESULT NewPage() = 0;
virtual HRESULT get_Height(double* dHeight) = 0;
virtual HRESULT put_Height(const double& dHeight) = 0;
virtual HRESULT get_Width(double* dWidth) = 0;
virtual HRESULT put_Width(const double& dWidth) = 0;
virtual HRESULT get_DpiX(double* dDpiX) = 0;
virtual HRESULT get_DpiY(double* dDpiY) = 0;
// тип рендерера-----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType) = 0;
//-------- Функции для работы со страницей --------------------------------------------------
virtual HRESULT NewPage() = 0;
virtual HRESULT get_Height(double* dHeight) = 0;
virtual HRESULT put_Height(const double& dHeight) = 0;
virtual HRESULT get_Width(double* dWidth) = 0;
virtual HRESULT put_Width(const double& dWidth) = 0;
virtual HRESULT get_DpiX(double* dDpiX) = 0;
virtual HRESULT get_DpiY(double* dDpiY) = 0;
// pen --------------------------------------------------------------------------------------
virtual HRESULT get_PenColor(LONG* lColor) = 0;
virtual HRESULT put_PenColor(const LONG& lColor) = 0;
virtual HRESULT get_PenAlpha(LONG* lAlpha) = 0;
virtual HRESULT put_PenAlpha(const LONG& lAlpha) = 0;
virtual HRESULT get_PenSize(double* dSize) = 0;
virtual HRESULT put_PenSize(const double& dSize) = 0;
virtual HRESULT get_PenDashStyle(BYTE* val) = 0;
virtual HRESULT put_PenDashStyle(const BYTE& val) = 0;
virtual HRESULT get_PenLineStartCap(BYTE* val) = 0;
virtual HRESULT put_PenLineStartCap(const BYTE& val) = 0;
virtual HRESULT get_PenLineEndCap(BYTE* val) = 0;
virtual HRESULT put_PenLineEndCap(const BYTE& val) = 0;
virtual HRESULT get_PenLineJoin(BYTE* val) = 0;
virtual HRESULT put_PenLineJoin(const BYTE& val) = 0;
virtual HRESULT get_PenDashOffset(double* dOffset) = 0;
virtual HRESULT put_PenDashOffset(const double& dOffset) = 0;
virtual HRESULT get_PenAlign(LONG* lAlign) = 0;
virtual HRESULT put_PenAlign(const LONG& lAlign) = 0;
virtual HRESULT get_PenMiterLimit(double* dOffset) = 0;
virtual HRESULT put_PenMiterLimit(const double& dOffset) = 0;
virtual HRESULT PenDashPattern(double* pPattern, LONG lCount)= 0;
// pen --------------------------------------------------------------------------------------
virtual HRESULT get_PenColor(LONG* lColor) = 0;
virtual HRESULT put_PenColor(const LONG& lColor) = 0;
virtual HRESULT get_PenAlpha(LONG* lAlpha) = 0;
virtual HRESULT put_PenAlpha(const LONG& lAlpha) = 0;
virtual HRESULT get_PenSize(double* dSize) = 0;
virtual HRESULT put_PenSize(const double& dSize) = 0;
virtual HRESULT get_PenDashStyle(BYTE* val) = 0;
virtual HRESULT put_PenDashStyle(const BYTE& val) = 0;
virtual HRESULT get_PenLineStartCap(BYTE* val) = 0;
virtual HRESULT put_PenLineStartCap(const BYTE& val) = 0;
virtual HRESULT get_PenLineEndCap(BYTE* val) = 0;
virtual HRESULT put_PenLineEndCap(const BYTE& val) = 0;
virtual HRESULT get_PenLineJoin(BYTE* val) = 0;
virtual HRESULT put_PenLineJoin(const BYTE& val) = 0;
virtual HRESULT get_PenDashOffset(double* dOffset) = 0;
virtual HRESULT put_PenDashOffset(const double& dOffset) = 0;
virtual HRESULT get_PenAlign(LONG* lAlign) = 0;
virtual HRESULT put_PenAlign(const LONG& lAlign) = 0;
virtual HRESULT get_PenMiterLimit(double* dOffset) = 0;
virtual HRESULT put_PenMiterLimit(const double& dOffset) = 0;
virtual HRESULT PenDashPattern(double* pPattern, LONG lCount) = 0;
// brush ------------------------------------------------------------------------------------
virtual HRESULT get_BrushType(LONG* lType) = 0;
virtual HRESULT put_BrushType(const LONG& lType) = 0;
virtual HRESULT get_BrushColor1(LONG* lColor) = 0;
virtual HRESULT put_BrushColor1(const LONG& lColor) = 0;
virtual HRESULT get_BrushAlpha1(LONG* lAlpha) = 0;
virtual HRESULT put_BrushAlpha1(const LONG& lAlpha) = 0;
virtual HRESULT get_BrushColor2(LONG* lColor) = 0;
virtual HRESULT put_BrushColor2(const LONG& lColor) = 0;
virtual HRESULT get_BrushAlpha2(LONG* lAlpha) = 0;
virtual HRESULT put_BrushAlpha2(const LONG& lAlpha) = 0;
virtual HRESULT get_BrushTexturePath(std::wstring* bsPath) = 0;
virtual HRESULT put_BrushTexturePath(const std::wstring& bsPath) = 0;
virtual HRESULT get_BrushTextureMode(LONG* lMode) = 0;
virtual HRESULT put_BrushTextureMode(const LONG& lMode) = 0;
virtual HRESULT get_BrushTextureAlpha(LONG* lTxAlpha) = 0;
virtual HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha) = 0;
virtual HRESULT get_BrushLinearAngle(double* dAngle) = 0;
virtual HRESULT put_BrushLinearAngle(const double& dAngle) = 0;
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height) = 0;
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height) = 0;
// brush ------------------------------------------------------------------------------------
virtual HRESULT get_BrushType(LONG* lType) = 0;
virtual HRESULT put_BrushType(const LONG& lType) = 0;
virtual HRESULT get_BrushColor1(LONG* lColor) = 0;
virtual HRESULT put_BrushColor1(const LONG& lColor) = 0;
virtual HRESULT get_BrushAlpha1(LONG* lAlpha) = 0;
virtual HRESULT put_BrushAlpha1(const LONG& lAlpha) = 0;
virtual HRESULT get_BrushColor2(LONG* lColor) = 0;
virtual HRESULT put_BrushColor2(const LONG& lColor) = 0;
virtual HRESULT get_BrushAlpha2(LONG* lAlpha) = 0;
virtual HRESULT put_BrushAlpha2(const LONG& lAlpha) = 0;
virtual HRESULT get_BrushTexturePath(std::wstring* bsPath) = 0;
virtual HRESULT put_BrushTexturePath(const std::wstring& bsPath) = 0;
virtual HRESULT get_BrushTextureMode(LONG* lMode) = 0;
virtual HRESULT put_BrushTextureMode(const LONG& lMode) = 0;
virtual HRESULT get_BrushTextureAlpha(LONG* lTxAlpha) = 0;
virtual HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha) = 0;
virtual HRESULT get_BrushLinearAngle(double* dAngle) = 0;
virtual HRESULT put_BrushLinearAngle(const double& dAngle) = 0;
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height) = 0;
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height) = 0;
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount) = 0;
//virtual void put_BrushGradInfo(const NSStructures::GradientInfo &_ginfo) {};
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount) = 0;
//virtual void put_BrushGradInfo(const NSStructures::GradientInfo &_ginfo) {};
// font -------------------------------------------------------------------------------------
virtual HRESULT get_FontName(std::wstring* bsName) = 0;
virtual HRESULT put_FontName(const std::wstring& bsName) = 0;
virtual HRESULT get_FontPath(std::wstring* bsName) = 0;
virtual HRESULT put_FontPath(const std::wstring& bsName) = 0;
virtual HRESULT get_FontSize(double* dSize) = 0;
virtual HRESULT put_FontSize(const double& dSize) = 0;
virtual HRESULT get_FontStyle(LONG* lStyle) = 0;
virtual HRESULT put_FontStyle(const LONG& lStyle) = 0;
virtual HRESULT get_FontStringGID(INT* bGID) = 0;
virtual HRESULT put_FontStringGID(const INT& bGID) = 0;
virtual HRESULT get_FontCharSpace(double* dSpace) = 0;
virtual HRESULT put_FontCharSpace(const double& dSpace) = 0;
virtual HRESULT get_FontFaceIndex(int* lFaceIndex) = 0;
virtual HRESULT put_FontFaceIndex(const int& lFaceIndex) = 0;
// font -------------------------------------------------------------------------------------
virtual HRESULT get_FontName(std::wstring* bsName) = 0;
virtual HRESULT put_FontName(const std::wstring& bsName) = 0;
virtual HRESULT get_FontPath(std::wstring* bsName) = 0;
virtual HRESULT put_FontPath(const std::wstring& bsName) = 0;
virtual HRESULT get_FontSize(double* dSize) = 0;
virtual HRESULT put_FontSize(const double& dSize) = 0;
virtual HRESULT get_FontStyle(LONG* lStyle) = 0;
virtual HRESULT put_FontStyle(const LONG& lStyle) = 0;
virtual HRESULT get_FontStringGID(INT* bGID) = 0;
virtual HRESULT put_FontStringGID(const INT& bGID) = 0;
virtual HRESULT get_FontCharSpace(double* dSpace) = 0;
virtual HRESULT put_FontCharSpace(const double& dSpace) = 0;
virtual HRESULT get_FontFaceIndex(int* lFaceIndex) = 0;
virtual HRESULT put_FontFaceIndex(const int& lFaceIndex) = 0;
//-------- Функции для вывода текста --------------------------------------------------------
virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h) = 0;
//-------- Функции для вывода текста --------------------------------------------------------
virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT CommandDrawTextCHAR2(unsigned int* codepoints, const unsigned int& codepointscount, const unsigned int& gid, const double& x, const double& y, const double& w, const double& h)
{
LONG c = (NULL == codepoints) ? 32 : codepoints[0];
return CommandDrawTextExCHAR(c, (LONG)gid, x, y, w, h);
}
virtual HRESULT CommandDrawTextCHAR2(unsigned int* codepoints, const unsigned int& codepointscount, const unsigned int& gid, const double& x, const double& y, const double& w, const double& h)
{
LONG c = (NULL == codepoints) ? 32 : codepoints[0];
return CommandDrawTextExCHAR(c, (LONG)gid, x, y, w, h);
}
//-------- Маркеры для команд ---------------------------------------------------------------
virtual HRESULT BeginCommand(const DWORD& lType) = 0;
virtual HRESULT EndCommand(const DWORD& lType) = 0;
//-------- Маркеры для команд ---------------------------------------------------------------
virtual HRESULT BeginCommand(const DWORD& lType) = 0;
virtual HRESULT EndCommand(const DWORD& lType) = 0;
//-------- Функции для работы с Graphics Path -----------------------------------------------
virtual HRESULT PathCommandMoveTo(const double& x, const double& y) = 0;
virtual HRESULT PathCommandLineTo(const double& x, const double& y) = 0;
virtual HRESULT PathCommandLinesTo(double* points, const int& count) = 0;
virtual HRESULT PathCommandCurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3) = 0;
virtual HRESULT PathCommandCurvesTo(double* points, const int& count) = 0;
virtual HRESULT PathCommandArcTo(const double& x, const double& y, const double& w, const double& h, const double& startAngle, const double& sweepAngle) = 0;
virtual HRESULT PathCommandClose() = 0;
virtual HRESULT PathCommandEnd() = 0;
virtual HRESULT DrawPath(const LONG& nType) = 0;
virtual HRESULT PathCommandStart() = 0;
virtual HRESULT PathCommandGetCurrentPoint(double* x, double* y) = 0;
//-------- Функции для работы с Graphics Path -----------------------------------------------
virtual HRESULT PathCommandMoveTo(const double& x, const double& y) = 0;
virtual HRESULT PathCommandLineTo(const double& x, const double& y) = 0;
virtual HRESULT PathCommandLinesTo(double* points, const int& count) = 0;
virtual HRESULT PathCommandCurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3) = 0;
virtual HRESULT PathCommandCurvesTo(double* points, const int& count) = 0;
virtual HRESULT PathCommandArcTo(const double& x, const double& y, const double& w, const double& h, const double& startAngle, const double& sweepAngle) = 0;
virtual HRESULT PathCommandClose() = 0;
virtual HRESULT PathCommandEnd() = 0;
virtual HRESULT DrawPath(const LONG& nType) = 0;
virtual HRESULT PathCommandStart() = 0;
virtual HRESULT PathCommandGetCurrentPoint(double* x, double* y) = 0;
virtual HRESULT PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT PathCommandText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT PathCommandText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT PathCommandTextEx(const std::wstring& sText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT PathCommandTextEx(const std::wstring& sText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) = 0;
//-------- Функции для вывода изображений ---------------------------------------------------
virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255) = 0;
//-------- Функции для вывода изображений ---------------------------------------------------
virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255) = 0;
// transform --------------------------------------------------------------------------------
virtual HRESULT GetCommandParams(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags)
{
return S_OK;
}
virtual HRESULT SetCommandParams(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags)
{
if ((dWidth <= 1) || (dHeight <= 1))
lFlags = 0;
// transform --------------------------------------------------------------------------------
virtual HRESULT GetCommandParams(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags)
{
return S_OK;
}
virtual HRESULT SetCommandParams(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags)
{
if ((dWidth <= 1) || (dHeight <= 1))
lFlags = 0;
INT bFlipX = (0 != (c_nParamFlipX & lFlags));
INT bFlipY = (0 != (c_nParamFlipY & lFlags));
INT bFlipX = (0 != (c_nParamFlipX & lFlags));
INT bFlipY = (0 != (c_nParamFlipY & lFlags));
float m11 = bFlipX ? -1.0f : 1.0f;
float m22 = bFlipY ? -1.0f : 1.0f;
float m11 = bFlipX ? -1.0f : 1.0f;
float m22 = bFlipY ? -1.0f : 1.0f;
Aggplus::CMatrix oMatrix(1, 0, 0, 1, 0, 0);
Aggplus::CMatrix oMatrix(1, 0, 0, 1, 0, 0);
if ((0 != dAngle) || (0 != lFlags))
{
double dCentreX = (double)(dLeft + dWidth / 2.0);
double dCentreY = (double)(dTop + dHeight / 2.0);
if ((0 != dAngle) || (0 != lFlags))
{
double dCentreX = (double)(dLeft + dWidth / 2.0);
double dCentreY = (double)(dTop + dHeight / 2.0);
oMatrix.Translate(-dCentreX, -dCentreY , Aggplus::MatrixOrderAppend);
oMatrix.Translate(-dCentreX, -dCentreY , Aggplus::MatrixOrderAppend);
oMatrix.Rotate(dAngle , Aggplus::MatrixOrderAppend);
oMatrix.Scale(m11, m22 , Aggplus::MatrixOrderAppend);
oMatrix.Rotate(dAngle , Aggplus::MatrixOrderAppend);
oMatrix.Scale(m11, m22 , Aggplus::MatrixOrderAppend);
oMatrix.Translate(dCentreX, dCentreY , Aggplus::MatrixOrderAppend);
}
double mass[6];
oMatrix.GetElements(mass);
SetTransform(mass[0], mass[1], mass[2], mass[3], mass[4], mass[5]);
return S_OK;
}
virtual HRESULT SetBaseTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6) { return S_OK; }
virtual HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6) = 0;
virtual HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF) = 0;
virtual HRESULT ResetTransform() = 0;
oMatrix.Translate(dCentreX, dCentreY , Aggplus::MatrixOrderAppend);
}
double mass[6];
oMatrix.GetElements(mass);
SetTransform(mass[0], mass[1], mass[2], mass[3], mass[4], mass[5]);
return S_OK;
}
virtual HRESULT SetBaseTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6) { return S_OK; }
virtual HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6) = 0;
virtual HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF) = 0;
virtual HRESULT ResetTransform() = 0;
// -----------------------------------------------------------------------------------------
virtual HRESULT get_ClipMode(LONG* plMode) = 0;
virtual HRESULT put_ClipMode(const LONG& lMode) = 0;
// -----------------------------------------------------------------------------------------
virtual HRESULT get_ClipMode(LONG* plMode) = 0;
virtual HRESULT put_ClipMode(const LONG& lMode) = 0;
// additiaonal params ----------------------------------------------------------------------
virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand) = 0;
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand) = 0;
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand) = 0;
// additiaonal params ----------------------------------------------------------------------
virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand) = 0;
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand) = 0;
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand) = 0;
virtual HRESULT StartConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = true;
return S_OK;
}
virtual HRESULT EndConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = false;
return S_OK;
}
virtual HRESULT AddHyperlink(const double& dX, const double& dY, const double& dW, const double& dH, const std::wstring& wsUrl, const std::wstring& wsTooltip) {return S_OK;}
virtual HRESULT AddLink(const double& dX, const double& dY, const double& dW, const double& dH, const double& dDestX, const double& dDestY, const int& nPage) {return S_OK;}
virtual HRESULT AddFormField(IFormField* pField) {return S_OK;}
virtual HRESULT DocInfo(const std::wstring& wsTitle, const std::wstring& wsCreator, const std::wstring& wsSubject, const std::wstring& wsKeywords) {return S_OK;}
virtual HRESULT StartConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = true;
return S_OK;
}
virtual HRESULT EndConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = false;
return S_OK;
}
virtual HRESULT AddHyperlink(const double& dX, const double& dY, const double& dW, const double& dH, const std::wstring& wsUrl, const std::wstring& wsTooltip) {return S_OK;}
virtual HRESULT AddLink(const double& dX, const double& dY, const double& dW, const double& dH, const double& dDestX, const double& dDestY, const int& nPage) {return S_OK;}
virtual HRESULT AddFormField(IFormField* pField) {return S_OK;}
virtual HRESULT DocInfo(const std::wstring& wsTitle, const std::wstring& wsCreator, const std::wstring& wsSubject, const std::wstring& wsKeywords) {return S_OK;}
virtual HRESULT IsExistAdditionalParam(const int& type) {return S_FALSE;}
virtual HRESULT GetAdditionalParam(const int& type, std::string& result) {return S_FALSE;}
};
#define PROPERTY_RENDERER(NameBase, Name, Type) \
STDMETHOD(get_##NameBase##Name)(Type* pVal) \
{ \
if (NULL == pVal) \
return S_FALSE; \
*pVal = m_o##NameBase.##Name; \
return S_OK; \
} \
STDMETHOD(put_##NameBase##Name)(Type Val) \
{ \
m_o##NameBase.##Name = Val; \
return S_OK; \
}
#define PROPERTY_RENDERER(NameBase, Name, Type) \
STDMETHOD(get_##NameBase##Name)(Type* pVal) \
{ \
if (NULL == pVal) \
return S_FALSE; \
*pVal = m_o##NameBase.##Name; \
return S_OK; \
} \
STDMETHOD(put_##NameBase##Name)(Type Val) \
{ \
m_o##NameBase.##Name = Val; \
return S_OK; \
}
// exapmle:
// PROPERTY_RENDERER(Pen, Color, LONG)

View File

@ -36,257 +36,289 @@
namespace NSOnlineOfficeBinToPdf
{
class CMetafileToRenderterRaster_private
{
public:
class CMetafileToRenderterRaster_private
{
public:
NSFonts::IApplicationFonts* appFonts;
int m_nRasterFormat;
int m_nSaveType; // 0 = stretch, 1 = aspect (width == maxsize)
bool m_bIsOnlyFirst;
std::wstring m_sFileName;
int m_nRasterW;
int m_nRasterH;
int m_nRasterFormat;
double m_dDpiX;
double m_dDpiY;
// save_type - combined integer
// saveType = save_type & 0x0F
// saveFlags = (save_type & 0xF0) >> 1
// saveType:
// 0 - stretch
// 1 - делаем максимально большую картинку с аспектом как у страницы и вписанную в [m_nRasterW x m_nRasterH]
// 2 - nRasterW = (int)((pageW * m_internal->m_dDpiX / 25.4) + 0.5);
// nRasterH = (int)((pageH * m_internal->m_dDpiY / 25.4) + 0.5);
// 3 - special mode for clouds (see code)
//
// saveFlags & 1: change w/h by orientation
int m_nSaveType;
bool m_bIsOnlyFirst;
std::wstring m_sFileName;
int m_nRasterW;
int m_nRasterH;
public:
CMetafileToRenderterRaster_private()
{
appFonts = NULL;
double m_dDpiX;
double m_dDpiY;
m_nRasterFormat = 4;
m_nSaveType = 2;
m_bIsOnlyFirst = true;
m_sFileName = L"";
public:
CMetafileToRenderterRaster_private()
{
appFonts = NULL;
m_nRasterW = 100;
m_nRasterH = 100;
m_nRasterFormat = 4;
m_nSaveType = 2;
m_bIsOnlyFirst = true;
m_sFileName = L"";
m_dDpiX = 96.0;
m_dDpiY = 96.0;
}
m_nRasterW = 100;
m_nRasterH = 100;
m_dDpiX = 96.0;
m_dDpiY = 96.0;
}
~CMetafileToRenderterRaster_private()
{
}
};
{
}
};
CMetafileToRenderterRaster::CMetafileToRenderterRaster(IRenderer* pRenderer) : IMetafileToRenderter(pRenderer)
{
m_internal = new CMetafileToRenderterRaster_private();
}
CMetafileToRenderterRaster::~CMetafileToRenderterRaster()
{
RELEASEOBJECT(m_internal);
}
CMetafileToRenderterRaster::CMetafileToRenderterRaster(IRenderer* pRenderer) : IMetafileToRenderter(pRenderer)
{
m_internal = new CMetafileToRenderterRaster_private();
}
CMetafileToRenderterRaster::~CMetafileToRenderterRaster()
{
RELEASEOBJECT(m_internal);
}
bool CMetafileToRenderterRaster::ConvertBuffer(BYTE* pBuffer, LONG lBufferLen)
{
std::wstring sMain = m_internal->m_sFileName;
std::wstring sExt = L"";
if (!m_internal->m_bIsOnlyFirst)
{
std::wstring::size_type pos = m_internal->m_sFileName.find_last_of('.');
if (std::wstring::npos == pos)
return false;
bool CMetafileToRenderterRaster::ConvertBuffer(BYTE* pBuffer, LONG lBufferLen)
{
std::wstring sMain = m_internal->m_sFileName;
std::wstring sExt = L"";
if (!m_internal->m_bIsOnlyFirst)
{
std::wstring::size_type pos = m_internal->m_sFileName.find_last_of('.');
if (std::wstring::npos == pos)
return false;
sMain = m_internal->m_sFileName.substr(0, pos);
sExt = m_internal->m_sFileName.substr(pos);
}
sMain = m_internal->m_sFileName.substr(0, pos);
sExt = m_internal->m_sFileName.substr(pos);
}
CMetafilePagesInfo oInfo;
oInfo.CheckBuffer(pBuffer, lBufferLen);
CMetafilePagesInfo oInfo;
oInfo.CheckBuffer(pBuffer, lBufferLen);
int nPagesCount = oInfo.PagesCount;
if (0 == nPagesCount)
return false;
int nPagesCount = oInfo.PagesCount;
if (0 == nPagesCount)
return false;
if (m_internal->m_bIsOnlyFirst)
nPagesCount = 1;
if (m_internal->m_bIsOnlyFirst)
nPagesCount = 1;
NSFonts::IFontManager* pFontManager = m_internal->appFonts->GenerateFontManager();
NSFonts::IFontsCache* pFontsCache = NSFonts::NSFontCache::Create();
pFontsCache->SetStreams(m_internal->appFonts->GetStreams());
pFontManager->SetOwnerCache(pFontsCache);
pFontsCache->SetStreams(m_internal->appFonts->GetStreams());
pFontManager->SetOwnerCache(pFontsCache);
CImageFilesCache* pImagesCache = new CImageFilesCache(m_internal->appFonts);
CImageFilesCache* pImagesCache = new CImageFilesCache(m_internal->appFonts);
for (int nPageIndex = 0; nPageIndex < nPagesCount; ++nPageIndex)
{
CBgraFrame oFrame;
int nRasterW = m_internal->m_nRasterW;
int nRasterH = m_internal->m_nRasterH;
for (int nPageIndex = 0; nPageIndex < nPagesCount; ++nPageIndex)
{
CBgraFrame oFrame;
int nRasterW = m_internal->m_nRasterW;
int nRasterH = m_internal->m_nRasterH;
int nOffsetX = 0;
int nResultW = nRasterW;
int nResultH = nRasterH;
int nOffsetX = 0;
int nResultW = nRasterW;
int nResultH = nRasterH;
if (1 == m_internal->m_nSaveType)
{
double w = oInfo.arSizes[nPageIndex].width;
double h = oInfo.arSizes[nPageIndex].height;
int nSaveType = m_internal->m_nSaveType & 0x0F;
int nSaveFlags = (m_internal->m_nSaveType & 0xF0) >> 4;
double dKoef1 = nRasterW / w;
double dKoef2 = nRasterH / h;
if (dKoef1 > dKoef2)
dKoef1 = dKoef2;
if (nSaveFlags & 0x01)
{
// change w/h if needed
double w = oInfo.arSizes[nPageIndex].width;
double h = oInfo.arSizes[nPageIndex].height;
if ((w > h && nResultH > nResultW) || (w < h && nResultW > nResultH))
{
int nTmp = nResultW;
nResultW = nResultH;
nResultH = nTmp;
nRasterW = (int)(w * dKoef1 + 0.5);
nRasterH = (int)(h * dKoef1 + 0.5);
}
else if (2 == m_internal->m_nSaveType)
{
double w = oInfo.arSizes[nPageIndex].width;
double h = oInfo.arSizes[nPageIndex].height;
nTmp = nRasterW;
nRasterW = nRasterH;
nRasterH = nTmp;
}
}
nRasterW = (int)((w * m_internal->m_dDpiX / 25.4) + 0.5);
nRasterH = (int)((h * m_internal->m_dDpiY / 25.4) + 0.5);
}
else if (3 == m_internal->m_nSaveType)
{
double w = oInfo.arSizes[nPageIndex].width;
double h = oInfo.arSizes[nPageIndex].height;
if (1 == nSaveType)
{
double w = oInfo.arSizes[nPageIndex].width;
double h = oInfo.arSizes[nPageIndex].height;
double dKoef1 = nRasterW / w;
double dKoef2 = nRasterH / h;
double dKoef1 = nRasterW / w;
double dKoef2 = nRasterH / h;
if (dKoef1 > dKoef2)
dKoef1 = dKoef2;
if (dKoef1 > dKoef2)
{
nRasterH = (int)(dKoef1 * h) + 1;
}
else
{
nRasterW = (int)(dKoef2 * w) + 1;
nOffsetX = (nRasterW - nResultW) >> 1;
}
}
nRasterW = (int)(w * dKoef1 + 0.5);
nRasterH = (int)(h * dKoef1 + 0.5);
}
else if (2 == nSaveType)
{
double w = oInfo.arSizes[nPageIndex].width;
double h = oInfo.arSizes[nPageIndex].height;
oFrame.put_Width(nRasterW);
oFrame.put_Height(nRasterH);
oFrame.put_Stride(4 * nRasterW);
nRasterW = (int)((w * m_internal->m_dDpiX / 25.4) + 0.5);
nRasterH = (int)((h * m_internal->m_dDpiY / 25.4) + 0.5);
}
else if (3 == nSaveType)
{
double w = oInfo.arSizes[nPageIndex].width;
double h = oInfo.arSizes[nPageIndex].height;
BYTE* pDataRaster = new BYTE[4 * nRasterW * nRasterH];
memset(pDataRaster, 0xFF, 4 * nRasterW * nRasterH);
oFrame.put_Data(pDataRaster);
double dKoef1 = nRasterW / w;
double dKoef2 = nRasterH / h;
CGraphicsRenderer oRenderer;
oRenderer.SetFontManager(pFontManager);
oRenderer.SetImageCache(pImagesCache);
if (dKoef1 > dKoef2)
{
nRasterH = (int)(dKoef1 * h) + 1;
}
else
{
nRasterW = (int)(dKoef2 * w) + 1;
nOffsetX = (nRasterW - nResultW) >> 1;
}
}
oRenderer.CreateFromBgraFrame(&oFrame);
oRenderer.SetTileImageDpi(96.0);
oRenderer.SetSwapRGB(false);
oFrame.put_Width(nRasterW);
oFrame.put_Height(nRasterH);
oFrame.put_Stride(4 * nRasterW);
this->m_pRenderer = &oRenderer;
BYTE* pBufferPage = oInfo.arSizes[nPageIndex].data;
LONG nLen = lBufferLen - ((LONG)(pBufferPage - pBuffer));
NSOnlineOfficeBinToPdf::ConvertBufferToRenderer(pBufferPage, nLen, this);
BYTE* pDataRaster = new BYTE[4 * nRasterW * nRasterH];
memset(pDataRaster, 0xFF, 4 * nRasterW * nRasterH);
oFrame.put_Data(pDataRaster);
if (3 == m_internal->m_nSaveType)
{
int nStride = 4 * nResultW;
BYTE* pDataResult = new BYTE[nStride * nResultH];
CGraphicsRenderer oRenderer;
oRenderer.SetFontManager(pFontManager);
oRenderer.SetImageCache(pImagesCache);
if (0 == nOffsetX)
{
memcpy(pDataResult, pDataRaster, nStride * nResultH);
}
else
{
BYTE* pDataCopy = pDataRaster + 4 * nOffsetX;
BYTE* pDataDst = pDataResult;
int nStrideSrc = 4 * nRasterW;
for (int i = 0; i < nResultH; ++i)
{
memcpy(pDataDst, pDataCopy, nStride);
pDataCopy += nStrideSrc;
pDataDst += nStride;
}
}
oRenderer.CreateFromBgraFrame(&oFrame);
oRenderer.SetTileImageDpi(96.0);
oRenderer.SetSwapRGB(false);
oFrame.put_Data(pDataResult);
oFrame.put_Width(nResultW);
oFrame.put_Height(nResultH);
oFrame.put_Stride(nStride);
this->m_pRenderer = &oRenderer;
BYTE* pBufferPage = oInfo.arSizes[nPageIndex].data;
LONG nLen = lBufferLen - ((LONG)(pBufferPage - pBuffer));
NSOnlineOfficeBinToPdf::ConvertBufferToRenderer(pBufferPage, nLen, this);
RELEASEARRAYOBJECTS(pDataRaster);
}
if (3 == nSaveType)
{
int nStride = 4 * nResultW;
BYTE* pDataResult = new BYTE[nStride * nResultH];
if (m_internal->m_bIsOnlyFirst)
oFrame.SaveFile(sMain + sExt, m_internal->m_nRasterFormat);
else
oFrame.SaveFile(sMain + std::to_wstring(nPageIndex + 1) + sExt, m_internal->m_nRasterFormat);
}
if (0 == nOffsetX)
{
memcpy(pDataResult, pDataRaster, nStride * nResultH);
}
else
{
BYTE* pDataCopy = pDataRaster + 4 * nOffsetX;
BYTE* pDataDst = pDataResult;
int nStrideSrc = 4 * nRasterW;
for (int i = 0; i < nResultH; ++i)
{
memcpy(pDataDst, pDataCopy, nStride);
pDataCopy += nStrideSrc;
pDataDst += nStride;
}
}
RELEASEINTERFACE(pFontManager);
RELEASEINTERFACE(pImagesCache);
oFrame.put_Data(pDataResult);
oFrame.put_Width(nResultW);
oFrame.put_Height(nResultH);
oFrame.put_Stride(nStride);
return true;
}
RELEASEARRAYOBJECTS(pDataRaster);
}
std::wstring CMetafileToRenderterRaster::GetFileName()
{
return m_internal->m_sFileName;
}
void CMetafileToRenderterRaster::SetFileName(const std::wstring& value)
{
m_internal->m_sFileName = value;
}
if (m_internal->m_bIsOnlyFirst)
oFrame.SaveFile(sMain + sExt, m_internal->m_nRasterFormat);
else
oFrame.SaveFile(sMain + std::to_wstring(nPageIndex + 1) + sExt, m_internal->m_nRasterFormat);
}
void CMetafileToRenderterRaster::SetApplication(NSFonts::IApplicationFonts* pFonts)
{
RELEASEINTERFACE(pFontManager);
RELEASEINTERFACE(pImagesCache);
return true;
}
std::wstring CMetafileToRenderterRaster::GetFileName()
{
return m_internal->m_sFileName;
}
void CMetafileToRenderterRaster::SetFileName(const std::wstring& value)
{
m_internal->m_sFileName = value;
}
void CMetafileToRenderterRaster::SetApplication(NSFonts::IApplicationFonts* pFonts)
{
m_internal->appFonts = pFonts;
}
}
int CMetafileToRenderterRaster::GetRasterFormat()
{
return m_internal->m_nRasterFormat;
}
void CMetafileToRenderterRaster::SetRasterFormat(const int& value)
{
m_internal->m_nRasterFormat = value;
}
int CMetafileToRenderterRaster::GetRasterFormat()
{
return m_internal->m_nRasterFormat;
}
void CMetafileToRenderterRaster::SetRasterFormat(const int& value)
{
m_internal->m_nRasterFormat = value;
}
int CMetafileToRenderterRaster::GetSaveType()
{
return m_internal->m_nSaveType;
}
void CMetafileToRenderterRaster::SetSaveType(const int& value)
{
m_internal->m_nSaveType = value;
}
int CMetafileToRenderterRaster::GetSaveType()
{
return m_internal->m_nSaveType;
}
void CMetafileToRenderterRaster::SetSaveType(const int& value)
{
m_internal->m_nSaveType = value;
}
int CMetafileToRenderterRaster::GetRasterW()
{
return m_internal->m_nRasterW;
}
void CMetafileToRenderterRaster::SetRasterW(const int& value)
{
m_internal->m_nRasterW = value;
}
int CMetafileToRenderterRaster::GetRasterW()
{
return m_internal->m_nRasterW;
}
void CMetafileToRenderterRaster::SetRasterW(const int& value)
{
m_internal->m_nRasterW = value;
}
int CMetafileToRenderterRaster::GetRasterH()
{
return m_internal->m_nRasterH;
}
void CMetafileToRenderterRaster::SetRasterH(const int& value)
{
m_internal->m_nRasterH = value;
}
int CMetafileToRenderterRaster::GetRasterH()
{
return m_internal->m_nRasterH;
}
void CMetafileToRenderterRaster::SetRasterH(const int& value)
{
m_internal->m_nRasterH = value;
}
bool CMetafileToRenderterRaster::GetIsOnlyFirst()
{
return m_internal->m_bIsOnlyFirst;
}
void CMetafileToRenderterRaster::SetIsOnlyFirst(const bool& value)
{
m_internal->m_bIsOnlyFirst = value;
}
void CMetafileToRenderterRaster::SetOutputDpi(const double& dDpiX, const double& dDpiY)
{
m_internal->m_dDpiX = dDpiX;
m_internal->m_dDpiY = dDpiY;
}
bool CMetafileToRenderterRaster::GetIsOnlyFirst()
{
return m_internal->m_bIsOnlyFirst;
}
void CMetafileToRenderterRaster::SetIsOnlyFirst(const bool& value)
{
m_internal->m_bIsOnlyFirst = value;
}
void CMetafileToRenderterRaster::SetOutputDpi(const double& dDpiX, const double& dDpiY)
{
m_internal->m_dDpiX = dDpiX;
m_internal->m_dDpiY = dDpiY;
}
}

View File

@ -39,7 +39,7 @@
namespace NSOnlineOfficeBinToPdf
{
class CMetafilePageInfo
class CMetafilePageInfo
{
public:
double width;
@ -57,11 +57,11 @@ namespace NSOnlineOfficeBinToPdf
}
};
class CMetafilePagesInfo
class GRAPHICS_DECL CMetafilePagesInfo
{
public:
int PagesCount;
std::vector<CMetafilePageInfo> arSizes;
std::vector<CMetafilePageInfo> arSizes;
public:
CMetafilePagesInfo()
@ -73,11 +73,11 @@ namespace NSOnlineOfficeBinToPdf
inline void AddPage()
{
++PagesCount;
arSizes.push_back(CMetafilePageInfo());
arSizes.push_back(CMetafilePageInfo());
}
void CheckBuffer(BYTE* pBuffer, LONG lBufferLen);
};
void CheckBuffer(BYTE* pBuffer, LONG lBufferLen);
};
}
#endif // _BUILD_METAFILE_TO_IRENDERER_H_

View File

@ -2,6 +2,7 @@ LIB_GRAPHICS_PRI_PATH=$$PWD/../..
DEFINES -= UNICODE
DEFINES -= _UNICODE
DEFINES += DISABLE_IMAGE_EXCEPTIONS
DEFINES += \
_QT \

View File

@ -0,0 +1,137 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
*
* 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-6 Ernesta Birznieka-Upish
* 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
*
*/
#pragma once
#include <vector>
#include <iostream>
#include <algorithm>
// Commands
std::wstring sCmdHelp = L"--h";
std::wstring sCmdHelpFull = L"--help";
std::wstring sCmdPluginsDir = L"--directory";
std::wstring sCmdMarketplaceUrl = L"--marketplace";
std::wstring sCmdPrintInstalled = L"--print-installed";
std::wstring sCmdPrintRemoved = L"--print-removed";
std::wstring sCmdPrintMarketplace = L"--print-marketplace";
std::wstring sCmdPrintBackup = L"--print-backup";
std::wstring sCmdReset = L"--reset";
std::wstring sCmdInstall = L"--install";
std::wstring sCmdRestore = L"--restore";
std::wstring sCmdUpdate = L"--update";
std::wstring sCmdUpdateAll = L"--update-all";
std::wstring sCmdAutorename = L"--autorename";
std::wstring sCmdRemove = L"--remove";
std::wstring sCmdRemoveAll = L"--remove-all";
// Settings
std::wstring sSetRemoved = L"--removed=";
std::vector<std::wstring> arrCommands {sCmdHelp, sCmdHelpFull, sCmdPluginsDir, sCmdMarketplaceUrl,
sCmdPrintInstalled, sCmdPrintRemoved, sCmdPrintMarketplace, sCmdPrintBackup,
sCmdReset, sCmdInstall, sCmdRestore, sCmdUpdate, sCmdUpdateAll, sCmdAutorename,
sCmdRemove, sCmdRemoveAll};
bool IsCommandExists(std::wstring sCommand)
{
return std::find(arrCommands.begin(), arrCommands.end(), sCommand) != arrCommands.end();
}
bool IsNeedSetValue(std::wstring sParam)
{
return sParam == sCmdPluginsDir ||
sParam == sCmdInstall ||
sParam == sCmdRestore ||
sParam == sCmdUpdate ||
sParam == sCmdRemove;
}
std::wstring sHelpText =
L"\nPlugins Manager Options\n\n" \
L" --h \n" \
L" --help = Print usage information.\n\n" \
L" --directory = Required parameter. Set plugins folder in quotes.\n" \
L" For example, --directory=\"/home/mark/plugins\"\n" \
L" The symbol = can be skipped for all parameters.\n" \
L" Must be first on the command line.\n\n" \
L" --marketplace = Optional parameter. Set plugins marketplace URL in quotes.\n" \
L" Default is https://onlyoffice.github.io\n\n" \
L" --print-installed = Optional parameter without value. Print installed plugins.\n\n" \
L" --print-removed = Optional parameter without value. Print removed plugins.\n\n" \
L" --print-marketplace = Optional parameter without value. Print available plugins from the marketplace.\n\n" \
L" --print-backup = Optional parameter without value. Print backup plugins.\n" \
L" Backup plugins can be restored using --restore option\n\n" \
L" --reset = Optional parameter without value. Reset user setting.\n\n" \
L" --install = Optional parameter. Set comma-separated quoted list of plugins to install.\n" \
L" Installing by plugin name, for example, --install=\"photo editor\"\n" \
L" GUID, for example, --install=\"{7327FC95-16DA-41D9-9AF2-0E7F449F6800}\"\n" \
L" URL, for example, --install=\"https://anysite.com/deploy/chess.plugin\"\n" \
L" file path, for example, --install=\"/home/mark/work/speech.plugin\"\n" \
L" config path, for example, --install=\"/home/mark/work/plugins.json\"\n" \
L" is supported.\n" \
L" Combined installation is supported, for example, --install=\"photo editor, {7327FC95-16DA-41D9-9AF2-0E7F449F6800}, etc\".\n" \
L" File paths without quotes, plugin extensions: .zip, .plugin.\n\n" \
L" --restore = Optional parameter. Set comma-separated quoted list of plugins to restore.\n" \
L" Print backup plugins using --print-backup option.\n" \
L" Restoring by plugin name or GUID is supported.\n" \
L" For example, --restore=\"Youtube, {7327FC95-16DA-41D9-9AF2-0E7F449F6800}\"\n\n" \
L" --update = Optional parameter. Set comma-separated quoted list of plugins to update.\n" \
L" Updating by plugin name, GUID, config path is supported.\n" \
L" For example, --update=\"Youtube, PhotoEditor, {7327FC95-16DA-41D9-9AF2-0E7F449F6800}\"\n\n" \
L" --update-all = Optional parameter without value. Update all installed plugins from marketplace.\n\n" \
L" --autorename = Optional parameter without value.\n" \
L" Rename installed plugins folders from name to GUID.\n" \
L" For example, youtube -> {38E022EA-AD92-45FC-B22B-49DF39746DB4}\n\n" \
L" --remove = Optional parameter. Set comma-separated quoted list of plugins to remove.\n" \
L" Removing by plugin name, GUID, config path is supported.\n" \
L" For example, --remove=\"Youtube, PhotoEditor, {7327FC95-16DA-41D9-9AF2-0E7F449F6800}\"\n\n" \
L" --remove-all = Optional parameter without value. Remove all installed plugins.\n" \
;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
CORE_ROOT_DIR = $$PWD/../..
PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
include($$CORE_ROOT_DIR/Common/3dParty/icu/icu.pri)
DESTDIR = $$CORE_BUILDS_BINARY_PATH
TARGET = pluginsmanager
DEFINES += KERNEL_USE_DYNAMIC_LIBRARY
ADD_DEPENDENCY(kernel, kernel_network, UnicodeConverter)
core_windows {
DEFINES += \
WIN32
DEFINES -= UNICODE
DEFINES -= _DEBUG
message(windows)
LIBS += -lAdvapi32
LIBS += -lShell32
LIBS += -lGdi32
LIBS += -lUser32
}
SOURCES += main.cpp
HEADERS += help.h

View File

@ -278,17 +278,21 @@ namespace MetaFile
double dLogicalFontHeight = std::fabs(pFont->GetHeight());
double dM11, dM12, dM21, dM22, dRx, dRy;
m_pRenderer->GetTransform(&dM11, &dM12, &dM21, &dM22, &dRx, &dRy);
if (dLogicalFontHeight < M_MINFONTSIZE)
{
m_pRenderer->GetTransform(&dM11, &dM12, &dM21, &dM22, &dRx, &dRy);
dFontScale = dM22;
dLogicalFontHeight *= dFontScale;
m_pRenderer->SetTransform(dM11 / std::fabs(dM11), dM12, dM21, dM22 / std::fabs(dM22), dRx, dRy);
dM11 /= std::fabs(dM11);
dM22 /= std::fabs(dM22);
m_pRenderer->SetTransform(dM11, dM12, dM21, dM22, dRx, dRy);
}
m_pRenderer->put_FontName(pFont->GetFaceName());
m_pRenderer->put_FontSize(fabs(dLogicalFontHeight * m_dScaleX / 25.4 * 72. * m_pFile->GetTransform()->M11));
m_pRenderer->put_FontSize(fabs(dLogicalFontHeight * m_dScaleX / 25.4 * 72.) * dM22);
int lStyle = 0;
if (pFont->GetWeight() > 550)
@ -1209,12 +1213,8 @@ namespace MetaFile
std::vector<double> arDashes(unSizeDash);
for (unsigned int unIndex = 0; unIndex < unSizeDash; ++unIndex)
{
if (PS_STARTCAP_ROUND == ulPenStartCap)
arDashes[unIndex] = pDataDash[unIndex] * ((0 == unIndex % 2) ? (dWidth / 4) : (1.5 * dWidth));
else
arDashes[unIndex] = pDataDash[unIndex] * dWidth;
}
m_pRenderer->PenDashPattern(arDashes.data(), unSizeDash);
nDashStyle = Aggplus::DashStyleCustom;

View File

@ -38,6 +38,7 @@
#include <math.h>
#include <sstream>
#include <iomanip>
#include <iostream>
#ifndef DIB_RGB_COLORS
#define DIB_RGB_COLORS 0x00
@ -1015,10 +1016,10 @@ namespace MetaFile
return sTmpFile;
}
std::wstring StringNormalization(std::wstring wsString)
std::wstring StringNormalization(const std::wstring& wsString)
{
std::wstring wsText;
for (wchar_t wChar : wsString)
for (const wchar_t& wChar : wsString)
if (wChar == L'<')
wsText += L"&lt;";
else if (wChar == L'>')
@ -1036,6 +1037,30 @@ namespace MetaFile
return wsText;
}
bool StringEquals(const std::wstring& wsFirst, const std::wstring& wsSecond)
{
#if 0
// since c++14!
return std::equal(wsFirst.begin(), wsFirst.end(),
wsSecond.begin(), wsSecond.end(),
[](wchar_t wchFirst, wchar_t wchSecond) {
return tolower(wchFirst) == tolower(wchSecond);
});
#else
size_t sizeFirst = wsFirst.length();
size_t sizeSecond = wsSecond.length();
if (sizeFirst != sizeSecond)
return false;
for (size_t i = 0; i < sizeFirst; ++i)
{
if (tolower(wsFirst[i]) != tolower(wsSecond[i]))
return false;
}
return true;
#endif
}
static int GetMinAccuracy(double dValue)
{
if (dValue == (int)dValue)

View File

@ -1229,7 +1229,8 @@ namespace MetaFile
void ProcessRasterOperation(unsigned int unRasterOperation, BYTE** ppBgra, unsigned int unWidth, unsigned int unHeight);
std::wstring GetTempFilename(const std::wstring& sFolder = L"");
std::wstring StringNormalization(std::wstring wsString);
std::wstring StringNormalization(const std::wstring& wsString);
bool StringEquals(const std::wstring& wsFirstString, const std::wstring& wsSecondString);
std::wstring ConvertToWString(double dValue, int nAccuracy = -1);
std::wstring ConvertToWString(const std::vector<double>& arValues, int nAccuracy = -1);

View File

@ -1,9 +1,6 @@
#include "CEmfInterpretatorSvg.h"
#include "../../Common/MetaFileUtils.h"
#include "../../../../graphics/Image.h"
#include "../../../BgraFrame.h"
#include <algorithm>
@ -1130,6 +1127,11 @@ namespace MetaFile
if (NULL == pFont)
return;
const std::wstring wsText = StringNormalization(wsString);
if (wsText.empty())
return;
NodeAttributes arNodeAttributes;
TXForm oTransform;
@ -1147,10 +1149,21 @@ namespace MetaFile
arNodeAttributes.push_back({L"font-size", ConvertToWString(dFontHeight)});
std::wstring wsFaceName = pFont->GetFaceName();
std::wstring wsFontName = pFont->GetFaceName();
if (!wsFaceName.empty())
arNodeAttributes.push_back({L"font-family", wsFaceName});
if (!wsFontName.empty())
{
NSFonts::CFontSelectFormat oFormat;
oFormat.wsName = new std::wstring(pFont->GetFaceName());
NSFonts::CFontInfo *pFontInfo = m_pParser->GetFontManager()->GetFontInfoByParams(oFormat);
if (NULL != pFontInfo && !StringEquals(wsFontName, pFontInfo->m_wsFontName))
wsFontName = L"&apos;" + wsFontName + L"&apos;, &apos;" + pFontInfo->m_wsFontName + L"&apos;";
}
if (!wsFontName.empty())
arNodeAttributes.push_back({L"font-family", wsFontName});
if (pFont->GetWeight() > 550)
arNodeAttributes.push_back({L"font-weight", L"bold"});
@ -1182,7 +1195,7 @@ namespace MetaFile
arNodeAttributes.push_back({L"x", wsX});
arNodeAttributes.push_back({L"y", wsY});
WriteNode(L"text", arNodeAttributes, wsString);
WriteNode(L"text", arNodeAttributes, wsText);
}
void CEmfInterpretatorSvg::HANDLE_EMFPLUS_DRAWELLIPSE(short shOgjectIndex, const TEmfPlusRectF &oRect)

View File

@ -253,6 +253,9 @@ namespace MetaFile
IFont *pFont = m_pParser->GetFont();
if (NULL == pFont)
return;
double dFontHeight = std::fabs(pFont->GetHeight());
if (dFontHeight < 0.01)
@ -260,12 +263,21 @@ namespace MetaFile
arNodeAttributes.push_back({L"font-size", ConvertToWString(dFontHeight)});
std::wstring wsFaceName = pFont->GetFaceName();
std::transform(wsFaceName.begin(), wsFaceName.end(), wsFaceName.begin(), towlower);
EraseWords(wsFaceName, {L" bold", L" italic"});
std::wstring wsFontName = pFont->GetFaceName();
if (!wsFaceName.empty())
arNodeAttributes.push_back({L"font-family", wsFaceName});
if (!wsFontName.empty())
{
NSFonts::CFontSelectFormat oFormat;
oFormat.wsName = new std::wstring(pFont->GetFaceName());
NSFonts::CFontInfo *pFontInfo = m_pParser->GetFontManager()->GetFontInfoByParams(oFormat);
if (NULL != pFontInfo && !StringEquals(wsFontName, pFontInfo->m_wsFontName))
wsFontName = L"&apos;" + wsFontName + L"&apos;, &apos;" + pFontInfo->m_wsFontName + L"&apos;";
}
if (!wsFontName.empty())
arNodeAttributes.push_back({L"font-family", wsFontName});
if (pFont->GetWeight() > 550)
arNodeAttributes.push_back({L"font-weight", L"bold"});
@ -319,14 +331,14 @@ namespace MetaFile
if (arDx.empty())
arNodeAttributes.push_back({L"text-anchor", L"end"});
else
dXCoord -= std::accumulate(arDx.begin(), arDx.end(), 0);
dXCoord -= std::accumulate(arDx.begin(), arDx.end(), 0.0);
}
else if (ulTextAlign == TA_CENTER)
{
if (arDx.empty())
arNodeAttributes.push_back({L"text-anchor", L"middle"});
else
dXCoord -= std::accumulate(arDx.begin(), arDx.end(), 0) / 2;
dXCoord -= std::accumulate(arDx.begin(), arDx.end(), 0.0) / 2;
}
else //if (ulTextAlign & TA_LEFT)
{
@ -351,10 +363,15 @@ namespace MetaFile
double dSin = std::sin(dEscapement * M_PI / 180.);
dXCoord -= dFontHeight * dSin;
dYCoord -= dFontHeight * dSin;
if (oScale.y < -0.00001)
dXCoord -= dFontHeight * dSin;
arNodeAttributes.push_back({L"transform", L"rotate(" + ConvertToWString(dEscapement) + L' ' + ConvertToWString(dXCoord) + L' ' + ConvertToWString(dYCoord) + L')'});
if (oScale.y > 0.00001)
dXCoord -= dFontHeight * dSin;
}
AddTransform(arNodeAttributes, &oTransform);
@ -395,10 +412,8 @@ namespace MetaFile
do
{
std::wstring wsTemp = StringNormalization(wsNormalizedText.substr(unStart, unPosLineBreak - unStart));
WriteNode(L"tspan", {{L"x", wsXCoord},
{L"y", ConvertToWString(dYNewCoord)}}, StringNormalization(wsNormalizedText.substr(unStart, unPosLineBreak - unStart)));
{L"y", ConvertToWString(dYNewCoord)}}, wsNormalizedText.substr(unStart, unPosLineBreak - unStart));
dYNewCoord += dFontHeight * 1.6;
unStart = wsNormalizedText.find_first_not_of(L"\n", unPosLineBreak);
@ -489,15 +504,27 @@ namespace MetaFile
unsigned int unMetaPenStyle = pPen->GetStyle();
unsigned int ulPenStyle = unMetaPenStyle & PS_STYLE_MASK;
unsigned int ulPenStartCap = unMetaPenStyle & PS_STARTCAP_MASK;
unsigned int ulPenEndCap = unMetaPenStyle & PS_ENDCAP_MASK;
unsigned int ulPenJoin = unMetaPenStyle & PS_JOIN_MASK;
// svg не поддерживает разные стили для разных сторон линии
std::wstring wsLineCap;
if (PS_ENDCAP_ROUND == ulPenEndCap)
wsLineCap = L"round";
else if (PS_ENDCAP_SQUARE == ulPenEndCap)
wsLineCap = L"square";
else if (PS_ENDCAP_FLAT == ulPenEndCap)
wsLineCap = L"butt";
if (PS_STARTCAP_FLAT == ulPenStartCap)
arAttributes.push_back({L"stroke-linecap", L"butt"});
wsLineCap = L"butt";
else if (PS_STARTCAP_SQUARE == ulPenStartCap)
arAttributes.push_back({L"stroke-linecap", L"square"});
wsLineCap = L"square";
else if (PS_STARTCAP_ROUND == ulPenStartCap)
arAttributes.push_back({L"stroke-linecap", L"round"});
wsLineCap = L"round";
arAttributes.push_back({L"stroke-linecap", wsLineCap});
if (PS_JOIN_MITER == ulPenJoin)
arAttributes.push_back({L"stroke-linejoin", L"miter"});

View File

@ -89,15 +89,23 @@ namespace MetaFile
double dXRadius = std::fabs(oNewRect.dRight - oNewRect.dLeft) / 2;
double dYRadius = std::fabs(oNewRect.dBottom - oNewRect.dTop) / 2;
std::wstring wsValue = L"M " + ConvertToWString(shXStartArc) + L' ' + ConvertToWString(shYStartArc);
double dStartAngle = GetEllipseAngle(oNewRect.dLeft, oNewRect.dTop, oNewRect.dRight, oNewRect.dBottom, shXStartArc, shYStartArc) / 180. * M_PI;
double dEndAngle = GetEllipseAngle(oNewRect.dLeft, oNewRect.dTop, oNewRect.dRight, oNewRect.dBottom, shXEndArc, shYEndArc) / 180. * M_PI;
double dX1 = std::cos(dStartAngle) * dXRadius;
double dY1 = std::sin(dStartAngle) * dXRadius;
double dX2 = std::cos(dEndAngle) * dXRadius;
double dY2 = std::sin(dEndAngle) * dYRadius;
std::wstring wsValue = L"M " + ConvertToWString(dX1 + (shRight + shLeft) / 2.) + L' ' + ConvertToWString(dY1 + (shBottom + shTop) / 2.);
wsValue += L" A " + ConvertToWString(dXRadius) + L' ' +
ConvertToWString(dYRadius) + L' ' +
L"0 0 1 " +
// ((std::fabs(dSweepAngle - dStartAngle) <= 180) ? L"0" : L"1") + L' ' +
// ((std::fabs(dSweepAngle - dStartAngle) <= 180) ? L"1" : L"0") + L' ' +
ConvertToWString(shXEndArc) + L' ' +
ConvertToWString(shYEndArc);
ConvertToWString(dYRadius) + L' ' +
L"0 0 0 " +
// ((std::fabs(dSweepAngle - dStartAngle) <= 180) ? L"0" : L"1") + L' ' +
// ((std::fabs(dSweepAngle - dStartAngle) <= 180) ? L"1" : L"0") + L' ' +
ConvertToWString(dX2 + (shRight + shLeft) / 2.) + L' ' +
ConvertToWString(dY2 + (shBottom + shTop) / 2.);
NodeAttributes arAttributes = {{L"d", wsValue}};

View File

@ -957,14 +957,29 @@ namespace MetaFile
if (NULL != m_pInterpretator)
m_pInterpretator->HANDLE_META_ARC(shYEndArc, shXEndArc, shYStartArc, shXStartArc, shBottom, shRight, shTop, shLeft);
double dStartAngle = GetEllipseAngle((int)shLeft, (int)shTop, (int)shRight, (int)shBottom, (int)shXStartArc, (int)shYStartArc);
double dEndAngle = GetEllipseAngle((int)shLeft, (int)shTop, (int)shRight, (int)shBottom, (int)shXEndArc, (int)shYEndArc);
double dXC = (shRight + shLeft) / 2.;
double dYC = (shTop + shBottom) / 2.;
double dXRadius = std::fabs(shRight - shLeft) / 2;
double dYRadius = std::fabs(shBottom - shTop) / 2;
double dStartAngle = agg::rad2deg(std::atan2(shYStartArc - dYC, shXStartArc - dXC));
double dEndAngle = agg::rad2deg(std::atan2(shYEndArc - dYC, shXEndArc - dXC));
if ((shXStartArc - dXC) < 0 && (shYStartArc - dYC) < 0)
dStartAngle += 360;
if ((shXEndArc - dXC) < 0 && (shYEndArc - dYC) < 0)
dEndAngle += 360;
double dX1 = dXC + std::cos(agg::deg2rad(dStartAngle)) * dXRadius;
double dY1 = dYC + std::sin(agg::deg2rad(dStartAngle)) * dYRadius;
double dSweepAngle = GetSweepAngle(dStartAngle, dEndAngle);
m_pDC->SetCurPos(shXStartArc, shYStartArc);
MoveTo(dX1, dY1);
ArcTo(shLeft, shTop, shRight, shBottom, dStartAngle, dSweepAngle);
DrawPath(true, false);
m_pDC->SetCurPos(shXEndArc, shYEndArc);
}
void CWmfParserBase::HANDLE_META_CHORD(short shYEndArc, short shXEndArc, short shYStartArc, short shXStartArc, short shBottom, short shRight, short shTop, short shLeft)

View File

@ -96,6 +96,7 @@ namespace NSBase64
}
#define OWN_BASE_64
#define DOCTRENDERER_NO_USE_DYNAMIC_LIBRARY
#include "../../../../doctrenderer/hash.cpp"
#ifdef __cplusplus

View File

@ -65,8 +65,7 @@ bool CBookItem::ReadItem(XmlUtils::CXmlLiteReader& oXmlLiteReader, int depth)
if (sAttributeName == L"href")
{
sAttributeValue = URLDecode(sAttributeValue);
size_t posLastSlash = sAttributeValue.rfind(L'/');
m_sRef = posLastSlash == std::wstring::npos ? sAttributeValue : sAttributeValue.substr(posLastSlash + 1);
m_sRef = NSFile::GetFileName(sAttributeValue);
}
else if (sAttributeName == L"id")
m_sID = sAttributeValue;

View File

@ -4,6 +4,7 @@
#include <string>
#include "../../DesktopEditor/xml/include/xmlutils.h"
#include "../../DesktopEditor/common/Directory.h"
class CBookItem
{

View File

@ -80,10 +80,7 @@ HRESULT CEpubFile::Convert(const std::wstring& sInputFile, const std::wstring& s
if (nContent != std::wstring::npos)
{
nContent += 11;
sContent = sFileContent.substr(nContent, sFileContent.find(L'\"', nContent) - nContent);
size_t posLastSlash = sContent.rfind(L'/');
if (posLastSlash != std::wstring::npos)
sContent = sContent.substr(posLastSlash + 1);
sContent = NSFile::GetFileName(sFileContent.substr(nContent, sFileContent.find(L'\"', nContent) - nContent));
}
sContent = m_sTempDir + (sContent.empty() ? L"/content.opf" : L'/' + sContent);

View File

@ -293,7 +293,10 @@ public:
{
std::wstring sText = m_oLightReader.GetText();
if (sText.length() > 1)
{
sImageName = sText.substr(1);
break;
}
}
}
m_oLightReader.MoveToElement();
@ -1053,12 +1056,15 @@ public:
// Читает binary
void getImage(const std::wstring& sImageId, const std::wstring& sMediaDirectory, NSStringUtils::CStringBuilder& oRels)
{
std::wstring sId;
std::wstring sId, sType = L".png";
while (m_oLightReader.MoveToNextAttribute())
{
std::wstring sName = m_oLightReader.GetName();
// Читает id
if (m_oLightReader.GetName() == L"id")
if (sName == L"id")
sId = m_oLightReader.GetText();
else if (sName == L"content-type")
sType = m_oLightReader.GetText().find(L"jpeg") == std::wstring::npos ? L".png" : L".jpeg";
}
m_oLightReader.MoveToElement();
if (sId.empty() || m_oLightReader.IsEmptyNode())
@ -1066,7 +1072,8 @@ public:
// Пишет картинку в файл
NSFile::CFileBinary oImageWriter;
if (oImageWriter.CreateFileW(sMediaDirectory + L'/' + sId + (sId.find(L'.') == std::wstring::npos ? L".png" : L"")))
std::wstring sImagePath = sMediaDirectory + L"/image" + sImageId + sType;
if (oImageWriter.CreateFileW(sImagePath))
{
std::string sBase64 = contentA();
int nSrcLen = (int)sBase64.length();
@ -1079,7 +1086,7 @@ public:
// Получаем размеры картинки
CBgraFrame oBgraFrame;
oBgraFrame.OpenFile(sMediaDirectory + L'/' + sId);
oBgraFrame.OpenFile(sImagePath);
int nHy = oBgraFrame.get_Height();
int nWx = oBgraFrame.get_Width();
if (nWx > nHy)
@ -1113,7 +1120,7 @@ public:
oRels += L"<Relationship Id=\"rPic";
oRels += sImageId;
oRels += L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"media/";
oRels += sId;
oRels += (L"image" + sImageId + sType);
oRels += L"\"/>";
}
}

View File

@ -50,8 +50,8 @@
void Download_OnComplete(int error)
{
int y = error;
return;
int y = error;
return;
}
//#define RASTER_TEST
@ -121,291 +121,302 @@ bool DownloadFilePS(const std::wstring& sFileURL, const std::wstring& strFileOut
int main(int argc, char *argv[])
{
DownloadFilePS(L"https://natworld.info/wp-content/uploads/2018/02/vodosvinka-ili-kapibara.jpg", L"D:/222.jpg");
//DownloadFilePS(L"https://natworld.info/wp-content/uploads/2018/02/vodosvinka-ili-kapibara.jpg", L"D:/222.jpg");
#ifdef DOWNLOADER_TEST
NSNetwork::NSFileTransport::CFileDownloader oDownloader(L"https://natworld.info/wp-content/uploads/2018/02/vodosvinka-ili-kapibara.jpg", false);
oDownloader.SetFilePath(L"D:\\111.jpg");
oDownloader.SetEvent_OnComplete(Download_OnComplete);
oDownloader.DownloadSync();
oDownloader.SetFilePath(L"D:\\111.jpg");
oDownloader.SetEvent_OnComplete(Download_OnComplete);
oDownloader.DownloadSync();
#endif
#ifdef RASTER_TEST
CBgraFrame oFrame;
oFrame.OpenFile(L"D:\\22.png");
oFrame.SaveFile(L"D:\\oleg.png", 4);
return 0;
CBgraFrame oFrame;
oFrame.OpenFile(L"D:\\22.png");
oFrame.SaveFile(L"D:\\oleg.png", 4);
return 0;
#endif
CApplicationFontsWorker oWorker;
oWorker.m_sDirectory = NSFile::GetProcessDirectory() + L"/fonts_cache";
//oWorker.m_arAdditionalFolders.push_back(L"D:\\GIT\\core-fonts");
oWorker.m_bIsNeedThumbnails = false;
CApplicationFontsWorker oWorker;
oWorker.m_sDirectory = NSFile::GetProcessDirectory() + L"/fonts_cache";
//oWorker.m_arAdditionalFolders.push_back(L"D:\\GIT\\core-fonts");
oWorker.m_bIsNeedThumbnails = false;
if (!NSDirectory::Exists(oWorker.m_sDirectory))
NSDirectory::CreateDirectory(oWorker.m_sDirectory);
if (!NSDirectory::Exists(oWorker.m_sDirectory))
NSDirectory::CreateDirectory(oWorker.m_sDirectory);
NSFonts::IApplicationFonts* pFonts = oWorker.Check();
NSFonts::IApplicationFonts* pFonts = oWorker.Check();
#if 0
NSFonts::CFontSelectFormat oFormat;
oFormat.wsName = new std::wstring(L"@ËÎÌå");
NSFonts::IFontManager* pTestManager = pFonts->GenerateFontManager();
NSFonts::CFontInfo* pFontInfo = pTestManager->GetFontInfoByParams(oFormat);
pTestManager->Release();
#endif
#ifdef METAFILE_TEST_X2T
MetaFile::IMetaFile* pMetafile = MetaFile::Create(pFonts);
if (pMetafile->LoadFromFile(L"image.emf"))
{
NSFonts::IFontManager* pFontManager = pFonts->GenerateFontManager();
MetaFile::IMetaFile* pMetafile = MetaFile::Create(pFonts);
if (pMetafile->LoadFromFile(L"image.emf"))
{
NSFonts::IFontManager* pFontManager = pFonts->GenerateFontManager();
double x = 0, y = 0, w = 0, h = 0;
pMetafile->GetBounds(&x, &y, &w, &h);
double x = 0, y = 0, w = 0, h = 0;
pMetafile->GetBounds(&x, &y, &w, &h);
double _max = (w >= h) ? w : h;
double dKoef = 1000.0 / _max;
double _max = (w >= h) ? w : h;
double dKoef = 1000.0 / _max;
int WW = (int)(dKoef * w + 0.5);
int HH = (int)(dKoef * h + 0.5);
int WW = (int)(dKoef * w + 0.5);
int HH = (int)(dKoef * h + 0.5);
NSHtmlRenderer::CASCSVGWriter oWriterSVG;
oWriterSVG.SetFontManager(pFontManager);
oWriterSVG.put_Width(WW);
oWriterSVG.put_Height(HH);
NSHtmlRenderer::CASCSVGWriter oWriterSVG;
oWriterSVG.SetFontManager(pFontManager);
oWriterSVG.put_Width(WW);
oWriterSVG.put_Height(HH);
bool bRes = true;
bool bIsBigestSVG = false;
bool bIsRaster = true;
try
{
bRes = pMetafile->DrawOnRenderer(&oWriterSVG, 0, 0, WW, HH);
}
catch (...)
{
bRes = false;
}
bool bRes = true;
bool bIsBigestSVG = false;
bool bIsRaster = true;
try
{
bRes = pMetafile->DrawOnRenderer(&oWriterSVG, 0, 0, WW, HH);
}
catch (...)
{
bRes = false;
}
if (bRes)
{
oWriterSVG.IsRaster(&bIsRaster);
if (bRes)
{
oWriterSVG.IsRaster(&bIsRaster);
LONG lSvgDataSize = 0;
oWriterSVG.GetSVGDataSize(&lSvgDataSize);
LONG lSvgDataSize = 0;
oWriterSVG.GetSVGDataSize(&lSvgDataSize);
bIsBigestSVG = (lSvgDataSize > 5 * 1024 * 1024);
}
bIsBigestSVG = (lSvgDataSize > 5 * 1024 * 1024);
}
if (bIsRaster || bIsBigestSVG || !bRes)
{
int nWidth = 0;
int nHeight = 0;
if (bIsRaster || bIsBigestSVG || !bRes)
{
int nWidth = 0;
int nHeight = 0;
int nMaxPixSize = 1000;
int nMaxPixSize = 1000;
double dKoef = nMaxPixSize / _max;
double dKoef = nMaxPixSize / _max;
nWidth = (int)(dKoef * w + 0.5);
nHeight = (int)(dKoef * h + 0.5);
nWidth = (int)(dKoef * w + 0.5);
nHeight = (int)(dKoef * h + 0.5);
pMetafile->ConvertToRaster(L"image.png", 4 /*CXIMAGE_FORMAT_PNG*/, nWidth, nHeight);
}
else
{
oWriterSVG.SaveFile(L"image.svg");
}
pMetafile->ConvertToRaster(L"image.png", 4 /*CXIMAGE_FORMAT_PNG*/, nWidth, nHeight);
}
else
{
oWriterSVG.SaveFile(L"image.svg");
}
RELEASEINTERFACE(pFontManager);
}
RELEASEOBJECT(pMetafile);
RELEASEINTERFACE(pFontManager);
}
RELEASEOBJECT(pMetafile);
#endif
#ifdef METAFILE_TEST
NSFonts::IFontManager* pManager = pFonts->GenerateFontManager();
NSFonts::IFontManager* pManager = pFonts->GenerateFontManager();
NSHtmlRenderer::CASCSVGWriter oWriterSVG;
oWriterSVG.SetFontManager(pManager);
NSHtmlRenderer::CASCSVGWriter oWriterSVG;
oWriterSVG.SetFontManager(pManager);
MetaFile::IMetaFile* pMetafile = MetaFile::Create(pFonts);
MetaFile::IMetaFile* pMetafile = MetaFile::Create(pFonts);
//pMetafile->LoadFromFile(L"D:\\2\\ppt\\media\\image4.wmf");
pMetafile->LoadFromFile(L"D:\\SVG\\Disigner 2.svg");
//pMetafile->LoadFromFile(L"D:\\2\\ppt\\media\\image4.wmf");
pMetafile->LoadFromFile(L"D:\\SVG\\Disigner 2.svg");
double x = 0, y = 0, w = 0, h = 0;
pMetafile->GetBounds(&x, &y, &w, &h);
double x = 0, y = 0, w = 0, h = 0;
pMetafile->GetBounds(&x, &y, &w, &h);
double _max = (w >= h) ? w : h;
double dKoef = 100000.0 / _max;
double _max = (w >= h) ? w : h;
double dKoef = 100000.0 / _max;
int WW = (int)(dKoef * w + 0.5);
int HH = (int)(dKoef * h + 0.5);
int WW = (int)(dKoef * w + 0.5);
int HH = (int)(dKoef * h + 0.5);
oWriterSVG.put_Width(WW);
oWriterSVG.put_Height(HH);
pMetafile->DrawOnRenderer(&oWriterSVG, 0, 0, WW, HH);
oWriterSVG.put_Width(WW);
oWriterSVG.put_Height(HH);
pMetafile->DrawOnRenderer(&oWriterSVG, 0, 0, WW, HH);
oWriterSVG.SaveFile(L"D:\\SVG\\out.png");
oWriterSVG.SaveFile(L"D:\\SVG\\out.png");
RELEASEOBJECT(pMetafile);
RELEASEINTERFACE(pManager);
RELEASEOBJECT(pFonts);
return 0;
RELEASEOBJECT(pMetafile);
RELEASEINTERFACE(pManager);
RELEASEOBJECT(pFonts);
return 0;
#endif
#ifdef METAFILE_TEST_RASTER
NSFonts::IFontManager* pManager = pFonts->GenerateFontManager();
NSFonts::IFontManager* pManager = pFonts->GenerateFontManager();
NSGraphics::IGraphicsRenderer* pRasterRenderer = NSGraphics::Create();
pRasterRenderer->SetFontManager(pManager);
NSGraphics::IGraphicsRenderer* pRasterRenderer = NSGraphics::Create();
pRasterRenderer->SetFontManager(pManager);
int nRasterW = 1000;
int nRasterH = 1000;
BYTE* pData = new BYTE[4 * nRasterW * nRasterH];
//memset(pData, 255, 4 * nRasterW * nRasterH);
int nRasterW = 1000;
int nRasterH = 1000;
BYTE* pData = new BYTE[4 * nRasterW * nRasterH];
//memset(pData, 255, 4 * nRasterW * nRasterH);
unsigned int back = 0xffffff;
unsigned int* pData32 = (unsigned int*)pData;
unsigned int* pData32End = pData32 + nRasterW * nRasterH;
//дефолтный тон должен быть прозрачным, а не белым
while (pData32 < pData32End)
*pData32++ = back;
unsigned int back = 0xffffff;
unsigned int* pData32 = (unsigned int*)pData;
unsigned int* pData32End = pData32 + nRasterW * nRasterH;
//дефолтный тон должен быть прозрачным, а не белым
while (pData32 < pData32End)
*pData32++ = back;
CBgraFrame oFrame;
oFrame.put_Data(pData);
oFrame.put_Width(nRasterW);
oFrame.put_Height(nRasterH);
oFrame.put_Stride(4 * nRasterW);
CBgraFrame oFrame;
oFrame.put_Data(pData);
oFrame.put_Width(nRasterW);
oFrame.put_Height(nRasterH);
oFrame.put_Stride(4 * nRasterW);
pRasterRenderer->CreateFromBgraFrame(&oFrame);
pRasterRenderer->SetSwapRGB(false);
pRasterRenderer->CreateFromBgraFrame(&oFrame);
pRasterRenderer->SetSwapRGB(false);
double dW_MM = nRasterW * 25.4 / 96;
double dH_MM = nRasterH * 25.4 / 96;
double dW_MM = nRasterW * 25.4 / 96;
double dH_MM = nRasterH * 25.4 / 96;
pRasterRenderer->put_Width(dW_MM);
pRasterRenderer->put_Height(dH_MM);
pRasterRenderer->put_Width(dW_MM);
pRasterRenderer->put_Height(dH_MM);
MetaFile::IMetaFile* pMetafile = MetaFile::Create(pFonts);
pMetafile->LoadFromFile(L"D:\\test\\123.svg");
MetaFile::IMetaFile* pMetafile = MetaFile::Create(pFonts);
pMetafile->LoadFromFile(L"D:\\test\\123.svg");
double x = 0, y = 0, w = 0, h = 0;
pMetafile->GetBounds(&x, &y, &w, &h);
double x = 0, y = 0, w = 0, h = 0;
pMetafile->GetBounds(&x, &y, &w, &h);
pMetafile->DrawOnRenderer(pRasterRenderer, dW_MM / 4, dW_MM / 4, dW_MM / 2, dH_MM / 2);
pMetafile->ConvertToRaster(L"D:\\SVG\\out2.png", 4, 1000);
pMetafile->DrawOnRenderer(pRasterRenderer, dW_MM / 4, dW_MM / 4, dW_MM / 2, dH_MM / 2);
pMetafile->ConvertToRaster(L"D:\\SVG\\out2.png", 4, 1000);
oFrame.SaveFile(L"D:\\SVG\\out.png", 4);
oFrame.SaveFile(L"D:\\SVG\\out.png", 4);
RELEASEOBJECT(pMetafile);
RELEASEINTERFACE(pManager);
RELEASEINTERFACE(pRasterRenderer);
return 0;
RELEASEOBJECT(pMetafile);
RELEASEINTERFACE(pManager);
RELEASEINTERFACE(pRasterRenderer);
return 0;
#endif
#ifdef ONLINE_WORD_TO_PDF
CPdfFile oPdfW(pFonts);
oPdfW.CreatePdf();
oPdfW.SetTempDirectory(L"C:\\Git\\Test\\Temp");
oPdfW.OnlineWordToPdf(L"C:\\Git\\Test\\123.txt", L"C:\\Git\\Test\\123.pdf");
RELEASEOBJECT(pFonts);
return 0;
CPdfFile oPdfW(pFonts);
oPdfW.CreatePdf();
oPdfW.SetTempDirectory(L"C:\\Git\\Test\\Temp");
oPdfW.OnlineWordToPdf(L"C:\\Git\\Test\\123.txt", L"C:\\Git\\Test\\123.pdf");
RELEASEOBJECT(pFonts);
return 0;
#endif
//std::wstring sFile = L"\\\\KIRILLOV8\\_Office\\PDF\\Android intro(2p).pdf";
//std::wstring sFile = L"D:\\activex\\Pi(1p).pdf";
//std::wstring sFile = L"\\\\192.168.3.208\\allusers\\Files\\PDF\\AllPDF\\asia.pdf";
//std::wstring sFile = L"D:\\knut.djvu";
//std::wstring sFile = L"D:\\bankomats.xps";
//std::wstring sFile = L"\\\\kirillov8\\_Office\\DJVU\\Основы разработки приложений на платформе Microsoft .NET Framework. Учебный курс Microsoft экзамен 70-536.djvu";
//std::wstring sFile = L"D:\\TESTFILES\\Алгоритмы - построение и анализ.djvu";
//std::wstring sFile = L"\\\\KIRILLOV8\\_Office\\PDF\\Android intro(2p).pdf";
//std::wstring sFile = L"D:\\activex\\Pi(1p).pdf";
//std::wstring sFile = L"\\\\192.168.3.208\\allusers\\Files\\PDF\\AllPDF\\asia.pdf";
//std::wstring sFile = L"D:\\knut.djvu";
//std::wstring sFile = L"D:\\bankomats.xps";
//std::wstring sFile = L"\\\\kirillov8\\_Office\\DJVU\\Основы разработки приложений на платформе Microsoft .NET Framework. Учебный курс Microsoft экзамен 70-536.djvu";
//std::wstring sFile = L"D:\\TESTFILES\\Алгоритмы - построение и анализ.djvu";
#ifndef WIN32
std::wstring sFile = L"/home/oleg/GIT/ddd/ZfAvCwDsowJALpClgmE_/source/ZfAvCwDsowJALpClgmE_.pdf";
std::wstring sFile = L"/home/oleg/GIT/ddd/ZfAvCwDsowJALpClgmE_/source/ZfAvCwDsowJALpClgmE_.pdf";
#else
//std::wstring sFile = L"D:\\ddd\\ZfAvCwDsowJALpClgmE_\\source\\ZfAvCwDsowJALpClgmE_.pdf";
//std::wstring sFile = L"D:\\2.pdf";
std::wstring sFile = L"D:\\OoPdfFormExample2.pdf";
//std::wstring sFile = L"D:\\ddd\\ZfAvCwDsowJALpClgmE_\\source\\ZfAvCwDsowJALpClgmE_.pdf";
//std::wstring sFile = L"D:\\2.pdf";
std::wstring sFile = L"D:\\OoPdfFormExample2.pdf";
#endif
#ifdef WIN32
std::wstring sDst = L"D:\\test\\Document";
std::wstring sDst = L"D:\\test\\Document";
#else
std::wstring sDst = L"/home/oleg/test/Document";
std::wstring sDst = L"/home/oleg/test/Document";
#endif
//std::wstring sFile = L"/home/oleg/activex/Android intro(2p).pdf";
//std::wstring sFile = L"/home/oleg/activex/Pi(1p).pdf";
//std::wstring sFile = L"/home/oleg/activex/knut.djvu";
//std::wstring sFile = L"/home/oleg/activex/bankomats.xps";
//std::wstring sDst = L"/home/oleg/activex/1";
//std::wstring sFile = L"/home/oleg/activex/Android intro(2p).pdf";
//std::wstring sFile = L"/home/oleg/activex/Pi(1p).pdf";
//std::wstring sFile = L"/home/oleg/activex/knut.djvu";
//std::wstring sFile = L"/home/oleg/activex/bankomats.xps";
//std::wstring sDst = L"/home/oleg/activex/1";
//NSFonts::NSApplicationFontStream::SetGlobalMemoryStorage(NSFonts::NSApplicationFontStream::CreateDefaultGlobalMemoryStorage());
//NSFonts::NSApplicationFontStream::SetGlobalMemoryStorage(NSFonts::NSApplicationFontStream::CreateDefaultGlobalMemoryStorage());
IOfficeDrawingFile* pReader = NULL;
pReader = new CPdfFile(pFonts);
//pReader = new CDjVuFile(pFonts);
//pReader = new CXpsFile(pFonts);
IOfficeDrawingFile* pReader = NULL;
pReader = new CPdfFile(pFonts);
//pReader = new CDjVuFile(pFonts);
//pReader = new CXpsFile(pFonts);
pReader->SetTempDirectory(sDst);
pReader->LoadFromFile(sFile);
pReader->SetTempDirectory(sDst);
pReader->LoadFromFile(sFile);
pReader->ConvertToRaster(0, L"D:\\111.png", 4);
pReader->ConvertToRaster(0, L"D:\\111.png", 4);
#ifdef TO_HTML_RENDERER
NSHtmlRenderer::CASCHTMLRenderer3 oRenderer;
NSHtmlRenderer::CASCHTMLRenderer3 oRenderer;
#ifdef ONLY_TEXT
oRenderer.SetOnlyTextMode(true);
oRenderer.CreateOfficeFile(L"temp/temp");
oRenderer.SetOnlyTextMode(true);
oRenderer.CreateOfficeFile(L"temp/temp");
#else
oRenderer.CreateOfficeFile(sDst);
oRenderer.CreateOfficeFile(sDst);
#endif
#else
CPdfFile oRenderer(pFonts);
oRenderer.SetTempDirectory(sDst);
CPdfFile oRenderer(pFonts);
oRenderer.SetTempDirectory(sDst);
#endif
int nPagesCount = pReader->GetPagesCount();
for (int i = 0; i < nPagesCount; ++i)
{
oRenderer.NewPage();
oRenderer.BeginCommand(c_nPageType);
int nPagesCount = pReader->GetPagesCount();
for (int i = 0; i < nPagesCount; ++i)
{
oRenderer.NewPage();
oRenderer.BeginCommand(c_nPageType);
double dPageDpiX, dPageDpiY;
double dWidth, dHeight;
pReader->GetPageInfo(i, &dWidth, &dHeight, &dPageDpiX, &dPageDpiY);
double dPageDpiX, dPageDpiY;
double dWidth, dHeight;
pReader->GetPageInfo(i, &dWidth, &dHeight, &dPageDpiX, &dPageDpiY);
dWidth *= 25.4 / dPageDpiX;
dHeight *= 25.4 / dPageDpiY;
dWidth *= 25.4 / dPageDpiX;
dHeight *= 25.4 / dPageDpiY;
oRenderer.put_Width(dWidth);
oRenderer.put_Height(dHeight);
oRenderer.put_Width(dWidth);
oRenderer.put_Height(dHeight);
#ifdef ONLY_TEXT
oRenderer.SetAdditionalParam("DisablePageEnd", L"yes");
oRenderer.SetAdditionalParam("DisablePageEnd", L"yes");
#endif
pReader->DrawPageOnRenderer(&oRenderer, i, NULL);
pReader->DrawPageOnRenderer(&oRenderer, i, NULL);
#ifdef ONLY_TEXT
oRenderer.SetAdditionalParam("DisablePageEnd", L"no");
oRenderer.SetAdditionalParam("DisablePageEnd", L"no");
int paragraphs = 0;
int words = 0;
int symbols = 0;
int spaces = 0;
std::string info;
oRenderer.GetLastPageInfo(paragraphs, words, symbols, spaces, info);
int paragraphs = 0;
int words = 0;
int symbols = 0;
int spaces = 0;
std::string info;
oRenderer.GetLastPageInfo(paragraphs, words, symbols, spaces, info);
#endif
oRenderer.EndCommand(c_nPageType);
}
oRenderer.EndCommand(c_nPageType);
}
#ifdef TO_HTML_RENDERER
#ifndef ONLY_TEXT
oRenderer.CloseFile();
oRenderer.CloseFile();
#endif
#else
oRenderer.SaveToFile(L"D:/11.pdf");
oRenderer.SaveToFile(L"D:/11.pdf");
#endif
RELEASEOBJECT(pFonts);
return 0;
RELEASEOBJECT(pFonts);
return 0;
}

View File

@ -62,11 +62,11 @@ namespace ODRAW
std::vector<long> m_arAbsMaxAdjustments;
std::vector<long> m_arAdjustments;
std::vector<double> m_arGuides;
LONG m_eJoin;
long m_eJoin;
bool m_bConcentricFill;
bool m_bCustomShape;
std::vector<SimpleTypes::CPoint> m_arConnectors;
std::vector<LONG> m_arConnectorAngles;
std::vector<long> m_arConnectorAngles;
std::vector<Aggplus::RECT> m_arTextRects;
@ -77,8 +77,8 @@ namespace ODRAW
std::wstring m_strPath;
std::wstring m_strRect;
LONG m_lLimoX;
LONG m_lLimoY;
int m_lLimoX;
int m_lLimoY;
CPath m_oPath;

View File

@ -511,9 +511,9 @@ namespace NSCustomVML
(*m_pAdjustValues)[lIndex] = lValue;
}
void CCustomVML::SetAdjusts(std::vector<LONG>* pList)
void CCustomVML::SetAdjusts(std::vector<long>* pValues)
{
m_pAdjustValues = pList;
m_pAdjustValues = pValues;
}
void CCustomVML::ToCustomShape(ODRAW::CBaseShape* pShape, NSGuidesVML::CFormulasManager& oManager)
{

View File

@ -93,7 +93,7 @@ namespace NSCustomVML
std::vector<Aggplus::POINT> m_arVertices;
std::vector<CSegment> m_arSegments;
std::vector<CGuide> m_arGuides;
std::vector<LONG>* m_pAdjustValues;
std::vector<long>* m_pAdjustValues;
std::vector<Aggplus::POINT> m_arConnectionSites;
std::vector<Aggplus::RECT> m_arInscribe;
std::vector<double> m_arConnectionSitesDir;
@ -128,7 +128,7 @@ namespace NSCustomVML
void addGuide(CGuide & oInfo);
void addAdjust(int lIndex, int lValue);
void SetAdjusts(std::vector<LONG>* pList);
void SetAdjusts(std::vector<long>* pList);
void ToCustomShape(ODRAW::CBaseShape* pShape, NSGuidesVML::CFormulasManager& oManager);
};
}

View File

@ -463,7 +463,7 @@ namespace NSGuidesVML
arAdj.push_back(0);
}
LONG lVal = (LONG)(dScale * arAdj[oHandle.gdRef.y]);
int lVal = (int)(dScale * arAdj[oHandle.gdRef.y]);
arAdj[oHandle.gdRef.y] = lVal;
}

View File

@ -275,7 +275,7 @@ namespace NSGuidesVML
m_arFormulas.clear();
m_arResults.clear();
}
void CFormulasManager::Clear(std::vector<LONG>* pAdjusts)
void CFormulasManager::Clear(std::vector<long>* pAdjusts)
{
m_pAdjustments = pAdjusts;

View File

@ -274,8 +274,8 @@ namespace NSGuidesVML
class CFormulasManager
{
public:
std::vector<LONG>* m_pAdjustments;
std::vector<LONG> m_arResults;
std::vector<long>* m_pAdjustments;
std::vector<long> m_arResults;
std::vector<CFormula> m_arFormulas;
@ -289,7 +289,7 @@ namespace NSGuidesVML
CFormulasManager& operator =(const CFormulasManager& oSrc);
void Clear();
void Clear(std::vector<LONG>* pAdjusts);
void Clear(std::vector<long>* pAdjusts);
void AddFormula(std::wstring strFormula);
void AddFormula(CFormula oFormula);

View File

@ -35,7 +35,6 @@
#include "../../../DocFile/OfficeDrawing/PresetShapeTypes.h"
#include <boost/lexical_cast.hpp>
//-------------------------------------------------------------------------------
//#define CREATE_BY_SPT(SHAPE_TYPE, CLASS_SHAPE_NAME) \
// case SHAPE_TYPE: { pShape = new CLASS_SHAPE_NAME(); break; } \
@ -631,68 +630,50 @@ CPPTShape* CPPTShape::CreateByShapeType(DocFileFormat::ShapeType* pShapeType)
}
// Connectors
if (pShapeType->ConnectorLocations.length())
if (false == pShapeType->ConnectorLocations.empty())
{
pShape->LoadConnectorsList(pShapeType->ConnectorLocations);
}
// TextRect
if (pShapeType->TextBoxRectangle.length())
if (false == pShapeType->TextBoxRectangle.empty())
{
pShape->LoadTextRect(pShapeType->TextBoxRectangle);
}
// Handles
for (std::list<DocFileFormat::Handle>::iterator iter = pShapeType->Handles.begin(); iter != pShapeType->Handles.end(); ++iter)
// Handles // todooo - убрать лишнее определение Handle !!!
for (size_t i = 0; i < pShapeType->Handles.size(); ++i)
{
CHandle_ oHandle;
oHandle.position = iter->position;
oHandle.xrange = iter->xrange;
oHandle.yrange = iter->yrange;
oHandle.switchHandle = iter->switchHandle;
oHandle.polar = iter->polar;
oHandle.radiusrange = iter->radiusrange;
oHandle.position = pShapeType->Handles[i].position;
oHandle.xrange = pShapeType->Handles[i].xrange;
oHandle.yrange = pShapeType->Handles[i].yrange;
oHandle.switchHandle = pShapeType->Handles[i].switchHandle;
oHandle.polar = pShapeType->Handles[i].polar;
oHandle.radiusrange = pShapeType->Handles[i].radiusrange;
pShape->m_arHandles.push_back(oHandle);
}
// Formulas / Guides
for (std::list<std::wstring>::iterator iter = pShapeType->Formulas.begin(); iter != pShapeType->Formulas.end(); ++iter)
for (size_t i = 0; i < pShapeType->Formulas.size(); ++i)
{
pShape->AddGuide(iter->c_str());
pShape->AddGuide(pShapeType->Formulas[i]);
}
// Adjustments
if (pShapeType->AdjustmentValues.length())
{
std::vector<std::wstring> adjArray;
boost::algorithm::split(adjArray, pShapeType->AdjustmentValues, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
for (size_t i = 0; i < adjArray.size(); ++i)
{
pShape->m_arAdjustments.push_back(boost::lexical_cast<double>(adjArray[i].c_str()));
}
}
pShape->m_arAdjustments = pShapeType->Adjustments;
// ConnectorAngles
if (pShapeType->ConnectorAngles.length())
{
std::vector<std::wstring> anglesArray;
boost::algorithm::split(anglesArray, pShapeType->ConnectorAngles, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
for (size_t i = 0; i < anglesArray.size(); ++i)
{
pShape->m_arConnectorAngles.push_back(boost::lexical_cast<LONG>(anglesArray[i].c_str()));
}
}
pShape->m_arConnectorAngles = pShapeType->ConnectorAngles;
// Limo
if (pShapeType->Limo.length())
if (false == pShapeType->Limo.empty())
{
std::vector<std::wstring> limoArray;
boost::algorithm::split(limoArray, pShapeType->Limo, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
if (limoArray.size() == 2)
{
pShape->m_lLimoX = boost::lexical_cast<long>(limoArray[0].c_str());
pShape->m_lLimoY = boost::lexical_cast<long>(limoArray[1].c_str());
pShape->m_lLimoX = boost::lexical_cast<int>(limoArray[0].c_str());
pShape->m_lLimoY = boost::lexical_cast<int>(limoArray[1].c_str());
}
}
}

View File

@ -133,9 +133,9 @@ namespace NSGuidesVML
{
LONG lVal = 0;
std::map<std::wstring, LONG>::iterator NumFmla = m_arMapFormula.find(strParam);
std::map<std::wstring, LONG>::iterator NumAdj = m_arMapAdj.find(strParam);
std::map<std::wstring, LONG>::iterator NumGuides = mapGuides.find(strParam);
std::map<std::wstring, long>::iterator NumFmla = m_arMapFormula.find(strParam);
std::map<std::wstring, long>::iterator NumAdj = m_arMapAdj.find(strParam);
std::map<std::wstring, long>::iterator NumGuides = mapGuides.find(strParam);
if (NumAdj != m_arMapAdj.end())
{

View File

@ -41,8 +41,8 @@ namespace NSGuidesVML
private:
std::vector<CSlice> m_arSlices;
CPPTShape* pPPTShape;
std::map<std::wstring, LONG> m_arMapFormula;
std::map<std::wstring, LONG> m_arMapAdj;
std::map<std::wstring, long> m_arMapFormula;
std::map<std::wstring, long> m_arMapAdj;
std::vector<CSlicePath> m_arSlicesPath;
LONG m_lIndexDst;
LONG m_lIndexAdj;

View File

@ -49,6 +49,15 @@ namespace DocFileFormat
ShapeType::~ShapeType()
{
}
std::wstring ShapeType::VectorToStr(std::vector<long> & arr) const
{
std::wstring sRes;
for (size_t i = 0; i < arr.size(); ++i)
{
sRes += std::to_wstring(arr[i]) + L",";
}
return sRes.empty() ? L"" : sRes.substr(sRes.size() - 1);
}
unsigned int ShapeType::GetTypeCode() const
{
return TypeCode;

View File

@ -34,6 +34,7 @@
#include "../IVisitable.h"
#include "../../Common/Base/XmlTools.h"
#include <boost/shared_ptr.hpp>
#include <vector>
namespace ODRAW
{
@ -280,57 +281,29 @@ namespace DocFileFormat
class ShapeType: public IVisitable
{
public:
ShapeType (unsigned int typeCode);
virtual ~ShapeType();
unsigned int GetTypeCode() const;
/// This string describes a sequence of commands that define the shapes path.
/// This string describes both the pSegmentInfo array and pVertices array in the shapes geometry properties.
std::wstring Path;
/// This specifies a list of formulas whose calculated values are referenced by other properties.
/// Each formula is listed on a separate line. Formulas are ordered, with the first formula having index 0.
/// This section can be omitted if the shape doesnt need any guides.
std::list<std::wstring> Formulas;
/// Specifies a comma-delimited list of parameters, or adjustment values,
/// used to define values for a parameterized formula.
/// These values represent the location of an adjust handle and may be
/// referenced by the geometry of an adjust handle or as a parameter guide function.
std::wstring AdjustmentValues;
/// These values specify the location of connection points on the shapes path.
/// The connection points are defined by a string consisting of pairs of x and y values, delimited by commas.
std::wstring ConnectorLocations;
/// This section specifies the properties of each adjust handle on the shape.
/// One adjust handle is specified per line.
/// The properties for each handle correspond to values of the ADJH structure
/// contained in the pAdjustHandles array in the shapes geometry properties.
std::list<Handle> Handles;
/// Specifies one or more text boxes inscribed inside the shape.
/// A textbox is defined by one or more sets of numbers specifying (in order) the left, top, right, and bottom points of the rectangle.
/// Multiple sets are delimited by a semicolon.
/// If omitted, the text box is the same as the geometrys bounding box.
std::wstring TextBoxRectangle;
bool ShapeConcentricFill;
/// Specifies what join style the shape has.
/// Since there is no UI for changing the join style,
/// all shapes of this type will always have the specified join style.
JoinStyle Joins;
/// Specifies the (x,y) coordinates of the limo stretch point.
/// Some shapes that have portions that should be constrained to a fixed aspect ratio, are designed with limo-stretch to keep those portions at the fixed aspect ratio.
std::wstring Limo;
/// Associated with each connection site, there is a direction which specifies at what angle elbow and curved connectors should attach to it
std::wstring ConnectorAngles;
/// Specifies if a shape of this type is filled by default
bool Filled;
/// Specifies if a shape of this type is stroked by default
bool Stroked;
/// Speicfies the locked properties of teh shape.
/// By default nothing is locked.
ODRAW::OfficeArtFOPTEPtr Lock;
///
std::wstring Textpath;
std::wstring VectorToStr(std::vector<long> & arr) const;
std::wstring Path;
std::vector<std::wstring> Formulas;
std::vector<long> Adjustments;
std::wstring ConnectorLocations;
std::vector<Handle> Handles;
std::wstring TextBoxRectangle;
std::vector<long> ConnectorAngles;
std::wstring Limo;
std::wstring Textpath;
JoinStyle Joins;
bool ShapeConcentricFill;
bool Filled;
bool Stroked;
ODRAW::OfficeArtFOPTEPtr Lock;
protected:
unsigned int TypeCode;

View File

@ -54,7 +54,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @1 @5 0");
Formulas.push_back( L"sum @2 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -128,7 +129,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @32 @5 0");
Formulas.push_back( L"sum @33 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -214,7 +216,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @39 @5 0");
Formulas.push_back( L"sum @40 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -295,7 +298,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @36 @5 0");
Formulas.push_back( L"sum @37 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -337,7 +341,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @11 @5 0");
Formulas.push_back( L"sum @12 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -379,7 +384,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @11 @5 0");
Formulas.push_back( L"sum @12 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -428,7 +434,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @16 @5 0");
Formulas.push_back( L"sum @17 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -477,7 +484,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @16 @5 0");
Formulas.push_back( L"sum @17 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -541,7 +549,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @25 @5 0");
Formulas.push_back( L"sum @26 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -587,7 +596,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @14 @5 0");
Formulas.push_back( L"sum @15 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -650,7 +660,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @25 @5 0");
Formulas.push_back( L"sum @26 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";
@ -745,7 +756,8 @@ namespace DocFileFormat
Formulas.push_back( L"sum @46 @5 0");
Formulas.push_back( L"sum @47 @5 0");
AdjustmentValues = L"1350";
Adjustments.push_back(1350);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@0,@0,@1,@2";

View File

@ -48,7 +48,12 @@ namespace DocFileFormat
Formulas.push_back( L"val #3");
Formulas.push_back( L"val #4");
AdjustmentValues = L"-5898240,,,21600,21600";
Adjustments.push_back(-5898240);
Adjustments.push_back(0);
Adjustments.push_back(0);
Adjustments.push_back(21600);
Adjustments.push_back(21600);
ConnectorLocations = L"0,0;21600,21600;0,21600";
Handle HandleOne;

View File

@ -52,9 +52,16 @@ namespace DocFileFormat
Formulas.push_back(L"prod @4 @3 10800");
Formulas.push_back(L"sum width 0 @5");
AdjustmentValues = L"16200,5400";
Adjustments.push_back(16200);
Adjustments.push_back(5400);
ConnectorLocations = L"@0,0;0,10800;@0,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,@1,@6,@2";
Handle one;
@ -82,9 +89,16 @@ namespace DocFileFormat
Formulas.push_back(L"prod @4 @3 10800");
Formulas.push_back(L"sum width 0 @5");
AdjustmentValues = L"16200,5400";
Adjustments.push_back(16200);
Adjustments.push_back(5400);
ConnectorLocations = L"10800,0;0,@0;10800,21600;21600,@0";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@1,0,@2,@6";
Handle one;
@ -110,9 +124,15 @@ namespace DocFileFormat
Formulas.push_back(L"prod #0 #1 10800");
Formulas.push_back(L"sum #0 0 @3");
AdjustmentValues = L"5400,5400";
Adjustments.push_back(5400);
Adjustments.push_back(5400);
ConnectorLocations = L"10800,0;0,@0;10800,21600;21600,@0";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@1,@4,@2,21600";
Handle one;
@ -138,9 +158,16 @@ namespace DocFileFormat
Formulas.push_back(L"prod #0 #1 10800");
Formulas.push_back(L"sum #0 0 @3");
AdjustmentValues = L"5400,5400";
Adjustments.push_back(5400);
Adjustments.push_back(5400);
ConnectorLocations = L"@0,0;0,10800;@0,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@4,@1,21600,@2";
Handle one;
@ -160,10 +187,21 @@ namespace DocFileFormat
Joins = miter;
Path = L"m,10800l@0,21600@0@3@2@3@2,21600,21600,10800@2,0@2@1@0@1@0,xe";
AdjustmentValues = L"4320,5400";
Adjustments.push_back(4320);
Adjustments.push_back(5400);
ConnectorLocations = L"@2,0;10800,@1;@0,0;0,10800;@0,21600;10800,@3;@2,21600;21600,10800";
ConnectorAngles = L"270,270,270,180,90,90,90,0";
TextBoxRectangle = L"@5,@1,@6,@3";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@5,@1,@6,@3";
Formulas.push_back(L"val #0");
Formulas.push_back(L"val #1");
@ -198,9 +236,20 @@ namespace DocFileFormat
Formulas.push_back(L"sum #1 0 @4");
Formulas.push_back(L"sum 21600 0 @5");
AdjustmentValues = L"5400,4320";
Adjustments.push_back(5400);
Adjustments.push_back(4320);
ConnectorLocations = L"10800,0;0,@0;@1,10800;0,@2;10800,21600;21600,@2;@3,10800;21600,@0";
ConnectorAngles = L"270,180,180,180,90,0,0,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@1,@5,@3,@6";
Handle one;
@ -231,7 +280,10 @@ namespace DocFileFormat
Formulas.push_back(L"prod @7 #2 @6");
Formulas.push_back(L"sum 21600 0 @8");
AdjustmentValues = L"6480,8640,4320";
Adjustments.push_back(6480);
Adjustments.push_back(8640);
Adjustments.push_back(4320);
ConnectorLocations = L"Rectangle";
TextBoxRectangle = L"@8,@1,@9,@4;@1,@8,@4,@9";
@ -276,9 +328,17 @@ namespace DocFileFormat
Formulas.push_back(L"sum @1 0 10800");
Formulas.push_back(L"prod @2 @16 @15");
AdjustmentValues = L"6480,8640,6171";
Adjustments.push_back(6480);
Adjustments.push_back(8640);
Adjustments.push_back(6171);
ConnectorLocations = L"10800,0;0,@8;10800,@9;21600,@8";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@13,@6,@14,@9;@1,@17,@4,@9";
Handle one;
@ -304,7 +364,12 @@ namespace DocFileFormat
Path = L"m21600,6079l15126,r,2912l12427,2912c5564,2912,,7052,,12158r,9442l6474,21600r,-9442c6474,10550,9139,9246,12427,9246r2699,l15126,12158,21600,6079xe";
ConnectorLocations = L"2830950,0;2830950,2722432;605830,4836695;4042610,1361216";
ConnectorAngles = L"270,90,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"12427,2912,18227,9246";
}
};
@ -319,7 +384,13 @@ namespace DocFileFormat
Path = L"m15662,14285l21600,8310r-2970,qy9250,,,8485l,21600r6110,l6110,8310qy8907,5842l9725,5842qx12520,8310l9725,8310xe";
ConnectorLocations = L"9250,0;3055,21600;9725,8310;15662,14285;21600,8310";
ConnectorAngles = L"270,90,90,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,8310,6110,21600";
}
};
@ -347,10 +418,22 @@ namespace DocFileFormat
Formulas.push_back(L"sum #0 0 @4");
Formulas.push_back(L"prod @2 @10 @11");
AdjustmentValues = L"9257,18514,6171";
Adjustments.push_back(9257);
Adjustments.push_back(18514);
Adjustments.push_back(6171);
ConnectorLocations = L"@4,0;@0,@2;@2,@0;0,@4;@2,21600;@7,@1;@1,@7;21600,@2";
ConnectorAngles = L"270,180,270,180,90,90,0,0";
TextBoxRectangle = L"@12,@5,@1,@1;@5,@12,@1,@1";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@12,@5,@1,@1;@5,@12,@1,@1";
Handle one;
one.position = L"#0,topLeft";
@ -394,9 +477,19 @@ namespace DocFileFormat
Formulas.push_back(L"sum @0 0 @4");
Formulas.push_back(L"prod @2 @15 @16");
AdjustmentValues = L"9257,18514,7200";
Adjustments.push_back(9257);
Adjustments.push_back(18514);
Adjustments.push_back(7200);
ConnectorLocations = L"@4,0;@0,@2;0,@11;@14,21600;@1,@13;21600,@2";
ConnectorAngles = L"270,180,180,90,0,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,@12,@1,21600;@5,@17,@1,21600";
@ -472,9 +565,18 @@ namespace DocFileFormat
Formulas.push_back(L"prod height 4390 32768");
Formulas.push_back(L"prod height 28378 32768");
AdjustmentValues = L"12960,19440,14400";
Adjustments.push_back(12960);
Adjustments.push_back(19440);
Adjustments.push_back(14400);
ConnectorLocations = L"0,@17;@2,@14;@22,@8;@2,@12;@22,@16";
ConnectorAngles = L"180,90,0,0,0";
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@47,@45,@48,@46";
Handle one;
@ -549,10 +651,19 @@ namespace DocFileFormat
Formulas.push_back(L"prod height 4390 32768");
Formulas.push_back(L"prod height 28378 32768");
AdjustmentValues = L"12960,19440,14400";
ConnectorLocations = L"0,@17;@2,@14;@22,@8;@2,@12;@22,@16";
ConnectorAngles = L"180,90,0,0,0";
TextBoxRectangle = L"@47,@45,@48,@46";
Adjustments.push_back(12960);
Adjustments.push_back(19440);
Adjustments.push_back(7200);
ConnectorLocations = L"0,@15;@2,@11;0,@8;@2,@13;@21,@16";
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@43,@41,@44,@42";
Handle one;
one.position = L"topLeft,#0";
@ -626,9 +737,18 @@ namespace DocFileFormat
Formulas.push_back(L"prod height 4390 32768");
Formulas.push_back(L"prod height 28378 32768");
AdjustmentValues = L"12960,19440,7200";
Adjustments.push_back(12960);
Adjustments.push_back(19440);
Adjustments.push_back(7200);
ConnectorLocations = L"@8,0;@11,@2;@15,0;@16,@21;@13,@2";
ConnectorAngles = L"270,270,270,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@41,@43,@42,@44";
Handle one;
@ -707,9 +827,18 @@ namespace DocFileFormat
Formulas.push_back(L"prod height 4390 32768");
Formulas.push_back(L"prod height 28378 32768");
AdjustmentValues = L"12960,19440,14400";
Adjustments.push_back(12960);
Adjustments.push_back(19440);
Adjustments.push_back(14400);
ConnectorLocations = L"@17,0;@16,@22;@12,@2;@8,@22;@14,@2";
ConnectorAngles = L"270,90,90,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@45,@47,@46,@48";
Handle one;
@ -746,9 +875,16 @@ namespace DocFileFormat
Formulas.push_back(L"prod @4 @3 10800");
Formulas.push_back(L"sum width 0 @5");
AdjustmentValues = L"16200,5400";
Adjustments.push_back(16200);
Adjustments.push_back(5400);
ConnectorLocations = L"@0,0;0,10800;@0,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"3375,@1,@6,@2";
Handle one;
@ -776,9 +912,16 @@ namespace DocFileFormat
Formulas.push_back(L"prod @4 @3 10800");
Formulas.push_back(L"sum width 0 @5");
AdjustmentValues = L"16200,5400";
Adjustments.push_back(16200);
Adjustments.push_back(5400);
ConnectorLocations = L"@0,0;@5,10800;@0,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@5,@1,@6,@2";
Handle one;
@ -801,9 +944,15 @@ namespace DocFileFormat
Formulas.push_back(L"val #0");
Formulas.push_back(L"prod #0 1 2");
AdjustmentValues = L"16200";
Adjustments.push_back(16200);
ConnectorLocations = L"@1,0;0,10800;@1,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,0,10800,21600;0,0,16200,21600;0,0,21600,21600";
Handle one;
@ -826,9 +975,15 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 @0");
Formulas.push_back(L"prod #0 1 2");
AdjustmentValues = L"16200";
Adjustments.push_back(16200);
ConnectorLocations = L"@2,0;@1,10800;@2,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,0,10800,21600;0,0,16200,21600;0,0,21600,21600";
Handle one;
@ -854,10 +1009,19 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 #1");
Formulas.push_back(L"sum 21600 0 #3");
Formulas.push_back(L"prod #0 1 2");
Adjustments.push_back(14400);
Adjustments.push_back(5400);
Adjustments.push_back(18000);
Adjustments.push_back(8100);
AdjustmentValues = L"14400,5400,18000,8100";
ConnectorLocations = L"@6,0;0,10800;@6,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,0,@0,21600";
Handle one;
@ -895,9 +1059,18 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 #3");
Formulas.push_back(L"sum #0 21600 0");
AdjustmentValues = L"7200,5400,3600,8100";
Adjustments.push_back(7200);
Adjustments.push_back(5400);
Adjustments.push_back(3600);
Adjustments.push_back(8100);
ConnectorLocations = L"@7,0;0,10800;@7,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@0,0,21600,21600";
Handle one;
@ -936,9 +1109,18 @@ namespace DocFileFormat
Formulas.push_back(L"sum #0 21600 0");
Formulas.push_back(L"prod @6 1 2");
AdjustmentValues = L"7200,5400,3600,8100";
Adjustments.push_back(7200);
Adjustments.push_back(5400);
Adjustments.push_back(3600);
Adjustments.push_back(8100);
ConnectorLocations = L"10800,0;0,@7;10800,21600;21600,@7";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,@0,21600,21600";
Handle one;
@ -976,9 +1158,18 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 #3");
Formulas.push_back(L"prod #0 1 2");
AdjustmentValues = L"14400,5400,18000,8100";
Adjustments.push_back(14400);
Adjustments.push_back(5400);
Adjustments.push_back(18000);
Adjustments.push_back(8100);
ConnectorLocations = L"10800,0;0,@6;10800,21600;21600,@6";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,0,21600,@0";
Handle one;
@ -1019,9 +1210,18 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 #0");
Formulas.push_back(L"sum 21600 0 #2");
AdjustmentValues = L"5400,5400,2700,8100";
Adjustments.push_back(5400);
Adjustments.push_back(5400);
Adjustments.push_back(2700);
Adjustments.push_back(8100);
ConnectorLocations = L"10800,0;0,10800;10800,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@0,0,@8,21600";
Handle one;
@ -1062,9 +1262,18 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 #0");
Formulas.push_back(L"sum 21600 0 #2");
AdjustmentValues = L"5400,5400,2700,8100";
Adjustments.push_back(5400);
Adjustments.push_back(5400);
Adjustments.push_back(2700);
Adjustments.push_back(8100);
ConnectorLocations = L"10800,0;0,10800;10800,21600;21600,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,@0,21600,@8";
Handle one;
@ -1105,7 +1314,11 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 #0");
Formulas.push_back(L"sum 21600 0 #2");
AdjustmentValues = L"5400,8100,2700,9450";
Adjustments.push_back(5400);
Adjustments.push_back(8100);
Adjustments.push_back(2700);
Adjustments.push_back(9450);
ConnectorLocations = L"Rectangle";
TextBoxRectangle = L"@0,@0,@8,@8";
@ -1135,8 +1348,6 @@ namespace DocFileFormat
ShapeConcentricFill = false;
Joins = miter;
AdjustmentValues = L"-11796480,,5400";
Path = L"al10800,10800@8@8@4@6,10800,10800,10800,10800@9@7l@30@31@17@18@24@25@15@16@32@33xe";
Formulas.push_back(L"val #1");
@ -1190,7 +1401,10 @@ namespace DocFileFormat
Formulas.push_back(L"sum @35 10800 0");
Formulas.push_back(L"sum @36 10800 0");
AdjustmentValues = L"-11796480,,5400";
Adjustments.push_back(-11796480);
Adjustments.push_back(0);
Adjustments.push_back(5400);
ConnectorLocations = L"@44,@45;@48,@49;@46,@47;@17,@18;@24,@25;@15,@16";
TextBoxRectangle = L"3163,3163,18437,18437";

View File

@ -54,7 +54,8 @@ namespace DocFileFormat
Formulas.push_back((L"sum @1 @5 0"));
Formulas.push_back((L"sum @2 @5 0"));
AdjustmentValues = (L"2700");
Adjustments.push_back(2700);
ConnectorLocations = (L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0");
TextBoxRectangle = (L"@0,@0,@1,@2");

View File

@ -88,7 +88,9 @@ namespace DocFileFormat
Formulas.push_back((L"if @4 @32 21600"));
Formulas.push_back((L"if @6 @41 @33"));
AdjustmentValues = (L"11796480,5400");
Adjustments.push_back(11796480);
Adjustments.push_back(5400);
ConnectorLocations = (L"10800,@27;@22,@23;10800,@26;@24,@23");
TextBoxRectangle = (L"@36,@40,@37,@42");

View File

@ -57,7 +57,8 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 @9");
Formulas.push_back(L"val #1");
AdjustmentValues = L"1800";
Adjustments.push_back(1800);
ConnectorLocations = L"0,0;21600,@11;0,21600";
TextBoxRectangle = L"0,@4,7637,@5";
@ -87,7 +88,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod #0 9598 32768");
Formulas.push_back(L"sum 21600 0 @2");
AdjustmentValues = L"1800";
Adjustments.push_back(1800);
ConnectorLocations = L"0,0;0,21600;21600,10800";
TextBoxRectangle = L"0,@2,15274,@3";
@ -120,7 +122,8 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 @9");
Formulas.push_back(L"val #1");
AdjustmentValues = L"1800,10800";
Adjustments.push_back(1800);
Adjustments.push_back(10800);
ConnectorLocations = L"21600,0;0,10800;21600,21600";
TextBoxRectangle = L"13963,@4,21600,@5";
@ -157,7 +160,9 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 @9");
Formulas.push_back(L"val #1");
AdjustmentValues = L"1800,10800";
Adjustments.push_back(1800);
Adjustments.push_back(10800);
ConnectorLocations = L"0,0;21600,@11;0,21600";
TextBoxRectangle = L"0,@4,7637,@5";
@ -197,7 +202,8 @@ namespace DocFileFormat
Formulas.push_back(L"sum @11 #0 0");
Formulas.push_back(L"sum width 0 @13");
AdjustmentValues = L"1800";
Adjustments.push_back(1800);
ConnectorLocations = L"@3,0;0,@4;@3,@2;@1,@4";
TextBoxRectangle = L"@13,@11,@14,@12";
@ -231,7 +237,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod width 1 2");
Formulas.push_back(L"prod height 1 2");
AdjustmentValues = L"1800";
Adjustments.push_back(1800);
ConnectorLocations = L"@8,0;0,@9;@8,@7;@6,@9";
TextBoxRectangle = L"@3,@3,@4,@5";

View File

@ -81,7 +81,9 @@ namespace DocFileFormat
Formulas.push_back(L"val #0");
Formulas.push_back(L"val #1");
AdjustmentValues = L"1350,25920";
Adjustments.push_back(1350);
Adjustments.push_back(25920);
ConnectorLocations = L"10800,0;0,10800;10800,21600;21600,10800;@34,@35";
Handle one;
@ -136,7 +138,8 @@ namespace DocFileFormat
Formulas.push_back(L"val #0");
Formulas.push_back(L"val #1");
AdjustmentValues = L"1350,25920";
Adjustments.push_back(1350);
Adjustments.push_back(25920);
ConnectorLocations = L"10800,0;0,10800;10800,21600;21600,10800;@34,@35";
TextBoxRectangle = L"791,791,20809,20809";
@ -179,7 +182,9 @@ namespace DocFileFormat
Formulas.push_back(L"if @20 #0 @13");
Formulas.push_back(L"if @20 #1 @14");
AdjustmentValues = L"1350,25920";
Adjustments.push_back(1350);
Adjustments.push_back(25920);
ConnectorLocations = L"10800,0;3163,3163;0,10800;3163,18437;10800,21600;18437,18437;21600,10800;18437,3163;@21,@22";
TextBoxRectangle = L"3163,3163,18437,18437";
@ -239,12 +244,14 @@ namespace DocFileFormat
Formulas.push_back(L"val #0");
Formulas.push_back(L"val #1");
AdjustmentValues = L"1350,25920";
Adjustments.push_back(1350);
Adjustments.push_back(25920);
ConnectorLocations = L"67,10800;10800,21577;21582,10800;10800,1235;@38,@39";
TextBoxRectangle = L"2977,3262,17087,17337";
Handle one;
one.position = L"#0,#1";
one.position = L"#0,#1";
Handles.push_back (one);
}
};
@ -263,7 +270,11 @@ namespace DocFileFormat
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-1800,24300,-1800,4050";
Adjustments.push_back(-1800);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -283,18 +294,23 @@ namespace DocFileFormat
{
ShapeConcentricFill = true;
Joins = miter;
Path = L"m@0@1l@2@3nfem,l21600,r,21600l,21600xe";
Path = L"m@0@1l@2@3nfem,l21600,r,21600l,21600xe";
Formulas.push_back(L"val #0");
Formulas.push_back(L"val #1");
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-8280,24300,-1800,4050";
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Adjustments.push_back(-8280);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
one.position = L"#0,#1";
one.position = L"#0,#1";
Handles.push_back (one);
Handle two;
@ -317,7 +333,13 @@ namespace DocFileFormat
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-10080,24300,-3600,4050,-1800,4050";
Adjustments.push_back(-10080);
Adjustments.push_back(24300);
Adjustments.push_back(-3600);
Adjustments.push_back(4050);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -346,7 +368,13 @@ namespace DocFileFormat
Formulas.push_back(L"val #4");
Formulas.push_back(L"val #5");
AdjustmentValues = L"-10080,24300,-3600,4050,-1800,4050";
Adjustments.push_back(-10080);
Adjustments.push_back(24300);
Adjustments.push_back(-3600);
Adjustments.push_back(4050);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -377,7 +405,10 @@ namespace DocFileFormat
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-1800,24300,-1800,4050";
Adjustments.push_back(-1800);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -404,7 +435,11 @@ namespace DocFileFormat
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-8280,24300,-1800,4050";
Adjustments.push_back(-8280);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -433,7 +468,11 @@ namespace DocFileFormat
Formulas.push_back(L"val #4");
Formulas.push_back(L"val #5");
AdjustmentValues = L"-8280,24300,-1800,4050";
Adjustments.push_back(-8280);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -468,7 +507,15 @@ namespace DocFileFormat
Formulas.push_back(L"val #6");
Formulas.push_back(L"val #7");
AdjustmentValues = L"23400,24400,25200,21600,25200,4050,23400,4050";
Adjustments.push_back(23400);
Adjustments.push_back(24400);
Adjustments.push_back(25200);
Adjustments.push_back(21600);
Adjustments.push_back(25200);
Adjustments.push_back(4050);
Adjustments.push_back(23400);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -503,7 +550,11 @@ namespace DocFileFormat
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-1800,24300,-1800,4050";
Adjustments.push_back(-1800);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -530,7 +581,11 @@ namespace DocFileFormat
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-8280,24300,-1800,4050";
Adjustments.push_back(-8280);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -559,7 +614,13 @@ namespace DocFileFormat
Formulas.push_back(L"val #4");
Formulas.push_back(L"val #5");
AdjustmentValues = L"-10080,24300,-3600,4050,-1800,4050";
Adjustments.push_back(-10080);
Adjustments.push_back(24300);
Adjustments.push_back(-3600);
Adjustments.push_back(4050);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -594,7 +655,15 @@ namespace DocFileFormat
Formulas.push_back(L"val #6");
Formulas.push_back(L"val #7");
AdjustmentValues = L"23400,24400,25200,21600,25200,4050,23400,4050";
Adjustments.push_back(23400);
Adjustments.push_back(24400);
Adjustments.push_back(25200);
Adjustments.push_back(21600);
Adjustments.push_back(25200);
Adjustments.push_back(4050);
Adjustments.push_back(23400);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -629,7 +698,11 @@ namespace DocFileFormat
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-1800,24300,-1800,4050";
Adjustments.push_back(-8280);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -656,7 +729,11 @@ namespace DocFileFormat
Formulas.push_back(L"val #2");
Formulas.push_back(L"val #3");
AdjustmentValues = L"-8280,24300,-1800,4050";
Adjustments.push_back(-8280);
Adjustments.push_back(24300);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -685,7 +762,13 @@ namespace DocFileFormat
Formulas.push_back(L"val #4");
Formulas.push_back(L"val #5");
AdjustmentValues = L"-10080,24300,-3600,4050,-1800,4050";
Adjustments.push_back(-10080);
Adjustments.push_back(24300);
Adjustments.push_back(-3600);
Adjustments.push_back(4050);
Adjustments.push_back(-1800);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;
@ -720,7 +803,15 @@ namespace DocFileFormat
Formulas.push_back(L"val #6");
Formulas.push_back(L"val #7");
AdjustmentValues = L"23400,24400,25200,21600,25200,4050,23400,4050";
Adjustments.push_back(23400);
Adjustments.push_back(24400);
Adjustments.push_back(25200);
Adjustments.push_back(21600);
Adjustments.push_back(25200);
Adjustments.push_back(4050);
Adjustments.push_back(23400);
Adjustments.push_back(4050);
ConnectorLocations = L"@0,@1;10800,0;10800,21600;0,10800;21600,10800";
Handle one;

View File

@ -41,28 +41,32 @@ namespace DocFileFormat
CanType():
ShapeType(msosptCan)
{
this->ShapeConcentricFill = true;
ShapeConcentricFill = true;
this->Joins = round;
Joins = round;
this->Path = L"m10800,qx0@1l0@2qy10800,21600,21600@2l21600@1qy10800,xem0@1qy10800@0,21600@1nfe";
Path = L"m10800,qx0@1l0@2qy10800,21600,21600@2l21600@1qy10800,xem0@1qy10800@0,21600@1nfe";
this->Formulas.push_back( L"val #0" );
this->Formulas.push_back( L"prod #0 1 2" );
this->Formulas.push_back( L"sum height 0 @1" );
Formulas.push_back( L"val #0" );
Formulas.push_back( L"prod #0 1 2" );
Formulas.push_back( L"sum height 0 @1" );
this->AdjustmentValues = L"5400";
Adjustments.push_back(5400);
this->ConnectorLocations = L"10800,@0;10800,0;0,10800;10800,21600;21600,10800";
ConnectorLocations = L"10800,@0;10800,0;0,10800;10800,21600;21600,10800";
this->ConnectorAngles = L"270,270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
this->TextBoxRectangle = L"0,@0,21600,@2";
TextBoxRectangle = L"0,@0,21600,@2";
Handle HandleOne;
HandleOne.position = L"center,#0";
HandleOne.yrange = L"0,10800";
this->Handles.push_back( HandleOne );
Handles.push_back( HandleOne );
}
virtual ~CanType()

View File

@ -56,7 +56,8 @@ namespace DocFileFormat
Formulas.push_back(L"val #0");
AdjustmentValues = L"10800";
Adjustments.push_back(10800);
ConnectorLocations = L"0,0;21600,21600";
}
};
@ -69,7 +70,6 @@ namespace DocFileFormat
ShapeConcentricFill = true;
Joins = miter;
Path = L"m,l21600,r,21600e";
//AdjustmentValues = L"10800";
Filled = true;
}
@ -82,11 +82,12 @@ namespace DocFileFormat
{
ShapeConcentricFill = true;
Joins = miter;
Path = L"m,l@0,0@0,21600,21600,21600e";
AdjustmentValues = L"10800";
Filled = true;
Path = L"m,l@0,0@0,21600,21600,21600e";
Adjustments.push_back(10800);
Formulas.push_back(L"val #0");
Handle one;
@ -102,11 +103,12 @@ namespace DocFileFormat
{
ShapeConcentricFill = true;
Joins = miter;
Path = L"m,l@0,0@0,21600,21600,21600e";
AdjustmentValues = L"10800";
Filled = true;
Path = L"m,l@0,0@0,21600,21600,21600e";
Adjustments.push_back(10800);
Formulas.push_back(L"val #0");
Handle one;
@ -122,10 +124,11 @@ namespace DocFileFormat
{
ShapeConcentricFill = true;
Joins = miter;
Path = L"m,l@0,0@0,21600,21600,21600e";
AdjustmentValues = L"10800";
Filled = true;
Path = L"m,l@0,0@0,21600,21600,21600e";
Adjustments.push_back(10800);
Formulas.push_back(L"val #0");
@ -142,13 +145,15 @@ namespace DocFileFormat
{
ShapeConcentricFill = true;
Joins = round;
Path = L"m,c@0,0@1,5400@1,10800@1,16200@2,21600,21600,21600e";
Formulas.push_back(L"mid #0 0");
Formulas.push_back(L"val #0");
Formulas.push_back(L"mid #0 21600");
AdjustmentValues = L"10800";
Adjustments.push_back(10800);
ConnectorLocations = L"0,0;21600,21600";
}
};

View File

@ -41,35 +41,39 @@ namespace DocFileFormat
CubeType():
ShapeType(msosptCube)
{
this->ShapeConcentricFill = true;
ShapeConcentricFill = true;
Joins = miter;
this->Joins = miter;
Path = L"m@0,l0@0,,21600@1,21600,21600@2,21600,xem0@0nfl@1@0,21600,em@1@0nfl@1,21600e";
this->Path = L"m@0,l0@0,,21600@1,21600,21600@2,21600,xem0@0nfl@1@0,21600,em@1@0nfl@1,21600e";
Formulas.push_back( L"val #0");
Formulas.push_back( L"sum width 0 #0");
Formulas.push_back( L"sum height 0 #0");
Formulas.push_back( L"mid height #0");
Formulas.push_back( L"prod @1 1 2");
Formulas.push_back( L"prod @2 1 2");
Formulas.push_back( L"mid width #0");
this->Formulas.push_back( L"val #0");
this->Formulas.push_back( L"sum width 0 #0");
this->Formulas.push_back( L"sum height 0 #0");
this->Formulas.push_back( L"mid height #0");
this->Formulas.push_back( L"prod @1 1 2");
this->Formulas.push_back( L"prod @2 1 2");
this->Formulas.push_back( L"mid width #0");
Adjustments.push_back(5400);
this->AdjustmentValues = L"5400";
ConnectorLocations = L"@6,0;@4,@0;0,@3;@4,21600;@1,@3;21600,@5";
this->ConnectorLocations = L"@6,0;@4,@0;0,@3;@4,21600;@1,@3;21600,@5";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
this->ConnectorAngles = L"270,270,180,90,0,0";
this->TextBoxRectangle = L"0,@0,@1,21600";
TextBoxRectangle = L"0,@0,@1,21600";
Handle HandleOne;
HandleOne.position = L"topLeft,#0";
HandleOne.switchHandle = L"true";
HandleOne.yrange = L"0,21600";
this->Handles.push_back( HandleOne );
Handles.push_back( HandleOne );
this->Limo = L"10800,10800";
Limo = L"10800,10800";
}
virtual ~CubeType()

View File

@ -51,7 +51,8 @@ namespace DocFileFormat
Formulas.push_back(L"sum width 0 @3" ) ;
Formulas.push_back(L"sum height 0 @3" );
AdjustmentValues = L"5400";
Adjustments.push_back(5400);
ConnectorLocations = L"10800,0;3163,3163;0,10800;3163,18437;10800,21600;18437,18437;21600,10800;18437,3163";
TextBoxRectangle = L"3163,3163,18437,18437";

View File

@ -70,7 +70,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod width 1 2");
Formulas.push_back(L"prod height 1 2");
AdjustmentValues = L"2700";
Adjustments.push_back(2700);
ConnectorLocations = L"@8,0;0,@9;@8,@7;@6,@9";
TextBoxRectangle = L"@3,@3,@4,@5";
Limo = L"10800,10800";
@ -144,9 +145,12 @@ namespace DocFileFormat
{
ShapeConcentricFill = true;
Joins = miter;
Path = L"m,20172v945,400,1887,628,2795,913c3587,21312,4342,21370,5060,21597v2037,,2567,-227,3095,-285c8722,21197,9325,20970,9855,20800v490,-228,945,-400,1472,-740c11817,19887,12347,19660,12875,19375v567,-228,1095,-513,1700,-740c15177,18462,15782,18122,16537,17950v718,-113,1398,-398,2228,-513c19635,17437,20577,17322,21597,17322l21597,,,xe";
Path = L"m,20172v945,400,1887,628,2795,913c3587,21312,4342,21370,5060,21597v2037,,2567,-227,3095,-285c8722,21197,9325,20970,9855,20800v490,-228,945,-400,1472,-740c11817,19887,12347,19660,12875,19375v567,-228,1095,-513,1700,-740c15177,18462,15782,18122,16537,17950v718,-113,1398,-398,2228,-513c19635,17437,20577,17322,21597,17322l21597,,,xe";
Adjustments.push_back(21600);
Adjustments.push_back(21600);
AdjustmentValues = L"21600,21600";
ConnectorLocations = L"10800,0;0,10800;10800,20400;21600,10800";
TextBoxRectangle = L"0,0,21600,17322";
}
@ -159,9 +163,12 @@ namespace DocFileFormat
{
ShapeConcentricFill = true;
Joins = miter;
Path = L"m,20465v810,317,1620,452,2397,725c3077,21325,3790,21417,4405,21597v1620,,2202,-180,2657,-272c7580,21280,8002,21010,8455,20917v422,-135,810,-405,1327,-542c10205,20150,10657,19967,11080,19742v517,-182,970,-407,1425,-590c13087,19017,13605,18745,14255,18610v615,-180,1262,-318,1942,-408c16975,18202,17785,18022,18595,18022r,-1670l19192,16252r808,l20000,14467r722,-75l21597,14392,21597,,2972,r,1815l1532,1815r,1860l,3675,,20465xem1532,3675nfl18595,3675r,12677em2972,1815nfl20000,1815r,12652e";
Path = L"m,20465v810,317,1620,452,2397,725c3077,21325,3790,21417,4405,21597v1620,,2202,-180,2657,-272c7580,21280,8002,21010,8455,20917v422,-135,810,-405,1327,-542c10205,20150,10657,19967,11080,19742v517,-182,970,-407,1425,-590c13087,19017,13605,18745,14255,18610v615,-180,1262,-318,1942,-408c16975,18202,17785,18022,18595,18022r,-1670l19192,16252r808,l20000,14467r722,-75l21597,14392,21597,,2972,r,1815l1532,1815r,1860l,3675,,20465xem1532,3675nfl18595,3675r,12677em2972,1815nfl20000,1815r,12652e";
Adjustments.push_back(21600);
Adjustments.push_back(21600);
AdjustmentValues = L"21600,21600";
ConnectorLocations = L"10800,0;0,10800;10800,19890;21600,10800";
TextBoxRectangle = L"0,3675,18595,18022";
}
@ -415,7 +422,13 @@ namespace DocFileFormat
Path = L"m10800,qx,3391l,18209qy10800,21600,21600,18209l21600,3391qy10800,xem,3391nfqy10800,6782,21600,3391e";
ConnectorLocations = L"10800,6782;10800,0;0,10800;10800,21600;21600,10800";
ConnectorAngles = L"270,270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"0,6782,21600,18209";
}
};
@ -430,7 +443,13 @@ namespace DocFileFormat
Path = L"m21600,10800qy18019,21600l3581,21600qx,10800,3581,l18019,qx21600,10800xem18019,21600nfqx14438,10800,18019,e";
ConnectorLocations = L"10800,0;0,10800;10800,21600;14438,10800;21600,10800";
ConnectorAngles = L"270,180,90,0,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"3581,0,14438,21600";
}
};

View File

@ -59,7 +59,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod @1 6144 32768");
Formulas.push_back(L"sum @12 @0 0");
AdjustmentValues = L"18900";
Adjustments.push_back(18900);
TextBoxRectangle = L"0,0,21600,@13";
Handle one;

View File

@ -40,14 +40,20 @@ namespace DocFileFormat
public:
HeartType () : ShapeType(msosptHeart)
{
ShapeConcentricFill = true;
Joins = miter;
Path = (L"m10860,2187c10451,1746,9529,1018,9015,730,7865,152,6685,,5415,,4175,152,2995,575,1967,1305,1150,2187,575,3222,242,4220,,5410,242,6560,575,7597l10860,21600,20995,7597v485,-1037,605,-2187,485,-3377c21115,3222,20420,2187,19632,1305,18575,575,17425,152,16275,,15005,,13735,152,12705,730v-529,288,-1451,1016,-1845,1457xe" );
ShapeConcentricFill = true;
Joins = miter;
Path = L"m10860,2187c10451,1746,9529,1018,9015,730,7865,152,6685,,5415,,4175,152,2995,575,1967,1305,1150,2187,575,3222,242,4220,,5410,242,6560,575,7597l10860,21600,20995,7597v485,-1037,605,-2187,485,-3377c21115,3222,20420,2187,19632,1305,18575,575,17425,152,16275,,15005,,13735,152,12705,730v-529,288,-1451,1016,-1845,1457xe";
AdjustmentValues = (L"21600" );
ConnectorLocations = (L"10860,2187;2928,10800;10860,21600;18672,10800" );
ConnectorAngles = (L"270,180,90,0" );
TextBoxRectangle = (L"5037,2277,16557,13677" );
Adjustments.push_back(21600);
ConnectorLocations = L"10860,2187;2928,10800;10860,21600;18672,10800";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"5037,2277,16557,13677";
}
};
}

View File

@ -41,24 +41,24 @@ namespace DocFileFormat
HexagonType():
ShapeType(msosptHexagon)
{
this->ShapeConcentricFill = true;
ShapeConcentricFill = true;
this->Joins = miter;
Joins = miter;
this->Path = L"m@0,l,10800@0,21600@1,21600,21600,10800@1,xe";
Path = L"m@0,l,10800@0,21600@1,21600,21600,10800@1,xe";
this->Formulas.push_back( L"val #0");
this->Formulas.push_back( L"sum width 0 #0");
this->Formulas.push_back( L"sum height 0 #0");
this->Formulas.push_back( L"prod @0 2929 10000");
this->Formulas.push_back( L"sum width 0 @3");
this->Formulas.push_back( L"sum height 0 @3");
Formulas.push_back( L"val #0");
Formulas.push_back( L"sum width 0 #0");
Formulas.push_back( L"sum height 0 #0");
Formulas.push_back( L"prod @0 2929 10000");
Formulas.push_back( L"sum width 0 @3");
Formulas.push_back( L"sum height 0 @3");
this->AdjustmentValues = L"5400";
Adjustments.push_back(5400);
this->ConnectorLocations = L"Rectangle";
ConnectorLocations = L"Rectangle";
this->TextBoxRectangle = L"1800,1800,19800,19800;3600,3600,18000,18000;6300,6300,15300,15300";
TextBoxRectangle = L"1800,1800,19800,19800;3600,3600,18000,18000;6300,6300,15300,15300";
Handle HandleOne;
HandleOne.position = L"#0,topLeft";

View File

@ -41,25 +41,25 @@ namespace DocFileFormat
IsoscelesTriangleType():
ShapeType(msosptIsocelesTriangle)
{
this->ShapeConcentricFill = true;
this->Joins = miter;
ShapeConcentricFill = true;
Joins = miter;
this->Path = L"m@0,l,21600r21600,xe" ;
Path = L"m@0,l,21600r21600,xe" ;
this->Formulas.push_back( L"val #0" );
this->Formulas.push_back( L"prod #0 1 2" );
this->Formulas.push_back( L"sum @1 10800 0");
Formulas.push_back( L"val #0" );
Formulas.push_back( L"prod #0 1 2" );
Formulas.push_back( L"sum @1 10800 0");
this->AdjustmentValues = L"10800" ;
Adjustments.push_back(10800);
this->ConnectorLocations = L"@0,0;@1,10800;0,21600;10800,21600;21600,21600;@2,10800";
ConnectorLocations = L"@0,0;@1,10800;0,21600;10800,21600;21600,21600;@2,10800";
this->TextBoxRectangle = L"0,10800,10800,18000;5400,10800,16200,18000;10800,10800,21600,18000;0,7200,7200,21600;7200,7200,14400,21600;14400,7200,21600,21600";
TextBoxRectangle = L"0,10800,10800,18000;5400,10800,16200,18000;10800,10800,21600,18000;0,7200,7200,21600;7200,7200,14400,21600;14400,7200,21600,21600";
Handle HandleOne;
HandleOne.position = L"#0,topLeft";
HandleOne.xrange = L"0,21600";
this->Handles.push_back( HandleOne );
Handles.push_back( HandleOne );
}
virtual ~IsoscelesTriangleType()

View File

@ -44,9 +44,16 @@ namespace DocFileFormat
Joins = miter;
Path = L"m8472,l,3890,7602,8382,5022,9705r7200,4192l10012,14915r11588,6685l14767,12877r1810,-870l11050,6797r1810,-717xe";
//AdjustmentValues = L"2700" );
ConnectorLocations = L"8472,0;0,3890;5022,9705;10012,14915;21600,21600;16577,12007;12860,6080";
ConnectorAngles = L"270,270,180,180,90,0,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"8757,7437,13917,14277";
}
};

View File

@ -62,9 +62,15 @@ namespace DocFileFormat
Formulas.push_back((L"sum 10800 0 @14"));
Formulas.push_back((L"sum @14 10800 0"));
AdjustmentValues = (L"10800");
Adjustments.push_back(10800);
ConnectorLocations = (L"21600,0;0,10800;21600,21600;@0,10800");
ConnectorAngles = (L"270,180,90,0");
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = (L"@12,@15,@0,@16");
Handle one;

View File

@ -62,7 +62,8 @@ namespace DocFileFormat
Formulas.push_back((L"sum 10800 0 @11" ));
Formulas.push_back((L"sum 21600 0 @0" ));
AdjustmentValues = (L"2700" );
Adjustments.push_back(2700);
ConnectorLocations = (L"10800,0;3163,3163;0,10800;3163,18437;10800,21600;18437,18437;21600,10800;18437,3163" );
TextBoxRectangle = (L"3163,3163,18437,18437" );

View File

@ -41,36 +41,36 @@ namespace DocFileFormat
OctagonType():
ShapeType(msosptOctagon)
{
this->ShapeConcentricFill = true;
ShapeConcentricFill = true;
this->Joins = miter;
Joins = miter;
this->Path = L"m@0,l0@0,0@2@0,21600@1,21600,21600@2,21600@0@1,xe";
Path = L"m@0,l0@0,0@2@0,21600@1,21600,21600@2,21600@0@1,xe";
this->Formulas.push_back( L"val #0");
this->Formulas.push_back( L"sum width 0 #0");
this->Formulas.push_back( L"sum height 0 #0");
this->Formulas.push_back( L"prod @0 2929 10000");
this->Formulas.push_back( L"sum width 0 @3");
this->Formulas.push_back( L"sum height 0 @3");
this->Formulas.push_back( L"val width");
this->Formulas.push_back( L"val height");
this->Formulas.push_back( L"prod width 1 2");
this->Formulas.push_back( L"prod height 1 2");
Formulas.push_back( L"val #0");
Formulas.push_back( L"sum width 0 #0");
Formulas.push_back( L"sum height 0 #0");
Formulas.push_back( L"prod @0 2929 10000");
Formulas.push_back( L"sum width 0 @3");
Formulas.push_back( L"sum height 0 @3");
Formulas.push_back( L"val width");
Formulas.push_back( L"val height");
Formulas.push_back( L"prod width 1 2");
Formulas.push_back( L"prod height 1 2");
this->AdjustmentValues = L"6326";
Adjustments.push_back(6326);
this->ConnectorLocations = L"@8,0;0,@9;@8,@7;@6,@9";
ConnectorLocations = L"@8,0;0,@9;@8,@7;@6,@9";
this->TextBoxRectangle = L"0,0,21600,21600;2700,2700,18900,18900;5400,5400,16200,16200";
TextBoxRectangle = L"0,0,21600,21600;2700,2700,18900,18900;5400,5400,16200,16200";
Handle HandleOne;
HandleOne.position = L"#0,topLeft";
HandleOne.switchHandle = L"true";
HandleOne.xrange = L"0,10800";
this->Handles.push_back( HandleOne );
Handles.push_back( HandleOne );
this->Limo = L"10800,10800";
Limo = L"10800,10800";
}
virtual ~OctagonType()

View File

@ -41,36 +41,36 @@ namespace DocFileFormat
ParallelogramType():
ShapeType(msosptParallelogram)
{
this->ShapeConcentricFill = true;
ShapeConcentricFill = true;
this->Joins = miter;
Joins = miter;
this->Path = L"m@0,l,21600@1,21600,21600,xe";
Path = L"m@0,l,21600@1,21600,21600,xe";
this->Formulas.push_back( L"val #0");
this->Formulas.push_back( L"sum width 0 #0");
this->Formulas.push_back( L"prod #0 1 2");
this->Formulas.push_back( L"sum width 0 @2");
this->Formulas.push_back( L"mid #0 width");
this->Formulas.push_back( L"mid @1 0");
this->Formulas.push_back( L"prod height width #0");
this->Formulas.push_back( L"prod @6 1 2");
this->Formulas.push_back( L"sum height 0 @7");
this->Formulas.push_back( L"prod width 1 2");
this->Formulas.push_back( L"sum #0 0 @9");
this->Formulas.push_back( L"if @10 @8 0");
this->Formulas.push_back( L"if @10 @7 height");
Formulas.push_back( L"val #0");
Formulas.push_back( L"sum width 0 #0");
Formulas.push_back( L"prod #0 1 2");
Formulas.push_back( L"sum width 0 @2");
Formulas.push_back( L"mid #0 width");
Formulas.push_back( L"mid @1 0");
Formulas.push_back( L"prod height width #0");
Formulas.push_back( L"prod @6 1 2");
Formulas.push_back( L"sum height 0 @7");
Formulas.push_back( L"prod width 1 2");
Formulas.push_back( L"sum #0 0 @9");
Formulas.push_back( L"if @10 @8 0");
Formulas.push_back( L"if @10 @7 height");
this->AdjustmentValues = L"5400";
Adjustments.push_back(5400);
this->ConnectorLocations = L"@4,0;10800,@11;@3,10800;@5,21600;10800,@12;@2,10800";
ConnectorLocations = L"@4,0;10800,@11;@3,10800;@5,21600;10800,@12;@2,10800";
this->TextBoxRectangle = L"1800,1800,19800,19800;8100,8100,13500,13500;10800,10800,10800,10800";
TextBoxRectangle = L"1800,1800,19800,19800;8100,8100,13500,13500;10800,10800,10800,10800";
Handle HandleOne;
HandleOne.position = L"#0,topLeft";
HandleOne.xrange = L"0,21600";
this->Handles.push_back( HandleOne );
Handles.push_back( HandleOne );
}
virtual ~ParallelogramType()

View File

@ -45,7 +45,14 @@ namespace DocFileFormat
Path = L"m10800,l,8259,4200,21600r13200,l21600,8259xe";
ConnectorLocations = L"10800,0;0,8259;4200,21600;10800,21600;17400,21600;21600,8259";
ConnectorAngles = L"270,180,90,90,90,0" ;
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"4200,5077,17400,21600";
}

View File

@ -41,31 +41,32 @@ namespace DocFileFormat
PlaqueType():
ShapeType(msosptPlaque)
{
this->ShapeConcentricFill = true;
this->Joins = miter;
this->Path = L"m@0,qy0@0l0@2qx@0,21600l@1,21600qy21600@2l21600@0qx@1,xe";
this->Formulas.push_back( L"val #0");
this->Formulas.push_back( L"sum width 0 #0");
this->Formulas.push_back( L"sum height 0 #0");
this->Formulas.push_back( L"prod @0 7071 10000");
this->Formulas.push_back( L"sum width 0 @3");
this->Formulas.push_back( L"sum height 0 @3");
this->Formulas.push_back( L"val width");
this->Formulas.push_back( L"val height");
this->Formulas.push_back( L"prod width 1 2");
this->Formulas.push_back( L"prod height 1 2");
ShapeConcentricFill = true;
Joins = miter;
Path = L"m@0,qy0@0l0@2qx@0,21600l@1,21600qy21600@2l21600@0qx@1,xe";
Formulas.push_back( L"val #0");
Formulas.push_back( L"sum width 0 #0");
Formulas.push_back( L"sum height 0 #0");
Formulas.push_back( L"prod @0 7071 10000");
Formulas.push_back( L"sum width 0 @3");
Formulas.push_back( L"sum height 0 @3");
Formulas.push_back( L"val width");
Formulas.push_back( L"val height");
Formulas.push_back( L"prod width 1 2");
Formulas.push_back( L"prod height 1 2");
this->AdjustmentValues = L"3600";
this->ConnectorLocations = L"@8,0;0,@9;@8,@7;@6,@9";
Adjustments.push_back(3600);
this->TextBoxRectangle = L"@3,@3,@4,@5";
ConnectorLocations = L"@8,0;0,@9;@8,@7;@6,@9";
TextBoxRectangle = L"@3,@3,@4,@5";
Handle HandleOne;
HandleOne.position = L"#0,topLeft";
HandleOne.switchHandle = L"true";
HandleOne.xrange = L"0,10800";
this->Handles.push_back( HandleOne );
Handles.push_back( HandleOne );
this->Limo = L"10800,10800";
Limo = L"10800,10800";
}
virtual ~PlaqueType()

View File

@ -58,7 +58,7 @@ namespace DocFileFormat
this->Formulas.push_back( L"prod width 1 2" );
this->Formulas.push_back( L"prod height 1 2" );
this->AdjustmentValues = L"5400";
Adjustments.push_back(5400);
this->ConnectorLocations = L"@8,0;0,@9;@8,@7;@6,@9";

View File

@ -42,7 +42,8 @@ namespace DocFileFormat
{
TypeCode = msosptRoundRectangle;
Joins = miter;
AdjustmentValues = L"5400";
Adjustments.push_back(5400);
Path = L"m0@0qy@0,0l@1,0qx21600@0l21600@1qy@1,21600l@0,21600qx0@1xe";

View File

@ -49,7 +49,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod @0 1 3" );
Formulas.push_back(L"sum @1 0 @2" );
AdjustmentValues = L"17520";
Adjustments.push_back(17520);
ConnectorLocations = L"10800,0;3163,3163;0,10800;3163,18437;10800,21600;18437,18437;21600,10800;18437,3163" ;
TextBoxRectangle = L"3163,3163,18437,18437" ;

View File

@ -64,7 +64,12 @@ namespace DocFileFormat
Path = L"m10800,5800l8352,2295,7312,6320,370,2295,4627,7617,,8615r3722,3160l135,14587r5532,-650l4762,17617,7715,15627r770,5973l10532,14935r2715,4802l14020,14457r4125,3638l16837,12942r4763,348l17607,10475,21097,8137,16702,7315,18380,4457r-4225,868l14522,xe";
ConnectorLocations = L"14522,0;0,8615;8485,21600;21600,13290";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"4627,6320,16702,13937";
}
};
@ -79,8 +84,13 @@ namespace DocFileFormat
Path = L"m11462,4342l9722,1887,8550,6382,4502,3625r870,4192l1172,8270r2763,3322l,12877r3330,2493l1285,17825r3520,415l4917,21600,7527,18125r1173,1587l9872,17370r1740,1472l12180,15935r2762,1435l14640,14350r4237,1282l16380,12310r1890,-1020l16985,9402,21600,6645,16380,6532,18007,3172,14525,5777,14790,xe";
ConnectorLocations = L"9722,1887;0,12877;11612,18842;21600,6645";
ConnectorAngles = L"270,180,90,0";
TextBoxRectangle = L"5372,6382,14640,15935";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"5372,6382,14640,15935";
}
};
@ -103,7 +113,7 @@ namespace DocFileFormat
ConnectorLocations = L"Rectangle";
TextBoxRectangle = L"@3,@3,@2,@2";
AdjustmentValues = L"8100";
Adjustments.push_back(8100);
Handle one;
one.position = L"#0,center";
@ -136,7 +146,7 @@ namespace DocFileFormat
ConnectorLocations = L"Rectangle";
TextBoxRectangle = L"@9,@9,@8,@8";
AdjustmentValues = L"2538";
Adjustments.push_back(2538);
Handle one;
one.position = L"#0,center";
@ -176,7 +186,7 @@ namespace DocFileFormat
ConnectorLocations = L"Rectangle";
TextBoxRectangle = L"@15,@15,@14,@14";
AdjustmentValues = L"2700";
Adjustments.push_back(2700);
Handle one;
one.position = L"#0,center";
@ -221,7 +231,7 @@ namespace DocFileFormat
ConnectorLocations = L"Rectangle";
TextBoxRectangle = L"@21,@21,@20,@20";
AdjustmentValues = L"2700";
Adjustments.push_back(2700);
Handle one;
one.position = L"#0,center";
@ -272,7 +282,7 @@ namespace DocFileFormat
ConnectorLocations = L"Rectangle";
TextBoxRectangle = L"@27,@27,@26,@26";
AdjustmentValues = L"2700";
Adjustments.push_back(2700);
Handle one;
one.position = L"#0,center";
@ -326,9 +336,13 @@ namespace DocFileFormat
ConnectorLocations = L"@25,0;2700,@22;@25,@10;@26,@22";
TextBoxRectangle = L"@0,0,@9,@10";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
AdjustmentValues = L"5400,18900";
Adjustments.push_back(5400);
Adjustments.push_back(18900);
Handle one;
one.position = L"#0,center";
@ -380,9 +394,13 @@ namespace DocFileFormat
ConnectorLocations = L"@18,@10;2700,@15;@18,21600;@19,@15";
TextBoxRectangle = L"@0,@10,@9,21600";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
AdjustmentValues = L"5400,2700";
Adjustments.push_back(5400);
Adjustments.push_back(2700);
Handle one;
one.position = L"#0,bottomRight";
@ -452,9 +470,17 @@ namespace DocFileFormat
Formulas.push_back(L"prod width 3 8");
Formulas.push_back(L"sum @42 0 4");
AdjustmentValues = L"5400,16200,2700";
Adjustments.push_back(5400);
Adjustments.push_back(16200);
Adjustments.push_back(2700);
ConnectorLocations = L"@6,0;@5,@36;@6,@1;@7,@36";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@0,@22,@19,@1";
Handle one;
@ -534,9 +560,17 @@ namespace DocFileFormat
Formulas.push_back(L"prod width 3 8");
Formulas.push_back(L"sum @46 0 4");
AdjustmentValues = L"5400,5400,18900";
Adjustments.push_back(5400);
Adjustments.push_back(5400);
Adjustments.push_back(18900);
ConnectorLocations = L"@6,@1;@5,@40;@6,@4;@7,@40";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@0,@1,@22,@25";
Handle one;
@ -583,9 +617,15 @@ namespace DocFileFormat
Formulas.push_back(L"prod height 1 2");
Formulas.push_back(L"prod width 1 2");
AdjustmentValues = L"2700";
Adjustments.push_back(2700);
ConnectorLocations = L"@14,0;@1,@13;@14,@12;@10,@13";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@1,@1,@10,@7";
Limo = L"10800,10800";
@ -623,9 +663,15 @@ namespace DocFileFormat
Formulas.push_back(L"prod width 1 2");
Formulas.push_back(L"prod height 1 2");
AdjustmentValues = L"2700";
Adjustments.push_back(2700);
ConnectorLocations = L"@13,@1;0,@14;@13,@10;@12,@14";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@1,@1,@7,@10";
Limo = L"10800,10800";
@ -687,9 +733,16 @@ namespace DocFileFormat
Formulas.push_back(L"mid @22 @23");
Formulas.push_back(L"mid @21 @25");
AdjustmentValues = L"2809,10800";
Adjustments.push_back(2809);
Adjustments.push_back(10800);
ConnectorLocations = L"@35,@0;@38,10800;@37,@4;@36,10800";
ConnectorAngles = L"270,180,90,0";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@31,@33,@32,@34";
Handle one;
@ -768,9 +821,16 @@ namespace DocFileFormat
Formulas.push_back(L"mid @36 @43");
Formulas.push_back(L"mid @30 @37");
AdjustmentValues = L"1404,10800";
ConnectorLocations = L"@40,@0;@51,10800;@33,@4;@50,10800";
ConnectorAngles = L"270,180,90,0";
Adjustments.push_back(1404);
Adjustments.push_back(10800);
ConnectorLocations = L"@40,@0;@51,10800;@33,@4;@50,10800";
ConnectorAngles.push_back(270);
ConnectorAngles.push_back(180);
ConnectorAngles.push_back(90);
ConnectorAngles.push_back(0);
TextBoxRectangle = L"@46,@48,@47,@49";
Handle one;

View File

@ -66,7 +66,8 @@ namespace DocFileFormat
Formulas.push_back(L"val #0");
Formulas.push_back(L"sum 21600 0 #0");
AdjustmentValues = L"5400";
Adjustments.push_back(5400);
ConnectorLocations = L"0,@4;@0,@4;@3,21600;@3,@2;21600,@4;@1,@4;@3,0;@3,@0";
TextBoxRectangle = L"@9,@9,@8,@8";

View File

@ -59,7 +59,8 @@ namespace DocFileFormat
Formulas.push_back( L"if @10 @8 0");
Formulas.push_back( L"if @10 @7 height");
AdjustmentValues = L"5400";
Adjustments.push_back(5400);
ConnectorLocations = L"@3,10800;10800,21600;@2,10800;10800,0";
TextBoxRectangle = L"1800,1800,19800,19800;4500,4500,17100,17100;7200,7200,14400,14400";

View File

@ -59,7 +59,7 @@ namespace DocFileFormat
Formulas.push_back(L"mid @6 @7");
Formulas.push_back(L"sum @6 0 @5");
AdjustmentValues = L"10800";
Adjustments.push_back(10800);
//<v:textpath on="t" fitshape="t"/>
}
@ -84,7 +84,8 @@ namespace DocFileFormat
Formulas.push_back(L"sum 0 @0 0");
Formulas.push_back(L"sum height 0 @0");
AdjustmentValues = L"5400";
Adjustments.push_back(5400);
Handle one;
one.position = L"0,@0";
Handles.push_back (one);
@ -128,7 +129,8 @@ namespace DocFileFormat
Formulas.push_back(L"if @9 0 21600");
Formulas.push_back(L"sum 10800 0 @18");
AdjustmentValues = L"11796480";
Adjustments.push_back(11796480);
Handle one;
one.position = L"@16,#0";
one.polar = L"10800,10800";
@ -152,7 +154,8 @@ namespace DocFileFormat
Formulas.push_back(L"val #0");
Formulas.push_back(L"sum 21600 0 #0");
AdjustmentValues = L"4050";
Adjustments.push_back(4050);
Handle one;
one.position = L"enter,#0";
one.yrange = L"0,8100";
@ -179,7 +182,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod @1 1 2");
Formulas.push_back(L"sum @4 10800 0");
AdjustmentValues = L"12000";
Adjustments.push_back(12000);
Handle one;
one.position = L"topLeft,#0";
one.yrange = L"0,15429";
@ -202,7 +206,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod @1 1 2");
Formulas.push_back(L"sum @2 10800 0");
AdjustmentValues = L"3086";
Adjustments.push_back(3086);
Handle one;
one.position = L"center,#0";
one.yrange = L"0,7200";
@ -260,7 +265,9 @@ namespace DocFileFormat
Formulas.push_back(L"mid @22 @23");
Formulas.push_back(L"mid @21 @25");
AdjustmentValues = L"2809,10800";
Adjustments.push_back(2809);
Adjustments.push_back(10800);
Handle one;
one.position = L"topLeft,#0";
one.yrange = L"0,4459";
@ -338,7 +345,9 @@ namespace DocFileFormat
Formulas.push_back(L"mid @36 @43");
Formulas.push_back(L"mid @30 @37");
AdjustmentValues = L"1404,10800";
Adjustments.push_back(1404);
Adjustments.push_back(10800);
Handle one;
one.position = L"topLeft,#0";
one.yrange = L"0,2229";
@ -415,7 +424,9 @@ namespace DocFileFormat
Formulas.push_back(L"mid @36 @43");
Formulas.push_back(L"mid @30 @37");
AdjustmentValues = L"1404,10800";
Adjustments.push_back(1404);
Adjustments.push_back(10800);
Handle one;
one.position = L"topLeft,#0";
one.yrange = L"0,2229";
@ -456,7 +467,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod @13 1 4");
Formulas.push_back(L"sum @11 14400 @14");
AdjustmentValues = L"9931";
Adjustments.push_back(9931);
Handle one;
one.position = L"topLeft,#0";
one.yrange = L"0,12169";
@ -483,7 +495,8 @@ namespace DocFileFormat
Formulas.push_back(L"sum 21600 0 @2");
Formulas.push_back(L"sum @1 21600 @0");
AdjustmentValues = L"7200";
Adjustments.push_back(7200);
Handle one;
one.position = L"#0,topLeft";
one.xrange = L"0,10792";
@ -509,7 +522,8 @@ namespace DocFileFormat
Formulas.push_back(L"sum @1 10800 0");
Formulas.push_back(L"sum 21600 0 @1");
AdjustmentValues = L"10800";
Adjustments.push_back(10800);
Handle one;
one.position = L"#topLeft,#0";
one.xrange = L"0,21600";
@ -540,7 +554,8 @@ namespace DocFileFormat
Formulas.push_back(L"sum @0 21600 @2");
Formulas.push_back(L"prod @7 1 2");
AdjustmentValues = L"9600";
Adjustments.push_back(9600);
Handle one;
one.position = L"bottomRight,#0";
one.yrange = L"6171,21600";
@ -567,7 +582,8 @@ namespace DocFileFormat
Formulas.push_back(L"prod #0 2 3");
Formulas.push_back(L"sum @3 7200 0");
AdjustmentValues = L"11475";
Adjustments.push_back(11475);
Handle one;
one.position = L"center,#0";
one.yrange = L"1350,21600";

View File

@ -577,7 +577,8 @@ namespace DocFileFormat
unsigned short val = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
switch (val)
{
case 0x0000: break; //inline
case 0x0000:
appendValueAttribute( _framePr, L"w:yAlign", L"inline"); break;
case 0xfffc: appendValueAttribute( _framePr, L"w:yAlign", L"top"); break;
case 0xfff8: appendValueAttribute( _framePr, L"w:yAlign", L"center"); break;
case 0xfff4: appendValueAttribute( _framePr, L"w:yAlign", L"bottom"); break;

View File

@ -68,8 +68,9 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute( L"o:spt", FormatUtils::IntToWideString( pShape->GetTypeCode() ));
// Adj
if (pShape->AdjustmentValues.length())
m_pXmlWriter->WriteAttribute( L"adj", pShape->AdjustmentValues);
std::wstring sAdjustments = pShape->VectorToStr(pShape->Adjustments);
if (!sAdjustments.empty())
m_pXmlWriter->WriteAttribute( L"adj", sAdjustments);
// Path
if (!pShape->Path.empty())
@ -113,10 +114,10 @@ namespace DocFileFormat
{
m_pXmlWriter->WriteNodeBegin( L"v:formulas");
for ( std::list<std::wstring>::iterator iter = pShape->Formulas.begin(); iter != pShape->Formulas.end(); iter++ )
for ( size_t i = 0; i < pShape->Formulas.size(); ++i)
{
m_pXmlWriter->WriteNodeBegin( L"v:f", true );
m_pXmlWriter->WriteAttribute( L"eqn", *iter );
m_pXmlWriter->WriteAttribute( L"eqn", pShape->Formulas[i]);
m_pXmlWriter->WriteNodeEnd( L"", true );
}
@ -160,8 +161,9 @@ namespace DocFileFormat
if (pShape->TextBoxRectangle.length())
m_pXmlWriter->WriteAttribute( L"textboxrect", pShape->TextBoxRectangle);
if (pShape->ConnectorAngles.length())
m_pXmlWriter->WriteAttribute( L"o:connectangles", pShape->ConnectorAngles);
std::wstring sConnectorAngles = pShape->VectorToStr(pShape->ConnectorAngles);
if (!sConnectorAngles.empty())
m_pXmlWriter->WriteAttribute( L"o:connectangles", sConnectorAngles);
}
WordArtTextType* wordArt = dynamic_cast<WordArtTextType*>(pShape);
if (wordArt)
@ -192,27 +194,27 @@ namespace DocFileFormat
{
m_pXmlWriter->WriteNodeBegin( L"v:handles" );
for ( std::list<Handle>::iterator iter = pShape->Handles.begin(); iter != pShape->Handles.end(); ++iter)
for (size_t i = 0; i < pShape->Handles.size(); ++i)
{
m_pXmlWriter->WriteNodeBegin( L"v:h", true );
if (iter->position.length())
m_pXmlWriter->WriteAttribute( L"position", iter->position);
if (pShape->Handles[i].position.length())
m_pXmlWriter->WriteAttribute( L"position", pShape->Handles[i].position);
if (iter->switchHandle.length())
m_pXmlWriter->WriteAttribute( L"switch", iter->switchHandle);
if (pShape->Handles[i].switchHandle.length())
m_pXmlWriter->WriteAttribute( L"switch", pShape->Handles[i].switchHandle);
if (iter->xrange.length())
m_pXmlWriter->WriteAttribute( L"xrange", iter->xrange);
if (pShape->Handles[i].xrange.length())
m_pXmlWriter->WriteAttribute( L"xrange", pShape->Handles[i].xrange);
if (iter->yrange.length())
m_pXmlWriter->WriteAttribute( L"yrange", iter->yrange);
if (pShape->Handles[i].yrange.length())
m_pXmlWriter->WriteAttribute( L"yrange", pShape->Handles[i].yrange);
if (iter->polar.length())
m_pXmlWriter->WriteAttribute( L"polar", iter->polar);
if (pShape->Handles[i].polar.length())
m_pXmlWriter->WriteAttribute( L"polar", pShape->Handles[i].polar);
if (iter->radiusrange.length())
m_pXmlWriter->WriteAttribute( L"radiusrange", iter->radiusrange );
if (pShape->Handles[i].radiusrange.length())
m_pXmlWriter->WriteAttribute( L"radiusrange", pShape->Handles[i].radiusrange );
m_pXmlWriter->WriteNodeEnd( L"", true );
}

View File

@ -840,13 +840,13 @@ void XlsConverter::convert(XLS::FORMATTING* formating)
if (fmt->ifmt < 5 || (fmt->ifmt > 8 && fmt->ifmt < 23) || (fmt->ifmt > 36 && fmt->ifmt < 41) || (fmt->ifmt > 44 && fmt->ifmt < 50))
continue;
std::map<_UINT16, bool>::iterator pFind = xls_global_info->mapUsedFormatCode.find(fmt->ifmt);
std::map<_UINT16, _UINT16>::iterator pFind = xls_global_info->mapUsedFormatCode.find(fmt->ifmt);
if (pFind != xls_global_info->mapUsedFormatCode.end())
{
CP_XML_STREAM() << L"<numFmt";
{
CP_XML_STREAM() << L" numFmtId=\"" << fmt->ifmt << L"\"";
CP_XML_STREAM() << L" numFmtId=\"" << fmt->ifmt_used << L"\"";
CP_XML_STREAM() << L" formatCode=\"" << fmt->stFormat << L"\"";
}
CP_XML_STREAM() << L"/>";

View File

@ -33,7 +33,6 @@
#include "xlsx_comments_context.h"
#include <iostream>
#include <boost/lexical_cast.hpp>
namespace oox {

View File

@ -32,7 +32,6 @@
#include "xlsx_hyperlinks.h"
#include "oox_rels.h"
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>

View File

@ -93,7 +93,7 @@ private:
bool in_cell_content;
//odf_reader::styles_container & styles_;
//odf_reader::text_format_properties_content * text_properties_cell_;
//odf_reader::text_format_properties * text_properties_cell_;
//odf_reader::styles_container * local_styles_ptr_;
std::wstring dump_text();
@ -202,7 +202,7 @@ void xlsx_text_context::Impl::end_hyperlink(std::wstring hId)
hyperlink_hId = hId;
}
void xlsx_text_context::Impl::ApplyTextProperties(/*std::wstring style,odf_reader::text_format_properties_content & propertiesOut, odf_types::style_family::type Type*/)
void xlsx_text_context::Impl::ApplyTextProperties(/*std::wstring style,odf_reader::text_format_properties & propertiesOut, odf_types::style_family::type Type*/)
{
}
@ -219,7 +219,7 @@ void xlsx_text_context::Impl::write_rPr(std::wostream & strm)
if (in_draw)
{
//oox_serialize_style_text(strm,text_properties_);
//oox_serialize_style_text(strm,odf_reader::text_format_properties_content & properties);
//oox_serialize_style_text(strm,odf_reader::text_format_properties & properties);
CP_XML_NODE(L"a:rPr")
{
//стр 3197

View File

@ -60,7 +60,7 @@ void BRAI::readFields(CFRecord& record)
fUnlinkedIfmt = static_cast<unsigned char>(GETBIT(flags, 0));
record >> ifmt;
global_info->mapUsedFormatCode.insert(std::make_pair(ifmt, true));
ifmt = global_info->RegisterNumFormat(ifmt, L""); // return update
formula.load(record);

View File

@ -31,8 +31,6 @@
*/
#include "BoundSheet8.h"
#include <boost/lexical_cast.hpp>
namespace XLS
{
@ -89,7 +87,7 @@ void BoundSheet8::readFields(CFRecord& record)
}
if (name_.empty())
{//file(6).xls
name_ = L"Sheet_" + boost::lexical_cast<std::wstring>(record.getGlobalWorkbookInfo()->current_sheet + 1);
name_ = L"Sheet_" + std::to_wstring(record.getGlobalWorkbookInfo()->current_sheet + 1);
}
GlobalWorkbookInfo::_sheet_info sheet_info;

View File

@ -39,7 +39,6 @@
namespace XLS
{
// Logical representation of FileSharing record in BIFF8 and BrtFileSharing in BIFF12
class FileSharing: public BiffRecord
{

View File

@ -66,7 +66,10 @@ void Format::readFields(CFRecord& record)
record >> notUsed;
}
else
{
record >> ifmt;
ifmt_used = ifmt;
}
}
if (global_info->Version < 0x0600)
@ -90,7 +93,7 @@ int Format::serialize(std::wostream & stream)
stream << L"<numFmt";
{
stream << L" numFmtId=\"" << ifmt << L"\"";
stream << L" numFmtId=\"" << ifmt_used << L"\"";
stream << L" formatCode=\"" << stFormat << L"\"";
}
stream << L"/>";

Some files were not shown because too many files have changed in this diff Show More