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
6b6abbd2
Commit
6b6abbd2
authored
Sep 06, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat - arrow drawing
parent
8ef8ee29
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
133 additions
and
5 deletions
+133
-5
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
+30
-1
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
...XlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
+80
-0
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h
...ceXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h
+23
-4
No files found.
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
View file @
6b6abbd2
...
...
@@ -1294,6 +1294,30 @@ void XlsConverter::convert_line_style(std::vector<ODRAW::OfficeArtFOPTEPtr> & pr
{
xlsx_context
->
get_drawing_context
().
set_line_dash
(
props
[
i
]
->
op
);
}
break
;
case
NSOfficeDrawing
:
:
lineStartArrowhead
:
{
xlsx_context
->
get_drawing_context
().
set_arrow_start
(
props
[
i
]
->
op
);
}
break
;
case
NSOfficeDrawing
:
:
lineEndArrowhead
:
{
xlsx_context
->
get_drawing_context
().
set_arrow_end
(
props
[
i
]
->
op
);
}
break
;
case
NSOfficeDrawing
:
:
lineStartArrowWidth
:
{
xlsx_context
->
get_drawing_context
().
set_arrow_start_width
(
props
[
i
]
->
op
);
}
break
;
case
NSOfficeDrawing
:
:
lineStartArrowLength
:
{
xlsx_context
->
get_drawing_context
().
set_arrow_start_length
(
props
[
i
]
->
op
);
}
break
;
case
NSOfficeDrawing
:
:
lineEndArrowWidth
:
{
xlsx_context
->
get_drawing_context
().
set_arrow_end_width
(
props
[
i
]
->
op
);
}
break
;
case
NSOfficeDrawing
:
:
lineEndArrowLength
:
{
xlsx_context
->
get_drawing_context
().
set_arrow_end_length
(
props
[
i
]
->
op
);
}
break
;
case
NSOfficeDrawing
:
:
lineBoolean
:
{
ODRAW
::
LineStyleBooleanProperties
*
bools
=
(
ODRAW
::
LineStyleBooleanProperties
*
)(
props
[
i
].
get
());
...
...
@@ -1301,6 +1325,11 @@ void XlsConverter::convert_line_style(std::vector<ODRAW::OfficeArtFOPTEPtr> & pr
{
if
(
bools
->
fUsefLine
&&
bools
->
fLine
==
false
)
xlsx_context
->
get_drawing_context
().
set_line_type
(
5
);
//no line
if
(
bools
->
fUsefArrowheadsOK
&&
bools
->
fArrowheadsOK
)
{
xlsx_context
->
get_drawing_context
().
set_line_arrow
(
true
);
}
}
}
break
;
}
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp
View file @
6b6abbd2
...
...
@@ -1405,6 +1405,43 @@ void xlsx_drawing_context::serialize_line(std::wostream & stream, _drawing_state
case
lineDashDotDot
:
CP_XML_ATTR
(
L"val"
,
L"lgDashDotDot"
);
break
;
}
}
if
(
line
.
arrow
.
enabled
)
{
serialize_arrow
(
CP_XML_STREAM
(),
L"a:headEnd"
,
line
.
arrow
.
start
,
line
.
arrow
.
start_width
,
line
.
arrow
.
start_length
);
serialize_arrow
(
CP_XML_STREAM
(),
L"a:tailEnd"
,
line
.
arrow
.
end
,
line
.
arrow
.
end_width
,
line
.
arrow
.
end_length
);
}
}
}
}
void
xlsx_drawing_context
::
serialize_arrow
(
std
::
wostream
&
stream
,
std
::
wstring
name
,
int
type
,
int
width
,
int
length
)
{
if
(
type
<
1
)
return
;
CP_XML_WRITER
(
stream
)
{
CP_XML_NODE
(
name
)
{
switch
(
type
)
{
case
1
:
CP_XML_ATTR
(
L"type"
,
L"triangle"
);
break
;
case
2
:
CP_XML_ATTR
(
L"type"
,
L"stealth"
);
break
;
case
3
:
CP_XML_ATTR
(
L"type"
,
L"diamond"
);
break
;
case
4
:
CP_XML_ATTR
(
L"type"
,
L"oval"
);
break
;
case
5
:
CP_XML_ATTR
(
L"type"
,
L"arrow"
);
break
;
}
switch
(
width
)
{
case
1
:
CP_XML_ATTR
(
L"w"
,
L"lg"
);
break
;
case
2
:
CP_XML_ATTR
(
L"w"
,
L"med"
);
break
;
case
3
:
CP_XML_ATTR
(
L"w"
,
L"sm"
);
break
;
}
switch
(
length
)
{
case
1
:
CP_XML_ATTR
(
L"len"
,
L"lg"
);
break
;
case
2
:
CP_XML_ATTR
(
L"len"
,
L"med"
);
break
;
case
3
:
CP_XML_ATTR
(
L"len"
,
L"sm"
);
break
;
}
}
}
}
...
...
@@ -1747,6 +1784,49 @@ void xlsx_drawing_context::set_line_width (int val)
current_drawing_states
->
back
()
->
line
.
width
=
val
;
}
void
xlsx_drawing_context
::
set_line_arrow
(
bool
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
enabled
=
val
;
}
void
xlsx_drawing_context
::
set_arrow_start
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
return
;
current_drawing_states
->
back
()
->
line
.
arrow
.
start
=
val
;
}
void
xlsx_drawing_context
::
set_arrow_end
(
int
val
)
{
if
(
current_drawing_states
==
NULL
)
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
;
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
;
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
;
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
;
current_drawing_states
->
back
()
->
line
.
arrow
.
end_length
=
val
;
}
//----------------------------------------------------------------------
void
xlsx_drawing_context
::
set_fill_old_version
(
_UINT32
val
)
{
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h
View file @
6b6abbd2
...
...
@@ -246,14 +246,26 @@ public:
std
::
vector
<
std
::
pair
<
double
,
_color
>>
colorsPosition
;
}
fill
;
struct
_arrow
{
_arrow
()
{
enabled
=
false
;
start
=
end
=
0
;
start_length
=
end_length
=
end_width
=
start_width
=
2
;}
bool
enabled
;
int
start
;
int
end
;
int
start_width
;
int
end_width
;
int
start_length
;
int
end_length
;
};
struct
_line
{
_line
()
{
fill
.
color
.
SetRGB
(
0
,
0
,
0
);
width
=
0
;}
_line
()
{
fill
.
color
.
SetRGB
(
0
,
0
,
0
);
width
=
0
;
}
std
::
wstring
style
;
int
width
;
_line_typeDash
typeDash
;
_fill
fill
;
_arrow
arrow
;
}
line
;
//for group
std
::
vector
<
_drawing_state_ptr
>
drawing_states
;
...
...
@@ -311,13 +323,19 @@ public:
void
add_fill_colors
(
double
position
,
int
index
,
int
type
);
void
set_fill_focus
(
int
val
);
void
set_line_color
(
int
nColor
,
const
std
::
wstring
&
color
);
void
set_line_color
(
int
index
,
int
type
);
void
set_line_type
(
int
val
);
void
set_line_style
(
int
val
);
void
set_line_width
(
int
val
);
void
set_line_dash
(
int
val
);
void
set_line_arrow
(
bool
val
);
void
set_arrow_start
(
int
val
);
void
set_arrow_end
(
int
val
);
void
set_arrow_start_width
(
int
val
);
void
set_arrow_end_width
(
int
val
);
void
set_arrow_start_length
(
int
val
);
void
set_arrow_end_length
(
int
val
);
void
set_fill_old_version
(
_UINT32
val
);
void
set_line_old_version
(
_UINT32
val
);
...
...
@@ -331,7 +349,6 @@ public:
void
set_properties
(
const
std
::
wstring
&
str
);
void
set_hyperlink
(
const
std
::
wstring
&
link
,
const
std
::
wstring
&
display
,
bool
is_external
);
void
set_text
(
const
std
::
wstring
&
text
);
void
set_text_wrap
(
int
val
);
void
set_text_align
(
int
val
);
...
...
@@ -401,6 +418,8 @@ private:
void
serialize_text
(
std
::
wostream
&
stream
,
_drawing_state_ptr
&
drawing_state
);
void
serialize_color
(
std
::
wostream
&
stream
,
const
_color
&
color
,
double
opacity
=
0
);
void
serialize_arrow
(
std
::
wostream
&
stream
,
std
::
wstring
name
,
int
type
,
int
width
,
int
length
);
bool
ChangeBlack2ColorImage
(
std
::
wstring
sRgbColor1
,
std
::
wstring
sRgbColor2
,
_drawing_state_ptr
&
drawing_state
);
_color
CorrectSysColor
(
int
nColorCode
,
_drawing_state_ptr
&
drawing_state
);
...
...
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