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
08ce8cb3
Commit
08ce8cb3
authored
Oct 26, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat ...
parent
5efe043a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
115 additions
and
25 deletions
+115
-25
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Obj.h
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Obj.h
+6
-7
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.cpp
...e2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.cpp
+4
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.h
...ile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.h
+3
-3
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
+2
-1
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.cpp
...XlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.cpp
+94
-10
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.h
...ceXlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.h
+2
-1
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
...XlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
+4
-2
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Obj.h
View file @
08ce8cb3
...
...
@@ -89,17 +89,16 @@ public:
struct
_
{
_
()
:
bFill
(
false
),
enabled
(
false
),
fill
(
0
),
line
(
0
),
flag
(
0
),
flag2
(
0
)
{}
bool
enabled
;
bool
enabled
=
false
;
ODRAW
::
OfficeArtRecordPtr
anchor
;
std
::
vector
<
BaseObjectPtr
>
additional
;
bool
bFill
;
bool
bFill
=
false
;
ShortXLAnsiString
name
;
_UINT32
fill
;
_UINT32
line
;
_UINT16
flag
;
_UINT16
flag2
;
_UINT32
fill
=
0
;
_UINT32
line
=
0
;
_UINT16
flag
=
0
;
_UINT16
flag2
=
0
;
}
old_version
;
};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.cpp
View file @
08ce8cb3
...
...
@@ -53,7 +53,10 @@ void PictFmlaKey::load(CFRecord& record)
{
char
*
buf
=
new
char
[
cbKey
];
memcpy
(
buf
,
record
.
getCurData
<
char
>
(),
cbKey
);
keyBuf
=
std
::
string
(
buf
,
cbKey
);
std
::
string
str
=
std
::
string
(
buf
,
cbKey
);
keyBuf
=
std
::
wstring
(
str
.
begin
(),
str
.
end
());
record
.
skipNunBytes
(
cbKey
);
delete
[]
buf
;
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.h
View file @
08ce8cb3
...
...
@@ -33,7 +33,7 @@
#include "BiffStructure.h"
#include "ObjFmla.h"
#include
<Logic/Biff_structures/FtPioGrbit.h>
#include
"FtPioGrbit.h"
namespace
XLS
{
...
...
@@ -51,8 +51,8 @@ public:
virtual
void
load
(
CFRecord
&
record
);
_UINT32
cbKey
;
std
::
string
keyBuf
;
// ActiveX license key
_UINT32
cbKey
;
std
::
wstring
keyBuf
;
// ActiveX license key
ObjFmla
fmlaLinkedCell
;
ObjFmla
fmlaListFillRange
;
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
View file @
08ce8cb3
...
...
@@ -1969,8 +1969,9 @@ void XlsConverter::convert(XLS::Obj * obj)
xlsx_context
->
get_drawing_context
().
set_control
(
objectId
);
xlsx_context
->
current_activeX
().
setClassId
(
info
);
xlsx_context
->
current_activeX
().
setDataBinRid
(
objectId
,
target
);
xlsx_context
->
current_activeX
().
setProgId
(
info
);
xlsx_context
->
current_activeX
().
setLicense
(
obj
->
pictFmla
.
key
.
keyBuf
);
}
else
if
(
!
obj
->
pictFlags
.
fPrstm
)
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.cpp
View file @
08ce8cb3
...
...
@@ -59,8 +59,9 @@ class oox_activeX_context::Impl
public:
Impl
()
{}
std
::
wstring
activeXDataBinRid
;
std
::
wstring
activeXClassId
;
std
::
wstring
dataBinRid
;
std
::
wstring
progId
;
std
::
wstring
license
;
std
::
vector
<
rel_
>
activeXRels_
;
...
...
@@ -110,13 +111,17 @@ oox_activeX_context::~oox_activeX_context()
}
void
oox_activeX_context
::
setDataBinRid
(
const
std
::
wstring
&
rid
,
const
std
::
wstring
&
bin_data
)
{
impl_
->
activeXD
ataBinRid
=
rid
;
impl_
->
d
ataBinRid
=
rid
;
impl_
->
add_rels
(
true
,
rid
,
bin_data
,
L"http://schemas.microsoft.com/office/2006/relationships/activeXControlBinary"
);
}
void
oox_activeX_context
::
set
ClassId
(
const
std
::
wstring
&
class
Id
)
void
oox_activeX_context
::
set
ProgId
(
const
std
::
wstring
&
prog
Id
)
{
impl_
->
activeXClassId
=
classId
;
impl_
->
progId
=
progId
;
}
void
oox_activeX_context
::
setLicense
(
const
std
::
wstring
&
license
)
{
impl_
->
license
=
license
;
}
void
oox_activeX_context
::
add_rels
(
bool
isInternal
,
...
...
@@ -132,16 +137,95 @@ void oox_activeX_context::dump_rels(rels & Rels)
}
void
oox_activeX_context
::
write_to
(
std
::
wostream
&
strm
)
{
//https://msdn.microsoft.com/en-us/library/ff533853(v=office.12).aspx
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE
(
L"ax:ocx"
)
{
CP_XML_ATTR
(
L"xmlns:ax"
,
L"http://schemas.microsoft.com/office/2006/activeX"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"ax:classid"
,
impl_
->
activeXClassId
);
std
::
wstring
classId
;
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L"Forms."
))
// Microsoft Forms 2.0
{
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".CommandButton."
))
{
classId
=
L"{D7053240-CE69-11CD-A777-00DD01143C57}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".CheckBox."
))
{
classId
=
L"{8BD21D40-EC42-11CE-9E0D-00AA006002F3}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".ComboBox."
))
{
classId
=
L"{8BD21D30-EC42-11CE-9E0D-00AA006002F3}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".Form."
))
{
classId
=
L"{C62A69F0-16DC-11CE-9E98-00AA00574A4F}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".Frame."
))
{
classId
=
L"{6E182020-F460-11CE-9BCD-00AA00608E01}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".Image."
))
{
classId
=
L"{4C599241-6926-101B-9992-00000B65C6F9}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".OptionButton."
))
{
classId
=
L"{8BD21D50-EC42-11CE-9E0D-00AA006002F3}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".Label."
))
{
classId
=
L"{978C9E23-D4B0-11CE-BF2D-00AA003F40D0}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".ListBox."
))
{
classId
=
L"{8BD21D20-EC42-11CE-9E0D-00AA006002F3}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".ScrollBar."
))
{
classId
=
L"{DFD181E0-5E2F-11CE-A449-00AA004A803D}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".SpinButton."
))
{
classId
=
L"{79176FB0-B7F2-11CE-97EF-00AA006D2776}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".TabStrip."
))
{
classId
=
L"{EAE50EB0-4A62-11CE-BED6-00AA00611080}"
;
}
else
if
(
std
::
wstring
::
npos
!=
impl_
->
progId
.
find
(
L".TextBox."
))
{
classId
=
L"{8BD21D10-EC42-11CE-9E0D-00AA006002F3}"
;
}
}
if
(
!
classId
.
empty
())
{
//classId = L"{00000000-0000-0000-0000-000000000000}";
CP_XML_ATTR
(
L"ax:classid"
,
classId
);
}
CP_XML_ATTR
(
L"ax:persistence"
,
L"persistStreamInit"
);
CP_XML_ATTR
(
L"r:id"
,
impl_
->
activeXDataBinRid
);
CP_XML_ATTR
(
L"r:id"
,
impl_
->
dataBinRid
);
if
(
!
impl_
->
license
.
empty
())
{
CP_XML_ATTR
(
L"ax:license"
,
impl_
->
license
);
}
CP_XML_ATTR
(
L"xmlns:ax"
,
L"http://schemas.microsoft.com/office/2006/activeX"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
//if (!impl_->progId.empty())
//{
// CP_XML_NODE(L"ax:ocxPr")
// {
// CP_XML_ATTR(L"ax:name", L"Name");
// CP_XML_ATTR(L"ax:value", impl_->progId);
// }
//}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.h
View file @
08ce8cb3
...
...
@@ -53,7 +53,8 @@ public:
external_items
::
Type
type
);
void
setDataBinRid
(
const
std
::
wstring
&
rid
,
const
std
::
wstring
&
bin_data
);
void
setClassId
(
const
std
::
wstring
&
classId
);
void
setProgId
(
const
std
::
wstring
&
classId
);
void
setLicense
(
const
std
::
wstring
&
license
);
private:
class
Impl
;
_CP_PTR
(
Impl
)
impl_
;
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
View file @
08ce8cb3
...
...
@@ -2172,9 +2172,9 @@ void xlsx_drawing_context::serialize_activeX(std::wostream & stream, _drawing_st
CP_XML_ATTR
(
L"shapeId"
,
drawing_state
->
id
);
CP_XML_ATTR
(
L"r:id"
,
drawing_state
->
objectId
);
if
(
!
drawing_state
->
objectProgId
.
empty
())
if
(
!
drawing_state
->
name
.
empty
())
{
CP_XML_ATTR
(
L"name"
,
drawing_state
->
objectProgId
);
CP_XML_ATTR
(
L"name"
,
drawing_state
->
name
);
}
CP_XML_NODE
(
L"controlPr"
)
...
...
@@ -2274,12 +2274,14 @@ void xlsx_drawing_context::serialize_object(std::wostream & stream, _drawing_sta
void
xlsx_drawing_context
::
set_name
(
const
std
::
wstring
&
str
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
str
.
empty
())
return
;
current_drawing_states
->
back
()
->
name
=
str
;
}
void
xlsx_drawing_context
::
set_description
(
const
std
::
wstring
&
str
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
str
.
empty
())
return
;
current_drawing_states
->
back
()
->
description
=
str
;
}
...
...
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