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
7dbbacf3
Commit
7dbbacf3
authored
Sep 22, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - fix after testing
parent
f43a0bbf
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
126 additions
and
47 deletions
+126
-47
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
+8
-9
ASCOfficeOdfFile/src/docx/docx_package.cpp
ASCOfficeOdfFile/src/docx/docx_package.cpp
+1
-0
ASCOfficeOdfFile/src/docx/oox_chart_series.cpp
ASCOfficeOdfFile/src/docx/oox_chart_series.cpp
+2
-1
ASCOfficeOdfFile/src/docx/oox_chart_series.h
ASCOfficeOdfFile/src/docx/oox_chart_series.h
+1
-0
ASCOfficeOdfFile/src/docx/oox_data_labels.cpp
ASCOfficeOdfFile/src/docx/oox_data_labels.cpp
+3
-3
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
+60
-20
ASCOfficeOdfFile/src/docx/oox_drawing.h
ASCOfficeOdfFile/src/docx/oox_drawing.h
+1
-1
ASCOfficeOdfFile/src/docx/oox_drawing_fills.cpp
ASCOfficeOdfFile/src/docx/oox_drawing_fills.cpp
+1
-1
ASCOfficeOdfFile/src/docx/oox_types_chart.cpp
ASCOfficeOdfFile/src/docx/oox_types_chart.cpp
+4
-0
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
+7
-0
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
+7
-0
ASCOfficeOdfFile/src/odf/datatypes/fontweight.cpp
ASCOfficeOdfFile/src/odf/datatypes/fontweight.cpp
+0
-1
ASCOfficeOdfFile/src/odf/datatypes/verticalalign.cpp
ASCOfficeOdfFile/src/odf/datatypes/verticalalign.cpp
+0
-1
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
+22
-7
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
+2
-2
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
+2
-1
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
+5
-0
No files found.
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
View file @
7dbbacf3
...
@@ -378,7 +378,8 @@ void docx_conversion_context::start_document()
...
@@ -378,7 +378,8 @@ void docx_conversion_context::start_document()
output_stream
()
<<
L"xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
\"
"
;
output_stream
()
<<
L"xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
\"
"
;
output_stream
()
<<
L"xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingInk
\"
"
;
output_stream
()
<<
L"xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingInk
\"
"
;
output_stream
()
<<
L"xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
"
;
output_stream
()
<<
L"xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
"
;
output_stream
()
<<
L"xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingShape
\"
"
;
output_stream
()
<<
L"xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingShape
\"
"
;
output_stream
()
<<
L"xmlns:a=
\"
http://schemas.openxmlformats.org/drawingml/2006/main
\"
"
;
output_stream
()
<<
L"mc:Ignorable=
\"
w14 wp14
\"
>"
;
output_stream
()
<<
L"mc:Ignorable=
\"
w14 wp14
\"
>"
;
...
@@ -406,14 +407,12 @@ void docx_conversion_context::end_document()
...
@@ -406,14 +407,12 @@ void docx_conversion_context::end_document()
output_document_
->
get_word_files
().
set_notes
(
notes_context_
);
output_document_
->
get_word_files
().
set_notes
(
notes_context_
);
////////////////////////
////////////////////////
int
count
=
0
;
for
(
size_t
i
=
0
;
i
<
charts_
.
size
();
i
++
)
BOOST_FOREACH
(
const
oox_chart_context_ptr
&
chart
,
charts_
)
{
{
count
++
;
package
::
chart_content_ptr
content
=
package
::
chart_content
::
create
();
package
::
chart_content_ptr
content
=
package
::
chart_content
::
create
();
chart
->
serialize
(
content
->
content
());
chart
s_
[
i
]
->
serialize
(
content
->
content
());
chart
->
dump_rels
(
content
->
get_rel_file
()
->
get_rels
());
chart
s_
[
i
]
->
dump_rels
(
content
->
get_rel_file
()
->
get_rels
());
output_document_
->
get_word_files
().
add_charts
(
content
);
output_document_
->
get_word_files
().
add_charts
(
content
);
...
@@ -580,10 +579,10 @@ mc:Ignorable=\"w14 wp14\">";
...
@@ -580,10 +579,10 @@ mc:Ignorable=\"w14 wp14\">";
strm
<<
L"</w:abstractNum>"
;
strm
<<
L"</w:abstractNum>"
;
}
}
BOOST_FOREACH
(
int
numId
,
numIds
)
for
(
size_t
i
=
0
;
i
<
numIds
.
size
();
i
++
)
{
{
strm
<<
L"<w:num w:numId=
\"
"
<<
numId
<<
L"
\"
>"
;
strm
<<
L"<w:num w:numId=
\"
"
<<
numId
s
[
i
]
<<
L"
\"
>"
;
strm
<<
L"<w:abstractNumId w:val=
\"
"
<<
numId
<<
"
\"
/>"
;
strm
<<
L"<w:abstractNumId w:val=
\"
"
<<
numId
s
[
i
]
<<
"
\"
/>"
;
strm
<<
L"</w:num>"
;
strm
<<
L"</w:num>"
;
}
}
...
...
ASCOfficeOdfFile/src/docx/docx_package.cpp
View file @
7dbbacf3
...
@@ -319,6 +319,7 @@ namespace
...
@@ -319,6 +319,7 @@ namespace
xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
\
xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
\
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
\
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
\
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
\
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
\
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
\
xmlns:a14=
\"
http://schemas.microsoft.com/office/drawing/2010/main
\"
>"
;
xmlns:a14=
\"
http://schemas.microsoft.com/office/drawing/2010/main
\"
>"
;
//mc:Ignorable=\"w14 wp14\"
//mc:Ignorable=\"w14 wp14\"
...
...
ASCOfficeOdfFile/src/docx/oox_chart_series.cpp
View file @
7dbbacf3
...
@@ -57,6 +57,7 @@ oox_chart_series::oox_chart_series()
...
@@ -57,6 +57,7 @@ oox_chart_series::oox_chart_series()
iSymbolMarkerType_
=
0
;
iSymbolMarkerType_
=
0
;
bLocalTable_
=
false
;
bLocalTable_
=
false
;
labelPosEnabled_
=
true
;
}
}
void
oox_chart_series
::
setName
(
std
::
wstring
&
value
)
void
oox_chart_series
::
setName
(
std
::
wstring
&
value
)
{
{
...
@@ -135,7 +136,7 @@ void oox_chart_series::parse_properties()
...
@@ -135,7 +136,7 @@ void oox_chart_series::parse_properties()
if
(
*
intVal
==
2
)
data_labels_
->
set_showPercent
(
true
);
if
(
*
intVal
==
2
)
data_labels_
->
set_showPercent
(
true
);
}
}
odf_reader
::
GetProperty
(
content_
.
properties_
,
L"label-position"
,
intVal
);
odf_reader
::
GetProperty
(
content_
.
properties_
,
L"label-position"
,
intVal
);
if
(
intVal
)
if
(
intVal
&&
labelPosEnabled_
)
{
{
if
(
!
data_labels_
)
data_labels_
=
oox_data_labels
();
if
(
!
data_labels_
)
data_labels_
=
oox_data_labels
();
...
...
ASCOfficeOdfFile/src/docx/oox_chart_series.h
View file @
7dbbacf3
...
@@ -55,6 +55,7 @@ public:
...
@@ -55,6 +55,7 @@ public:
virtual
void
oox_serialize
(
std
::
wostream
&
_Wostream
)
=
0
;
virtual
void
oox_serialize
(
std
::
wostream
&
_Wostream
)
=
0
;
bool
labelPosEnabled_
;
_oox_chart_values
values_
[
5
];
//cat(labels), common, x, y, bubble,
_oox_chart_values
values_
[
5
];
//cat(labels), common, x, y, bubble,
int
id_
;
int
id_
;
std
::
wstring
name_
;
//tx (Series Text) §21.2.2.215
std
::
wstring
name_
;
//tx (Series Text) §21.2.2.215
...
...
ASCOfficeOdfFile/src/docx/oox_data_labels.cpp
View file @
7dbbacf3
...
@@ -117,15 +117,15 @@ void oox_data_labels::oox_serialize(std::wostream & _Wostream)
...
@@ -117,15 +117,15 @@ void oox_data_labels::oox_serialize(std::wostream & _Wostream)
case
1
:
CP_XML_ATTR
(
L"val"
,
L"b"
);
break
;
case
1
:
CP_XML_ATTR
(
L"val"
,
L"b"
);
break
;
case
2
:
CP_XML_ATTR
(
L"val"
,
L"b"
);
break
;
case
2
:
CP_XML_ATTR
(
L"val"
,
L"b"
);
break
;
case
3
:
CP_XML_ATTR
(
L"val"
,
L"b"
);
break
;
case
3
:
CP_XML_ATTR
(
L"val"
,
L"b"
);
break
;
case
4
:
CP_XML_ATTR
(
L"val"
,
L"ctr"
);
break
;
case
5
:
CP_XML_ATTR
(
L"val"
,
L"inEnd"
);
break
;
case
6
:
CP_XML_ATTR
(
L"val"
,
L"l"
);
break
;
case
6
:
CP_XML_ATTR
(
L"val"
,
L"l"
);
break
;
case
7
:
CP_XML_ATTR
(
L"val"
,
L"inBase"
);
break
;
case
7
:
CP_XML_ATTR
(
L"val"
,
L"inBase"
);
break
;
case
8
:
CP_XML_ATTR
(
L"val"
,
L"outEnd"
);
break
;
case
9
:
CP_XML_ATTR
(
L"val"
,
L"r"
);
break
;
case
9
:
CP_XML_ATTR
(
L"val"
,
L"r"
);
break
;
case
10
:
CP_XML_ATTR
(
L"val"
,
L"t"
);
break
;
case
10
:
CP_XML_ATTR
(
L"val"
,
L"t"
);
break
;
case
11
:
CP_XML_ATTR
(
L"val"
,
L"t"
);
break
;
case
11
:
CP_XML_ATTR
(
L"val"
,
L"t"
);
break
;
case
12
:
CP_XML_ATTR
(
L"val"
,
L"t"
);
break
;
case
12
:
CP_XML_ATTR
(
L"val"
,
L"t"
);
break
;
case
5
:
//CP_XML_ATTR(L"val", L"inEnd"); break;
case
8
:
//CP_XML_ATTR(L"val", L"outEnd"); break;
case
4
:
CP_XML_ATTR
(
L"val"
,
L"ctr"
);
break
;
}
}
}
}
...
...
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
View file @
7dbbacf3
...
@@ -171,7 +171,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
...
@@ -171,7 +171,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
if
(
color
.
empty
()
)
if
(
color
.
empty
()
)
{
{
if
(
always_draw
)
color
=
L"000000"
;
if
(
always_draw
)
color
=
L"000000"
;
else
color
=
L"FFFFFF
FF
"
;
else
color
=
L"FFFFFF"
;
}
}
CP_XML_NODE
(
L"a:srgbClr"
)
CP_XML_NODE
(
L"a:srgbClr"
)
...
@@ -210,16 +210,15 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
...
@@ -210,16 +210,15 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
}
}
}
}
}
}
void
oox_serialize_aLst
(
std
::
wostream
&
strm
,
const
std
::
vector
<
odf_reader
::
_property
>
&
prop
)
void
oox_serialize_aLst
(
std
::
wostream
&
strm
,
const
std
::
vector
<
odf_reader
::
_property
>
&
prop
,
const
std
::
wstring
&
shapeGeomPreset
)
{
{
CP_XML_WRITER
(
strm
)
CP_XML_WRITER
(
strm
)
{
{
CP_XML_NODE
(
L"a:avLst"
)
CP_XML_NODE
(
L"a:avLst"
)
{
{
_CP_OPT
(
bool
)
bModifiers
;
_CP_OPT
(
std
::
wstring
)
strModifiers
;
_CP_OPT
(
std
::
wstring
)
strModifiers
;
odf_reader
::
GetProperty
(
prop
,
L"bModifiers"
,
bModifiers
);
odf_reader
::
GetProperty
(
prop
,
L"oox-draw-modifiers"
,
strModifiers
);
odf_reader
::
GetProperty
(
prop
,
L"oox-draw-modifiers"
,
strModifiers
);
if
(
strModifiers
)
if
(
strModifiers
)
{
{
std
::
vector
<
std
::
wstring
>
values
;
std
::
vector
<
std
::
wstring
>
values
;
...
@@ -227,17 +226,61 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_pro
...
@@ -227,17 +226,61 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_pro
if
(
!
values
.
empty
()
&&
values
.
back
().
empty
())
values
.
pop_back
();
if
(
!
values
.
empty
()
&&
values
.
back
().
empty
())
values
.
pop_back
();
std
::
vector
<
std
::
wstring
>
names
;
if
(
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"math"
)
||
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"bentConnector"
)
||
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"curvedConnector"
)
||
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"frame"
))
{
names
.
push_back
(
L"adj1"
);
}
else
if
(
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"decagon"
))
{
names
.
push_back
(
L"vf"
);
}
else
if
(
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"heptagon"
)
||
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"pentagon"
))
{
names
.
push_back
(
L"hf"
);
names
.
push_back
(
L"vf"
);
}
else
if
(
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"hexagon"
))
{
names
.
push_back
(
L"adj"
);
names
.
push_back
(
L"vf"
);
}
else
if
(
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"star5"
)
||
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"star7"
))
{
names
.
push_back
(
L"adj"
);
names
.
push_back
(
L"hf"
);
names
.
push_back
(
L"vf"
);
}
else
if
(
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"star6"
)
||
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"star10"
))
{
names
.
push_back
(
L"adj"
);
names
.
push_back
(
L"hf"
);
}
for
(
size_t
i
=
0
;
i
<
values
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
values
.
size
();
i
++
)
{
{
if
(
values
[
i
].
empty
())
continue
;
if
(
values
[
i
].
empty
())
continue
;
CP_XML_NODE
(
L"a:gd"
)
CP_XML_NODE
(
L"a:gd"
)
{
{
//if (values.size() > 1 || bModifiers)
if
(
names
.
size
()
>
i
)
//весьма странное .. для некоторых модификаторов (напр math...) нужно указывать множественность их
{
CP_XML_ATTR
(
L"name"
,
L"adj"
+
std
::
to_wstring
(
i
+
1
));
CP_XML_ATTR
(
L"name"
,
names
[
i
]);
//else
}
// CP_XML_ATTR(L"name", L"adj");
else
{
if
(
values
.
size
()
>
1
)
CP_XML_ATTR
(
L"name"
,
L"adj"
+
std
::
to_wstring
(
i
+
1
));
else
CP_XML_ATTR
(
L"name"
,
L"adj"
);
}
CP_XML_ATTR
(
L"fmla"
,
L"val "
+
values
[
i
]);
CP_XML_ATTR
(
L"fmla"
,
L"val "
+
values
[
i
]);
}
}
}
}
...
@@ -321,7 +364,8 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
...
@@ -321,7 +364,8 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
CP_XML_NODE
(
L"a:prstTxWarp"
)
CP_XML_NODE
(
L"a:prstTxWarp"
)
{
{
CP_XML_ATTR
(
L"prst"
,
shapeType
);
CP_XML_ATTR
(
L"prst"
,
shapeType
);
oox_serialize_aLst
(
CP_XML_STREAM
(),
prop
);
oox_serialize_aLst
(
CP_XML_STREAM
(),
prop
,
shapeType
);
}
}
}
}
}
}
...
@@ -370,7 +414,8 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
...
@@ -370,7 +414,8 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
{
{
CP_XML_NODE
(
L"a:custGeom"
)
CP_XML_NODE
(
L"a:custGeom"
)
{
{
oox_serialize_aLst
(
CP_XML_STREAM
(),
additional
);
std
::
vector
<
std
::
wstring
>
names
;
oox_serialize_aLst
(
CP_XML_STREAM
(),
additional
,
L""
);
CP_XML_NODE
(
L"a:ahLst"
);
CP_XML_NODE
(
L"a:ahLst"
);
CP_XML_NODE
(
L"a:gdLst"
);
CP_XML_NODE
(
L"a:gdLst"
);
...
@@ -414,11 +459,7 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
...
@@ -414,11 +459,7 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
CP_XML_ATTR
(
L"prst"
,
shapeGeomPreset
);
CP_XML_ATTR
(
L"prst"
,
shapeGeomPreset
);
if
(
!
bWordArt
)
if
(
!
bWordArt
)
{
{
if
(
std
::
wstring
::
npos
!=
shapeGeomPreset
.
find
(
L"mathPlus"
))
oox_serialize_aLst
(
CP_XML_STREAM
(),
additional
,
shapeGeomPreset
);
{
additional
.
push_back
(
odf_reader
::
_property
(
L"bModifiers"
,
true
));
}
oox_serialize_aLst
(
CP_XML_STREAM
(),
additional
);
}
}
}
}
}
}
...
@@ -525,9 +566,6 @@ void oox_serialize_action(std::wostream & strm, _action_desc const & val)
...
@@ -525,9 +566,6 @@ void oox_serialize_action(std::wostream & strm, _action_desc const & val)
{
{
CP_XML_NODE
(
L"a:hlinkClick"
)
CP_XML_NODE
(
L"a:hlinkClick"
)
{
{
//CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
//CP_XML_ATTR(L"xmlns:a", L"http://schemas.openxmlformats.org/drawingml/2006/main");
if
(
!
val
.
action
.
empty
())
if
(
!
val
.
action
.
empty
())
CP_XML_ATTR
(
L"action"
,
val
.
action
);
CP_XML_ATTR
(
L"action"
,
val
.
action
);
...
@@ -544,6 +582,8 @@ void oox_serialize_action(std::wostream & strm, _action_desc const & val)
...
@@ -544,6 +582,8 @@ void oox_serialize_action(std::wostream & strm, _action_desc const & val)
CP_XML_ATTR
(
L"name"
,
L"sound"
);
CP_XML_ATTR
(
L"name"
,
L"sound"
);
}
}
}
}
//CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
//CP_XML_ATTR(L"xmlns:a", L"http://schemas.openxmlformats.org/drawingml/2006/main");
}
}
}
}
}
}
...
...
ASCOfficeOdfFile/src/docx/oox_drawing.h
View file @
7dbbacf3
...
@@ -118,7 +118,7 @@ namespace oox {
...
@@ -118,7 +118,7 @@ namespace oox {
typedef
_CP_PTR
(
_oox_drawing
)
oox_drawing_ptr
;
typedef
_CP_PTR
(
_oox_drawing
)
oox_drawing_ptr
;
void
oox_serialize_ln
(
std
::
wostream
&
strm
,
const
std
::
vector
<
odf_reader
::
_property
>
&
val
,
bool
always_draw
=
false
);
void
oox_serialize_ln
(
std
::
wostream
&
strm
,
const
std
::
vector
<
odf_reader
::
_property
>
&
val
,
bool
always_draw
=
false
);
void
oox_serialize_aLst
(
std
::
wostream
&
strm
,
const
std
::
vector
<
odf_reader
::
_property
>
&
val
);
void
oox_serialize_aLst
(
std
::
wostream
&
strm
,
const
std
::
vector
<
odf_reader
::
_property
>
&
val
,
const
std
::
wstring
&
shapeGeomPreset
);
void
oox_serialize_action
(
std
::
wostream
&
strm
,
const
_action_desc
&
val
);
void
oox_serialize_action
(
std
::
wostream
&
strm
,
const
_action_desc
&
val
);
}
}
...
...
ASCOfficeOdfFile/src/docx/oox_drawing_fills.cpp
View file @
7dbbacf3
...
@@ -168,7 +168,7 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
...
@@ -168,7 +168,7 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
{
{
if
(
val
.
bitmap
->
isInternal
)
if
(
val
.
bitmap
->
isInternal
)
{
{
//
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"r:embed"
,
val
.
bitmap
->
rId
);
CP_XML_ATTR
(
L"r:embed"
,
val
.
bitmap
->
rId
);
}
}
else
else
...
...
ASCOfficeOdfFile/src/docx/oox_types_chart.cpp
View file @
7dbbacf3
...
@@ -102,6 +102,10 @@ void oox_chart::oox_serialize_common(std::wostream & _Wostream)
...
@@ -102,6 +102,10 @@ void oox_chart::oox_serialize_common(std::wostream & _Wostream)
}
}
for
(
size_t
i
=
0
;
i
<
series_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
series_
.
size
();
i
++
)
{
{
if
(
is3D_
||
type_
==
CHART_TYPE_AREA
||
type_
==
CHART_TYPE_STOCK
)
{
series_
[
i
]
->
labelPosEnabled_
=
false
;
}
series_
[
i
]
->
oox_serialize
(
_Wostream
);
series_
[
i
]
->
oox_serialize
(
_Wostream
);
}
}
for
(
size_t
i
=
0
;
i
<
axisId_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
axisId_
.
size
();
i
++
)
...
...
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
View file @
7dbbacf3
...
@@ -472,6 +472,13 @@ void pptx_slide_context::set_media_param(std::wstring name, std::wstring value)
...
@@ -472,6 +472,13 @@ void pptx_slide_context::set_media_param(std::wstring name, std::wstring value)
void
pptx_slide_context
::
set_image
(
const
std
::
wstring
&
path
)
void
pptx_slide_context
::
set_image
(
const
std
::
wstring
&
path
)
{
{
int
pos_replaicement
=
path
.
find
(
L"ObjectReplacements"
);
if
(
pos_replaicement
>=
0
)
{
if
(
path
.
length
()
-
(
pos_replaicement
+
18
)
<
2
)
return
;
//object without image
}
if
(
impl_
->
object_description_
.
type_
==
typeUnknown
)
if
(
impl_
->
object_description_
.
type_
==
typeUnknown
)
{
{
impl_
->
object_description_
.
type_
=
typeImage
;
impl_
->
object_description_
.
type_
=
typeImage
;
...
...
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
View file @
7dbbacf3
...
@@ -299,6 +299,13 @@ void xlsx_drawing_context::set_ms_object(const std::wstring & path, const std::w
...
@@ -299,6 +299,13 @@ void xlsx_drawing_context::set_ms_object(const std::wstring & path, const std::w
}
}
void
xlsx_drawing_context
::
set_image
(
const
std
::
wstring
&
path
)
void
xlsx_drawing_context
::
set_image
(
const
std
::
wstring
&
path
)
{
{
int
pos_replaicement
=
path
.
find
(
L"ObjectReplacements"
);
if
(
pos_replaicement
>=
0
)
{
if
(
path
.
length
()
-
(
pos_replaicement
+
18
)
<
2
)
return
;
//object without image
}
if
(
impl_
->
object_description_
.
type_
==
typeUnknown
)
if
(
impl_
->
object_description_
.
type_
==
typeUnknown
)
{
{
impl_
->
object_description_
.
type_
=
typeImage
;
impl_
->
object_description_
.
type_
=
typeImage
;
...
...
ASCOfficeOdfFile/src/odf/datatypes/fontweight.cpp
View file @
7dbbacf3
...
@@ -108,7 +108,6 @@ font_weight font_weight::parse(const std::wstring & Str)
...
@@ -108,7 +108,6 @@ font_weight font_weight::parse(const std::wstring & Str)
return
font_weight
(
W900
);
return
font_weight
(
W900
);
else
else
{
{
BOOST_THROW_EXCEPTION
(
errors
::
invalid_attribute
()
);
return
WNormal
;
return
WNormal
;
}
}
}
}
...
...
ASCOfficeOdfFile/src/odf/datatypes/verticalalign.cpp
View file @
7dbbacf3
...
@@ -84,7 +84,6 @@ vertical_align vertical_align::parse(const std::wstring & Str)
...
@@ -84,7 +84,6 @@ vertical_align vertical_align::parse(const std::wstring & Str)
return
vertical_align
(
Justify
);
return
vertical_align
(
Justify
);
else
else
{
{
BOOST_THROW_EXCEPTION
(
errors
::
invalid_attribute
()
);
return
vertical_align
(
Baseline
);
return
vertical_align
(
Baseline
);
}
}
}
}
...
...
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
View file @
7dbbacf3
...
@@ -1067,7 +1067,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1067,7 +1067,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
return
;
return
;
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
int
pos_replaicement
=
href
.
find
(
L"ObjectReplacements"
);
int
pos_replaicement
=
href
.
find
(
L"ObjectReplacements"
);
const
draw_frame
*
frame
=
Context
.
get_drawing_context
().
get_current_frame
();
//owner
const
draw_frame
*
frame
=
Context
.
get_drawing_context
().
get_current_frame
();
//owner
if
(
!
frame
)
if
(
!
frame
)
...
@@ -1076,9 +1076,12 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1076,9 +1076,12 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
oox
::
_docx_drawing
*
drawing
=
dynamic_cast
<
oox
::
_docx_drawing
*>
(
frame
->
oox_drawing_
.
get
());
oox
::
_docx_drawing
*
drawing
=
dynamic_cast
<
oox
::
_docx_drawing
*>
(
frame
->
oox_drawing_
.
get
());
if
(
!
drawing
)
return
;
if
(
!
drawing
)
return
;
if
(
pos_replaicement
>=
0
&&
!
Context
.
get_drawing_context
().
get_use_image_replace
()
)
if
(
pos_replaicement
>=
0
)
{
{
return
;
//skip replacement image (math, chart, ...) - возможно записать как альтернативный контент - todooo ???
if
(
!
Context
.
get_drawing_context
().
get_use_image_replace
())
return
;
//skip replacement image (math, chart, ...) - возможно записать как альтернативный контент - todooo ???
if
(
href
.
length
()
-
(
pos_replaicement
+
18
)
<
2
)
return
;
//href="./ObjectReplacements/"
}
}
if
(
drawing
->
type
==
oox
::
typeUnknown
)
if
(
drawing
->
type
==
oox
::
typeUnknown
)
...
@@ -1122,7 +1125,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1122,7 +1125,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
drawing
->
fill
.
bitmap
=
oox
::
oox_bitmap_fill
::
create
();
drawing
->
fill
.
bitmap
=
oox
::
oox_bitmap_fill
::
create
();
drawing
->
fill
.
type
=
2
;
drawing
->
fill
.
type
=
2
;
drawing
->
fill
.
bitmap
->
isInternal
=
false
;
drawing
->
fill
.
bitmap
->
isInternal
=
false
;
drawing
->
fill
.
bitmap
->
rId
=
Context
.
add_mediaitem
(
href
,
oox
::
typeImage
,
drawing
->
fill
.
bitmap
->
isInternal
,
href
);
drawing
->
fill
.
bitmap
->
rId
=
Context
.
add_mediaitem
(
href
,
oox
::
typeImage
,
drawing
->
fill
.
bitmap
->
isInternal
,
href
);
drawing
->
fill
.
bitmap
->
bStretch
=
true
;
drawing
->
fill
.
bitmap
->
bStretch
=
true
;
const
std
::
wstring
styleName
=
frame
->
common_draw_attlists_
.
shape_with_text_and_styles_
.
const
std
::
wstring
styleName
=
frame
->
common_draw_attlists_
.
shape_with_text_and_styles_
.
...
@@ -1388,12 +1391,24 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1388,12 +1391,24 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
Context
.
set_paragraph_state
(
false
);
Context
.
set_paragraph_state
(
false
);
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
Context
.
add_new_run
(
_T
(
""
));
{
if
(
!
pState
)
//0115GS3-KeyboardShortcuts.odt
{
Context
.
start_paragraph
();
}
Context
.
add_new_run
(
L""
);
}
drawing
->
serialize
(
Context
.
output_stream
()
/*, Context.get_drawing_state_content()*/
);
drawing
->
serialize
(
Context
.
output_stream
()
/*, Context.get_drawing_state_content()*/
);
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
{
Context
.
finish_run
();
Context
.
finish_run
();
if
(
!
pState
)
//0115GS3-KeyboardShortcuts.odt
{
Context
.
finish_paragraph
();
}
}
Context
.
set_run_state
(
runState
);
Context
.
set_run_state
(
runState
);
Context
.
set_paragraph_state
(
pState
);
Context
.
set_paragraph_state
(
pState
);
...
@@ -1406,9 +1421,9 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1406,9 +1421,9 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
{
{
try
try
{
{
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
if
(
!
odf_document_
)
if
(
!
odf_document_
&&
!
href
.
empty
()
)
{
{
std
::
wstring
folderPath
=
Context
.
root
()
->
get_folder
();
std
::
wstring
folderPath
=
Context
.
root
()
->
get_folder
();
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
...
...
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
View file @
7dbbacf3
...
@@ -257,9 +257,9 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
...
@@ -257,9 +257,9 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
{
{
try
try
{
{
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
if
(
!
odf_document_
)
if
(
!
odf_document_
&&
!
href
.
empty
()
)
{
{
std
::
wstring
folderPath
=
Context
.
root
()
->
get_folder
();
std
::
wstring
folderPath
=
Context
.
root
()
->
get_folder
();
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
...
...
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
View file @
7dbbacf3
...
@@ -265,7 +265,8 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -265,7 +265,8 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
try
try
{
{
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
if
(
!
odf_document_
)
if
(
!
odf_document_
&&
!
href
.
empty
())
{
{
std
::
wstring
folderPath
=
Context
.
root
()
->
get_folder
();
std
::
wstring
folderPath
=
Context
.
root
()
->
get_folder
();
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
...
...
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
View file @
7dbbacf3
...
@@ -86,10 +86,15 @@ void text::add_text(const std::wstring & Text)
...
@@ -86,10 +86,15 @@ void text::add_text(const std::wstring & Text)
void
text
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
void
text
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
{
if
(
Context
.
get_process_note
()
!=
oox
::
docx_conversion_context
::
noNote
&&
Context
.
get_delete_text_state
())
return
;
//в ms нет рецензирования notes
Context
.
add_element_to_run
();
Context
.
add_element_to_run
();
std
::
wostream
&
strm
=
Context
.
output_stream
();
std
::
wostream
&
strm
=
Context
.
output_stream
();
std
::
wstring
textNode
=
L"w:t"
;
std
::
wstring
textNode
=
L"w:t"
;
if
(
Context
.
get_delete_text_state
())
textNode
=
L"w:delText"
;
if
(
Context
.
get_delete_text_state
())
textNode
=
L"w:delText"
;
strm
<<
L"<"
<<
textNode
;
strm
<<
L"<"
<<
textNode
;
...
...
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