Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
16af8670
Commit
16af8670
authored
Apr 26, 2016
by
Oleg Korshul
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
сделал полностью работу с быстрым открытием в десктопе
parent
4ab14c9c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
159 additions
and
11 deletions
+159
-11
HtmlRenderer/include/HTMLRenderer3.h
HtmlRenderer/include/HTMLRenderer3.h
+7
-1
HtmlRenderer/src/HTMLRenderer3.cpp
HtmlRenderer/src/HTMLRenderer3.cpp
+109
-4
HtmlRenderer/src/Writer.h
HtmlRenderer/src/Writer.h
+42
-5
HtmlRenderer/test/test.pro
HtmlRenderer/test/test.pro
+1
-1
No files found.
HtmlRenderer/include/HTMLRenderer3.h
View file @
16af8670
...
@@ -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
;
};
};
...
...
HtmlRenderer/src/HTMLRenderer3.cpp
View file @
16af8670
This diff is collapsed.
Click to expand it.
HtmlRenderer/src/Writer.h
View file @
16af8670
...
@@ -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
();
...
...
HtmlRenderer/test/test.pro
View file @
16af8670
...
@@ -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
)
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment