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
5818f499
Commit
5818f499
authored
Aug 08, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
htmlrenderer no base64
parent
691042c5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
15 deletions
+29
-15
HtmlRenderer/include/HTMLRenderer3.h
HtmlRenderer/include/HTMLRenderer3.h
+1
-1
HtmlRenderer/src/HTMLRenderer3.cpp
HtmlRenderer/src/HTMLRenderer3.cpp
+2
-2
HtmlRenderer/src/Writer.h
HtmlRenderer/src/Writer.h
+26
-12
No files found.
HtmlRenderer/include/HTMLRenderer3.h
View file @
5818f499
...
@@ -181,7 +181,7 @@ namespace NSHtmlRenderer
...
@@ -181,7 +181,7 @@ namespace NSHtmlRenderer
virtual
HRESULT
put_Mode
(
LONG
lMode
);
virtual
HRESULT
put_Mode
(
LONG
lMode
);
virtual
HRESULT
CreateOfficeFile
(
std
::
wstring
bsFileName
,
const
std
::
wstring
&
fontsDir
=
L""
);
virtual
HRESULT
CreateOfficeFile
(
std
::
wstring
bsFileName
,
const
std
::
wstring
&
fontsDir
=
L""
);
virtual
HRESULT
CloseFile
();
virtual
HRESULT
CloseFile
(
bool
bIsNoBase64
=
false
);
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
);
...
...
HtmlRenderer/src/HTMLRenderer3.cpp
View file @
5818f499
...
@@ -1287,14 +1287,14 @@ namespace NSHtmlRenderer
...
@@ -1287,14 +1287,14 @@ namespace NSHtmlRenderer
m_pInternal
->
m_oSimpleGraphicsConverter
.
SetRenderer
(
this
);
m_pInternal
->
m_oSimpleGraphicsConverter
.
SetRenderer
(
this
);
return
S_OK
;
return
S_OK
;
}
}
HRESULT
CASCHTMLRenderer3
::
CloseFile
()
HRESULT
CASCHTMLRenderer3
::
CloseFile
(
bool
bIsNoBase64
)
{
{
if
(
m_pInternal
->
m_bPageOpened
)
if
(
m_pInternal
->
m_bPageOpened
)
{
{
m_pInternal
->
EndPage
();
m_pInternal
->
EndPage
();
}
}
m_pInternal
->
m_oWriter
.
WriteEndDocument
(
m_pInternal
->
m_oDocument
);
m_pInternal
->
m_oWriter
.
WriteEndDocument
(
m_pInternal
->
m_oDocument
,
bIsNoBase64
);
return
S_OK
;
return
S_OK
;
}
}
...
...
HtmlRenderer/src/Writer.h
View file @
5818f499
...
@@ -2075,7 +2075,7 @@ namespace NSHtmlRenderer
...
@@ -2075,7 +2075,7 @@ namespace NSHtmlRenderer
m_bIsGids
=
false
;
m_bIsGids
=
false
;
}
}
void
WriteEndDocument
(
CDocument
&
oDocument
)
void
WriteEndDocument
(
CDocument
&
oDocument
,
bool
bIsNoBase64
)
{
{
CMetafile
oDocInfo
;
CMetafile
oDocInfo
;
oDocInfo
.
WriteLONG
(
m_lPagesCount
);
oDocInfo
.
WriteLONG
(
m_lPagesCount
);
...
@@ -2114,6 +2114,17 @@ namespace NSHtmlRenderer
...
@@ -2114,6 +2114,17 @@ namespace NSHtmlRenderer
NSFile
::
CFileBinary
::
Remove
(
m_strDstDirectoryFiles
+
L"/document_temp.bin"
);
NSFile
::
CFileBinary
::
Remove
(
m_strDstDirectoryFiles
+
L"/document_temp.bin"
);
if
(
bIsNoBase64
)
{
NSFile
::
CFileBinary
oDestinationFile
;
oDestinationFile
.
CreateFileW
(
m_strDstDirectoryFiles
+
L"/Editor.bin"
);
oDestinationFile
.
WriteFile
(
pData
,
(
DWORD
)
lSizeAll
);
oDestinationFile
.
CloseFile
();
RELEASEARRAYOBJECTS
(
pData
);
}
else
{
char
*
pOutput
=
NULL
;
char
*
pOutput
=
NULL
;
int
nOutputLen
=
0
;
int
nOutputLen
=
0
;
NSFile
::
CBase64Converter
::
Encode
(
pData
,
lSizeAll
,
pOutput
,
nOutputLen
,
NSBase64
::
B64_BASE64_FLAG_NOCRLF
);
NSFile
::
CBase64Converter
::
Encode
(
pData
,
lSizeAll
,
pOutput
,
nOutputLen
,
NSBase64
::
B64_BASE64_FLAG_NOCRLF
);
...
@@ -2131,6 +2142,9 @@ namespace NSHtmlRenderer
...
@@ -2131,6 +2142,9 @@ namespace NSHtmlRenderer
_file
.
CloseFile
();
_file
.
CloseFile
();
RELEASEARRAYOBJECTS
(
pOutput
);
}
::
CFontManager
*
pFontManager
=
m_pApplicationFonts
->
GenerateFontManager
();
::
CFontManager
*
pFontManager
=
m_pApplicationFonts
->
GenerateFontManager
();
m_oDstFontGenerator
.
WriteFonts
(
pFontManager
,
m_strDstDirectoryFiles
+
L"/fonts"
,
m_bIsGids
);
m_oDstFontGenerator
.
WriteFonts
(
pFontManager
,
m_strDstDirectoryFiles
+
L"/fonts"
,
m_bIsGids
);
RELEASEOBJECT
(
pFontManager
);
RELEASEOBJECT
(
pFontManager
);
...
...
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