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
ef76c800
Commit
ef76c800
authored
Dec 28, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat - fix errors fmt & old comments
parent
bb6e95ce
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
213 additions
and
124 deletions
+213
-124
ASCOfficeDocFile/DocDocxConverter/NumberingMapping.cpp
ASCOfficeDocFile/DocDocxConverter/NumberingMapping.cpp
+3
-3
ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp
ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp
+1
-3
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
+4
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DXF.cpp
...fficeXlsFile2/source/XlsFormat/Logic/Biff_records/DXF.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TxO.cpp
...fficeXlsFile2/source/XlsFormat/Logic/Biff_records/TxO.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN.cpp
...eXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN.cpp
+0
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFNum.cpp
...lsFile2/source/XlsFormat/Logic/Biff_structures/DXFNum.cpp
+7
-16
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFNum.h
...eXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFNum.h
+0
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.cpp
...lsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.cpp
+57
-30
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.h
...eXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.h
+2
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProps.cpp
...sFile2/source/XlsFormat/Logic/Biff_structures/XFProps.cpp
+9
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProps.h
...XlsFile2/source/XlsFormat/Logic/Biff_structures/XFProps.h
+2
-1
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
+8
-10
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_comments.cpp
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_comments.cpp
+10
-10
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_comments.h
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_comments.h
+3
-3
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
...XlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
+105
-32
No files found.
ASCOfficeDocFile/DocDocxConverter/NumberingMapping.cpp
View file @
ef76c800
...
...
@@ -672,7 +672,7 @@ namespace DocFileFormat
{
if
(
grpprlChpx
)
{
unsigned
int
cp
=
0
;
unsigned
int
index
=
0
;
bool
isPictureBullet
=
false
;
for
(
std
::
list
<
SinglePropertyModifier
>::
const_iterator
iter
=
grpprlChpx
->
grpprl
->
begin
();
iter
!=
grpprlChpx
->
grpprl
->
end
();
++
iter
)
...
...
@@ -681,7 +681,7 @@ namespace DocFileFormat
{
case
sprmCPbiIBullet
:
{
cp
=
FormatUtils
::
BytesToUInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
index
=
FormatUtils
::
BytesToUInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
break
;
case
sprmCPbiGrf
:
...
...
@@ -694,7 +694,7 @@ namespace DocFileFormat
if
(
isPictureBullet
)
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:lvlPicBulletId"
),
TRUE
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:val"
),
FormatUtils
::
IntToWideString
(
cp
));
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:val"
),
FormatUtils
::
IntToWideString
(
index
));
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp
View file @
ef76c800
...
...
@@ -419,9 +419,7 @@ namespace DocFileFormat
m_pXmlWriter
->
WriteString
(
m_imageData
->
GetXMLString
());
}
if
(
!
m_isInlinePicture
)
{
//borders
{
//borders
writePictureBorder
(
L"bordertop"
,
pict
->
brcTop
);
writePictureBorder
(
L"borderleft"
,
pict
->
brcLeft
);
writePictureBorder
(
L"borderbottom"
,
pict
->
brcBottom
);
...
...
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
View file @
ef76c800
...
...
@@ -371,9 +371,9 @@ namespace DocFileFormat
if
(
(
bookmarkName
!=
NULL
)
&&
(
*
bookmarkName
==
L"_PictureBullets"
)
)
{
for
(
unsigned
int
j
=
BookmarkStartEndCPs
[
i
].
first
,
k
=
0
;
j
<
this
->
Text
->
size
();
++
j
,
++
k
)
for
(
unsigned
int
j
=
BookmarkStartEndCPs
[
i
].
first
,
k
=
0
;
j
<
Text
->
size
();
++
j
,
++
k
)
{
if
(
this
->
Text
->
at
(
j
)
==
1
)
if
(
Text
->
at
(
j
)
==
1
)
{
PictureBulletsCPsMap
.
insert
(
std
::
make_pair
(
k
,
j
));
}
...
...
@@ -424,7 +424,7 @@ namespace DocFileFormat
int
cp
=
SectionPlex
->
CharacterPositions
[
i
+
1
];
//Get the SEPX
VirtualStreamReader
wordReader
(
this
->
WordDocumentStream
,
sed
->
fcSepx
,
bOlderVersion
);
VirtualStreamReader
wordReader
(
WordDocumentStream
,
sed
->
fcSepx
,
bOlderVersion
);
//!!!TODO: cbSepx is the size in bytes of the rest properties part!!!
short
cbSepx
=
wordReader
.
ReadInt16
();
...
...
@@ -672,7 +672,7 @@ namespace DocFileFormat
//last fkp?
//use full table
if
(
i
++
==
(
this
->
AllChpxFkps
->
size
()
-
1
)
)
if
(
i
++
==
(
AllChpxFkps
->
size
()
-
1
)
)
{
max
=
fkp
->
rgfcSize
;
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DXF.cpp
View file @
ef76c800
...
...
@@ -66,7 +66,7 @@ int DXF::serialize(std::wostream & stream)
{
CP_XML_NODE
(
L"dxf"
)
{
xfprops
.
serialize
(
CP_XML_STREAM
());
xfprops
.
serialize
(
CP_XML_STREAM
()
,
true
);
}
}
return
0
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TxO.cpp
View file @
ef76c800
...
...
@@ -219,7 +219,7 @@ int TxO::serialize_rPr (std::wostream & _stream, int iFmt, std::wstring namespac
if
(
!
pGlobalWorkbookInfoPtr
->
m_arFonts
)
return
0
;
int
sz
=
pGlobalWorkbookInfoPtr
->
m_arFonts
->
size
();
if
(
iFmt
-
1
>
sz
||
iFmt
<
1
)
return
0
;
if
(
iFmt
-
1
>
=
sz
||
iFmt
<
1
)
return
0
;
Font
*
font
=
dynamic_cast
<
Font
*>
(
pGlobalWorkbookInfoPtr
->
m_arFonts
->
at
(
iFmt
-
1
).
get
());
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN.cpp
View file @
ef76c800
...
...
@@ -93,7 +93,6 @@ void DXFN::load(CFRecord& record)
if
(
ibitAtrNum
)
{
dxfnum
.
setIsUserDefined
(
fIfmtUser
);
record
>>
dxfnum
;
}
if
(
ibitAtrFnt
)
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFNum.cpp
View file @
ef76c800
...
...
@@ -39,18 +39,6 @@ namespace XLS
{
void
DXFNum
::
setIsUserDefined
(
const
bool
is_user_defined
)
{
is_user_defined_
=
is_user_defined
;
}
const
bool
DXFNum
::
getIsUserDefined
()
const
{
return
true
==
is_user_defined_
;
}
BiffStructurePtr
DXFNum
::
clone
()
{
return
BiffStructurePtr
(
new
DXFNum
(
*
this
));
...
...
@@ -58,11 +46,13 @@ BiffStructurePtr DXFNum::clone()
void
DXFNum
::
load
(
CFRecord
&
record
)
{
if
((
is_user_defined_
)
&&
(
*
is_user_defined_
))
if
(
!
parent
)
return
;
if
(
parent
->
fIfmtUser
)
{
record
>>
user_defined
;
}
else
if
(
!
parent
->
ifmtNinch
)
//
else
{
record
>>
fmt_id
;
}
...
...
@@ -71,7 +61,7 @@ void DXFNum::load(CFRecord& record)
int
DXFNum
::
serialize
(
std
::
wostream
&
stream
)
{
if
(
parent
->
ifmtNinch
&&
parent
->
fIfmtUser
)
return
0
;
if
(
!
parent
)
return
0
;
CP_XML_WRITER
(
stream
)
{
...
...
@@ -79,7 +69,8 @@ int DXFNum::serialize(std::wostream & stream)
{
if
(
!
parent
->
ifmtNinch
)
CP_XML_ATTR
(
L"numFmtId"
,
fmt_id
.
ifmt
);
if
(
!
parent
->
fIfmtUser
)
if
(
parent
->
fIfmtUser
)
CP_XML_ATTR
(
L"formatCode"
,
/*xml::utils::replace_text_to_xml*/
(
user_defined
.
fmt
.
value
()));
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFNum.h
View file @
ef76c800
...
...
@@ -50,12 +50,8 @@ public:
virtual
void
load
(
CFRecord
&
record
);
int
serialize
(
std
::
wostream
&
stream
);
void
setIsUserDefined
(
const
bool
is_user_defined
);
const
bool
getIsUserDefined
()
const
;
_CP_OPT
(
bool
)
is_user_defined_
;
DXFNumIFmt
fmt_id
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.cpp
View file @
ef76c800
...
...
@@ -169,6 +169,23 @@ static void serialize_val_prop(std::wostream & stream, const std::wstring & name
}
}
}
static
void
serialize_val_attr
(
CP_ATTR_NODE
,
const
std
::
wstring
&
name
,
BiffStructurePtr
&
val
)
{
if
(
val
==
NULL
)
return
;
if
(
name
.
empty
())
return
;
BIFF_DWORD
*
dword
=
dynamic_cast
<
BIFF_DWORD
*>
(
val
.
get
());
if
(
dword
)
CP_XML_ATTR
(
name
.
c_str
(),
*
dword
->
value
());
BIFF_WORD
*
word
=
dynamic_cast
<
BIFF_WORD
*>
(
val
.
get
());
if
(
word
)
CP_XML_ATTR
(
name
.
c_str
(),
*
word
->
value
());
BIFF_BYTE
*
byte_
=
dynamic_cast
<
BIFF_BYTE
*>
(
val
.
get
());
if
(
byte_
)
CP_XML_ATTR
(
name
.
c_str
(),
*
byte_
->
value
());
LPWideString
*
str_
=
dynamic_cast
<
LPWideString
*>
(
val
.
get
());
if
(
str_
)
CP_XML_ATTR
(
name
.
c_str
(),
xml
::
utils
::
replace_text_to_xml
(
str_
->
value
()));
}
static
void
serialize_border_prop
(
std
::
wostream
&
stream
,
const
std
::
wstring
&
name
,
BiffStructurePtr
&
val
)
{
if
(
name
.
empty
())
return
;
...
...
@@ -206,39 +223,49 @@ static void serialize_border_prop(std::wostream & stream, const std::wstring & n
void
XFProp
::
serialize_attr
(
CP_ATTR_NODE
)
{
if
(
xfPropType
==
0
)
switch
(
xfPropType
)
{
BIFF_BYTE
*
byte_
=
dynamic_cast
<
BIFF_BYTE
*>
(
xfPropDataBlob
.
get
());
if
(
!
byte_
)
return
;
case
0x0000
:
{
BIFF_BYTE
*
byte_
=
dynamic_cast
<
BIFF_BYTE
*>
(
xfPropDataBlob
.
get
());
if
(
!
byte_
)
return
;
switch
(
*
byte_
)
{
case
2
:
CP_XML_ATTR
(
L"patternType"
,
L"pct50"
);
break
;
//50% gray
case
3
:
CP_XML_ATTR
(
L"patternType"
,
L"pct75"
);
break
;
//75% gray
case
4
:
CP_XML_ATTR
(
L"patternType"
,
L"pct25"
);
break
;
//25% gray
case
5
:
CP_XML_ATTR
(
L"patternType"
,
L"horzStripe"
);
break
;
//Horizontal stripe
case
6
:
CP_XML_ATTR
(
L"patternType"
,
L"vertStripe"
);
break
;
//Vertical stripe
case
7
:
CP_XML_ATTR
(
L"patternType"
,
L"reverseDiagStripe"
);
break
;
//Reverse diagonal stripe
case
8
:
CP_XML_ATTR
(
L"patternType"
,
L"diagStripe"
);
break
;
//Diagonal stripe
case
9
:
CP_XML_ATTR
(
L"patternType"
,
L"diagCross"
);
break
;
//Diagonal crosshatch
case
10
:
CP_XML_ATTR
(
L"patternType"
,
L"trellis"
);
break
;
//Thick Diagonal crosshatch
case
11
:
CP_XML_ATTR
(
L"patternType"
,
L"thinHorzStripe"
);
break
;
//Thin horizontal stripe
case
12
:
CP_XML_ATTR
(
L"patternType"
,
L"thinVertStripe"
);
break
;
//Thin vertical stripe
case
13
:
CP_XML_ATTR
(
L"patternType"
,
L"thinReverseDiagStripe"
);
break
;
//Thin reverse diagonal stripe
case
14
:
CP_XML_ATTR
(
L"patternType"
,
L"thinDiagStripe"
);
break
;
//Thin diagonal stripe
case
15
:
CP_XML_ATTR
(
L"patternType"
,
L"thinHorzCross"
);
break
;
//Thin horizontal crosshatch
case
16
:
CP_XML_ATTR
(
L"patternType"
,
L"thinDiagCross"
);
break
;
//Thin diagonal crosshatch
case
17
:
CP_XML_ATTR
(
L"patternType"
,
L"gray125"
);
break
;
//12.5% gray
case
18
:
CP_XML_ATTR
(
L"patternType"
,
L"gray0625"
);
break
;
//6.25% gray
default:
CP_XML_ATTR
(
L"patternType"
,
L"solid"
);
}
switch
(
*
byte_
)
{
case
2
:
CP_XML_ATTR
(
L"patternType"
,
L"pct50"
);
break
;
//50% gray
case
3
:
CP_XML_ATTR
(
L"patternType"
,
L"pct75"
);
break
;
//75% gray
case
4
:
CP_XML_ATTR
(
L"patternType"
,
L"pct25"
);
break
;
//25% gray
case
5
:
CP_XML_ATTR
(
L"patternType"
,
L"horzStripe"
);
break
;
//Horizontal stripe
case
6
:
CP_XML_ATTR
(
L"patternType"
,
L"vertStripe"
);
break
;
//Vertical stripe
case
7
:
CP_XML_ATTR
(
L"patternType"
,
L"reverseDiagStripe"
);
break
;
//Reverse diagonal stripe
case
8
:
CP_XML_ATTR
(
L"patternType"
,
L"diagStripe"
);
break
;
//Diagonal stripe
case
9
:
CP_XML_ATTR
(
L"patternType"
,
L"diagCross"
);
break
;
//Diagonal crosshatch
case
10
:
CP_XML_ATTR
(
L"patternType"
,
L"trellis"
);
break
;
//Thick Diagonal crosshatch
case
11
:
CP_XML_ATTR
(
L"patternType"
,
L"thinHorzStripe"
);
break
;
//Thin horizontal stripe
case
12
:
CP_XML_ATTR
(
L"patternType"
,
L"thinVertStripe"
);
break
;
//Thin vertical stripe
case
13
:
CP_XML_ATTR
(
L"patternType"
,
L"thinReverseDiagStripe"
);
break
;
//Thin reverse diagonal stripe
case
14
:
CP_XML_ATTR
(
L"patternType"
,
L"thinDiagStripe"
);
break
;
//Thin diagonal stripe
case
15
:
CP_XML_ATTR
(
L"patternType"
,
L"thinHorzCross"
);
break
;
//Thin horizontal crosshatch
case
16
:
CP_XML_ATTR
(
L"patternType"
,
L"thinDiagCross"
);
break
;
//Thin diagonal crosshatch
case
17
:
CP_XML_ATTR
(
L"patternType"
,
L"gray125"
);
break
;
//12.5% gray
case
18
:
CP_XML_ATTR
(
L"patternType"
,
L"gray0625"
);
break
;
//6.25% gray
CP_XML_ATTR
(
L"patternType"
,
L"solid"
);
}
}
break
;
case
0x0003
:
{
XFPropGradient
*
grad_
=
dynamic_cast
<
XFPropGradient
*>
(
xfPropDataBlob
.
get
());
if
(
grad_
)
grad_
->
serialize_attr
(
CP_GET_XML_NODE
());
}
break
;
case
0x0026
:
{
serialize_val_attr
(
CP_GET_XML_NODE
(),
L"formatCode"
,
xfPropDataBlob
);
}
break
;
case
0x0029
:
{
serialize_val_attr
(
CP_GET_XML_NODE
(),
L"numFmtId"
,
xfPropDataBlob
);
}
break
;
}
if
(
xfPropType
==
3
)
{
XFPropGradient
*
grad_
=
dynamic_cast
<
XFPropGradient
*>
(
xfPropDataBlob
.
get
());
if
(
grad_
)
grad_
->
serialize_attr
(
CP_GET_XML_NODE
());
}
}
int
XFProp
::
serialize
(
std
::
wostream
&
stream
)
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.h
View file @
ef76c800
...
...
@@ -52,9 +52,8 @@ public:
virtual
void
load
(
CFRecord
&
record
);
int
serialize
(
std
::
wostream
&
stream
);
void
serialize_attr
(
CP_ATTR_NODE
);
int
serialize
(
std
::
wostream
&
stream
);
void
serialize_attr
(
CP_ATTR_NODE
);
unsigned
short
xfPropType
;
unsigned
short
cb
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProps.cpp
View file @
ef76c800
...
...
@@ -110,7 +110,7 @@ void XFProps::load(CFRecord& record)
}
}
}
int
XFProps
::
serialize
(
std
::
wostream
&
stream
)
int
XFProps
::
serialize
(
std
::
wostream
&
stream
,
bool
dxf
)
{
CP_XML_WRITER
(
stream
)
{
...
...
@@ -130,7 +130,14 @@ int XFProps::serialize(std::wostream & stream)
{
for
(
int
i
=
0
;
i
<
arXFPropNumFmt
.
size
();
i
++
)
{
arXFPropNumFmt
[
i
].
serialize
(
CP_XML_STREAM
());
if
(
dxf
)
{
arXFPropNumFmt
[
i
].
serialize_attr
(
CP_GET_XML_NODE
());
}
else
{
arXFPropNumFmt
[
i
].
serialize
(
CP_XML_STREAM
());
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProps.h
View file @
ef76c800
...
...
@@ -52,7 +52,8 @@ public:
unsigned
short
cprops
;
int
serialize
(
std
::
wostream
&
stream
);
int
serialize
(
std
::
wostream
&
stream
){
return
serialize
(
stream
,
false
)
;
}
int
serialize
(
std
::
wostream
&
stream
,
bool
dxf
);
std
::
vector
<
XFProp
>
arXFPropFont
;
std
::
vector
<
XFProp
>
arXFPropNumFmt
;
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
View file @
ef76c800
...
...
@@ -435,12 +435,16 @@ void XlsConverter::convert(XLS::WorksheetSubstream* sheet)
convert
((
XLS
::
OBJECTS
*
)
sheet
->
m_OBJECTS
.
get
(),
sheet
);
if
(
sheet
->
m_arNote
.
size
()
>
0
&&
xls_global_info
->
Version
<
0x0600
)
if
(
!
sheet
->
m_arNote
.
empty
()
&&
xls_global_info
->
Version
<
0x0600
)
{
xlsx_context
->
get_drawing_context
().
start_drawing
(
0
);
for
(
int
i
=
0
;
i
<
sheet
->
m_arNote
.
size
();
i
++
)
{
convert
(
dynamic_cast
<
XLS
::
Note
*>
(
sheet
->
m_arNote
[
i
].
get
()));
xlsx_context
->
get_drawing_context
().
start_drawing
(
0x0019
);
convert
(
dynamic_cast
<
XLS
::
Note
*>
(
sheet
->
m_arNote
[
i
].
get
()));
xlsx_context
->
get_drawing_context
().
end_drawing
();
}
xlsx_context
->
get_drawing_context
().
end_group
();
}
if
(
sheet
->
m_PAGESETUP
)
...
...
@@ -1704,11 +1708,6 @@ void XlsConverter::convert(XLS::Note* note)
note
->
note_sh
.
calculate
();
if
(
xls_global_info
->
Version
<
0x0600
)
{
xlsx_context
->
get_comments_context
().
start_comment
();
}
xlsx_context
->
get_comments_context
().
set_ref
(
note
->
note_sh
.
ref_
,
note
->
note_sh
.
col
,
note
->
note_sh
.
row
);
xlsx_context
->
get_comments_context
().
set_author
(
note
->
note_sh
.
stAuthor
);
xlsx_context
->
get_comments_context
().
set_visibly
(
note
->
note_sh
.
fShow
);
...
...
@@ -1720,9 +1719,8 @@ void XlsConverter::convert(XLS::Note* note)
if
(
xls_global_info
->
Version
<
0x0600
)
{
//todooo размеры произвольные .. можно сделать оценку по размеру строки
xlsx_context
->
get_drawing_context
().
set_child_anchor
(
120
,
64
,
note
->
note_sh
.
x_
/
12700.
,
note
->
note_sh
.
y_
/
12700.
);
xlsx_context
->
get_comments_context
().
set_content
(
std
::
wstring
(
L"<t>"
)
+
note
->
note_sh
.
stText
.
value
()
+
std
::
wstring
(
L"</t>"
));
xlsx_context
->
get_comments_context
().
end_comment
();
xlsx_context
->
get_drawing_context
().
set_child_anchor
(
note
->
note_sh
.
x_
,
note
->
note_sh
.
y_
,
120
*
12700.
,
64
*
12700.
);
xlsx_context
->
get_drawing_context
().
set_text
(
std
::
wstring
(
L"<t>"
)
+
note
->
note_sh
.
stText
.
value
()
+
std
::
wstring
(
L"</t>"
));
}
}
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_comments.cpp
View file @
ef76c800
...
...
@@ -63,8 +63,6 @@ public:
void
serialize
(
std
::
wostream
&
strm
)
{
//std::sort(xlsx_comment_.begin(), xlsx_comment_.end(), sort_()); - излишне
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE
(
L"comments"
)
...
...
@@ -73,27 +71,27 @@ public:
CP_XML_NODE
(
L"authors"
)
{
BOOST_FOREACH
(
std
::
wstring
const
&
a
,
author_list_
)
for
(
int
i
=
0
;
i
<
author_list_
.
size
();
i
++
)
{
CP_XML_NODE
(
L"author"
)
{
CP_XML_STREAM
()
<<
a
;
CP_XML_STREAM
()
<<
a
uthor_list_
[
i
]
;
}
}
}
CP_XML_NODE
(
L"commentList"
)
{
BOOST_FOREACH
(
_xlsx_comment
const
&
c
,
xlsx_comment_
)
for
(
int
i
=
0
;
i
<
xlsx_comment_
.
size
();
i
++
)
{
CP_XML_NODE
(
L"comment"
)
{
CP_XML_ATTR
(
L"ref"
,
c
.
ref_
);
CP_XML_ATTR
(
L"authorId"
,
c
.
author_
);
CP_XML_ATTR
(
L"ref"
,
xlsx_comment_
[
i
]
.
ref_
);
CP_XML_ATTR
(
L"authorId"
,
xlsx_comment_
[
i
]
.
author_
);
CP_XML_NODE
(
L"text"
)
{
CP_XML_STREAM
()
<<
c
.
content_
;
CP_XML_STREAM
()
<<
xlsx_comment_
[
i
]
.
content_
;
}
}
}
...
...
@@ -106,14 +104,16 @@ public:
{
return
(
xlsx_comment_
.
empty
());
}
void
add
(
_xlsx_comment
&
c
)
{
bool
find
=
false
;
for
(
long
i
=
0
;
i
<
author_list_
.
size
();
i
++
)
for
(
long
i
=
0
;
i
<
author_list_
.
size
();
i
++
)
{
if
(
c
.
author_
==
author_list_
[
i
])
{
find
=
true
;
find
=
true
;
c
.
author_
=
boost
::
lexical_cast
<
std
::
wstring
>
(
i
);
break
;
}
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_comments.h
View file @
ef76c800
...
...
@@ -70,13 +70,13 @@ class xlsx_comments
public:
xlsx_comments
();
~
xlsx_comments
();
static
xlsx_comments_ptr
create
();
public:
void
add
(
_xlsx_comment
&
d
);
bool
empty
()
const
;
void
serialize
(
std
::
wostream
&
strm
);
void
serialize
(
std
::
wostream
&
strm
);
static
xlsx_comments_ptr
create
();
private:
class
Impl
;
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
View file @
ef76c800
...
...
@@ -340,7 +340,7 @@ bool xlsx_drawing_context::start_drawing(int type)
external_items
::
Type
xlsx_drawing_context
::
getType
()
{
if
(
current_drawing_states
==
NULL
)
return
external_items
::
typeUnknown
;
if
(
current_drawing_states
->
size
()
<
1
)
return
external_items
::
typeUnknown
;
if
(
current_drawing_states
->
empty
()
)
return
external_items
::
typeUnknown
;
return
current_drawing_states
->
back
()
->
type
;
}
...
...
@@ -366,7 +366,8 @@ void xlsx_drawing_context::start_comment()
current_drawing_states
->
push_back
(
create_drawing_state
());
current_drawing_states
->
back
()
->
type
=
external_items
::
typeComment
;
current_drawing_states
->
back
()
->
type
=
external_items
::
typeComment
;
//current_drawing_states->back()->vmlwrite_mode_ = true; это только для HF !!!
count_object
++
;
...
...
@@ -435,29 +436,29 @@ void xlsx_drawing_context::start_shape(int type)
void
xlsx_drawing_context
::
set_id
(
int
id
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
size
()
<
1
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
()
)
return
;
current_drawing_states
->
back
()
->
id
=
id
;
}
void
xlsx_drawing_context
::
set_FlipH
()
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
size
()
<
1
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
()
)
return
;
current_drawing_states
->
back
()
->
flipH
=
true
;
}
void
xlsx_drawing_context
::
set_FlipV
()
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
size
()
<
1
)
return
;
if
(
current_drawing_states
->
empty
()
)
return
;
current_drawing_states
->
back
()
->
flipV
=
true
;
}
void
xlsx_drawing_context
::
set_shape_id
(
int
id
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
size
()
<
1
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
()
)
return
;
if
(
current_drawing_states
->
back
()
->
bTextBox
)
return
;
...
...
@@ -465,13 +466,15 @@ void xlsx_drawing_context::set_shape_id(int id)
}
void
xlsx_drawing_context
::
set_object_visible
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
);
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
visible
=
val
;
}
void
xlsx_drawing_context
::
set_object_anchor
(
int
col
,
int
row
)
{
if
(
current_drawing_states
==
NULL
);
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
object
.
col
=
col
;
current_drawing_states
->
back
()
->
object
.
row
=
row
;
...
...
@@ -484,8 +487,9 @@ void xlsx_drawing_context::set_object_id(int val)
void
xlsx_drawing_context
::
end_drawing
()
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
size
()
<
1
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
if
(
current_drawing_states
->
back
()
->
type
==
external_items
::
typeGroup
)
return
;
end_drawing
(
current_drawing_states
->
back
());
...
...
@@ -566,6 +570,7 @@ void xlsx_drawing_context::end_drawing(_drawing_state_ptr & drawing_state)
void
xlsx_drawing_context
::
serialize_group
()
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
_drawing_state_ptr
&
drawing_state
=
current_drawing_states
->
front
();
std
::
wstringstream
strm
;
...
...
@@ -719,14 +724,18 @@ void xlsx_drawing_context::serialize_shape_comment(_drawing_state_ptr & drawing_
CP_XML_NODE
(
L"x:MoveWithCells"
){}
CP_XML_NODE
(
L"x:SizeWithCells"
){}
std
::
wstringstream
strmAnchor
;
strmAnchor
<<
drawing_state
->
sheet_anchor
.
colFrom
<<
L", "
<<
(
int
)(
2
*
drawing_state
->
sheet_anchor
.
xFrom
/
12700.
)
<<
L", "
<<
drawing_state
->
sheet_anchor
.
rwFrom
<<
L", "
<<
(
int
)(
2
*
drawing_state
->
sheet_anchor
.
yFrom
/
12700.
)
<<
L", "
<<
drawing_state
->
sheet_anchor
.
colTo
<<
L", "
<<
(
int
)(
2
*
drawing_state
->
sheet_anchor
.
xTo
/
12700.
)
<<
L", "
<<
drawing_state
->
sheet_anchor
.
rwTo
<<
L", "
<<
(
int
)(
2
*
drawing_state
->
sheet_anchor
.
yTo
/
12700.
);
if
(
!
strmAnchor
.
str
().
empty
())
{
CP_XML_NODE
(
L"x:Anchor"
){
CP_XML_CONTENT
(
strmAnchor
.
str
());}
if
(
drawing_state
->
sheet_anchor
.
xFrom
>=
0
&&
drawing_state
->
sheet_anchor
.
yFrom
>
0
)
{
//old xls don't have this
std
::
wstringstream
strmAnchor
;
strmAnchor
<<
drawing_state
->
sheet_anchor
.
colFrom
<<
L", "
<<
(
int
)(
2
*
drawing_state
->
sheet_anchor
.
xFrom
/
12700.
)
<<
L", "
<<
drawing_state
->
sheet_anchor
.
rwFrom
<<
L", "
<<
(
int
)(
2
*
drawing_state
->
sheet_anchor
.
yFrom
/
12700.
)
<<
L", "
<<
drawing_state
->
sheet_anchor
.
colTo
<<
L", "
<<
(
int
)(
2
*
drawing_state
->
sheet_anchor
.
xTo
/
12700.
)
<<
L", "
<<
drawing_state
->
sheet_anchor
.
rwTo
<<
L", "
<<
(
int
)(
2
*
drawing_state
->
sheet_anchor
.
yTo
/
12700.
);
if
(
!
strmAnchor
.
str
().
empty
())
{
CP_XML_NODE
(
L"x:Anchor"
){
CP_XML_CONTENT
(
strmAnchor
.
str
());}
}
}
CP_XML_NODE
(
L"x:AutoFill"
)
{
CP_XML_CONTENT
(
"False"
);}
CP_XML_NODE
(
L"x:Row"
)
{
CP_XML_CONTENT
(
drawing_state
->
object
.
row
);}
...
...
@@ -1742,6 +1751,7 @@ void xlsx_drawing_context::set_sheet_anchor(int colFrom, int xFrom, int rwFrom,
void
xlsx_drawing_context
::
set_child_anchor
(
int
x
,
int
y
,
int
cx
,
int
cy
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
child_anchor
.
x
=
x
;
current_drawing_states
->
back
()
->
child_anchor
.
y
=
y
;
...
...
@@ -1751,6 +1761,7 @@ void xlsx_drawing_context::set_child_anchor(int x, int y, int cx, int cy)
void
xlsx_drawing_context
::
set_group_anchor
(
int
x
,
int
y
,
int
cx
,
int
cy
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
group_anchor
.
x
=
x
;
current_drawing_states
->
back
()
->
group_anchor
.
y
=
y
;
...
...
@@ -1760,6 +1771,8 @@ void xlsx_drawing_context::set_group_anchor(int x, int y, int cx, int cy)
void
xlsx_drawing_context
::
set_absolute_anchor
(
double
x
,
double
y
,
double
cx
,
double
cy
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
if
(
current_drawing_states
->
back
()
->
type_anchor
!=
0
)
return
;
current_drawing_states
->
back
()
->
absolute_anchor
.
x
=
x
;
...
...
@@ -1773,12 +1786,14 @@ void xlsx_drawing_context::set_absolute_anchor(double x, double y, double cx, do
void
xlsx_drawing_context
::
set_fill_texture_mode
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
fill
.
texture_mode
=
(
_texture_mode
)
val
;
}
void
xlsx_drawing_context
::
set_fill_texture
(
const
std
::
wstring
&
str
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
if
(
str
.
empty
())
return
;
...
...
@@ -1788,6 +1803,7 @@ void xlsx_drawing_context::set_fill_texture(const std::wstring & str)
void
xlsx_drawing_context
::
set_crop_top
(
double
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
fill
.
texture_crop
[
1
]
=
val
;
current_drawing_states
->
back
()
->
fill
.
texture_crop_enabled
=
true
;
...
...
@@ -1795,6 +1811,7 @@ void xlsx_drawing_context::set_crop_top (double val)
void
xlsx_drawing_context
::
set_crop_bottom
(
double
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
fill
.
texture_crop
[
3
]
=
val
;
current_drawing_states
->
back
()
->
fill
.
texture_crop_enabled
=
true
;
...
...
@@ -1802,6 +1819,7 @@ void xlsx_drawing_context::set_crop_bottom(double val)
void
xlsx_drawing_context
::
set_crop_left
(
double
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
fill
.
texture_crop
[
0
]
=
val
;
current_drawing_states
->
back
()
->
fill
.
texture_crop_enabled
=
true
;
...
...
@@ -1809,6 +1827,7 @@ void xlsx_drawing_context::set_crop_left (double val)
void
xlsx_drawing_context
::
set_crop_right
(
double
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
fill
.
texture_crop
[
2
]
=
val
;
current_drawing_states
->
back
()
->
fill
.
texture_crop_enabled
=
true
;
...
...
@@ -1816,12 +1835,14 @@ void xlsx_drawing_context::set_crop_right (double val)
void
xlsx_drawing_context
::
set_rotation
(
double
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
rotation
=
val
;
}
void
xlsx_drawing_context
::
set_line_color
(
int
nColor
,
const
std
::
wstring
&
sColor
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
fill
.
color
.
sRGB
=
sColor
;
current_drawing_states
->
back
()
->
line
.
fill
.
color
.
nRGB
=
nColor
;
...
...
@@ -1829,6 +1850,7 @@ void xlsx_drawing_context::set_line_color (int nColor, const std::wstring & sCol
void
xlsx_drawing_context
::
set_line_color
(
int
index
,
int
type
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
_color
color
;
if
(
type
==
3
)
...
...
@@ -1853,18 +1875,21 @@ void xlsx_drawing_context::set_line_color (int index, int type)
void
xlsx_drawing_context
::
set_fill_angle
(
double
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
fill
.
angle
=
val
;
}
void
xlsx_drawing_context
::
set_fill_focus
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
fill
.
focus
=
val
;
}
void
xlsx_drawing_context
::
set_fill_color
(
int
nColor
,
const
std
::
wstring
&
sColor
,
bool
background
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
if
(
background
)
{
...
...
@@ -1880,6 +1905,7 @@ void xlsx_drawing_context::set_fill_color (int nColor, const std::wstring & sCol
void
xlsx_drawing_context
::
set_fill_color
(
int
index
,
int
type
,
bool
background
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
_color
color
;
if
(
type
==
3
)
...
...
@@ -1904,7 +1930,7 @@ void xlsx_drawing_context::set_fill_color (int index, int type, bool background)
void
xlsx_drawing_context
::
set_fill_opacity
(
double
val
,
bool
background
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
if
(
background
)
current_drawing_states
->
back
()
->
fill
.
opacity2
=
val
;
else
current_drawing_states
->
back
()
->
fill
.
opacity
=
val
;
...
...
@@ -1912,7 +1938,7 @@ void xlsx_drawing_context::set_fill_opacity (double val, bool background)
void
xlsx_drawing_context
::
add_fill_colors
(
double
position
,
const
std
::
wstring
&
col
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
_color
color
;
color
.
sRGB
=
col
;
...
...
@@ -1921,6 +1947,7 @@ void xlsx_drawing_context::add_fill_colors(double position, const std::wstring &
void
xlsx_drawing_context
::
add_fill_colors
(
double
position
,
int
index
,
int
type
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
_color
color
;
color
.
index
=
index
;
...
...
@@ -1931,6 +1958,7 @@ void xlsx_drawing_context::add_fill_colors(double position, int index, int type)
void
xlsx_drawing_context
::
set_fill_type
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
fill
.
type
=
(
_fill_type
)
val
;
}
...
...
@@ -1938,6 +1966,7 @@ void xlsx_drawing_context::set_fill_type (int val)
void
xlsx_drawing_context
::
set_line_dash
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
switch
(
val
)
{
...
...
@@ -1958,6 +1987,7 @@ void xlsx_drawing_context::set_line_dash(int val)
void
xlsx_drawing_context
::
set_line_type
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
switch
(
val
)
{
...
...
@@ -1970,6 +2000,7 @@ void xlsx_drawing_context::set_line_type (int val)
void
xlsx_drawing_context
::
set_line_style
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
switch
(
val
)
{
...
...
@@ -1984,6 +2015,7 @@ void xlsx_drawing_context::set_line_style (int val)
void
xlsx_drawing_context
::
set_line_width
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
width
=
val
;
}
...
...
@@ -1991,48 +2023,58 @@ void xlsx_drawing_context::set_line_width (int val)
void
xlsx_drawing_context
::
set_line_arrow
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
enabled
=
val
;
}
void
xlsx_drawing_context
::
set_arrow_start
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
start
=
val
;
}
void
xlsx_drawing_context
::
set_arrow_end
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
end
=
val
;
}
void
xlsx_drawing_context
::
set_arrow_start_width
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
start_width
=
val
;
}
void
xlsx_drawing_context
::
set_arrow_end_width
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
end_width
=
val
;
}
void
xlsx_drawing_context
::
set_arrow_start_length
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
start_length
=
val
;
}
void
xlsx_drawing_context
::
set_arrow_end_length
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
end_length
=
val
;
}
//----------------------------------------------------------------------
void
xlsx_drawing_context
::
set_fill_old_version
(
_UINT32
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
unsigned
char
backColorIdx
=
GETBITS
(
val
,
0
,
7
);
unsigned
char
patternColorIdx
=
GETBITS
(
val
,
8
,
15
);
unsigned
char
pattern
=
GETBITS
(
val
,
16
,
23
);
...
...
@@ -2086,6 +2128,9 @@ void xlsx_drawing_context::set_line_old_version (_UINT32 val)
}
void
xlsx_drawing_context
::
set_flag_old_version
(
_UINT16
val
,
_UINT16
val2
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
unsigned
short
flips_flag
=
0
;
if
(
current_drawing_states
->
back
()
->
shape_id
==
MSOSPT
::
msosptArc
)
{
...
...
@@ -2144,6 +2189,7 @@ void xlsx_drawing_context::set_flag_old_version(_UINT16 val, _UINT16 val2)
void
xlsx_drawing_context
::
set_hyperlink
(
const
std
::
wstring
&
link
,
const
std
::
wstring
&
display
,
bool
is_external
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
std
::
wstring
sId
=
std
::
wstring
(
L"hId"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
hlinks_
.
size
()
+
1
);
std
::
wstring
link_correct
=
link
;
...
...
@@ -2161,72 +2207,84 @@ void xlsx_drawing_context::set_hyperlink(const std::wstring & link, const std::w
void
xlsx_drawing_context
::
set_wordart_text
(
const
std
::
wstring
&
text
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
text
=
text
;
}
void
xlsx_drawing_context
::
set_wordart_font
(
const
std
::
wstring
&
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
font
=
val
;
}
void
xlsx_drawing_context
::
set_wordart_size
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
size
=
val
;
}
void
xlsx_drawing_context
::
set_text_align
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
text
.
align
=
val
;
}
void
xlsx_drawing_context
::
set_text_vert_align
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
text
.
vert_align
=
val
;
}
void
xlsx_drawing_context
::
set_text_vertical
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
text
.
vertical
=
val
;
}
void
xlsx_drawing_context
::
set_text_margin
(
RECT
&
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
text
.
margins
=
val
;
}
void
xlsx_drawing_context
::
set_text_fit_shape
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
text
.
fit_shape
=
val
;
}
void
xlsx_drawing_context
::
set_wordart_bold
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
bold
=
val
;
}
void
xlsx_drawing_context
::
set_wordart_italic
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
italic
=
val
;
}
void
xlsx_drawing_context
::
set_wordart_underline
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
underline
=
val
;
}
void
xlsx_drawing_context
::
set_wordart_strike
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
strike
=
val
;
}
...
...
@@ -2234,86 +2292,101 @@ void xlsx_drawing_context::set_wordart_strike(bool val)
void
xlsx_drawing_context
::
set_wordart_vertical
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
vertical
=
val
;
}
void
xlsx_drawing_context
::
set_wordart_spacing
(
double
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
wordart
.
spacing
=
val
;
}
void
xlsx_drawing_context
::
set_text
(
const
std
::
wstring
&
text
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
text
.
content
=
text
;
}
void
xlsx_drawing_context
::
set_text_wrap
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
text
.
wrap
=
val
;
}
void
xlsx_drawing_context
::
set_custom_rect
(
_rect
&
rect
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
custom_rect
=
rect
;
}
void
xlsx_drawing_context
::
set_properties
(
const
std
::
wstring
&
str
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
shape
=
str
;
}
void
xlsx_drawing_context
::
set_custom_verticles
(
std
::
vector
<
ODRAW
::
MSOPOINT
>
&
points
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
custom_verticles
=
points
;
}
void
xlsx_drawing_context
::
set_custom_guides
(
std
::
vector
<
ODRAW
::
MSOSG
>
&
guides
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
if
(
current_drawing_states
->
back
()
->
shape_id
==
MSOSPT
::
msosptNotchedCircularArrow
)
return
;
current_drawing_states
->
back
()
->
custom_guides
=
guides
;
}
void
xlsx_drawing_context
::
set_custom_segments
(
std
::
vector
<
ODRAW
::
MSOPATHINFO
>
&
segments
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
custom_segments
=
segments
;
}
void
xlsx_drawing_context
::
set_custom_adjustHandles
(
std
::
vector
<
ODRAW
::
ADJH
>
&
handles
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
custom_adjustHandles
=
handles
;
}
void
xlsx_drawing_context
::
set_custom_adjustValues
(
std
::
vector
<
_CP_OPT
(
int
)
>
&
values
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
custom_adjustValues
=
values
;
}
void
xlsx_drawing_context
::
set_custom_path
(
int
type_path
)
{
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
custom_path
=
type_path
;
}
//----------------------------------------------------------------------------------------------------------
bool
xlsx_drawing_context
::
get_mode_vmlwrite
()
{
//comment, shapes in header/footer, ....
if
(
current_drawing_states
==
NULL
)
return
false
;
if
(
current_drawing_states
==
NULL
)
return
false
;
if
(
current_drawing_states
->
empty
())
return
false
;
return
current_drawing_states
->
back
()
->
vmlwrite_mode_
;
}
void
xlsx_drawing_context
::
set_mode_vmlwrite
(
bool
val
)
{
//comment, shapes in header/footer, ....
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
==
NULL
)
return
;
if
(
current_drawing_states
->
empty
())
return
;
current_drawing_states
->
back
()
->
vmlwrite_mode_
=
val
;
}
...
...
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