Compare commits

...

6 Commits

Author SHA1 Message Date
47318eef9c RtfFormatReader - fix users files 2019-07-26 17:33:24 +03:00
094a1d98d6 Add executable path to rpath 2019-07-26 16:55:00 +03:00
471219e59a [x2t] Fix dataValidations writing 2019-07-26 14:10:29 +03:00
2cfd2a0126 Change com object 2019-07-26 14:07:43 +03:00
f3ec039a01 Fix bug #42195
Fix the problem with reading EMF_BITBLT record in the EMF
2019-07-26 12:26:07 +03:00
f4795db0b8 Add allfonts path param 2019-07-26 11:30:21 +03:00
15 changed files with 265 additions and 65 deletions

View File

@ -232,12 +232,12 @@ std::wstring RtfFont::RenderToOOX(RenderParameter oRenderParameter)
else
{
RtfFont oCurFont;
if( true == poRtfDocument->m_oFontTable.GetFont(m_nID,oCurFont) )
if( true == poRtfDocument->m_oFontTable.GetFont(m_nID, oCurFont) )
{
std::wstring sHint;
switch(m_nCharset)
switch(oCurFont.m_nCharset)
{
case 128://Japanese
//case 128://Japanese //vedomost.rtf ????
case 129://Korean
case 130://Korean
case 134://China

View File

@ -275,7 +275,7 @@ public:
if(sResult.length() > 0)
{
std::string str;
ExecuteTextInternalSkipChars (sResult, oReader, str, nSkipChars);
// ExecuteTextInternalSkipChars (sResult, oReader, str, nSkipChars); //vedomost.rtf
ExecuteText ( oDocument, oReader, sResult);
}
}

View File

@ -96,7 +96,7 @@ void CDataValidation::toXML2(NSStringUtils::CStringBuilder& writer, bool bExtend
if (m_oFormula2.IsInit())
{
writer.WriteString(L"<x14:formula2>");
m_oFormula1->toXML2(writer, true);
m_oFormula2->toXML2(writer, true);
writer.WriteString(L"</x14:formula2>");
}
if (m_oSqRef.IsInit())

View File

@ -35,6 +35,8 @@ core_windows {
core_linux {
LIBS += -lz -pthread
QMAKE_LFLAGS += -Wl,--rpath=./
}
SOURCES += main.cpp

View File

@ -29,6 +29,8 @@ core_windows {
core_linux {
LIBS += -lz -pthread
QMAKE_LFLAGS += -Wl,--rpath=./
}
SOURCES += main.cpp

View File

@ -235,6 +235,7 @@ int main(int argc, char** argv)
std::wstring sSrcThemesDir = L"";
std::wstring sX2tPath = L"";
std::wstring sOutputThumbnails = L"";
std::wstring sAllFonts = L"";
bool bIsNeedCorrectSdkAll = false;
for (int i = 0; i < argc; ++i)
@ -281,6 +282,10 @@ int main(int argc, char** argv)
bIsNeedCorrectSdkAll = true;
}
}
else if (sKey == L"--allfonts")
{
sAllFonts = sValue;
}
}
}
@ -328,8 +333,13 @@ int main(int argc, char** argv)
oBuilder.WriteString(L"</m_sFileFrom><m_sFileTo>");
oBuilder.WriteEncodeXmlString(sOut + L"/theme.bin");
oBuilder.WriteString(L"</m_sFileTo><m_nFormatTo>8192</m_nFormatTo><m_sThemeDir>./</m_sThemeDir>");
oBuilder.WriteString(L"<m_bDontSaveAdditional>true</m_bDontSaveAdditional><m_sAllFontsPath>");
oBuilder.WriteString(L"AllFonts.js</m_sAllFontsPath>");
oBuilder.WriteString(L"<m_bDontSaveAdditional>true</m_bDontSaveAdditional>");
if (!sAllFonts.empty())
{
oBuilder.WriteString(L"<m_sAllFontsPath>");
oBuilder.WriteString(sAllFonts);
oBuilder.WriteString(L"</m_sAllFontsPath>");
}
oBuilder.WriteString(L"</TaskQueueDataConvert>");
std::wstring sXmlConvert = oBuilder.GetData();
@ -373,7 +383,7 @@ int main(int argc, char** argv)
std::wstring sXmlDoctRenderer = oBuilder.GetData();
NSDoctRenderer::CDoctrenderer oRenderer;
oRenderer.LoadConfig(sX2tPath);
oRenderer.LoadConfig(sX2tPath, sAllFonts);
std::wstring sError;
bool bIsSuccess = oRenderer.Execute(sXmlDoctRenderer, sError);

View File

@ -35,7 +35,7 @@
//
#define IDS_PROJNAME 100
#define IDR_ASCDOCBUILDER 101
#define IDR_ONLYOFFICEDOCBUILDER 101
// Next default values for new objects
//

View File

@ -0,0 +1,17 @@
SET SCRIPTPATH=%~dp0
CD /D %~dp0
SET VC64_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE
SET VC32_PATH=%ProgramFiles%\Microsoft Visual Studio 14.0\Common7\IDE
setlocal enabledelayedexpansion
if defined ProgramFiles(x86) (
SET PATH=!VC64_PATH!;!PATH!
) else (
SET PATH=!VC32_PATH!;!PATH!
)
call devenv docbuilder.com.sln /Rebuild "Release|x64"
call devenv docbuilder.com.sln /Rebuild "Release|Win32"
exit /b 0

View File

@ -37,9 +37,9 @@
#include "docbuilder.h"
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{B43F4AFD-2278-4175-992C-D7AE390507D8}",
name = "ascdocbuilder",
helpstring = "ascdocbuilder 1.0 Type Library",
resource_name = "IDR_ASCDOCBUILDER") ];
[ module(dll, uuid = "{7368AB25-7082-4815-8AE5-A30C2ABDD2A0}",
name = "onlyofficedocbuilder",
helpstring = "onlyofficedocbuilder 1.0 Type Library",
resource_name = "IDR_ONLYOFFICEDOCBUILDER") ];

View File

@ -60,11 +60,11 @@ BEGIN
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "Ascensio System SIA"
VALUE "FileDescription", "Ascensio System SIA docbuilder ActiveX DLL"
VALUE "CompanyName", "Ascensio System SIA 2019"
VALUE "FileDescription", "ONLYOFFICE docbuilder ActiveX DLL"
VALUE "FileVersion", "1.0.0.1"
VALUE "InternalName", "docbuilder.com.dll"
VALUE "LegalCopyright", "Ascensio System SIA Copyright (c) 2011-2016. All rights reserved."
VALUE "LegalCopyright", "Copyright (C) Ascensio System SIA 2019. All rights reserved."
VALUE "OriginalFilename", "docbuilder.com.dll"
VALUE "ProductName", "docbuilder.com"
VALUE "ProductVersion", "1.0.0.1"
@ -88,7 +88,7 @@ BEGIN
IDS_PROJNAME "docbuilder.com"
END
IDR_ASCDOCBUILDER REGISTRY "docbuilder.com.rgs"
IDR_ONLYOFFICEDOCBUILDER REGISTRY "docbuilder.com.rgs"
////////////////////////////////////////////////////////////////////////////

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -26,25 +26,25 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<UseOfAtl>false</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<UseOfAtl>Dynamic</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<UseOfAtl>Dynamic</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<UseOfAtl>Dynamic</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@ -121,16 +121,12 @@
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<RegisterOutput>true</RegisterOutput>
<RegisterOutput>false</RegisterOutput>
<MergedIDLBaseFileName>_docbuilder.idl</MergedIDLBaseFileName>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>regsvr32 $(TargetPath)</Command>
<Message>Performing registration</Message>
</PostBuildEvent>
<CustomBuildStep>
<Command>
</Command>
@ -170,10 +166,6 @@
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<PostBuildEvent>
<Command>regsvr32 $(TargetPath)</Command>
<Message>Performing registration</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
@ -194,7 +186,7 @@
<Optimization>MaxSpeed</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -205,7 +197,7 @@
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<RegisterOutput>true</RegisterOutput>
<RegisterOutput>false</RegisterOutput>
<MergedIDLBaseFileName>_docbuilder.idl</MergedIDLBaseFileName>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -213,10 +205,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Message>Performing registration</Message>
<Command>regsvr32 $(TargetPath)</Command>
</PostBuildEvent>
<CustomBuildStep>
<Command>
</Command>
@ -258,10 +246,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<PostBuildEvent>
<Message>Performing registration</Message>
<Command>regsvr32 $(TargetPath)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="docbuilder.com.cpp" />

View File

@ -31,6 +31,7 @@
*/
// docbuildercom.h : Declaration of the CDocbuilder
#pragma once
#include "stdafx.h"
#include "resource.h" // main symbols
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
@ -48,18 +49,18 @@ using namespace ATL;
#pragma comment(lib, "../../../build/lib/win_32/doctrenderer.lib")
#endif
#include "../docbuilder.h"
#include "../../common/File.h"
#include "../../../DesktopEditor/doctrenderer/docbuilder.h"
#include "../../../Common/OfficeFileFormats.h"
// IASCDocBuilder
[object, uuid("B0C0E80B-2076-4C33-BC6D-3DB1B0FE9687"), dual, pointer_default(unique)]
__interface IASCDocBuilder : IDispatch
// IONLYOFFICEDocBuilder
[object, uuid("0C07B7E7-86A4-42E1-8E42-2FA961992E0F"), dual, pointer_default(unique)]
__interface IONLYOFFICEDocBuilder : IDispatch
{
[id(1)] HRESULT CreateInstance([in] VARIANT_BOOL checkFonts);
[id(100)] HRESULT OpenFile([in] BSTR path, [in] BSTR params, [out, retval] VARIANT_BOOL* result);
[id(101)] HRESULT CreateFile([in] int type, [out, retval] VARIANT_BOOL* result);
[id(101)] HRESULT CreateFile([in] BSTR type, [out, retval] VARIANT_BOOL* result);
[id(102)] HRESULT SetTmpFolder([in] BSTR folder);
[id(103)] HRESULT SaveFile([in] int type, [in] BSTR path, [out, retval] VARIANT_BOOL* result);
[id(103)] HRESULT SaveFile([in] BSTR type, [in] BSTR path, [out, retval] VARIANT_BOOL* result);
[id(104)] HRESULT CloseFile(void);
[id(105)] HRESULT ExecuteCommand([in] BSTR command, [out, retval] VARIANT_BOOL* result);
[id(106)] HRESULT Run([in] BSTR path, [out, retval] VARIANT_BOOL* result);
@ -73,21 +74,41 @@ __interface IASCDocBuilder : IDispatch
[id(1002)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue);
};
// CASCDocBuilder
[coclass, uuid("227DE4AD-D992-4CCD-9704-0F041CE908F3"), threading(apartment), vi_progid("ASCDocBuilder.DocBuilder"), progid("ASCDocBuilder.DocBuilder.1"), version(1.0)]
class ATL_NO_VTABLE CASCDocBuilder : public IASCDocBuilder
static CStringW GetCurrentDllDirPath()
{
CStringW thisPath = L"";
WCHAR path[MAX_PATH];
HMODULE hm;
if (GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(LPWSTR)&GetCurrentDllDirPath, &hm))
{
GetModuleFileNameW(hm, path, sizeof(path));
PathRemoveFileSpecW(path);
thisPath = CStringW(path);
if (!thisPath.IsEmpty() &&
thisPath.GetAt(thisPath.GetLength() - 1) != '\\')
thisPath += L"\\";
}
return thisPath;
}
// CONLYOFFICEDocBuilder
[coclass, uuid("9BF69F3C-1506-41B9-B8EE-2839948C02E9"), threading(apartment), vi_progid("ONLYOFFICE.Builder"), progid("ONLYOFFICE.Builder.1"), version(1.0)]
class ATL_NO_VTABLE CONLYOFFICEDocBuilder : public IONLYOFFICEDocBuilder
{
protected:
NSDoctRenderer::CDocBuilder* m_pBuilder;
public:
CASCDocBuilder()
CONLYOFFICEDocBuilder()
{
m_pBuilder = NULL;
this->CreateInstance(VARIANT_TRUE);
}
~CASCDocBuilder()
~CONLYOFFICEDocBuilder()
{
if (NULL != m_pBuilder)
delete m_pBuilder;
@ -98,6 +119,10 @@ public:
delete m_pBuilder;
m_pBuilder = new NSDoctRenderer::CDocBuilder();
CStringW sCurrentDir = GetCurrentDllDirPath();
BSTR bsCurrentDir = sCurrentDir.AllocSysString();
m_pBuilder->SetProperty("--work-directory", (wchar_t*)bsCurrentDir);
SysFreeString(bsCurrentDir);
return S_OK;
}
STDMETHOD(OpenFile)(BSTR path, BSTR params, VARIANT_BOOL* result)
@ -109,12 +134,19 @@ public:
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
STDMETHOD(CreateFile)(int type, VARIANT_BOOL* result)
STDMETHOD(CreateFile)(BSTR type, VARIANT_BOOL* result)
{
if (NULL == m_pBuilder)
return S_FALSE;
bool bRet = m_pBuilder->CreateFile(type);
int nType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX;
CStringW sType = (CString)type;
if (L"pptx" == sType)
nType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX;
else if (L"xlsx" == sType)
nType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX;
bool bRet = m_pBuilder->CreateFile(nType);
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
@ -126,12 +158,45 @@ public:
m_pBuilder->SetTmpFolder(folder);
return S_OK;
}
STDMETHOD(SaveFile)(int type, BSTR path, VARIANT_BOOL* result)
STDMETHOD(SaveFile)(BSTR type, BSTR path, VARIANT_BOOL* result)
{
if (NULL == m_pBuilder)
return S_FALSE;
bool bRet = m_pBuilder->SaveFile(type, path);
int nType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX;
CStringW sType = (CString)type;
if (L"docx" == sType)
nType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX;
else if (L"doc" == sType)
nType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC;
else if (L"odt" == sType)
nType = AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT;
else if (L"rtf" == sType)
nType = AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF;
else if (L"txt" == sType)
nType = AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT;
else if (L"pptx" == sType)
nType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX;
else if (L"odp" == sType)
nType = AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP;
else if (L"xlsx" == sType)
nType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX;
else if (L"xls" == sType)
nType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS;
else if (L"ods" == sType)
nType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS;
else if (L"csv" == sType)
nType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV;
else if (L"pdf" == sType)
nType = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF;
else if (L"image" == sType)
nType = AVS_OFFICESTUDIO_FILE_IMAGE;
else if (L"jpg" == sType)
nType = AVS_OFFICESTUDIO_FILE_IMAGE;
else if (L"png" == sType)
nType = AVS_OFFICESTUDIO_FILE_IMAGE;
bool bRet = m_pBuilder->SaveFile(nType, path);
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}

View File

@ -0,0 +1,116 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef DOCBUILDER_H
#define DOCBUILDER_H
#ifdef _MSC_VER
#define BUILDING_DOCBUILDER __declspec(dllimport)
#else
#define BUILDING_DOCBUILDER
#endif
#define OFFICESTUDIO_FILE_DOCUMENT 0x0040
#define OFFICESTUDIO_FILE_DOCUMENT_DOCX OFFICESTUDIO_FILE_DOCUMENT + 0x0001
#define OFFICESTUDIO_FILE_DOCUMENT_DOC OFFICESTUDIO_FILE_DOCUMENT + 0x0002
#define OFFICESTUDIO_FILE_DOCUMENT_ODT OFFICESTUDIO_FILE_DOCUMENT + 0x0003
#define OFFICESTUDIO_FILE_DOCUMENT_RTF OFFICESTUDIO_FILE_DOCUMENT + 0x0004
#define OFFICESTUDIO_FILE_DOCUMENT_TXT OFFICESTUDIO_FILE_DOCUMENT + 0x0005
#define OFFICESTUDIO_FILE_DOCUMENT_DOTX OFFICESTUDIO_FILE_DOCUMENT + 0x000c
#define OFFICESTUDIO_FILE_DOCUMENT_OTT OFFICESTUDIO_FILE_DOCUMENT + 0x000f
#define OFFICESTUDIO_FILE_PRESENTATION 0x0080
#define OFFICESTUDIO_FILE_PRESENTATION_PPTX OFFICESTUDIO_FILE_PRESENTATION + 0x0001
#define OFFICESTUDIO_FILE_PRESENTATION_PPT OFFICESTUDIO_FILE_PRESENTATION + 0x0002
#define OFFICESTUDIO_FILE_PRESENTATION_ODP OFFICESTUDIO_FILE_PRESENTATION + 0x0003
#define OFFICESTUDIO_FILE_PRESENTATION_PPSX OFFICESTUDIO_FILE_PRESENTATION + 0x0004
#define OFFICESTUDIO_FILE_PRESENTATION_POTX OFFICESTUDIO_FILE_PRESENTATION + 0x0007
#define OFFICESTUDIO_FILE_PRESENTATION_OTP OFFICESTUDIO_FILE_PRESENTATION + 0x000a
#define OFFICESTUDIO_FILE_SPREADSHEET 0x0100
#define OFFICESTUDIO_FILE_SPREADSHEET_XLSX OFFICESTUDIO_FILE_SPREADSHEET + 0x0001
#define OFFICESTUDIO_FILE_SPREADSHEET_XLS OFFICESTUDIO_FILE_SPREADSHEET + 0x0002
#define OFFICESTUDIO_FILE_SPREADSHEET_ODS OFFICESTUDIO_FILE_SPREADSHEET + 0x0003
#define OFFICESTUDIO_FILE_SPREADSHEET_CSV OFFICESTUDIO_FILE_SPREADSHEET + 0x0004
#define OFFICESTUDIO_FILE_SPREADSHEET_XLTX OFFICESTUDIO_FILE_SPREADSHEET + 0x0006
#define OFFICESTUDIO_FILE_SPREADSHEET_OTS OFFICESTUDIO_FILE_SPREADSHEET + 0x0009
#define OFFICESTUDIO_FILE_CROSSPLATFORM 0x0200
#define OFFICESTUDIO_FILE_CROSSPLATFORM_PDF OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0001
#define OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0003
#define OFFICESTUDIO_FILE_CROSSPLATFORM_XPS OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0004
#define OFFICESTUDIO_FILE_CROSSPLATFORM_PDFA OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0009
#define OFFICESTUDIO_FILE_IMAGE 0x0400
#define OFFICESTUDIO_FILE_IMAGE_JPG OFFICESTUDIO_FILE_IMAGE + 0x0001
#define OFFICESTUDIO_FILE_IMAGE_PNG OFFICESTUDIO_FILE_IMAGE + 0x0005
#define OFFICESTUDIO_FILE_IMAGE_BMP OFFICESTUDIO_FILE_IMAGE + 0x0008
namespace NSDoctRenderer
{
class CDocBuilder_Private;
class BUILDING_DOCBUILDER CDocBuilder
{
public:
CDocBuilder();
~CDocBuilder();
public:
int OpenFile(const wchar_t* path, const wchar_t* params);
bool CreateFile(const int& type);
void SetTmpFolder(const wchar_t* folder);
int SaveFile(const int& type, const wchar_t* path, const wchar_t* params = 0);
void CloseFile();
bool ExecuteCommand(const wchar_t* command);
bool Run(const wchar_t* path);
bool RunTextW(const wchar_t* commands);
bool RunTextA(const char* commands);
void SetProperty(const char* param, const wchar_t* value);
void SetPropertyW(const wchar_t* param, const wchar_t* value);
void WriteData(const wchar_t* path, const wchar_t* value, const bool& append);
bool IsSaveWithDoctrendererMode();
char* GetVersion();
public:
static void Initialize();
static void Dispose();
private:
CDocBuilder_Private* m_pInternal;
};
}
#endif // DOCBUILDER_H

View File

@ -825,7 +825,10 @@ static const struct ActionNamesEmf
BYTE* pBgraBuffer = NULL;
unsigned int ulWidth, ulHeight;
if (ReadImage(oBitmap.offBmiSrc, oBitmap.cbBmiSrc, oBitmap.offBitsSrc, oBitmap.cbBitsSrc, sizeof(TEmfBitBlt) + 8, &pBgraBuffer, &ulWidth, &ulHeight))
// sizeof использовать нельзя, т.к. мы используем double в структуре TEmfBitBlt, а читаем его 4-байтовым
unsigned int unEmfBitBltRecordSize = 100; // sizeof(TEmfBitBlt) + 8
if (ReadImage(oBitmap.offBmiSrc, oBitmap.cbBmiSrc, oBitmap.offBitsSrc, oBitmap.cbBitsSrc, unEmfBitBltRecordSize, &pBgraBuffer, &ulWidth, &ulHeight))
{
DrawImage(oBitmap.xDest, oBitmap.yDest, oBitmap.cxDest, oBitmap.cyDest, pBgraBuffer, ulWidth, ulHeight);
}

View File

@ -6229,26 +6229,27 @@ void BinaryWorksheetTableWriter::WriteSparklineGroup(const OOX::Spreadsheet::CSp
}
void BinaryWorksheetTableWriter::WriteDataValidations(const OOX::Spreadsheet::CDataValidations& oDataValidations)
{
int nCurPos = 0;
if (oDataValidations.m_oDisablePrompts.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_DataValidation::DisablePrompts);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
nCurPos = m_oBcw.WriteItemStart(c_oSer_DataValidation::DisablePrompts);
m_oBcw.m_oStream.WriteBOOL(oDataValidations.m_oDisablePrompts->ToBool());
m_oBcw.WriteItemEnd(nCurPos);
}
if (oDataValidations.m_oXWindow.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_DataValidation::XWindow);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
nCurPos = m_oBcw.WriteItemStart(c_oSer_DataValidation::XWindow);
m_oBcw.m_oStream.WriteLONG(oDataValidations.m_oXWindow->GetValue());
m_oBcw.WriteItemEnd(nCurPos);
}
if (oDataValidations.m_oYWindow.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_DataValidation::YWindow);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
nCurPos = m_oBcw.WriteItemStart(c_oSer_DataValidation::YWindow);
m_oBcw.m_oStream.WriteLONG(oDataValidations.m_oYWindow->GetValue());
m_oBcw.WriteItemEnd(nCurPos);
}
int nCurPos = m_oBcw.WriteItemStart(c_oSer_DataValidation::DataValidations);
nCurPos = m_oBcw.WriteItemStart(c_oSer_DataValidation::DataValidations);
WriteDataValidationsContent(oDataValidations);
m_oBcw.WriteItemEnd(nCurPos);
}