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
17f49033
Commit
17f49033
authored
Sep 29, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/hotfix/v5.0.1' into develop
parents
f9e87624
dc89e1d4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
103 additions
and
37 deletions
+103
-37
ASCOfficeOdfFile/formulasconvert/formulasconvert_odf.cpp
ASCOfficeOdfFile/formulasconvert/formulasconvert_odf.cpp
+1
-1
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp
+8
-4
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
+59
-9
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
+17
-3
ASCOfficeRtfFile/RtfFormatLib/source/Ole1FormatReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Ole1FormatReader.h
+1
-0
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
+7
-3
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
+0
-15
Common/DocxFormat/Source/XlsxFormat/Chart/ChartSerialize.cpp
Common/DocxFormat/Source/XlsxFormat/Chart/ChartSerialize.cpp
+10
-2
No files found.
ASCOfficeOdfFile/formulasconvert/formulasconvert_odf.cpp
View file @
17f49033
...
...
@@ -480,7 +480,7 @@ namespace formulasconvert {
else
{
size_t
sz_workstr
=
workstr
.
length
();
if
(
workstr
.
substr
(
0
,
std
::
min
((
size_t
)
3
,
sz_workstr
))
==
L"of:"
)
//sample_02neu_crashes.ods
if
(
workstr
.
substr
(
0
,
(
std
::
min
)
((
size_t
)
3
,
sz_workstr
))
==
L"of:"
)
//sample_02neu_crashes.ods
workstr
=
workstr
.
substr
(
3
);
}
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp
View file @
17f49033
...
...
@@ -174,7 +174,8 @@ namespace PPTX
NSBinPptxRW
::
CBinaryFileWriter
*
old_writer
=
oDrawingConverter
.
m_pBinaryWriter
;
NSCommon
::
smart_ptr
<
OOX
::
IFileContainer
>
old_rels
=
*
pWriter
->
m_pCurrentContainer
;
BinDocxRW
::
CDocxSerializer
*
old_serial
=
pWriter
->
m_pMainDocument
;
NSCommon
::
smart_ptr
<
PPTX
::
Theme
>
old_theme
=
*
pWriter
->
m_pTheme
;
oDrawingConverter
.
m_pBinaryWriter
=
pWriter
;
oDocxSerializer
.
m_pParamsWriter
=
new
BinDocxRW
::
ParamsWriter
(
pWriter
,
&
oFontProcessor
,
&
oDrawingConverter
,
NULL
);
...
...
@@ -189,6 +190,7 @@ namespace PPTX
oDrawingConverter
.
m_pBinaryWriter
=
old_writer
;
*
pWriter
->
m_pCurrentContainer
=
old_rels
;
pWriter
->
m_pMainDocument
=
old_serial
;
*
pWriter
->
m_pTheme
=
old_theme
;
}
else
if
(
office_checker
.
nFileType
==
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX
||
office_checker
.
nFileType
==
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM
)
...
...
@@ -201,9 +203,10 @@ namespace PPTX
DocWrapper
::
FontProcessor
fp
;
NSBinPptxRW
::
CDrawingConverter
oDrawingConverter
;
NSBinPptxRW
::
CBinaryFileWriter
*
old_writer
=
oDrawingConverter
.
m_pBinaryWriter
;
NSBinPptxRW
::
CBinaryFileWriter
*
old_writer
=
oDrawingConverter
.
m_pBinaryWriter
;
NSCommon
::
smart_ptr
<
OOX
::
IFileContainer
>
old_rels
=
*
pWriter
->
m_pCurrentContainer
;
NSCommon
::
smart_ptr
<
PPTX
::
Theme
>
old_theme
=
*
pWriter
->
m_pTheme
;
oDrawingConverter
.
m_pBinaryWriter
=
pWriter
;
BinXlsxRW
::
BinaryFileWriter
xlsxBinaryWriter
(
fp
);
...
...
@@ -215,7 +218,8 @@ namespace PPTX
oDrawingConverter
.
m_pBinaryWriter
=
old_writer
;
*
pWriter
->
m_pCurrentContainer
=
old_rels
;
}
*
pWriter
->
m_pTheme
=
old_theme
;
}
//else if (office_checker.nFileType == AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX)
//{
//}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
View file @
17f49033
...
...
@@ -46,7 +46,14 @@ HRESULT ConvertOle1ToOle2(BYTE *pData, int nSize, std::wstring sOle2Name)
NSFile
::
CFileBinary
file
;
file
.
CreateFileW
(
sOle2Name
);
file
.
WriteFile
(
ole1Reader
.
NativeData
,
ole1Reader
.
NativeDataSize
);
if
(
ole1Reader
.
NativeDataSize
>
0
)
//conv_NI38P7GBIpw1aD84H3k.rtf
{
file
.
WriteFile
(
ole1Reader
.
NativeData
,
ole1Reader
.
NativeDataSize
);
}
else
{
file
.
WriteFile
(
pData
,
nSize
);
}
file
.
CloseFile
();
return
S_FALSE
;
}
...
...
@@ -817,8 +824,7 @@ bool RtfShadingRowCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRe
else
return
false
;
return
true
;
}
}
bool
RtfCharPropsCommand
::
ExecuteCommand
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
std
::
string
sCommand
,
bool
hasParameter
,
int
parameter
,
RtfCharProperty
*
charProps
,
bool
bLookOnBorder
)
{
if
(
!
charProps
)
return
false
;
...
...
@@ -1645,7 +1651,49 @@ bool RtfFieldInstReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
return
RtfParagraphPropDestination
::
ExecuteCommand
(
oDocument
,
oReader
,
(
*
this
),
sCommand
,
hasParameter
,
parameter
);
}
}
bool
RtfOleBinReader
::
ExecuteCommand
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
std
::
string
sCommand
,
bool
hasParameter
,
int
parameter
)
{
if
(
"objdata"
==
sCommand
)
return
true
;
if
(
"bin"
==
sCommand
)
// from RtfOleReader - conv_NI38P7GBIpw1aD84H3k.rtf
{
int
nDataSize
=
0
;
if
(
hasParameter
)
nDataSize
=
parameter
;
BYTE
*
pData
=
NULL
;
oReader
.
m_oLex
.
ReadBytes
(
parameter
,
&
pData
);
m_arData
.
push_back
(
std
::
string
((
char
*
)
pData
,
nDataSize
));
RELEASEOBJECT
(
pData
);
}
return
true
;
}
void
RtfOleBinReader
::
ExecuteText
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
std
::
wstring
sText
)
{
m_arData
.
push_back
(
std
::
string
(
sText
.
begin
(),
sText
.
end
()));
}
void
RtfOleBinReader
::
GetData
(
BYTE
**
ppData
,
long
&
nSize
)
{
nSize
=
0
;
for
(
size_t
i
=
0
;
i
<
m_arData
.
size
();
i
++
)
{
nSize
+=
m_arData
[
i
].
length
();
}
(
*
ppData
)
=
new
BYTE
[
nSize
];
int
pos
=
0
;
for
(
size_t
i
=
0
;
i
<
m_arData
.
size
();
i
++
)
{
memcpy
((
*
ppData
)
+
pos
,
m_arData
[
i
].
c_str
(),
m_arData
[
i
].
length
());
pos
+=
m_arData
[
i
].
length
();
}
}
bool
RtfOleReader
::
ExecuteCommand
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
std
::
string
sCommand
,
bool
hasParameter
,
int
parameter
)
{
if
(
"object"
==
sCommand
)
...
...
@@ -1663,19 +1711,21 @@ bool RtfOleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, st
}
else
if
(
"objdata"
==
sCommand
)
{
std
::
wstring
sOleData
;
TextReader
oTextReader
(
sOleData
,
false
);
StartSubReader
(
o
Text
Reader
,
oDocument
,
oReader
);
RtfOleBinReader
oBinReader
;
StartSubReader
(
o
Bin
Reader
,
oDocument
,
oReader
);
BYTE
*
pData
=
NULL
;
long
nSize
=
0
;
RtfUtility
::
WriteDataToBinary
(
sOleData
,
&
pData
,
nSize
);
oBinReader
.
GetData
(
&
pData
,
nSize
);
if
(
0
!=
nSize
&&
pData
)
{
HRESULT
hRes
=
S_FALSE
;
//конвертация Ole1 в Ole2
#if 0//defined(_WIN32) || defined(_WIN64)
#if 0
//defined(_WIN32) || defined(_WIN64)
RtfOle1ToOle2Stream oStream;
oStream.lpstbl = new OLESTREAMVTBL();
...
...
@@ -1689,7 +1739,7 @@ bool RtfOleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, st
std::wstring sOleStorageName = Utils::CreateTempFile( oReader.m_sTempFolder );
IStorage* piMSStorage = NULL;
if ( SUCCEEDED( StgCreateDocfile( sOleStorageName, STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED/* | STGM_DELETEONRELEASE*/, NULL, &piMSStorage) ) )
if ( SUCCEEDED( StgCreateDocfile( sOleStorageName
.c_str()
, STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED/* | STGM_DELETEONRELEASE*/, NULL, &piMSStorage) ) )
{
hRes = OleConvertOLESTREAMToIStorage( &oStream, piMSStorage, NULL );
piMSStorage->Commit( STGC_DEFAULT );
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
View file @
17f49033
...
...
@@ -109,13 +109,13 @@ public:
}
};
//class RtfOldList;
class
TextReader
:
public
RtfAbstractReader
class
TextReader
:
public
RtfAbstractReader
{
private:
std
::
wstring
&
m_sName
;
bool
m_bErease
;
bool
m_bErease
;
public:
TextReader
(
std
::
wstring
&
sName
,
bool
bErease
=
true
)
:
m_sName
(
sName
),
m_bErease
(
bErease
)
TextReader
(
std
::
wstring
&
sName
,
bool
bErease
=
true
)
:
m_sName
(
sName
),
m_bErease
(
bErease
)
{
}
void
ExecuteText
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
std
::
wstring
sText
)
...
...
@@ -782,6 +782,20 @@ public:
bool
ExecuteCommand
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
std
::
string
sCommand
,
bool
hasParameter
,
int
parameter
);
};
class
RtfOleBinReader
:
public
RtfAbstractReader
{
private:
std
::
vector
<
std
::
string
>
/*&*/
m_arData
;
public:
RtfOleBinReader
()
{
}
bool
ExecuteCommand
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
std
::
string
sCommand
,
bool
hasParameter
,
int
parameter
);
void
ExecuteText
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
std
::
wstring
sText
);
void
GetData
(
BYTE
**
ppData
,
long
&
nSize
);
};
class
RtfTrackerChangesReader
:
public
RtfAbstractReader
{
private:
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Ole1FormatReader.h
View file @
17f49033
...
...
@@ -300,6 +300,7 @@ public:
Ole1FormatReader
(
BYTE
*
pData
,
int
Size
)
{
NativeDataSize
=
0
;
if
(
!
pData
||
Size
<
8
)
return
;
CDataStream
stream
(
pData
,
Size
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfOle.cpp
View file @
17f49033
...
...
@@ -93,10 +93,14 @@ std::wstring RtfOle::RenderToOOX(RenderParameter oRenderParameter)
RenderParameter
oNewRenderParameter
=
oRenderParameter
;
oNewRenderParameter
.
nType
=
RENDER_TO_OOX_PARAM_SHAPE_WSHAPE2
;
m_oResultPic
->
m_bIsOle
=
true
;
sResult
+=
m_oResultPic
->
RenderToOOX
(
oNewRenderParameter
);
oNewRenderParameter
.
nValue
=
m_oResultPic
->
m_nID
;
if
(
m_oResultPic
)
{
m_oResultPic
->
m_bIsOle
=
true
;
sResult
+=
m_oResultPic
->
RenderToOOX
(
oNewRenderParameter
);
oNewRenderParameter
.
nValue
=
m_oResultPic
->
m_nID
;
}
sResult
+=
RenderToOOXOnlyOle
(
oNewRenderParameter
);
sResult
+=
L"</w:object>"
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
View file @
17f49033
...
...
@@ -617,21 +617,6 @@ public:
file
.
CloseFile
();
}
static
void
WriteDataToBinary
(
std
::
wstring
sData
,
BYTE
**
ppData
,
long
&
nSize
)
{
wchar_t
*
buf
=
(
wchar_t
*
)
sData
.
c_str
();
int
nLengthText
=
(
int
)
sData
.
length
();
nSize
=
nLengthText
/
2
;
BYTE
*
buf2
=
new
BYTE
[
nSize
];
(
*
ppData
)
=
buf2
;
BYTE
nByte
=
0
;
for
(
long
i
=
0
;
i
<
nSize
;
i
++
)
{
nByte
=
ToByte
(
buf
[
2
*
i
])
<<
4
;
nByte
|=
ToByte
(
buf
[
2
*
i
+
1
]);
buf2
[
i
]
=
nByte
;
}
}
static
std
::
wstring
DecodeHex
(
std
::
wstring
sText
)
{
std
::
wstring
sHexText
;
...
...
Common/DocxFormat/Source/XlsxFormat/Chart/ChartSerialize.cpp
View file @
17f49033
...
...
@@ -2771,8 +2771,16 @@ namespace OOX{
if
(
_T
(
"val"
)
==
wsName
)
{
double
*
pNewElem
=
new
double
;
std
::
wstring
sVal
=
oReader
.
GetText
();
*
pNewElem
=
_tstof
(
sVal
.
c_str
());
std
::
wstring
sVal
=
oReader
.
GetText
();
// Yp2bbamFbt1iHeX3WM0_.pptx - value = "-"
*
pNewElem
=
0
;
__try
{
*
pNewElem
=
_tstof
(
sVal
.
c_str
());
}
catch
(...)
{
}
m_val
=
pNewElem
;
}
WritingElement_ReadAttributes_End_No_NS
(
oReader
)
...
...
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