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
8b80aa94
Commit
8b80aa94
authored
Oct 27, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat - ..
parent
f960fc60
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
371 additions
and
61 deletions
+371
-61
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BiffRecord.cpp
...sFile2/source/XlsFormat/Logic/Biff_records/BiffRecord.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Obj.cpp
...fficeXlsFile2/source/XlsFormat/Logic/Biff_records/Obj.cpp
+2
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
...Format/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
+2
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ObjLinkFmla.cpp
...e2/source/XlsFormat/Logic/Biff_structures/ObjLinkFmla.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
...ceXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
+12
-15
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.h
...ficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.h
+2
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/CodePageOle.cpp
...Logic/SummaryInformationStream/Structures/CodePageOle.cpp
+49
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/CodePageOle.h
...t/Logic/SummaryInformationStream/Structures/CodePageOle.h
+33
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertyFactory.cpp
...c/SummaryInformationStream/Structures/PropertyFactory.cpp
+13
-1
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
+42
-16
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.cpp
...XlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.cpp
+30
-6
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_conversion_context.cpp
...File2/source/XlsXlsxConverter/xlsx_conversion_context.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
...XlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
+153
-5
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h
...ceXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h
+27
-5
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_tablecontext.cpp
...iceXlsFile2/source/XlsXlsxConverter/xlsx_tablecontext.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_tablecontext.h
...fficeXlsFile2/source/XlsXlsxConverter/xlsx_tablecontext.h
+1
-1
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BiffRecord.cpp
View file @
8b80aa94
...
...
@@ -70,7 +70,7 @@ const bool BiffRecord::read(CFStreamCacheReader& reader, BaseObject* parent, con
size_t
rdPtr
=
record
->
getRdPtr
();
size_t
typeId
=
getTypeId
();
if
(
record
->
getDataSize
()
!=
record
->
getRdPtr
()
&&
getTypeId
()
!=
rt_ANY_TYPE
)
if
(
record
->
getDataSize
()
!=
record
->
getRdPtr
()
&&
getTypeId
()
!=
rt_ANY_TYPE
&&
getTypeId
()
!=
rt_MsoDrawing
)
{
Log
::
warning
(
STR
::
int2str
(
record
->
getDataSize
()
-
record
->
getRdPtr
(),
10
)
+
" unsigned chars were not processed while reading from "
+
record
->
getTypeString
());
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Obj.cpp
View file @
8b80aa94
...
...
@@ -123,7 +123,8 @@ void Obj::readFields(CFRecord& record)
OBJ_RadioButton
==
cmo
.
ot
||
OBJ_SpinControl
==
cmo
.
ot
||
OBJ_Scrollbar
==
cmo
.
ot
||
OBJ_List
==
cmo
.
ot
/*|| OBJ_DropdownList == cmo.ot*/
)
OBJ_List
==
cmo
.
ot
||
OBJ_DropdownList
==
cmo
.
ot
)
{
linkFmla
.
load
(
record
);
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
View file @
8b80aa94
...
...
@@ -64,6 +64,8 @@ OfficeArtRecordPtr OfficeArtContainer::CreateOfficeArt(unsigned short type)
OfficeArtRecordPtr
art_record
;
switch
(
type
)
{
case
DggContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtDggContainer
(
anchor_type_
));
break
;
case
DgContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtDgContainer
(
anchor_type_
));
break
;
case
FDG
:
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ObjLinkFmla.cpp
View file @
8b80aa94
...
...
@@ -45,7 +45,7 @@ void ObjLinkFmla::load(CFRecord& record)
unsigned
short
ft
;
record
>>
ft
;
if
(
ft
!=
0x0014
)
if
(
ft
!=
0x0014
&&
ft
!=
0x000e
)
{
record
.
RollRdPtrBack
(
2
);
return
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
View file @
8b80aa94
...
...
@@ -31,17 +31,16 @@
*/
#include "OBJECTS.h"
#include <Logic/Biff_records/MsoDrawingSelection.h>
#include <Logic/Biff_records/MsoDrawing.h>
#include "TEXTOBJECT.h"
#include "OBJ.h"
#include "CHART.h"
#include "IMDATAOBJECT.h"
#include <Logic/Biff_unions/TEXTOBJECT.h>
#include <Logic/Biff_unions/OBJ.h>
#include <Logic/Biff_unions/CHART.h>
#include <Logic/Biff_unions/IMDATAOBJECT.h>
#include <Logic/Biff_records/Continue.h>
#include <Logic/Biff_records/Obj.h>
#include <Logic/Biff_records/IMDATA.h>
#include "../Biff_records/MsoDrawingSelection.h"
#include "../Biff_records/MsoDrawing.h"
#include "../Biff_records/Continue.h"
#include "../Biff_records/Obj.h"
#include "../Biff_records/IMDATA.h"
namespace
XLS
{
...
...
@@ -109,20 +108,19 @@ public:
const
bool
loadContent
(
BinProcessor
&
proc
)
{
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
return
false
;
}
const
bool
loadContentRead
(
BinReaderProcessor
&
proc
)
{
bool
res
=
proc
.
mandatory
(
*
mso_drawing_
);
bool
res
=
proc
.
optional
(
*
mso_drawing_
);
Parenthesis_OBJECTS_2
parenthesis_objects_2
(
mso_drawing_
);
int
count
=
proc
.
repeated
(
parenthesis_objects_2
,
0
,
0
);
int
count
2
=
proc
.
repeated
(
parenthesis_objects_2
,
0
,
0
);
return
res
||
count
>
0
;
return
res
||
(
count2
>
0
)
;
}
MsoDrawingPtr
mso_drawing_
;
...
...
@@ -138,7 +136,6 @@ BaseObjectPtr OBJECTS::clone()
const
bool
OBJECTS
::
loadContent
(
BinProcessor
&
proc
)
{
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
return
false
;
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.h
View file @
8b80aa94
...
...
@@ -39,7 +39,6 @@ namespace XLS
class
MsoDrawing
;
typedef
boost
::
shared_ptr
<
MsoDrawing
>
MsoDrawingPtr
;
// Logical representation of OBJECTS union of records
class
OBJECTS
:
public
CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME
(
OBJECTS
)
...
...
@@ -58,7 +57,6 @@ public:
bool
is_inside_chart_sheet_
;
MsoDrawingPtr
m_MsoDrawing
;
};
}
// namespace XLS
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/CodePageOle.cpp
View file @
8b80aa94
...
...
@@ -134,6 +134,55 @@ PropertyDateCreate::PropertyDateCreate(const unsigned short value_type, XLS::CFS
{
*
stream
>>
dwLowDateTime
>>
dwHighDateTime
;
}
}
PropertyWordCount
::
PropertyWordCount
(
const
unsigned
short
value_type
,
XLS
::
CFStreamPtr
stream
)
{
count
=
0
;
if
(
value_type
==
Property
::
VT_I4
)
{
*
stream
>>
count
;
}
else
if
(
value_type
==
Property
::
VT_LPSTR
)
{
_UINT32
size
;
*
stream
>>
size
;
if
(
size
>
0
)
{
char
*
s
=
new
char
[
size
];
stream
->
read
(
s
,
size
);
value
=
STR
::
toStdWString
(
s
,
size
,
0
);
delete
[]
s
;
}
}
}
PropertyCharCount
::
PropertyCharCount
(
const
unsigned
short
value_type
,
XLS
::
CFStreamPtr
stream
)
{
count
=
0
;
if
(
value_type
==
Property
::
VT_I4
)
{
*
stream
>>
count
;
}
else
if
(
value_type
==
Property
::
VT_LPSTR
)
{
_UINT32
size
;
*
stream
>>
size
;
if
(
size
>
0
)
{
char
*
s
=
new
char
[
size
];
stream
->
read
(
s
,
size
);
value
=
STR
::
toStdWString
(
s
,
size
,
0
);
delete
[]
s
;
}
}
}
PropertyDocSecurity
::
PropertyDocSecurity
(
const
unsigned
short
value_type
,
XLS
::
CFStreamPtr
stream
)
{
value
=
0
;
if
(
value_type
==
Property
::
VT_I4
)
{
*
stream
>>
value
;
}
}
}
// namespace OLEPS
ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/CodePageOle.h
View file @
8b80aa94
...
...
@@ -31,8 +31,8 @@
*/
#pragma once
#include "Property.h"
#include
<Binary/BinSmartPointers.h>
#include "../../../Binary/BinSmartPointers.h"
#include
"../../../../../../Common/DocxFormat/Source/Base/Types_32.h"
namespace
OLEPS
{
...
...
@@ -106,4 +106,35 @@ public:
std
::
wstring
dateCreate
;
};
typedef
boost
::
shared_ptr
<
PropertyDateCreate
>
PropertyDateCreatesPtr
;
//-----------------------------------------------------------------------------------------
class
PropertyWordCount
:
public
Property
{
public:
PropertyWordCount
(
const
unsigned
short
value_type
,
XLS
::
CFStreamPtr
stream
);
static
const
unsigned
int
Type
=
0x000f
;
_UINT32
count
;
std
::
wstring
value
;
};
typedef
boost
::
shared_ptr
<
PropertyWordCount
>
PropertyWordCountPtr
;
//-----------------------------------------------------------------------------------------
class
PropertyCharCount
:
public
Property
{
public:
PropertyCharCount
(
const
unsigned
short
value_type
,
XLS
::
CFStreamPtr
stream
);
static
const
unsigned
int
Type
=
0x0010
;
_UINT32
count
;
std
::
wstring
value
;
};
typedef
boost
::
shared_ptr
<
PropertyCharCount
>
PropertyCharCountPtr
;
//-----------------------------------------------------------------------------------------
class
PropertyDocSecurity
:
public
Property
{
public:
PropertyDocSecurity
(
const
unsigned
short
value_type
,
XLS
::
CFStreamPtr
stream
);
static
const
unsigned
int
Type
=
0x0013
;
_UINT32
value
;
};
typedef
boost
::
shared_ptr
<
PropertyDocSecurity
>
PropertyDocSecurityPtr
;
}
// namespace OLEPS
ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertyFactory.cpp
View file @
8b80aa94
...
...
@@ -48,7 +48,7 @@ PropertyPtr PropertyFactory::ReadProperty(const unsigned int prop_type, XLS::CFS
stream
->
seekFromBegin
(
property_offset
);
unsigned
short
value_type
;
if
(
stream
->
getStreamPointer
()
+
2
>
stream
->
getStreamSize
())
return
PropertyPtr
();
if
(
stream
->
getStreamPointer
()
+
2
>
stream
->
getStreamSize
())
return
PropertyPtr
();
*
stream
>>
value_type
;
stream
->
seekFromCurForward
(
2
);
// Skip 2 reserved unsigned chars
...
...
@@ -68,7 +68,19 @@ PropertyPtr PropertyFactory::ReadProperty(const unsigned int prop_type, XLS::CFS
return
PropertyPtr
(
new
PropertyComments
(
value_type
,
stream
));
case
0x0C
:
//CREATE_DTM
return
PropertyPtr
(
new
PropertyDateCreate
(
value_type
,
stream
));
case
0x0f
:
//PIDSI_WORDCOUNT
return
PropertyPtr
(
new
PropertyWordCount
(
value_type
,
stream
));
case
0x10
:
//PIDSI_CHARCOUNT
return
PropertyPtr
(
new
PropertyCharCount
(
value_type
,
stream
));
case
0x13
:
//PIDSI_DOC_SECURITY
return
PropertyPtr
(
new
PropertyDocSecurity
(
value_type
,
stream
));
case
0x08
:
//PIDSI_LASTAUTHOR
case
0x0b
:
//PIDSI_LASTPRINTED
case
0x0d
:
//PIDSI_LASTSAVE_DTM
case
0x12
:
//PIDSI_APPNAME
case
0x16
:
//??
case
0x17
:
//??
default:
return
PropertyPtr
();
}
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
View file @
8b80aa94
...
...
@@ -147,22 +147,8 @@ XlsConverter::XlsConverter(const std::wstring & xlsFileName, const std::wstring
XLS
::
CFStreamPtr
summary
;
XLS
::
CFStreamPtr
doc_summary
;
try
{
summary
=
xls_file
->
getNamedStream
(
L"SummaryInformation"
);
}
catch
(...)
{
}
try
{
doc_summary
=
xls_file
->
getNamedStream
(
L"DocumentSummaryInformation"
);
}
catch
(...)
{
return
;
}
_UINT16
workbook_code_page
=
XLS
::
WorkbookStreamObject
::
DefaultCodePage
;
if
(
summary
)
...
...
@@ -2009,8 +1995,48 @@ void XlsConverter::convert(XLS::Obj * obj)
}
}
}
if
(
obj
->
sbs
.
fExist
)
{
xlsx_context
->
get_drawing_context
().
set_object_x_val
(
obj
->
sbs
.
iVal
);
xlsx_context
->
get_drawing_context
().
set_object_x_min
(
obj
->
sbs
.
iMin
);
xlsx_context
->
get_drawing_context
().
set_object_x_max
(
obj
->
sbs
.
iMax
);
xlsx_context
->
get_drawing_context
().
set_object_x_inc
(
obj
->
sbs
.
dInc
);
xlsx_context
->
get_drawing_context
().
set_object_x_page
(
obj
->
sbs
.
dPage
);
}
if
(
obj
->
list
.
fExist
)
{
xlsx_context
->
get_drawing_context
().
set_object_x_sel
(
obj
->
list
.
iSel
);
xlsx_context
->
get_drawing_context
().
set_object_x_sel_type
(
obj
->
list
.
wListSelType
);
xlsx_context
->
get_drawing_context
().
set_object_lct
(
obj
->
list
.
lct
);
if
(
obj
->
list
.
fmla
.
bFmlaExist
)
{
std
::
wstring
link
=
obj
->
list
.
fmla
.
fmla
.
getAssembledFormula
(
true
);
xlsx_context
->
get_drawing_context
().
set_object_fmlaRange
(
link
);
}
if
(
obj
->
list
.
dropData
)
{
xlsx_context
->
get_drawing_context
().
set_object_drop_style
(
obj
->
list
.
dropData
->
wStyle
);
xlsx_context
->
get_drawing_context
().
set_object_drop_lines
(
obj
->
list
.
dropData
->
cLine
);
}
}
if
(
obj
->
checkBox
.
fExist
)
{
//unsigned short fChecked;
//unsigned short accel;
//bool fNo3d;
}
if
(
obj
->
radioButton
.
fExist
)
{
//unsigned short idRadNext;
//Boolean<unsigned short> fFirstBtn;
}
if
(
obj
->
edit
.
fExist
)
{
//unsigned short ivtEdit;
//Boolean<unsigned short> fMultiLine;
//unsigned short fVScroll;
//unsigned short id;
}
bool
full_ref
=
false
;
if
(
obj
->
cmo
.
ot
>
0x06
)
full_ref
=
true
;
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_activeX_context.cpp
View file @
8b80aa94
...
...
@@ -37,6 +37,10 @@
#include <simple_xml_writer.h>
#if defined(_WIN32) || defined(_WIN64)
#pragma comment(lib, "Ole32.lib")
#endif
namespace
oox
{
class
oox_activeX_context
::
Impl
...
...
@@ -139,6 +143,7 @@ void oox_activeX_context::write_to(std::wostream & strm)
{
//https://msdn.microsoft.com/en-us/library/ff533853(v=office.12).aspx
bool
badClassId
=
false
;
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE
(
L"ax:ocx"
)
...
...
@@ -200,11 +205,31 @@ void oox_activeX_context::write_to(std::wostream & strm)
classId
=
L"{8BD21D10-EC42-11CE-9E0D-00AA006002F3}"
;
}
}
if
(
!
classId
.
empty
())
#if defined(_WIN32) || defined(_WIN64)
if
(
classId
.
empty
())
{
//classId = L"{00000000-0000-0000-0000-000000000000}";
CP_XML_ATTR
(
L"ax:classid"
,
classId
);
//std::wstring test = L"AVSAudioEditor4.EditorFileInfo.1";
//LPOLESTR str =(wchar_t*) test.c_str();
LPOLESTR
str
=
(
wchar_t
*
)
impl_
->
progId
.
c_str
();
CLSID
clsid
;
HRESULT
hr
=
CLSIDFromProgID
(
str
,
&
clsid
);
if
(
S_OK
==
hr
)
{
LPOLESTR
className
;
if
(
S_OK
==
StringFromCLSID
(
clsid
,
&
className
))
{
classId
=
className
;
CoTaskMemFree
(
className
);
}
}
}
#endif
if
(
classId
.
empty
())
{
classId
=
L"{00024500-0000-0000-C000-000000000046}"
;
badClassId
=
true
;
}
CP_XML_ATTR
(
L"ax:classid"
,
classId
);
CP_XML_ATTR
(
L"ax:persistence"
,
L"persistStreamInit"
);
CP_XML_ATTR
(
L"r:id"
,
impl_
->
dataBinRid
);
...
...
@@ -217,12 +242,11 @@ void oox_activeX_context::write_to(std::wostream & strm)
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())
//if (!impl_->progId.empty()
&& badClassId
)
//{
// CP_XML_NODE(L"ax:ocxPr")
// {
// CP_XML_ATTR(L"ax:name", L"Name");
// CP_XML_ATTR(L"ax:name", L"ProgId");
// CP_XML_ATTR(L"ax:value", impl_->progId);
// }
//}
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_conversion_context.cpp
View file @
8b80aa94
...
...
@@ -172,7 +172,7 @@ void xlsx_conversion_context::end_external()
void
xlsx_conversion_context
::
end_table
()
{
get_table_context
().
serialize_ole_objects
(
current_sheet
().
ole_objects
());
get_table_context
().
serialize_activeXs
(
current_sheet
().
activeXs
());
get_table_context
().
serialize_activeXs
_controls
(
current_sheet
().
activeXs
());
get_table_context
().
dump_rels_drawing
(
current_sheet
().
sheet_rels
());
get_table_context
().
serialize_hyperlinks
(
current_sheet
().
hyperlinks
());
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
View file @
8b80aa94
...
...
@@ -686,7 +686,83 @@ void xlsx_drawing_context::set_object_link(const std::wstring & formula)
current_drawing_states
->
back
()
->
object
.
link
=
formula
;
}
void
xlsx_drawing_context
::
set_object_x_val
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
x_val
=
val
;
}
void
xlsx_drawing_context
::
set_object_x_min
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
x_min
=
val
;
}
void
xlsx_drawing_context
::
set_object_x_max
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
x_max
=
val
;
}
void
xlsx_drawing_context
::
set_object_x_inc
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
x_inc
=
val
;
}
void
xlsx_drawing_context
::
set_object_x_page
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
x_page
=
val
;
}
void
xlsx_drawing_context
::
set_object_x_sel
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
x_sel
=
val
;
}
void
xlsx_drawing_context
::
set_object_x_sel_type
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
x_sel_type
=
val
;
}
void
xlsx_drawing_context
::
set_object_lct
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
lct
=
val
;
}
void
xlsx_drawing_context
::
set_object_fmlaRange
(
const
std
::
wstring
&
fmla
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
fmlaRange
=
fmla
;
}
void
xlsx_drawing_context
::
set_object_drop_style
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
drop_style
=
val
;
}
void
xlsx_drawing_context
::
set_object_drop_lines
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
drop_lines
=
val
;
}
void
xlsx_drawing_context
::
end_drawing
()
{
if
(
current_drawing_states
==
NULL
)
return
;
...
...
@@ -787,6 +863,10 @@ void xlsx_drawing_context::end_drawing(_drawing_state_ptr & drawing_state)
if
(
drawing_state
->
type
==
external_items
::
typeControl
)
{
serialize_control
(
drawing_state
);
if
(
!
drawing_state
->
objectId
.
empty
())
{
drawing_states_activeX
.
push_back
(
drawing_state
);
// for serialize in sheet
}
}
}
...
...
@@ -1048,6 +1128,65 @@ void xlsx_drawing_context::serialize_vml_shape(_drawing_state_ptr & drawing_stat
{
CP_XML_NODE
(
L"x:FmlaLink"
){
CP_XML_CONTENT
(
drawing_state
->
object
.
link
);}
}
if
(
drawing_state
->
object
.
x_val
)
{
CP_XML_NODE
(
L"x:Val"
){
CP_XML_CONTENT
(
*
drawing_state
->
object
.
x_val
);}
}
if
(
drawing_state
->
object
.
x_min
)
{
CP_XML_NODE
(
L"x:Min"
){
CP_XML_CONTENT
(
*
drawing_state
->
object
.
x_min
);}
}
if
(
drawing_state
->
object
.
x_max
)
{
CP_XML_NODE
(
L"x:Max"
){
CP_XML_CONTENT
(
*
drawing_state
->
object
.
x_max
);}
}
if
(
drawing_state
->
object
.
x_inc
)
{
CP_XML_NODE
(
L"x:Inc"
){
CP_XML_CONTENT
(
*
drawing_state
->
object
.
x_inc
);}
}
if
(
drawing_state
->
object
.
x_page
)
{
CP_XML_NODE
(
L"x:Page"
){
CP_XML_CONTENT
(
*
drawing_state
->
object
.
x_page
);}
}
if
(
!
drawing_state
->
object
.
fmlaRange
.
empty
()
)
{
CP_XML_NODE
(
L"x:FmlaRange"
){
CP_XML_CONTENT
(
drawing_state
->
object
.
fmlaRange
);}
}
if
(
drawing_state
->
object
.
x_sel
)
{
CP_XML_NODE
(
L"x:Sel"
){
CP_XML_CONTENT
(
*
drawing_state
->
object
.
x_sel
);}
}
if
(
drawing_state
->
object
.
x_sel_type
)
{
switch
(
*
drawing_state
->
object
.
x_sel_type
)
{
case
0
:
default:
CP_XML_NODE
(
L"x:SelType"
){
CP_XML_CONTENT
(
L"Single"
);}
}
}
if
(
drawing_state
->
object
.
lct
)
{
switch
(
*
drawing_state
->
object
.
lct
)
{
case
0
:
default:
CP_XML_NODE
(
L"x:LCT"
){
CP_XML_CONTENT
(
L"Normal"
);}
}
}
if
(
drawing_state
->
object
.
drop_style
)
{
switch
(
*
drawing_state
->
object
.
drop_style
)
{
case
0
:
default:
CP_XML_NODE
(
L"x:DropStyle"
){
CP_XML_CONTENT
(
L"Combo"
);}
}
}
if
(
drawing_state
->
object
.
drop_lines
)
{
CP_XML_NODE
(
L"x:DropLines"
){
CP_XML_CONTENT
(
*
drawing_state
->
object
.
drop_lines
);}
}
}
}
...
...
@@ -2134,9 +2273,10 @@ void xlsx_drawing_context::serialize(std::wostream & stream, _drawing_state_ptr
}
}
}
void
xlsx_drawing_context
::
serialize_activeX
(
std
::
wostream
&
stream
,
_drawing_state_ptr
&
drawing_state
)
void
xlsx_drawing_context
::
serialize_activeX
_control
(
std
::
wostream
&
stream
,
_drawing_state_ptr
&
drawing_state
)
{
if
(
drawing_state
->
type
!=
external_items
::
typeActiveX
)
return
;
if
(
drawing_state
->
type
!=
external_items
::
typeActiveX
&&
drawing_state
->
type
!=
external_items
::
typeControl
)
return
;
if
(
drawing_state
->
type_anchor
==
3
)
{
//absolute
...
...
@@ -2181,7 +2321,15 @@ void xlsx_drawing_context::serialize_activeX(std::wostream & stream, _drawing_st
{
CP_XML_ATTR
(
L"defaultSize"
,
0
);
//CP_XML_ATTR(L"autoPict", 0);
CP_XML_ATTR
(
L"autoLine"
,
0
);
if
(
!
drawing_state
->
object
.
link
.
empty
())
{
CP_XML_ATTR
(
L"linkedCell"
,
drawing_state
->
object
.
link
);
}
if
(
!
drawing_state
->
object
.
fmlaRange
.
empty
())
{
CP_XML_ATTR
(
L"listFillRange"
,
drawing_state
->
object
.
fmlaRange
);
}
if
(
!
drawing_state
->
fill
.
texture_target
.
empty
())
{
bool
isIternal
=
false
;
...
...
@@ -3077,11 +3225,11 @@ void xlsx_drawing_context::serialize_objects(std::wostream & strm)
}
drawing_states_objects
.
clear
();
}
void
xlsx_drawing_context
::
serialize_activeXs
(
std
::
wostream
&
strm
)
void
xlsx_drawing_context
::
serialize_activeXs
_controls
(
std
::
wostream
&
strm
)
{
for
(
size_t
i
=
0
;
i
<
drawing_states_activeX
.
size
();
i
++
)
{
serialize_activeX
(
strm
,
drawing_states_activeX
[
i
]);
serialize_activeX
_control
(
strm
,
drawing_states_activeX
[
i
]);
}
drawing_states_activeX
.
clear
();
}
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h
View file @
8b80aa94
...
...
@@ -302,6 +302,17 @@ public:
int
row
;
std
::
wstring
macro
;
std
::
wstring
link
;
_CP_OPT
(
int
)
x_val
;
_CP_OPT
(
int
)
x_min
;
_CP_OPT
(
int
)
x_max
;
_CP_OPT
(
int
)
x_inc
;
_CP_OPT
(
int
)
x_page
;
_CP_OPT
(
int
)
x_sel
;
_CP_OPT
(
int
)
x_sel_type
;
_CP_OPT
(
int
)
lct
;
std
::
wstring
fmlaRange
;
_CP_OPT
(
int
)
drop_style
;
_CP_OPT
(
int
)
drop_lines
;
}
object
;
//for group
std
::
vector
<
_drawing_state_ptr
>
drawing_states
;
...
...
@@ -425,7 +436,18 @@ public:
void
set_object_id
(
int
val
);
void
set_object_visible
(
bool
val
);
void
set_object_anchor
(
int
col
,
int
row
);
void
set_object_link
(
const
std
::
wstring
&
text
);
void
set_object_link
(
const
std
::
wstring
&
fmla
);
void
set_object_x_val
(
int
val
);
void
set_object_x_min
(
int
val
);
void
set_object_x_max
(
int
val
);
void
set_object_x_inc
(
int
val
);
void
set_object_x_page
(
int
val
);
void
set_object_x_sel
(
int
val
);
void
set_object_x_sel_type
(
int
val
);
void
set_object_lct
(
int
val
);
void
set_object_fmlaRange
(
const
std
::
wstring
&
fmla
);
void
set_object_drop_style
(
int
val
);
void
set_object_drop_lines
(
int
val
);
//---------------------------------------------------------------------------------------------
void
set_custom_rect
(
_rect
&
rect
);
void
set_custom_verticles
(
std
::
vector
<
ODRAW
::
MSOPOINT
>
&
points
);
...
...
@@ -455,9 +477,9 @@ public:
//-----------------------------------------------------------------------------------
void
serialize
(
std
::
wostream
&
strm
,
_drawing_state_ptr
&
drawing_state
);
void
serialize_object
(
std
::
wostream
&
strm
,
_drawing_state_ptr
&
drawing_state
);
void
serialize_activeX
(
std
::
wostream
&
strm
,
_drawing_state_ptr
&
drawing_state
);
void
serialize_activeX
_control
(
std
::
wostream
&
strm
,
_drawing_state_ptr
&
drawing_state
);
//-----------------------------------------------------------------------------------
void
serialize_activeXs
(
std
::
wostream
&
strm
);
void
serialize_activeXs
_controls
(
std
::
wostream
&
strm
);
void
serialize_objects
(
std
::
wostream
&
strm
);
void
serialize_vml_HF
(
std
::
wostream
&
strm
);
void
serialize_vml
(
std
::
wostream
&
strm
);
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_tablecontext.cpp
View file @
8b80aa94
...
...
@@ -160,8 +160,8 @@ void xlsx_table_context::serialize_ole_objects(std::wostream & strm)
{
state
()
->
drawing_context_
.
serialize_objects
(
strm
);
}
void
xlsx_table_context
::
serialize_activeXs
(
std
::
wostream
&
strm
)
void
xlsx_table_context
::
serialize_activeXs
_controls
(
std
::
wostream
&
strm
)
{
state
()
->
drawing_context_
.
serialize_activeXs
(
strm
);
state
()
->
drawing_context_
.
serialize_activeXs
_controls
(
strm
);
}
}
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_tablecontext.h
View file @
8b80aa94
...
...
@@ -73,7 +73,7 @@ public:
void
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
);
void
serialize_ole_objects
(
std
::
wostream
&
_Wostream
);
void
serialize_activeXs
(
std
::
wostream
&
_Wostream
);
void
serialize_activeXs
_controls
(
std
::
wostream
&
_Wostream
);
void
dump_rels_drawing
(
rels
&
Rels
);
private:
xlsx_conversion_context
&
context_
;
...
...
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