Compare commits

..

7 Commits

5 changed files with 60 additions and 50 deletions

View File

@ -202,10 +202,12 @@ core_win_64 {
core_linux {
DEFINES += LINUX _LINUX
QMAKE_CUSTOM_SYSROOT = $$(QMAKE_CUSTOM_SYSROOT)
QMAKE_CUSTOM_SYSROOT_BIN = $$(QMAKE_CUSTOM_SYSROOT)/usr/bin/
core_linux_64 {
!linux_arm64 { # x86_64
QMAKE_CUSTOM_SYSROOT = $$(QMAKE_CUSTOM_SYSROOT)
QMAKE_CUSTOM_SYSROOT_BIN = $$(QMAKE_CUSTOM_SYSROOT)/usr/bin/
QMAKE_CUSTOM_SYSROOT_LIB = $$(QMAKE_CUSTOM_SYSROOT)/usr/lib/x86_64-linux-gnu
!isEmpty(QMAKE_CUSTOM_SYSROOT) {
message("using custom sysroot $$QMAKE_CUSTOM_SYSROOT")
@ -222,41 +224,6 @@ core_linux {
}
}
core_linux_32 {
CORE_BUILDS_PLATFORM_PREFIX = linux_32
}
core_linux_64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_64
}
core_linux_arm {
CORE_BUILDS_PLATFORM_PREFIX = arm
}
linux_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_arm64
DEFINES += _ARM_ALIGN_
ARM64_TOOLCHAIN_BIN = $$(ARM64_TOOLCHAIN_BIN)
ARM64_TOOLCHAIN_BIN_PREFIX = $$(ARM64_TOOLCHAIN_BIN_PREFIX)
ARM64_SYSROOT = $$(ARM64_SYSROOT)
!isEmpty(ARM64_TOOLCHAIN_BIN){
!isEmpty(ARM64_TOOLCHAIN_BIN_PREFIX){
ARM64_TOOLCHAIN_BIN_FULL = $$ARM64_TOOLCHAIN_BIN/$$ARM64_TOOLCHAIN_BIN_PREFIX
message("using arm64 toolchain $$ARM64_TOOLCHAIN_BIN")
QMAKE_CC = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "gcc")
QMAKE_CXX = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK_SHLIB = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_AR = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "ar cqs")
QMAKE_OBJCOPY = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "objcopy")
QMAKE_NM = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "nm -P")
QMAKE_STRIP = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "strip")
}
}
}
gcc {
COMPILER_VERSION = $$system($$QMAKE_CXX " -dumpversion")
COMPILER_MAJOR_VERSION_ARRAY = $$split(COMPILER_VERSION, ".")
@ -357,6 +324,12 @@ core_win_64 {
core_win_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = win_arm64
}
core_linux_32 {
CORE_BUILDS_PLATFORM_PREFIX = linux_32
}
core_linux_64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_64
}
core_mac_64 {
CORE_BUILDS_PLATFORM_PREFIX = mac_64
@ -365,6 +338,34 @@ core_mac_64 {
QMAKE_APPLE_DEVICE_ARCHS = arm64
}
}
core_linux_arm {
CORE_BUILDS_PLATFORM_PREFIX = arm
}
linux_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_arm64
DEFINES += _ARM_ALIGN_
ARM64_TOOLCHAIN_BIN = $$(ARM64_TOOLCHAIN_BIN)
ARM64_TOOLCHAIN_BIN_PREFIX = $$(ARM64_TOOLCHAIN_BIN_PREFIX)
!isEmpty(ARM64_TOOLCHAIN_BIN){
!isEmpty(ARM64_TOOLCHAIN_BIN_PREFIX){
ARM64_TOOLCHAIN_BIN_FULL = $$ARM64_TOOLCHAIN_BIN/$$ARM64_TOOLCHAIN_BIN_PREFIX
message("using arm64 toolchain $$ARM64_TOOLCHAIN_BIN")
QMAKE_CC = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "gcc")
QMAKE_CXX = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK_SHLIB = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_AR = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "ar cqs")
QMAKE_OBJCOPY = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "objcopy")
QMAKE_NM = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "nm -P")
QMAKE_STRIP = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "strip")
}
}
}
core_ios {
CORE_BUILDS_PLATFORM_PREFIX = ios

View File

@ -45,6 +45,10 @@
#undef DeleteFile
#endif
#if defined(GetSystemDirectory)
#undef GetSystemDirectory
#endif
#ifndef _BUILD_FILE_CROSSPLATFORM_H_
#define _BUILD_FILE_CROSSPLATFORM_H_

View File

@ -4786,7 +4786,7 @@ private:
oXml->WriteString(L"\"/></w:r>");
m_oNoteXml.WriteString(L"<w:footnote w:id=\"");
m_oNoteXml.WriteString(std::to_wstring(m_nFootnoteId++));
m_oNoteXml.WriteString(L"\"><w:p><w:pPr><w:pStyle w:val=\"footnote-p\"/></w:pPr><w:r><w:rPr><w:footnoteRef/></w:rPr><w:t xml:space=\"preserve\"> </w:t></w:r><w:r><w:rPr><w:rStyle w:val=\"footnote\"/></w:rPr></w:r><w:r><w:t xml:space=\"preserve\">");
m_oNoteXml.WriteString(L"\"><w:p><w:pPr><w:pStyle w:val=\"footnote-p\"/></w:pPr><w:r><w:rPr><w:rStyle w:val=\"footnote\"/></w:rPr><w:footnoteRef/></w:r><w:r><w:t xml:space=\"preserve\"> </w:t></w:r><w:r><w:t xml:space=\"preserve\">");
m_oNoteXml.WriteEncodeXmlString(sNote);
m_oNoteXml.WriteString(L"</w:t></w:r></w:p></w:footnote>");

View File

@ -106,13 +106,13 @@ std::wstring process_border(border_style & borderStyle,
return res;
}
std::wstring pptx_process_margin(const _CP_OPT(length_or_percent) & margin, length::unit unit, double Mul)
std::wstring pptx_process_margin(const _CP_OPT(length_or_percent) & margin, length::unit unit, double Mul, bool bLeft)
{
if (margin)
{
if (margin->get_type() == length_or_percent::Length)
{
int val = (int)(0.57 * (0.5 + Mul * margin->get_length().get_value_unit(unit)));
int val = ( bLeft && margin->get_length().get_unit() == length::unit::cm) ? (int)(0.57 * (0.5 + Mul * margin->get_length().get_value_unit(unit))) : (int)(0.5 + Mul * margin->get_length().get_value_unit(unit));
return std::to_wstring( val );
}
else
@ -156,9 +156,9 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
// TODO auto indent
std::wstring w_left, w_right, w_firstLine;
w_left = pptx_process_margin(fo_margin_left_, length::emu, 1.);
w_right = pptx_process_margin(fo_margin_right_, length::emu, 1.);
w_firstLine = pptx_process_margin(fo_text_indent_,length::emu, 1.);
w_left = pptx_process_margin(fo_margin_left_, length::emu, 1., false);
w_right = pptx_process_margin(fo_margin_right_, length::emu, 1., false);
w_firstLine = pptx_process_margin(fo_text_indent_,length::emu, 1., false);
//if (w_left.empty()) w_left = L"0";
//if (w_right.empty()) w_right = L"0";
@ -227,7 +227,7 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
{
if (fo_margin_top_->get_type() == length_or_percent::Length)
{
std::wstring w_before = pptx_process_margin(fo_margin_top_, length::pt, 100.0);
std::wstring w_before = pptx_process_margin(fo_margin_top_, length::pt, 100.0, false);
CP_XML_NODE(L"a:spcPts")
{
CP_XML_ATTR(L"val",w_before);
@ -249,7 +249,7 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
{
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
{
std::wstring w_after = pptx_process_margin(fo_margin_bottom_, length::pt, 100.0);
std::wstring w_after = pptx_process_margin(fo_margin_bottom_, length::pt, 100.0, false);
CP_XML_NODE(L"a:spcPts")
{
CP_XML_ATTR(L"val",w_after);
@ -280,9 +280,9 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
// TODO auto indent
std::wstring w_left, w_right, w_firstLine;
w_left = pptx_process_margin(fo_margin_left_, length::emu, 1.);
w_right = pptx_process_margin(fo_margin_right_, length::emu, 1.);
w_firstLine = pptx_process_margin(fo_text_indent_,length::emu, 1.);
w_left = pptx_process_margin(fo_margin_left_, length::emu, 1., true);
w_right = pptx_process_margin(fo_margin_right_, length::emu, 1., false);
w_firstLine = pptx_process_margin(fo_text_indent_,length::emu, 1., false);
//if (w_left.empty()) w_left = L"0";
//if (w_right.empty()) w_right = L"0";
@ -481,7 +481,7 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
}
}
std::wstring w_before = pptx_process_margin(margin_top, length::pt, 100.0);
std::wstring w_before = pptx_process_margin(margin_top, length::pt, 100.0, false);
CP_XML_NODE(L"a:spcPts")
{
CP_XML_ATTR(L"val", w_before);
@ -504,7 +504,7 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
{
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
{
std::wstring w_after = pptx_process_margin(fo_margin_bottom_, length::pt, 100.0);
std::wstring w_after = pptx_process_margin(fo_margin_bottom_, length::pt, 100.0, false);
CP_XML_NODE(L"a:spcPts")
{
CP_XML_ATTR(L"val", w_after);

View File

@ -831,6 +831,11 @@ void CPdfReader::DrawPageOnRenderer(IRenderer* pRenderer, int _nPageIndex, bool*
((GlobalParamsAdaptor*)globalParams)->ClearRedact();
LONG lRendererType = 0;
pRenderer->get_Type(&lRendererType);
if (c_nDocxWriter == lRendererType)
return; // Без отрисовки Redact при ScanPage
Page* pPage = pDoc->getCatalog()->getPage(nPageIndex);
PDFRectangle* cropBox = pPage->getCropBox();
pRenderer->SetTransform(1, 0, 0, 1, 0, 0);