Commit 16af8670 authored by Oleg Korshul's avatar Oleg Korshul Committed by Alexander Trofimov

сделал полностью работу с быстрым открытием в десктопе

parent 4ab14c9c
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _ASC_HTMLRENDERER3_H_ #define _ASC_HTMLRENDERER3_H_
#include "../../DesktopEditor/graphics/IRenderer.h" #include "../../DesktopEditor/graphics/IRenderer.h"
#include "../../DesktopEditor/common/officedrawingfile.h"
#ifndef HTMLRENDERER_USE_DYNAMIC_LIBRARY #ifndef HTMLRENDERER_USE_DYNAMIC_LIBRARY
#define HTMLRENDERER_DECL_EXPORT #define HTMLRENDERER_DECL_EXPORT
...@@ -145,12 +146,17 @@ namespace NSHtmlRenderer ...@@ -145,12 +146,17 @@ namespace NSHtmlRenderer
virtual HRESULT get_Mode(LONG *plMode); virtual HRESULT get_Mode(LONG *plMode);
virtual HRESULT put_Mode(LONG lMode); virtual HRESULT put_Mode(LONG lMode);
virtual HRESULT CreateOfficeFile(std::wstring bsFileName); virtual HRESULT CreateOfficeFile(std::wstring bsFileName, const std::wstring& fontsDir = L"");
virtual HRESULT CloseFile(); virtual HRESULT CloseFile();
virtual HRESULT SetAdditionalParam(std::string sParamName, int nValue); virtual HRESULT SetAdditionalParam(std::string sParamName, int nValue);
virtual HRESULT SetAdditionalParam(std::string sParamName, const std::wstring& sParam); virtual HRESULT SetAdditionalParam(std::string sParamName, const std::wstring& sParam);
bool GetOnlyTextMode();
void SetOnlyTextMode(const bool& enabled);
void GetLastPageInfo(int& paragraphs, int& words, int& symbols, int& spaces, std::string& sBase64Data);
protected: protected:
CASCHTMLRenderer3_Private* m_pInternal; CASCHTMLRenderer3_Private* m_pInternal;
}; };
......
This diff is collapsed.
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include "Document.h" #include "Document.h"
#include "../../DesktopEditor/fontengine/FontConverter.h" #include "../../DesktopEditor/fontengine/FontConverter.h"
#include "../../DesktopEditor/ChromiumBasedEditors2/lib/src/Logger.h"
namespace NSHtmlRenderer namespace NSHtmlRenderer
{ {
static double __g_matrix_eps = 0.0001; static double __g_matrix_eps = 0.0001;
...@@ -1239,6 +1241,8 @@ namespace NSHtmlRenderer ...@@ -1239,6 +1241,8 @@ namespace NSHtmlRenderer
bool m_bIsClipping; bool m_bIsClipping;
bool m_bIsSimpleGraphics; bool m_bIsSimpleGraphics;
bool m_bIsOnlyTextMode;
public: public:
CWriter() CWriter()
{ {
...@@ -1272,6 +1276,8 @@ namespace NSHtmlRenderer ...@@ -1272,6 +1276,8 @@ namespace NSHtmlRenderer
m_bIsClipping = false; m_bIsClipping = false;
m_bIsSimpleGraphics = false; m_bIsSimpleGraphics = false;
m_lTilingCounter = 0; m_lTilingCounter = 0;
m_bIsOnlyTextMode = false;
} }
void SetApplicationFonts(CApplicationFonts* pFonts) void SetApplicationFonts(CApplicationFonts* pFonts)
...@@ -1514,10 +1520,37 @@ namespace NSHtmlRenderer ...@@ -1514,10 +1520,37 @@ namespace NSHtmlRenderer
m_arrPages[m_arrPages.size() - 1].m_lEnd = m_lCurrentDumpSize + m_oPage.GetPosition(); m_arrPages[m_arrPages.size() - 1].m_lEnd = m_lCurrentDumpSize + m_oPage.GetPosition();
m_lCurrentDumpSize += m_oPage.GetPosition(); m_lCurrentDumpSize += m_oPage.GetPosition();
m_oFileWriter.WriteFile(m_oPage.GetData(), m_oPage.GetPosition()); if (!m_bIsOnlyTextMode)
m_oFileWriter.WriteFile(m_oPage.GetData(), m_oPage.GetPosition());
m_oPage.Clear(); m_oPage.Clear();
} }
void GetLastPageInfo(int& paragraphs, int& words, int& symbols, int& spaces, std::string& sBase64Data)
{
m_oSmartText.ClosePage();
paragraphs = (int)m_oSmartText.m_lCountParagraphs;
words = (int)m_oSmartText.m_lCountWords;
spaces = (int)m_oSmartText.m_lCountSpaces;
symbols = (int)m_oSmartText.m_lCountSymbols;
sBase64Data = "";
if (m_lPagesCount > 0)
{
char* pDst = NULL;
int nDst = 0;
NSFile::CBase64Converter::Encode(m_oPage.GetData(), (int)m_oPage.GetPosition(), pDst, nDst, NSBase64::B64_BASE64_FLAG_NOCRLF);
if (0 < nDst)
sBase64Data = std::string(pDst);
sBase64Data = std::to_string((int)m_oPage.GetPosition()) + ";" + sBase64Data;
RELEASEARRAYOBJECTS(pDst);
}
}
inline void CheckVectorGraphics() inline void CheckVectorGraphics()
{ {
/* /*
...@@ -2070,15 +2103,19 @@ namespace NSHtmlRenderer ...@@ -2070,15 +2103,19 @@ namespace NSHtmlRenderer
m_strDstDirectoryFiles = m_strDstDirectory + L"/" + strFileName;// + _T("_files"); m_strDstDirectoryFiles = m_strDstDirectory + L"/" + strFileName;// + _T("_files");
m_strFileName = strFileName; m_strFileName = strFileName;
NSDirectory::CreateDirectory(m_strDstDirectoryFiles); if (!m_bIsOnlyTextMode)
NSDirectory::CreateDirectory(m_strDstDirectoryFiles);
m_strDstMedia = m_strDstDirectoryFiles + L"/media"; m_strDstMedia = m_strDstDirectoryFiles + L"/media";
NSDirectory::CreateDirectory(m_strDstMedia); if (!m_bIsOnlyTextMode)
NSDirectory::CreateDirectory(m_strDstMedia);
std::wstring strFileFonts = m_strDstDirectoryFiles + L"/fonts"; std::wstring strFileFonts = m_strDstDirectoryFiles + L"/fonts";
NSDirectory::CreateDirectory(strFileFonts); if (!m_bIsOnlyTextMode)
NSDirectory::CreateDirectory(strFileFonts);
std::wstring strDocRendererS = m_strDstDirectoryFiles + L"/document_temp.bin"; std::wstring strDocRendererS = m_strDstDirectoryFiles + L"/document_temp.bin";
m_oFileWriter.CreateFileW(strDocRendererS); if (!m_bIsOnlyTextMode)
m_oFileWriter.CreateFileW(strDocRendererS);
m_oPage.Clear(); m_oPage.Clear();
m_arrPages.clear(); m_arrPages.clear();
......
...@@ -26,7 +26,7 @@ INCLUDEPATH += \ ...@@ -26,7 +26,7 @@ INCLUDEPATH += \
TEMPLATE = app TEMPLATE = app
############### destination path ############### ############### destination path ###############
DESTINATION_SDK_PATH = $$PWD/../../SDK/lib DESTINATION_SDK_PATH = $$PWD/../../build/lib
# WINDOWS # WINDOWS
win32:contains(QMAKE_TARGET.arch, x86_64):{ win32:contains(QMAKE_TARGET.arch, x86_64):{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment