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
eb6fb03c
Commit
eb6fb03c
authored
Sep 28, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/hotfix/v5.0.1' into develop
parents
5e60456f
ad40f51d
Changes
36
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
411 additions
and
175 deletions
+411
-175
ASCOfficeOdfFile/formulasconvert/formulasconvert_odf.cpp
ASCOfficeOdfFile/formulasconvert/formulasconvert_odf.cpp
+7
-1
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
+1
-1
ASCOfficeOdfFile/src/docx/mediaitems.cpp
ASCOfficeOdfFile/src/docx/mediaitems.cpp
+6
-2
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
+8
-2
ASCOfficeOdfFile/src/docx/oox_drawing.h
ASCOfficeOdfFile/src/docx/oox_drawing.h
+2
-1
ASCOfficeOdfFile/src/docx/oox_drawing_fills.cpp
ASCOfficeOdfFile/src/docx/oox_drawing_fills.cpp
+5
-5
ASCOfficeOdfFile/src/docx/oox_drawing_fills.h
ASCOfficeOdfFile/src/docx/oox_drawing_fills.h
+1
-1
ASCOfficeOdfFile/src/docx/oox_package.cpp
ASCOfficeOdfFile/src/docx/oox_package.cpp
+2
-1
ASCOfficeOdfFile/src/docx/pptx_drawing.cpp
ASCOfficeOdfFile/src/docx/pptx_drawing.cpp
+19
-3
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
+7
-5
ASCOfficeOdfFile/src/docx/pptx_table_context.cpp
ASCOfficeOdfFile/src/docx/pptx_table_context.cpp
+21
-8
ASCOfficeOdfFile/src/docx/xlsx_conditionalFormatting.cpp
ASCOfficeOdfFile/src/docx/xlsx_conditionalFormatting.cpp
+5
-0
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.cpp
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.cpp
+136
-50
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.h
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.h
+1
-0
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
+11
-0
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
+6
-2
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.cpp
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.cpp
+4
-0
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.h
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.h
+1
-0
ASCOfficeOdfFile/src/docx/xlsx_utils.cpp
ASCOfficeOdfFile/src/docx/xlsx_utils.cpp
+1
-1
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.cpp
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.cpp
+7
-4
ASCOfficeOdfFile/src/odf/datatypes/smil_transitiontype.cpp
ASCOfficeOdfFile/src/odf/datatypes/smil_transitiontype.cpp
+39
-39
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
+11
-2
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
+15
-2
ASCOfficeOdfFile/src/odf/math_layout_elements.cpp
ASCOfficeOdfFile/src/odf/math_layout_elements.cpp
+15
-1
ASCOfficeOdfFile/src/odf/math_table_elements.cpp
ASCOfficeOdfFile/src/odf/math_table_elements.cpp
+8
-3
ASCOfficeOdfFile/src/odf/math_token_elements.cpp
ASCOfficeOdfFile/src/odf/math_token_elements.cpp
+6
-1
ASCOfficeOdfFile/src/odf/odfcontext.cpp
ASCOfficeOdfFile/src/odf/odfcontext.cpp
+2
-2
ASCOfficeOdfFile/src/odf/odfcontext.h
ASCOfficeOdfFile/src/odf/odfcontext.h
+3
-3
ASCOfficeOdfFile/src/odf/office_annotation.cpp
ASCOfficeOdfFile/src/odf/office_annotation.cpp
+9
-4
ASCOfficeOdfFile/src/odf/office_body.cpp
ASCOfficeOdfFile/src/odf/office_body.cpp
+1
-1
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
+25
-7
ASCOfficeOdfFile/src/odf/styles.cpp
ASCOfficeOdfFile/src/odf/styles.cpp
+15
-19
ASCOfficeOdfFile/src/odf/styles.h
ASCOfficeOdfFile/src/odf/styles.h
+2
-1
ASCOfficeOdfFile/src/odf/svg_parser.cpp
ASCOfficeOdfFile/src/odf/svg_parser.cpp
+1
-1
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
+4
-0
DesktopEditor/raster/ImageFileFormatChecker.cpp
DesktopEditor/raster/ImageFileFormatChecker.cpp
+4
-2
No files found.
ASCOfficeOdfFile/formulasconvert/formulasconvert_odf.cpp
View file @
eb6fb03c
...
...
@@ -477,6 +477,12 @@ namespace formulasconvert {
}
//todooo INDEX((A1:C6~A8:C11),2,2,2) - ???? - INDEX_emb.ods
}
else
{
size_t
sz_workstr
=
workstr
.
length
();
if
(
workstr
.
substr
(
0
,
min
(
3
,
sz_workstr
))
==
L"of:"
)
//sample_02neu_crashes.ods
workstr
=
workstr
.
substr
(
3
);
}
//-----------------------------------------------------------
...
...
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
View file @
eb6fb03c
...
...
@@ -800,7 +800,7 @@ bool docx_conversion_context::process_page_properties(std::wostream & strm)
if
(
page_layout_instance_
)
{
page_layout_instance_
->
docx_
convert_
serialize
(
strm
,
*
this
);
page_layout_instance_
->
docx_serialize
(
strm
,
*
this
);
}
else
{
...
...
ASCOfficeOdfFile/src/docx/mediaitems.cpp
View file @
eb6fb03c
...
...
@@ -181,7 +181,11 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
sub_path
=
L"embeddings/"
;
}
else
{
isMediaInternal
=
is_internal
(
href
,
odf_packet_
);
if
(
href
.
empty
()
&&
type
==
typeImage
)
return
L""
;
}
int
number
=
0
;
...
...
@@ -205,9 +209,9 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
if
(
type
==
typeChart
)
outputPath
=
outputPath
+
L".xml"
;
std
::
wstring
id
;
for
(
in
t
i
=
0
;
i
<
items_
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
items_
.
size
();
i
++
)
{
if
(
items_
[
i
].
href
==
inputPath
)
if
(
(
items_
[
i
].
href
==
inputPath
&&
!
inputPath
.
empty
())
||
(
items_
[
i
].
type
==
type
&&
inputPath
.
empty
())
)
{
id
=
items_
[
i
].
Id
;
outputPath
=
items_
[
i
].
outputName
;
...
...
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
View file @
eb6fb03c
...
...
@@ -436,8 +436,14 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
{
CP_XML_NODE
(
L"a:path"
)
{
CP_XML_ATTR
(
L"w"
,
w
?
*
w
:
cx
);
CP_XML_ATTR
(
L"h"
,
h
?
*
h
:
cy
);
int
path_w
=
w
?
*
w
:
cx
;
int
path_h
=
h
?
*
h
:
cy
;
if
(
path_w
<
1
)
path_w
=
1024
;
if
(
path_h
<
1
)
path_h
=
1024
;
CP_XML_ATTR
(
L"w"
,
path_w
);
CP_XML_ATTR
(
L"h"
,
path_h
);
if
(
sCustomPath
)
{
...
...
ASCOfficeOdfFile/src/docx/oox_drawing.h
View file @
eb6fb03c
...
...
@@ -83,7 +83,7 @@ namespace oox {
class
_oox_drawing
{
public:
_oox_drawing
()
:
type
(
typeUnknown
),
id
(
0
),
x
(
0
),
y
(
0
),
cx
(
0
),
cy
(
0
),
sub_type
(
0
),
inGroup
(
false
),
name
(
L"object"
)
_oox_drawing
()
:
type
(
typeUnknown
),
id
(
0
),
x
(
0
),
y
(
0
),
cx
(
0
),
cy
(
0
),
sub_type
(
0
),
inGroup
(
false
),
name
(
L"object"
)
,
extExternal
(
false
)
{
}
RelsType
type
;
...
...
@@ -103,6 +103,7 @@ namespace oox {
std
::
wstring
objectProgId
;
std
::
wstring
extId
;
bool
extExternal
;
_action_desc
action
;
std
::
vector
<
_hlink_desc
>
hlinks
;
...
...
ASCOfficeOdfFile/src/docx/oox_drawing_fills.cpp
View file @
eb6fb03c
...
...
@@ -37,7 +37,7 @@
namespace
cpdoccore
{
namespace
oox
{
oox_bitmap_fill
::
oox_bitmap_fill
()
:
name_space
(
L"a"
),
bStretch
(
false
),
bCrop
(
false
),
bTile
(
false
),
isInternal
(
true
)
oox_bitmap_fill
::
oox_bitmap_fill
()
:
name_space
(
L"a"
),
bStretch
(
false
),
bCrop
(
false
),
bTile
(
false
),
isInternal
(
true
)
{
memset
(
cropRect
,
0
,
sizeof
(
double
)
*
4
);
}
...
...
@@ -186,10 +186,10 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
{
CP_XML_NODE
(
L"a:srcRect"
)
{
CP_XML_ATTR
(
L"l"
,
static_cast
<
size_
t
>
(
val
.
bitmap
->
cropRect
[
0
]
*
1000
));
CP_XML_ATTR
(
L"t"
,
static_cast
<
size_
t
>
(
val
.
bitmap
->
cropRect
[
1
]
*
1000
));
CP_XML_ATTR
(
L"r"
,
static_cast
<
size_
t
>
(
val
.
bitmap
->
cropRect
[
2
]
*
1000
));
CP_XML_ATTR
(
L"b"
,
static_cast
<
size_
t
>
(
val
.
bitmap
->
cropRect
[
3
]
*
1000
));
CP_XML_ATTR
(
L"l"
,
static_cast
<
in
t
>
(
val
.
bitmap
->
cropRect
[
0
]
*
1000
));
CP_XML_ATTR
(
L"t"
,
static_cast
<
in
t
>
(
val
.
bitmap
->
cropRect
[
1
]
*
1000
));
CP_XML_ATTR
(
L"r"
,
static_cast
<
in
t
>
(
val
.
bitmap
->
cropRect
[
2
]
*
1000
));
CP_XML_ATTR
(
L"b"
,
static_cast
<
in
t
>
(
val
.
bitmap
->
cropRect
[
3
]
*
1000
));
}
}
if
(
val
.
bitmap
->
bTile
)
...
...
ASCOfficeOdfFile/src/docx/oox_drawing_fills.h
View file @
eb6fb03c
...
...
@@ -147,6 +147,6 @@ namespace oox {
void
oox_serialize_fill
(
std
::
wostream
&
strm
,
const
_oox_fill
&
val
);
void
oox_serialize_srgb
(
std
::
wostream
&
strm
,
std
::
wstring
color
,
_CP_OPT
(
double
)
opacity
);
void
oox_serialize_srgb
(
std
::
wostream
&
strm
,
std
::
wstring
color
,
_CP_OPT
(
odf_types
::
percent
)
opacity
);
void
oox_serialize_bitmap_fill
(
std
::
wostream
&
strm
,
const
_oox_fill
&
val
);
}
}
ASCOfficeOdfFile/src/docx/oox_package.cpp
View file @
eb6fb03c
...
...
@@ -70,13 +70,14 @@ static std::wstring get_mime_type(const std::wstring & extension)
else
if
(
L"tif"
==
extension
)
return
L"image/x-tiff"
;
else
if
(
L"tiff"
==
extension
)
return
L"image/x-tiff"
;
else
if
(
L"pdf"
==
extension
)
return
L"application/pdf"
;
else
if
(
L"bmp"
==
extension
)
return
L"image/bmp"
;
else
if
(
L"wav"
==
extension
)
return
L"audio/wav"
;
else
if
(
L"mp3"
==
extension
)
return
L"audio/mpeg"
;
else
if
(
L"wma"
==
extension
)
return
L"audio/x-ms-wma"
;
else
if
(
L"m4a"
==
extension
)
return
L"audio/unknown"
;
else
if
(
L"avi"
==
extension
)
return
L"video/
avi
"
;
else
if
(
L"avi"
==
extension
)
return
L"video/
x-msvideo
"
;
else
if
(
L"wmv"
==
extension
)
return
L"video/x-ms-wmv"
;
else
if
(
L"mov"
==
extension
)
return
L"video/unknown"
;
else
if
(
L"mp4"
==
extension
)
return
L"video/unknown"
;
...
...
ASCOfficeOdfFile/src/docx/pptx_drawing.cpp
View file @
eb6fb03c
...
...
@@ -150,15 +150,30 @@ void pptx_serialize_media(std::wostream & strm, _pptx_drawing & val)
CP_XML_NODE
(
L"p14:media"
)
{
CP_XML_ATTR
(
L"xmlns:p14"
,
L"http://schemas.microsoft.com/office/powerpoint/2010/main"
);
if
(
val
.
extExternal
)
{
CP_XML_ATTR
(
L"r:link"
,
val
.
extId
);
}
else
{
CP_XML_ATTR
(
L"r:embed"
,
val
.
extId
);
}
}
}
}
}
}
if
(
val
.
fill
.
bitmap
)
{
val
.
fill
.
bitmap
->
name_space
=
L"p"
;
oox_serialize_fill
(
CP_XML_STREAM
(),
val
.
fill
);
oox_serialize_bitmap_fill
(
strm
,
val
.
fill
);
val
.
fill
.
bitmap
.
reset
();
}
else
{
CP_XML_NODE
(
L"p:blipFill"
);
}
CP_XML_NODE
(
L"p:spPr"
)
{
...
...
@@ -169,7 +184,8 @@ void pptx_serialize_media(std::wostream & strm, _pptx_drawing & val)
CP_XML_ATTR
(
L"prst"
,
L"rect"
);
CP_XML_NODE
(
L"a:avLst"
);
}
oox_serialize_ln
(
CP_XML_STREAM
(),
val
.
additional
);
oox_serialize_fill
(
CP_XML_STREAM
(),
val
.
fill
);
oox_serialize_ln
(
CP_XML_STREAM
(),
val
.
additional
);
}
//_CP_OPT(std::wstring) strTextContent;
//odf::GetProperty(properties,L"text-content",strTextContent);
...
...
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
View file @
eb6fb03c
...
...
@@ -555,6 +555,7 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p
bool
isMediaInternal
=
false
;
drawing
.
fill
.
bitmap
->
rId
=
get_mediaitems
().
add_or_find
(
obj
.
xlink_href_
,
typeImage
,
isMediaInternal
,
ref
);
drawing
.
fill
.
bitmap
->
isInternal
=
isMediaInternal
;
if
(
drawing
.
type
==
typeShape
)
{
...
...
@@ -649,9 +650,10 @@ void pptx_slide_context::Impl::process_media(drawing_object_description& obj, _p
drawing
.
objectId
=
get_mediaitems
().
add_or_find
(
obj
.
xlink_href_
,
drawing
.
type
,
isMediaInternal
,
ref
);
drawing
.
extId
=
L"ext"
+
drawing
.
objectId
;
drawing
.
extExternal
=
!
isMediaInternal
;
add_drawing
(
drawing
,
false
,
drawing
.
objectId
,
L"NULL"
,
drawing
.
type
);
add_additional_rels
(
true
,
drawing
.
extId
,
ref
,
typeMedia
);
add_additional_rels
(
isMediaInternal
,
drawing
.
extId
,
ref
,
typeMedia
);
if
(
drawing
.
fill
.
bitmap
)
{
...
...
ASCOfficeOdfFile/src/docx/pptx_table_context.cpp
View file @
eb6fb03c
...
...
@@ -332,21 +332,34 @@ void oox_serialize_tcPr(std::wostream & strm, std::vector<const odf_reader::styl
}
if
(
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_
)
{
CP_XML_ATTR
(
L"marT"
,
*
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_
);
CP_XML_ATTR
(
L"marB"
,
*
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_
);
CP_XML_ATTR
(
L"marL"
,
*
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_
);
CP_XML_ATTR
(
L"marR"
,
*
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_
);
double
padding
=
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_
->
get_value_unit
(
odf_types
::
length
::
emu
);
CP_XML_ATTR
(
L"marT"
,
(
long
)
padding
);
CP_XML_ATTR
(
L"marB"
,
(
long
)
padding
);
CP_XML_ATTR
(
L"marL"
,
(
long
)
padding
);
CP_XML_ATTR
(
L"marR"
,
(
long
)
padding
);
}
else
{
if
(
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_top_
)
CP_XML_ATTR
(
L"marT"
,
*
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_top_
);
{
double
padding
=
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_top_
->
get_value_unit
(
odf_types
::
length
::
emu
);
CP_XML_ATTR
(
L"marT"
,
(
long
)
padding
);
}
if
(
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_bottom_
)
CP_XML_ATTR
(
L"marB"
,
*
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_bottom_
);
{
double
padding
=
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_bottom_
->
get_value_unit
(
odf_types
::
length
::
emu
);
CP_XML_ATTR
(
L"marB"
,
(
long
)
padding
);
}
if
(
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_left_
)
CP_XML_ATTR
(
L"marL"
,
*
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_left_
);
{
double
padding
=
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_left_
->
get_value_unit
(
odf_types
::
length
::
emu
);
CP_XML_ATTR
(
L"marL"
,
(
long
)
padding
);
}
if
(
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_right_
)
CP_XML_ATTR
(
L"marR"
,
*
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_right_
);
{
double
padding
=
style_cell_attlist
.
common_padding_attlist_
.
fo_padding_right_
->
get_value_unit
(
odf_types
::
length
::
emu
);
CP_XML_ATTR
(
L"marR"
,
(
long
)
padding
);
}
}
//vert //
//style_cell_attlist.pptx_serialize(Context, CP_XML_STREAM()); //nodes
...
...
ASCOfficeOdfFile/src/docx/xlsx_conditionalFormatting.cpp
View file @
eb6fb03c
...
...
@@ -281,6 +281,11 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
impl_
->
conditionalFormattings_
.
back
().
rules
.
back
().
formula_type
=
L"expression"
;
impl_
->
conditionalFormattings_
.
back
().
rules
.
back
().
formula
=
converter
.
convert_named_expr
(
val
);
}
else
if
(
0
<=
(
pos
=
f
.
find
(
L"is-error"
)))
{
impl_
->
conditionalFormattings_
.
back
().
rules
.
back
().
formula_type
=
L"containsErrors"
;
impl_
->
conditionalFormattings_
.
back
().
rules
.
back
().
formula
=
L"0"
;
}
else
if
(
0
<=
(
pos
=
f
.
find
(
L"duplicate"
)))
{
impl_
->
conditionalFormattings_
.
back
().
rules
.
back
().
formula_type
=
L"duplicateValues"
;
...
...
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.cpp
View file @
eb6fb03c
...
...
@@ -38,6 +38,8 @@
#include <cpdoccore/xml/simple_xml_writer.h>
#include"../../Common/DocxFormat/Source/XML/Utils.h"
#include"../../Common/DocxFormat/Source/base/types_32.h"
#include <map>
namespace
cpdoccore
{
...
...
@@ -80,6 +82,7 @@ public:
bool
repeat_item_labels
=
true
;
int
type_groups
=
0
;
int
sort
=
0
;
std
::
wstring
source_groups
;
std
::
vector
<
int
>
subtotals
;
...
...
@@ -143,9 +146,13 @@ public:
bool
data_on_row
=
false
;
}
current_
;
void
sort_fields
();
void
serialize_view
(
std
::
wostream
&
strm
);
void
serialize_cache
(
std
::
wostream
&
strm
);
void
serialize_type_field
(
CP_ATTR_NODE
,
_field
&
field
);
private:
bool
clear_header_map
(
std
::
map
<
size_t
,
size_t
>
&
map
)
{
//отсев по секонд - нужны тока повторы
...
...
@@ -243,12 +250,27 @@ private:
}
connections_
+=
strm
.
str
();
}
};
xlsx_pivots_context
::
xlsx_pivots_context
()
:
impl_
(
new
xlsx_pivots_context
::
Impl
())
{
}
void
xlsx_pivots_context
::
Impl
::
sort_fields
()
{
for
(
size_t
i
=
0
;
i
<
current_
.
fields
.
size
();
i
++
)
{
if
(
current_
.
fields
[
i
].
type
==
7
)
continue
;
if
(
!
current_
.
fields
[
i
].
source_groups
.
empty
()
&&
i
!=
current_
.
fields
.
size
()
-
1
)
{
current_
.
fields
.
push_back
(
current_
.
fields
[
i
]);
current_
.
fields
.
erase
(
current_
.
fields
.
begin
()
+
i
,
current_
.
fields
.
begin
()
+
i
+
1
);
i
--
;
}
}
}
void
xlsx_pivots_context
::
Impl
::
serialize_view
(
std
::
wostream
&
strm
)
{
if
(
current_
.
headers
.
empty
())
return
;
...
...
@@ -403,6 +425,7 @@ void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
CP_XML_ATTR
(
L"colPageCount"
,
1
);
}
}
std
::
map
<
std
::
wstring
,
bool
>
used_field_name
;
CP_XML_NODE
(
L"pivotFields"
)
{
CP_XML_ATTR
(
L"count"
,
current_
.
fields_count
);
...
...
@@ -411,6 +434,11 @@ void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
if
(
current_
.
fields
[
i
].
type
==
7
)
continue
;
if
(
used_field_name
.
end
()
!=
used_field_name
.
find
(
current_
.
fields
[
i
].
name
))
continue
;
used_field_name
.
insert
(
std
::
make_pair
(
current_
.
fields
[
i
].
name
,
true
));
CP_XML_NODE
(
L"pivotField"
)
{
switch
(
current_
.
fields
[
i
].
type
)
...
...
@@ -554,9 +582,90 @@ void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
}
}
}
void
xlsx_pivots_context
::
Impl
::
serialize_type_field
(
CP_ATTR_NODE
,
_field
&
field
)
{
_CP_OPT
(
bool
)
containsSemiMixedTypes
;
_CP_OPT
(
bool
)
containsMixedTypes
;
_CP_OPT
(
bool
)
containsNonDate
;
_CP_OPT
(
bool
)
containsDate
;
_CP_OPT
(
bool
)
containsString
;
_CP_OPT
(
bool
)
containsBlank
;
_CP_OPT
(
bool
)
containsNumber
;
_CP_OPT
(
bool
)
containsInteger
;
if
(
field
.
bDate
&
field
.
bNumber
/* ||
field.bNumber & field.bString*/
)
{
containsSemiMixedTypes
=
true
;
}
else
if
(
field
.
bDate
&
field
.
bString
||
field
.
bNumber
&
field
.
bString
||
field
.
bInteger
&
field
.
bString
)
{
containsMixedTypes
=
true
;
if
(
field
.
bInteger
)
{
if
(
field
.
bNumber
)
field
.
bInteger
=
false
;
field
.
bNumber
=
true
;
}
}
else
if
(
!
field
.
bEmpty
&&
!
field
.
bString
&&
!
field
.
bBool
)
{
containsSemiMixedTypes
=
false
;
}
if
(
field
.
bDate
&&
!
(
field
.
bNumber
||
field
.
bInteger
||
field
.
bString
||
field
.
bEmpty
))
{
containsNonDate
=
false
;
}
if
(
field
.
bDate
)
{
containsDate
=
true
;
}
if
(
!
field
.
bString
&&
(
field
.
bInteger
||
field
.
bDate
||
field
.
bNumber
||
field
.
bEmpty
))
{
containsString
=
false
;
if
(
field
.
bInteger
)
{
if
(
field
.
bNumber
)
field
.
bInteger
=
false
;
field
.
bNumber
=
true
;
}
if
(
/*!field.bDate && */
field
.
bEmpty
)
containsNonDate
=
false
;
}
if
(
field
.
bEmpty
)
{
containsBlank
=
true
;
}
if
(
field
.
bNumber
)
{
containsNumber
=
true
;
}
if
(
field
.
bInteger
&&
!
field
.
bDate
)
{
if
(
containsMixedTypes
)
{
containsNumber
=
true
;
containsInteger
=
true
;
}
else
containsInteger
=
true
;
}
if
(
containsNonDate
)
CP_XML_ATTR
(
L"containsNonDate"
,
*
containsNonDate
);
if
(
containsSemiMixedTypes
)
CP_XML_ATTR
(
L"containsSemiMixedTypes"
,
*
containsSemiMixedTypes
);
if
(
containsString
)
CP_XML_ATTR
(
L"containsString"
,
*
containsString
);
if
(
containsBlank
)
CP_XML_ATTR
(
L"containsBlank"
,
*
containsBlank
);
if
(
containsMixedTypes
)
CP_XML_ATTR
(
L"containsMixedTypes"
,
*
containsMixedTypes
);
if
(
containsDate
)
CP_XML_ATTR
(
L"containsDate"
,
*
containsDate
);
if
(
containsNumber
)
CP_XML_ATTR
(
L"containsNumber"
,
*
containsNumber
);
if
(
containsInteger
)
CP_XML_ATTR
(
L"containsInteger"
,
*
containsInteger
);
}
void
xlsx_pivots_context
::
Impl
::
serialize_cache
(
std
::
wostream
&
strm
)
{
std
::
map
<
std
::
wstring
,
bool
>
used_field_name
;
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE
(
L"pivotCacheDefinition"
)
...
...
@@ -611,11 +720,21 @@ void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm)
if
(
current_
.
fields
[
i
].
type
==
7
)
continue
;
if
(
used_field_name
.
end
()
!=
used_field_name
.
find
(
current_
.
fields
[
i
].
name
))
continue
;
used_field_name
.
insert
(
std
::
make_pair
(
current_
.
fields
[
i
].
name
,
true
));
CP_XML_NODE
(
L"cacheField"
)
{
CP_XML_ATTR
(
L"name"
,
current_
.
fields
[
i
].
name
);
CP_XML_ATTR
(
L"numFmtId"
,
0
);
if
(
!
current_
.
fields
[
i
].
source_groups
.
empty
())
{
CP_XML_ATTR
(
L"databaseField"
,
0
);
}
CP_XML_NODE
(
L"sharedItems"
)
{
if
(
current_
.
fields
[
i
].
caches
.
empty
()
==
false
/* &&
...
...
@@ -631,47 +750,7 @@ void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm)
current_
.
fields
[
i
].
bString
=
false
;
}
if
((
current_
.
fields
[
i
].
bDate
&
current_
.
fields
[
i
].
bNumber
)
||
(
current_
.
fields
[
i
].
bNumber
&
current_
.
fields
[
i
].
bString
))
{
CP_XML_ATTR
(
L"containsSemiMixedTypes"
,
1
);
}
else
if
(
current_
.
fields
[
i
].
bDate
&
current_
.
fields
[
i
].
bString
)
{
CP_XML_ATTR
(
L"containsMixedTypes"
,
1
);
}
else
if
(
!
current_
.
fields
[
i
].
bEmpty
&&
!
current_
.
fields
[
i
].
bString
&&
!
current_
.
fields
[
i
].
bBool
)
{
CP_XML_ATTR
(
L"containsSemiMixedTypes"
,
0
);
}
if
(
current_
.
fields
[
i
].
bDate
&&
!
(
current_
.
fields
[
i
].
bNumber
||
current_
.
fields
[
i
].
bInteger
||
current_
.
fields
[
i
].
bString
||
current_
.
fields
[
i
].
bEmpty
))
{
CP_XML_ATTR
(
L"containsNonDate"
,
0
);
}
if
(
current_
.
fields
[
i
].
bDate
)
CP_XML_ATTR
(
L"containsDate"
,
1
);
if
(
!
current_
.
fields
[
i
].
bString
&&
(
current_
.
fields
[
i
].
bInteger
||
current_
.
fields
[
i
].
bDate
||
current_
.
fields
[
i
].
bNumber
||
current_
.
fields
[
i
].
bEmpty
))
{
CP_XML_ATTR
(
L"containsString"
,
0
);
}
if
(
current_
.
fields
[
i
].
bEmpty
)
CP_XML_ATTR
(
L"containsBlank"
,
1
);
if
(
current_
.
fields
[
i
].
bNumber
)
CP_XML_ATTR
(
L"containsNumber"
,
1
);
if
(
current_
.
fields
[
i
].
bInteger
&&
!
current_
.
fields
[
i
].
bDate
)
{
if
(
current_
.
fields
[
i
].
bString
)
{
CP_XML_ATTR
(
L"containsInteger"
,
1
);
}
else
if
(
!
current_
.
fields
[
i
].
bNumber
)
{
CP_XML_ATTR
(
L"containsNumber"
,
1
);
CP_XML_ATTR
(
L"containsInteger"
,
1
);
}
}
serialize_type_field
(
CP_GET_XML_NODE
(),
current_
.
fields
[
i
]);
if
(
current_
.
fields
[
i
].
type_groups
==
0
)
{
for
(
size_t
j
=
0
;
j
<
current_
.
fields
[
i
].
caches
.
size
();
j
++
)
...
...
@@ -691,7 +770,7 @@ void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm)
{
CP_XML_NODE
(
L"fieldGroup"
)
{
CP_XML_ATTR
(
L"base"
,
i
);
CP_XML_ATTR
(
L"base"
,
0
);
CP_XML_NODE
(
L"rangePr"
)
{
switch
(
current_
.
fields
[
i
].
type_groups
)
...
...
@@ -824,6 +903,8 @@ int xlsx_pivots_context::end_table()
std
::
wstringstream
cache_strm
;
std
::
wstringstream
rec_strm
;
impl_
->
sort_fields
();
impl_
->
serialize_view
(
view_strm
);
impl_
->
serialize_cache
(
cache_strm
);
...
...
@@ -973,6 +1054,10 @@ void xlsx_pivots_context::set_field_groups(int type)
{
impl_
->
current_
.
fields
.
back
().
type_groups
=
type
+
1
;
}
void
xlsx_pivots_context
::
set_field_groups_source
(
std
::
wstring
name
)
{
impl_
->
current_
.
fields
.
back
().
source_groups
=
name
;
}
void
xlsx_pivots_context
::
set_field_sort
(
int
type
)
{
impl_
->
current_
.
fields
.
back
().
sort
=
type
+
1
;
...
...
@@ -1002,15 +1087,16 @@ void xlsx_pivots_context::add_field_cache(int index, std::wstring value)
_CP_OPT
(
double
)
dVal
;
if
(
pos
>=
0
)
//финановый .. todooo общее правило бы...
{
value
=
value
.
substr
(
pos
+
1
);
XmlUtils
::
replace_all
(
value
,
L","
,
L""
);
XmlUtils
::
replace_all
(
value
,
L" "
,
L""
);
XmlUtils
::
replace_all
(
value
,
L"
\x00A0
"
,
L""
);
//
value = value.substr(pos + 1);
//
XmlUtils::replace_all(value, L",", L"");
//
XmlUtils::replace_all(value, L" ", L"");
//
XmlUtils::replace_all(value, L"\x00A0", L"");
}
if
(
oox
::
IsNumber
(
value
))
{
try
{
XmlUtils
::
replace_all
(
value
,
L","
,
L"."
);
dVal
=
boost
::
lexical_cast
<
double
>
(
value
);
}
catch
(...)
...
...
@@ -1021,7 +1107,7 @@ void xlsx_pivots_context::add_field_cache(int index, std::wstring value)
{
node_name
=
L"n"
;
int
iVal
=
*
dVal
;
_INT64
iVal
=
*
dVal
;
if
(
abs
(
iVal
-
*
dVal
)
>
0.00001
)
{
value
=
std
::
to_wstring
(
*
dVal
);
...
...
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.h
View file @
eb6fb03c
...
...
@@ -60,6 +60,7 @@ public:
void
set_field_data_layout
(
bool
val
);
void
set_field_sort
(
int
type
);
void
set_field_groups
(
int
type
);
void
set_field_groups_source
(
std
::
wstring
name
);
void
set_repeat_item_labels
(
bool
val
);
void
end_field
();
...
...
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
View file @
eb6fb03c
...
...
@@ -358,7 +358,18 @@ void xlsx_table_state::serialize_page_properties (std::wostream & strm)
page_layout
->
xlsx_serialize
(
strm
,
*
context_
);
}
void
xlsx_table_state
::
serialize_background
(
std
::
wostream
&
strm
)
{
if
(
tableBackground_
.
empty
())
return
;
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE
(
L"picture"
)
{
CP_XML_ATTR
(
L"r:id"
,
tableBackground_
);
}
}
}
void
xlsx_table_state
::
serialize_table_format
(
std
::
wostream
&
strm
)
{
odf_reader
::
odf_read_context
&
odfContext
=
context_
->
root
()
->
odf_context
();
...
...
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
View file @
eb6fb03c
...
...
@@ -125,12 +125,15 @@ public:
void
start_hyperlink
();
std
::
wstring
end_hyperlink
(
std
::
wstring
const
&
ref
,
std
::
wstring
const
&
href
,
std
::
wstring
const
&
display
);
void
set_background
(
std
::
wstring
rId
)
{
tableBackground_
=
rId
;
}
void
serialize_conditionalFormatting
(
std
::
wostream
&
_Wostream
);
void
serialize_table_format
(
std
::
wostream
&
_Wostream
);
void
serialize_merge_cells
(
std
::
wostream
&
_Wostream
);
void
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
);
void
serialize_ole_objects
(
std
::
wostream
&
_Wostream
);
void
serialize_page_properties
(
std
::
wostream
&
_Wostream
);
void
serialize_background
(
std
::
wostream
&
_Wostream
);
void
dump_rels_hyperlinks
(
rels
&
Rels
);
void
dump_rels_ole_objects
(
rels
&
Rels
);
...
...
@@ -154,6 +157,7 @@ private:
std
::
wstring
tableName_
;
int
tableId_
;
std
::
wstring
tableBackground_
;
std
::
wstring
table_style_
;
std
::
wstring
table_row_style_
;
...
...
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.cpp
View file @
eb6fb03c
...
...
@@ -320,6 +320,10 @@ void xlsx_table_context::serialize_page_properties(std::wostream & _Wostream)
{
return
state
()
->
serialize_page_properties
(
_Wostream
);
}
void
xlsx_table_context
::
serialize_background
(
std
::
wostream
&
_Wostream
)
{
return
state
()
->
serialize_background
(
_Wostream
);
}
void
xlsx_table_context
::
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
)
{
return
state
()
->
serialize_hyperlinks
(
_Wostream
);
...
...
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.h
View file @
eb6fb03c
...
...
@@ -90,6 +90,7 @@ public:
void
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
);
void
serialize_ole_objects
(
std
::
wostream
&
_Wostream
);
void
serialize_page_properties
(
std
::
wostream
&
_Wostream
);
void
serialize_background
(
std
::
wostream
&
_Wostream
);
xlsx_table_metrics
&
get_table_metrics
();
...
...
ASCOfficeOdfFile/src/docx/xlsx_utils.cpp
View file @
eb6fb03c
...
...
@@ -47,7 +47,7 @@ namespace oox {
bool
IsNumber
(
const
std
::
wstring
&
value
)
{
boost
::
wregex
rule
(
L"
\\
-?^[0-9]*[.,]?
[0-9]*$"
);
boost
::
wregex
rule
(
L"
^
\\
-{0,1}[0-9]*[.,]{0,1}
[0-9]*$"
);
boost
::
match_results
<
std
::
wstring
::
const_iterator
>
results
;
return
boost
::
regex_search
(
value
/*.begin(), value.end(), results*/
,
rule
);
...
...
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.cpp
View file @
eb6fb03c
...
...
@@ -476,8 +476,9 @@ void xlsx_conversion_context::end_table()
CP_XML_ATTR
(
L"r:id"
,
drawingName
.
second
);
}
}
}
get_table_context
().
serialize_background
(
current_sheet
().
drawing
());
if
(
!
get_comments_context
().
empty
())
{
std
::
wstringstream
strm
;
...
...
@@ -495,7 +496,6 @@ void xlsx_conversion_context::end_table()
current_sheet
().
set_comments_link
(
commentsName
.
first
,
commentsName
.
second
);
current_sheet
().
set_vml_drawing_link
(
vml_drawingName
.
first
,
vml_drawingName
.
second
);
}
//background picture
get_table_context
().
end_table
();
}
...
...
@@ -547,7 +547,10 @@ int xlsx_conversion_context::current_table_row()
std
::
wstring
xlsx_conversion_context
::
current_cell_address
()
{
return
oox
::
getCellAddress
(
current_table_column
(),
current_table_row
());
int
col
=
current_table_column
();
int
row
=
current_table_row
();
return
oox
::
getCellAddress
(
col
<
0
?
0
:
col
,
row
<
0
?
0
:
row
);
//under covered cell
}
void
xlsx_conversion_context
::
start_office_spreadsheet
(
const
odf_reader
::
office_element
*
elm
)
...
...
ASCOfficeOdfFile/src/odf/datatypes/smil_transitiontype.cpp
View file @
eb6fb03c
...
...
@@ -91,47 +91,47 @@ smil_transition_type smil_transition_type::parse(const std::wstring & Str)
std
::
wstring
tmp
=
Str
;
boost
::
algorithm
::
to_lower
(
tmp
);
if
(
tmp
==
L"bar
W
ipe"
)
return
smil_transition_type
(
barWipe
);
else
if
(
tmp
==
L"box
W
ipe"
)
return
smil_transition_type
(
boxWipe
);
else
if
(
tmp
==
L"fourbox
W
ipe"
)
return
smil_transition_type
(
fourBoxWipe
);
else
if
(
tmp
==
L"barndoor
W
ipe"
)
return
smil_transition_type
(
barnDoorWipe
);
else
if
(
tmp
==
L"diagonal
W
ipe"
)
return
smil_transition_type
(
diagonalWipe
);
else
if
(
tmp
==
L"bowtie
W
ipe"
)
return
smil_transition_type
(
bowTieWipe
);
else
if
(
tmp
==
L"miscdiagonal
W
ipe"
)
return
smil_transition_type
(
miscDiagonalWipe
);
else
if
(
tmp
==
L"vee
W
ipe"
)
return
smil_transition_type
(
veeWipe
);
else
if
(
tmp
==
L"barnvee
W
ipe"
)
return
smil_transition_type
(
barnVeeWipe
);
else
if
(
tmp
==
L"zigzag
W
ipe"
)
return
smil_transition_type
(
zigZagWipe
);
else
if
(
tmp
==
L"barnzigzag
W
ipe"
)
return
smil_transition_type
(
barnZigZagWipe
);
else
if
(
tmp
==
L"iris
W
ipe"
)
return
smil_transition_type
(
irisWipe
);
else
if
(
tmp
==
L"triangle
W
ipe"
)
return
smil_transition_type
(
triangleWipe
);
else
if
(
tmp
==
L"arrowhead
W
ipe"
)
return
smil_transition_type
(
arrowHeadWipe
);
else
if
(
tmp
==
L"pentagon
W
ipe"
)
return
smil_transition_type
(
pentagonWipe
);
else
if
(
tmp
==
L"hexagon
W
ipe"
)
return
smil_transition_type
(
hexagonWipe
);
else
if
(
tmp
==
L"ellipse
W
ipe"
)
return
smil_transition_type
(
ellipseWipe
);
else
if
(
tmp
==
L"eye
W
ipe"
)
return
smil_transition_type
(
eyeWipe
);
else
if
(
tmp
==
L"roundrect
W
ipe"
)
return
smil_transition_type
(
roundRectWipe
);
else
if
(
tmp
==
L"star
W
ipe"
)
return
smil_transition_type
(
starWipe
);
else
if
(
tmp
==
L"miscshape
W
ipe"
)
return
smil_transition_type
(
miscShapeWipe
);
else
if
(
tmp
==
L"clock
W
ipe"
)
return
smil_transition_type
(
clockWipe
);
else
if
(
tmp
==
L"pinwheel
W
ipe"
)
return
smil_transition_type
(
pinWheelWipe
);
else
if
(
tmp
==
L"singlesweep
W
ipe"
)
return
smil_transition_type
(
singleSweepWipe
);
else
if
(
tmp
==
L"fan
W
ipe"
)
return
smil_transition_type
(
fanWipe
);
else
if
(
tmp
==
L"doublefan
W
ipe"
)
return
smil_transition_type
(
doubleFanWipe
);
else
if
(
tmp
==
L"doublesweep
W
ipe"
)
return
smil_transition_type
(
doubleSweepWipe
);
else
if
(
tmp
==
L"saloondoor
W
ipe"
)
return
smil_transition_type
(
saloonDoorWipe
);
else
if
(
tmp
==
L"windshield
W
ipe"
)
return
smil_transition_type
(
windshieldWipe
);
else
if
(
tmp
==
L"snake
W
ipe"
)
return
smil_transition_type
(
snakeWipe
);
else
if
(
tmp
==
L"spiral
W
ipe"
)
return
smil_transition_type
(
spiralWipe
);
else
if
(
tmp
==
L"parallelsnakes
W
ipe"
)
return
smil_transition_type
(
parallelSnakesWipe
);
else
if
(
tmp
==
L"boxsnakes
W
ipe"
)
return
smil_transition_type
(
boxSnakesWipe
);
else
if
(
tmp
==
L"waterfall
W
ipe"
)
return
smil_transition_type
(
waterfallWipe
);
else
if
(
tmp
==
L"push
W
ipe"
)
return
smil_transition_type
(
pushWipe
);
else
if
(
tmp
==
L"slide
W
ipe"
)
return
smil_transition_type
(
slideWipe
);
if
(
tmp
==
L"bar
w
ipe"
)
return
smil_transition_type
(
barWipe
);
else
if
(
tmp
==
L"box
w
ipe"
)
return
smil_transition_type
(
boxWipe
);
else
if
(
tmp
==
L"fourbox
w
ipe"
)
return
smil_transition_type
(
fourBoxWipe
);
else
if
(
tmp
==
L"barndoor
w
ipe"
)
return
smil_transition_type
(
barnDoorWipe
);
else
if
(
tmp
==
L"diagonal
w
ipe"
)
return
smil_transition_type
(
diagonalWipe
);
else
if
(
tmp
==
L"bowtie
w
ipe"
)
return
smil_transition_type
(
bowTieWipe
);
else
if
(
tmp
==
L"miscdiagonal
w
ipe"
)
return
smil_transition_type
(
miscDiagonalWipe
);
else
if
(
tmp
==
L"vee
w
ipe"
)
return
smil_transition_type
(
veeWipe
);
else
if
(
tmp
==
L"barnvee
w
ipe"
)
return
smil_transition_type
(
barnVeeWipe
);
else
if
(
tmp
==
L"zigzag
w
ipe"
)
return
smil_transition_type
(
zigZagWipe
);
else
if
(
tmp
==
L"barnzigzag
w
ipe"
)
return
smil_transition_type
(
barnZigZagWipe
);
else
if
(
tmp
==
L"iris
w
ipe"
)
return
smil_transition_type
(
irisWipe
);
else
if
(
tmp
==
L"triangle
w
ipe"
)
return
smil_transition_type
(
triangleWipe
);
else
if
(
tmp
==
L"arrowhead
w
ipe"
)
return
smil_transition_type
(
arrowHeadWipe
);
else
if
(
tmp
==
L"pentagon
w
ipe"
)
return
smil_transition_type
(
pentagonWipe
);
else
if
(
tmp
==
L"hexagon
w
ipe"
)
return
smil_transition_type
(
hexagonWipe
);
else
if
(
tmp
==
L"ellipse
w
ipe"
)
return
smil_transition_type
(
ellipseWipe
);
else
if
(
tmp
==
L"eye
w
ipe"
)
return
smil_transition_type
(
eyeWipe
);
else
if
(
tmp
==
L"roundrect
w
ipe"
)
return
smil_transition_type
(
roundRectWipe
);
else
if
(
tmp
==
L"star
w
ipe"
)
return
smil_transition_type
(
starWipe
);
else
if
(
tmp
==
L"miscshape
w
ipe"
)
return
smil_transition_type
(
miscShapeWipe
);
else
if
(
tmp
==
L"clock
w
ipe"
)
return
smil_transition_type
(
clockWipe
);
else
if
(
tmp
==
L"pinwheel
w
ipe"
)
return
smil_transition_type
(
pinWheelWipe
);
else
if
(
tmp
==
L"singlesweep
w
ipe"
)
return
smil_transition_type
(
singleSweepWipe
);
else
if
(
tmp
==
L"fan
w
ipe"
)
return
smil_transition_type
(
fanWipe
);
else
if
(
tmp
==
L"doublefan
w
ipe"
)
return
smil_transition_type
(
doubleFanWipe
);
else
if
(
tmp
==
L"doublesweep
w
ipe"
)
return
smil_transition_type
(
doubleSweepWipe
);
else
if
(
tmp
==
L"saloondoor
w
ipe"
)
return
smil_transition_type
(
saloonDoorWipe
);
else
if
(
tmp
==
L"windshield
w
ipe"
)
return
smil_transition_type
(
windshieldWipe
);
else
if
(
tmp
==
L"snake
w
ipe"
)
return
smil_transition_type
(
snakeWipe
);
else
if
(
tmp
==
L"spiral
w
ipe"
)
return
smil_transition_type
(
spiralWipe
);
else
if
(
tmp
==
L"parallelsnakes
w
ipe"
)
return
smil_transition_type
(
parallelSnakesWipe
);
else
if
(
tmp
==
L"boxsnakes
w
ipe"
)
return
smil_transition_type
(
boxSnakesWipe
);
else
if
(
tmp
==
L"waterfall
w
ipe"
)
return
smil_transition_type
(
waterfallWipe
);
else
if
(
tmp
==
L"push
w
ipe"
)
return
smil_transition_type
(
pushWipe
);
else
if
(
tmp
==
L"slide
w
ipe"
)
return
smil_transition_type
(
slideWipe
);
else
if
(
tmp
==
L"fade"
)
return
smil_transition_type
(
fade
);
else
if
(
tmp
==
L"checkerboard
W
ipe"
)
return
smil_transition_type
(
checkerBoardWipe
);
else
if
(
tmp
==
L"blinds
W
ipe"
)
return
smil_transition_type
(
blindsWipe
);
else
if
(
tmp
==
L"checkerboard
w
ipe"
)
return
smil_transition_type
(
checkerBoardWipe
);
else
if
(
tmp
==
L"blinds
w
ipe"
)
return
smil_transition_type
(
blindsWipe
);
else
if
(
tmp
==
L"dissolve"
)
return
smil_transition_type
(
dissolve
);
else
if
(
tmp
==
L"randombar
W
ipe"
)
return
smil_transition_type
(
randomBarWipe
);
else
if
(
tmp
==
L"randombar
w
ipe"
)
return
smil_transition_type
(
randomBarWipe
);
else
{
return
smil_transition_type
(
barWipe
);
...
...
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
View file @
eb6fb03c
...
...
@@ -754,7 +754,7 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
}
void
common_draw_docx_convert
(
oox
::
docx_conversion_context
&
Context
,
const
union_common_draw_attlists
&
attlists_
,
oox
::
_docx_drawing
*
drawing
)
void
common_draw_docx_convert
(
oox
::
docx_conversion_context
&
Context
,
union_common_draw_attlists
&
attlists_
,
oox
::
_docx_drawing
*
drawing
)
{
const
std
::
wstring
styleName
=
attlists_
.
shape_with_text_and_styles_
.
common_shape_draw_attlist_
.
draw_style_name_
.
get_value_or
(
L""
);
...
...
@@ -899,7 +899,16 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
}
}
///////////////////////////
if
(
attlists_
.
rel_size_
.
common_draw_size_attlist_
.
svg_width_
)
{
double
w_shape
=
attlists_
.
rel_size_
.
common_draw_size_attlist_
.
svg_width_
->
get_value_unit
(
length
::
pt
);
if
(
w_shape
<
1
)
attlists_
.
rel_size_
.
common_draw_size_attlist_
.
svg_width_
=
length
(
1
,
length
::
pt
);
}
if
(
attlists_
.
rel_size_
.
common_draw_size_attlist_
.
svg_height_
)
{
double
h_shape
=
attlists_
.
rel_size_
.
common_draw_size_attlist_
.
svg_height_
->
get_value_unit
(
length
::
pt
);
if
(
h_shape
<
1
)
attlists_
.
rel_size_
.
common_draw_size_attlist_
.
svg_height_
=
length
(
1
,
length
::
pt
);
}
drawing
->
x
=
get_value_emu
(
attlists_
.
position_
.
svg_x_
);
drawing
->
y
=
get_value_emu
(
attlists_
.
position_
.
svg_y_
);
...
...
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
View file @
eb6fb03c
...
...
@@ -298,6 +298,8 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
shape
->
additional_
.
push_back
(
odf_reader
::
_property
(
L"custom_path"
,
output_
.
str
()));
set_shape
=
true
;
int
w
=
0
;
int
h
=
0
;
if
(
draw_enhanced_geometry_attlist_
.
drawooo_sub_view_size_
)
{
...
...
@@ -306,8 +308,8 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
if
(
splitted
.
size
()
==
2
)
{
int
w
=
boost
::
lexical_cast
<
int
>
(
splitted
[
0
]);
int
h
=
boost
::
lexical_cast
<
int
>
(
splitted
[
1
]);
w
=
boost
::
lexical_cast
<
int
>
(
splitted
[
0
]);
h
=
boost
::
lexical_cast
<
int
>
(
splitted
[
1
]);
shape
->
additional_
.
push_back
(
odf_reader
::
_property
(
L"custom_path_w"
,
w
));
shape
->
additional_
.
push_back
(
odf_reader
::
_property
(
L"custom_path_h"
,
h
));
...
...
@@ -320,6 +322,17 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
int
b
=
boost
::
lexical_cast
<
int
>
(
splitted
[
3
]);
}
//if (shape->common_draw_attlists_.rel_size_.common_draw_size_attlist_.svg_width_)
//{
// int w_shape = shape->common_draw_attlists_.rel_size_.common_draw_size_attlist_.svg_width_->get_value();
// if (w_shape < 1) shape->common_draw_attlists_.rel_size_.common_draw_size_attlist_.svg_width_ = length(1, length::pt);
//}
//if (shape->common_draw_attlists_.rel_size_.common_draw_size_attlist_.svg_height_)
//{
// int h_shape = shape->common_draw_attlists_.rel_size_.common_draw_size_attlist_.svg_height_->get_value();
// if (h_shape < 1) shape->common_draw_attlists_.rel_size_.common_draw_size_attlist_.svg_height_ = length(1, length::pt);
//}
}
}
}
...
...
ASCOfficeOdfFile/src/odf/math_layout_elements.cpp
View file @
eb6fb03c
...
...
@@ -33,6 +33,7 @@
#include "math_layout_elements.h"
#include "math_token_elements.h"
#include "style_text_properties.h"
#include "math_limit_elements.h"
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
@@ -297,8 +298,21 @@ void math_mstyle::oox_convert(oox::math_context & Context)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
math_munder
*
munder_test
=
dynamic_cast
<
math_munder
*>
(
content_
[
i
].
get
());
math_mfrac
*
frac_test
=
dynamic_cast
<
math_mfrac
*>
(
content_
[
i
].
get
());
math_mrow
*
row_test
=
dynamic_cast
<
math_mrow
*>
(
content_
[
i
].
get
());
if
(
row_test
||
munder_test
||
frac_test
)
Context
.
output_stream
()
<<
L"<m:e>"
;
office_math_element
*
math_element
=
dynamic_cast
<
office_math_element
*>
(
content_
[
i
].
get
());
math_element
->
oox_convert
(
Context
);
if
(
row_test
||
munder_test
||
frac_test
)
Context
.
output_stream
()
<<
L"</m:e>"
;
//office_math_element* math_element = dynamic_cast<office_math_element*>(content_[i].get());
//math_element->oox_convert(Context);
}
//reset to default math text props
Context
.
text_properties_
=
odf_reader
::
style_text_properties_ptr
(
new
odf_reader
::
style_text_properties
());
...
...
ASCOfficeOdfFile/src/odf/math_table_elements.cpp
View file @
eb6fb03c
...
...
@@ -32,6 +32,7 @@
#include "math_table_elements.h"
#include "math_layout_elements.h"
#include "math_limit_elements.h"
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
@@ -93,14 +94,18 @@ void math_mtr::oox_convert(oox::math_context & Context)
strm
<<
L"<m:mr>"
;
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
math_mrow
*
mrow_test
=
dynamic_cast
<
math_mrow
*>
(
content_
[
i
].
get
());
if
(
mrow_test
)
math_mrow
*
row_test
=
dynamic_cast
<
math_mrow
*>
(
content_
[
i
].
get
());
math_munder
*
munder_test
=
dynamic_cast
<
math_munder
*>
(
content_
[
i
].
get
());
math_mfrac
*
frac_test
=
dynamic_cast
<
math_mfrac
*>
(
content_
[
i
].
get
());
if
(
row_test
||
munder_test
||
frac_test
)
Context
.
output_stream
()
<<
L"<m:e>"
;
// EqArray записался в числитель вместо знаменателя.docx - дублирование
office_math_element
*
math_element
=
dynamic_cast
<
office_math_element
*>
(
content_
[
i
].
get
());
math_element
->
oox_convert
(
Context
);
if
(
mrow
_test
)
if
(
row_test
||
munder_test
||
frac
_test
)
strm
<<
L"</m:e>"
;
}
strm
<<
L"</m:mr>"
;
...
...
ASCOfficeOdfFile/src/odf/math_token_elements.cpp
View file @
eb6fb03c
...
...
@@ -283,7 +283,12 @@ void math_mtext::add_text(const std::wstring & Text)
void
math_mtext
::
oox_convert
(
oox
::
math_context
&
Context
)
{
if
(
text_
)
{
Context
.
output_stream
()
<<
L"<m:r><m:rPr><m:nor/></m:rPr><m:t>"
;
Context
.
output_stream
()
<<
*
text_
;
Context
.
output_stream
()
<<
L"</m:t></m:r>"
;
}
}
//----------------------------------------------------------------------------------------------------
const
wchar_t
*
math_mglyph
::
ns
=
L"math"
;
...
...
ASCOfficeOdfFile/src/odf/odfcontext.cpp
View file @
eb6fb03c
...
...
@@ -331,7 +331,7 @@ void page_layout_instance::xlsx_serialize(std::wostream & strm, oox::xlsx_conver
props
->
xlsx_serialize
(
strm
,
Context
);
}
void
page_layout_instance
::
docx_
convert_
serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
)
void
page_layout_instance
::
docx_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
)
{
const
style_header_style
*
headerStyle
=
dynamic_cast
<
style_header_style
*>
(
style_page_layout_
->
style_header_style_
.
get
());
const
style_footer_style
*
footerStyle
=
dynamic_cast
<
style_footer_style
*>
(
style_page_layout_
->
style_footer_style_
.
get
());
...
...
@@ -357,7 +357,7 @@ void page_layout_instance::docx_convert_serialize(std::wostream & strm, oox::doc
style_page_layout_properties
*
props
=
properties
();
if
(
props
)
props
->
docx_
convert_
serialize
(
strm
,
Context
);
props
->
docx_serialize
(
strm
,
Context
);
}
void
page_layout_instance
::
pptx_serialize
(
std
::
wostream
&
strm
,
oox
::
pptx_conversion_context
&
Context
)
{
...
...
ASCOfficeOdfFile/src/odf/odfcontext.h
View file @
eb6fb03c
...
...
@@ -193,9 +193,9 @@ public:
const
std
::
wstring
&
name
()
const
;
style_page_layout_properties
*
properties
()
const
;
void
docx_convert_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
);
void
xlsx_serialize
(
std
::
wostream
&
strm
,
oox
::
xlsx_conversion_context
&
Context
);
void
docx_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
);
void
pptx_serialize
(
std
::
wostream
&
strm
,
oox
::
pptx_conversion_context
&
Context
);
void
xlsx_serialize
(
std
::
wostream
&
strm
,
oox
::
xlsx_conversion_context
&
Context
);
const
style_page_layout
*
style_page_layout_
;
...
...
ASCOfficeOdfFile/src/odf/office_annotation.cpp
View file @
eb6fb03c
...
...
@@ -40,9 +40,10 @@
#include "serialize_elements.h"
#include <cpdoccore/odf/odf_document.h>
#include "
../odf/
odfcontext.h"
#include "odfcontext.h"
#include "../odf/calcs_styles.h"
#include "calcs_styles.h"
#include "../docx/xlsx_utils.h"
namespace
cpdoccore
{
...
...
@@ -215,8 +216,12 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context)
const
std
::
wstring
textStyleName
=
office_annotation_attr_
.
draw_text_style_name_
.
get_value_or
(
L""
);
std
::
wstring
ref
=
Context
.
current_cell_address
();
Context
.
get_comments_context
().
end_comment
(
ref
,
Context
.
current_table_column
(),
Context
.
current_table_row
());
int
col
=
Context
.
current_table_column
();
if
(
col
<
0
)
col
=
0
;
int
row
=
Context
.
current_table_row
();
if
(
row
<
0
)
row
=
0
;
std
::
wstring
ref
=
oox
::
getCellAddress
(
col
,
row
);
Context
.
get_comments_context
().
end_comment
(
ref
,
col
,
row
);
}
// officeooo:annotation
//////////////////////////////////////////////////////////////////////////////////////////////////
...
...
ASCOfficeOdfFile/src/odf/office_body.cpp
View file @
eb6fb03c
...
...
@@ -152,7 +152,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
{
if
(
page_layout_instance
*
lastPageLayout
=
Context
.
root
()
->
odf_context
().
pageLayoutContainer
().
page_layout_by_name
(
Context
.
get_page_properties
()))
{
lastPageLayout
->
docx_
convert_
serialize
(
Context
.
output_stream
(),
Context
);
lastPageLayout
->
docx_serialize
(
Context
.
output_stream
(),
Context
);
//Context.remove_page_properties();
}
}
...
...
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
View file @
eb6fb03c
...
...
@@ -90,20 +90,38 @@ void text::docx_convert(oox::docx_conversion_context & Context)
Context
.
get_delete_text_state
())
return
;
//в ms нет рецензирования notes
bool
add_del_run
=
false
;
if
(
Context
.
get_drawing_state_content
()
&&
Context
.
get_delete_text_state
())
{
//0503IG-AddingFormattingText.odt - удаленый текст в удаленом объекте
oox
::
text_tracked_context
::
_state
&
state
=
Context
.
get_text_tracked_context
().
get_tracked_change
(
L""
);
if
(
state
.
type
==
2
)
{
add_del_run
=
true
;
Context
.
output_stream
()
<<
L"<w:del>"
;
}
}
Context
.
add_element_to_run
();
std
::
wostream
&
strm
=
Context
.
output_stream
();
std
::
wstring
textNode
=
L"w:t"
;
if
(
Context
.
get_delete_text_state
())
textNode
=
L"w:delText"
;
strm
<<
L"<"
<<
textNode
;
Context
.
output_stream
()
<<
L"<"
<<
textNode
;
if
(
preserve_
&&
!
Context
.
get_delete_text_state
())
strm
<<
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L">"
;
Context
.
output_stream
()
<<
L" xml:space=
\"
preserve
\"
"
;
Context
.
output_stream
()
<<
L">"
;
Context
.
output_stream
()
<<
xml
::
utils
::
replace_text_to_xml
(
text_
);
Context
.
output_stream
()
<<
L"</"
<<
textNode
<<
L">"
;
if
(
add_del_run
)
{
Context
.
finish_run
();
Context
.
output_stream
()
<<
L"</w:del>"
;
}
strm
<<
xml
::
utils
::
replace_text_to_xml
(
text_
);
strm
<<
L"</"
<<
textNode
<<
L">"
;
}
void
text
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
...
...
ASCOfficeOdfFile/src/odf/styles.cpp
View file @
eb6fb03c
...
...
@@ -1254,7 +1254,6 @@ bool style_page_layout_properties::docx_background_serialize(std::wostream & str
void
style_page_layout_properties
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
}
void
style_page_layout_properties
::
xlsx_serialize
(
std
::
wostream
&
strm
,
oox
::
xlsx_conversion_context
&
Context
)
{
CP_XML_WRITER
(
strm
)
...
...
@@ -1319,6 +1318,7 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
}
}
}
}
if
(
elements_
.
style_background_image_
)
{
oox
::
_oox_fill
fill
;
...
...
@@ -1334,16 +1334,12 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
Context
.
get_drawing_context
().
get_drawings
()
->
add
(
fill
.
bitmap
->
isInternal
,
fill
.
bitmap
->
rId
,
href
,
oox
::
typeImage
,
true
);
}
CP_XML_NODE
(
L"picture"
)
{
CP_XML_ATTR
(
L"r:id"
,
fill
.
bitmap
->
rId
);
}
}
Context
.
get_table_context
().
state
()
->
set_background
(
fill
.
bitmap
->
rId
);
}
}
}
void
style_page_layout_properties
::
docx_
convert_
serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
)
void
style_page_layout_properties
::
docx_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
)
{
style_columns
*
columns
=
dynamic_cast
<
style_columns
*>
(
elements_
.
style_columns_
.
get
());
...
...
ASCOfficeOdfFile/src/odf/styles.h
View file @
eb6fb03c
...
...
@@ -975,11 +975,12 @@ public:
static
const
ElementType
type
=
typeStylePageLayout
;
CPDOCCORE_DEFINE_VISITABLE
();
void
docx_convert_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
);
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
void
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
);
bool
docx_background_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
,
oox
::
_oox_fill
&
fill
,
int
id
);
void
docx_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
);
void
xlsx_serialize
(
std
::
wostream
&
strm
,
oox
::
xlsx_conversion_context
&
Context
);
void
pptx_serialize
(
std
::
wostream
&
strm
,
oox
::
pptx_conversion_context
&
Context
);
...
...
ASCOfficeOdfFile/src/odf/svg_parser.cpp
View file @
eb6fb03c
...
...
@@ -790,7 +790,7 @@ namespace svg_path
}
}
if
((
aCurrPoly
.
points
.
size
()
>
0
||
!
bIsClosed
)
&&
!
aCurrPoly
.
command
.
empty
()
&&
aCurrPoly
.
command
!=
L"a:cubicBezTo"
)
if
((
aCurrPoly
.
points
.
size
()
>
0
/* || !bIsClosed*/
)
&&
!
aCurrPoly
.
command
.
empty
()
&&
aCurrPoly
.
command
!=
L"a:cubicBezTo"
)
{
// end-process last poly
...
...
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
View file @
eb6fb03c
...
...
@@ -406,6 +406,10 @@ void table_data_pilot_groups::xlsx_convert(oox::xlsx_conversion_context & Contex
if
(
table_grouped_by_
)
Context
.
get_pivots_context
().
set_field_groups
(
table_grouped_by_
->
get_type
());
if
(
table_source_field_name_
)
Context
.
get_pivots_context
().
set_field_groups_source
(
*
table_source_field_name_
);
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
content_
[
i
]
->
xlsx_convert
(
Context
);
...
...
DesktopEditor/raster/ImageFileFormatChecker.cpp
View file @
eb6fb03c
...
...
@@ -304,8 +304,10 @@ bool CImageFileFormatChecker::isSvmFile(BYTE* pBuffer,DWORD dwBytes)
if
(
eFileType
)
return
false
;
if
(
(
6
<=
dwBytes
)
&&
(
0x56
==
pBuffer
[
0
]
&&
0x43
==
pBuffer
[
1
]
&&
0x4c
==
pBuffer
[
2
]
&&
0x4d
==
pBuffer
[
3
]
&&
0x54
==
pBuffer
[
4
]
&&
0x46
==
pBuffer
[
5
]
&&
0x01
==
pBuffer
[
6
]
&&
0x00
==
pBuffer
[
7
]
&&
0x31
==
pBuffer
[
8
]
&&
0x00
==
pBuffer
[
9
]
&&
0x00
==
pBuffer
[
10
]
&&
0x00
==
pBuffer
[
11
])
)
&&
0x54
==
pBuffer
[
4
]
&&
0x46
==
pBuffer
[
5
]
/*&& 0x01 == pBuffer[6] && 0x00 == pBuffer[7]
&& 0x31 == pBuffer[8]*/
&&
0x00
==
pBuffer
[
9
]
&&
0x00
==
pBuffer
[
10
]
&&
0x00
==
pBuffer
[
11
])
)
//0x02, 0x00, 0x32,
//0x01,0x00, 0x031
return
true
;
return
false
;
...
...
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