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
42d1b8df
Commit
42d1b8df
authored
Oct 31, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormat Reader/Writer - review
parent
e71342c4
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
398 additions
and
390 deletions
+398
-390
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
+79
-13
ASCOfficeOdfFile/src/docx/docx_conversion_context.h
ASCOfficeOdfFile/src/docx/docx_conversion_context.h
+5
-1
ASCOfficeOdfFile/src/docx/oox_conversion_context.cpp
ASCOfficeOdfFile/src/docx/oox_conversion_context.cpp
+8
-2
ASCOfficeOdfFile/src/docx/oox_conversion_context.h
ASCOfficeOdfFile/src/docx/oox_conversion_context.h
+1
-1
ASCOfficeOdfFile/src/docx/xlsx_font.cpp
ASCOfficeOdfFile/src/docx/xlsx_font.cpp
+9
-10
ASCOfficeOdfFile/src/odf/datatypes/linetype.cpp
ASCOfficeOdfFile/src/odf/datatypes/linetype.cpp
+3
-4
ASCOfficeOdfFile/src/odf/datatypes/linetype.h
ASCOfficeOdfFile/src/odf/datatypes/linetype.h
+1
-8
ASCOfficeOdfFile/src/odf/odfcontext.cpp
ASCOfficeOdfFile/src/odf/odfcontext.cpp
+2
-2
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
+14
-13
ASCOfficeOdfFile/src/odf/style_paragraph_properties_docx.cpp
ASCOfficeOdfFile/src/odf/style_paragraph_properties_docx.cpp
+3
-6
ASCOfficeOdfFile/src/odf/style_text_properties.cpp
ASCOfficeOdfFile/src/odf/style_text_properties.cpp
+17
-44
ASCOfficeOdfFile/src/odf/style_text_properties.h
ASCOfficeOdfFile/src/odf/style_text_properties.h
+76
-204
ASCOfficeOdfFile/src/odf/styles_list.cpp
ASCOfficeOdfFile/src/odf/styles_list.cpp
+7
-5
ASCOfficeOdfFile/src/odf/text_elements.cpp
ASCOfficeOdfFile/src/odf/text_elements.cpp
+18
-2
ASCOfficeOdfFile/src/odf/text_elements.h
ASCOfficeOdfFile/src/odf/text_elements.h
+3
-0
ASCOfficeOdfFileW/source/OdfFormat/odf_conversion_context.cpp
...fficeOdfFileW/source/OdfFormat/odf_conversion_context.cpp
+1
-1
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
...fficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
+40
-25
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
+3
-2
ASCOfficeOdfFileW/source/OdfFormat/text_elements.cpp
ASCOfficeOdfFileW/source/OdfFormat/text_elements.cpp
+2
-0
ASCOfficeOdfFileW/source/OdfFormat/text_elements.h
ASCOfficeOdfFileW/source/OdfFormat/text_elements.h
+3
-0
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
+1
-1
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+97
-42
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
+2
-1
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
+3
-3
No files found.
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
View file @
42d1b8df
...
...
@@ -42,6 +42,7 @@
#include "docx_conversion_context.h"
#include "../odf/odfcontext.h"
#include "../odf/style_paragraph_properties.h"
#include "../odf/style_text_properties.h"
#include "../odf/style_graphic_properties.h"
#include "../odf/datatypes/style_ref.h"
...
...
@@ -108,6 +109,11 @@ void text_tracked_context::set_user_info (std::wstring &author, std::wstring &da
current_state_
.
author
=
author
;
current_state_
.
date
=
date
;
}
void
text_tracked_context
::
set_style_name
(
std
::
wstring
style_name
)
{
current_state_
.
style_name
=
style_name
;
}
text_tracked_context
::
_state
&
text_tracked_context
::
get_tracked_change
(
std
::
wstring
id
)
{
std
::
map
<
std
::
wstring
,
_state
>::
iterator
it
=
mapChanges_
.
find
(
id
);
...
...
@@ -206,7 +212,7 @@ void docx_conversion_context::add_element_to_run(std::wstring parenStyleId)
textProp
->
content
().
docx_convert
(
*
this
);
}
get_styles_context
().
docx_serialize_text_style
(
output_stream
(),
parenStyleId
);
get_styles_context
().
docx_serialize_text_style
(
output_stream
(),
parenStyleId
,
text_tracked_context_
.
dumpRPr_
);
}
}
...
...
@@ -818,7 +824,7 @@ void docx_conversion_context::end_process_style_content(bool in_styles)
docx_serialize_paragraph_style
(
output_stream
(),
automatic_parent_style_
,
in_styles
);
if
(
automatic_parent_style_
.
empty
())
styles_context_
.
docx_serialize_text_style
(
output_stream
(),
_T
(
""
)
);
styles_context_
.
docx_serialize_text_style
(
output_stream
(),
L""
,
text_tracked_context_
.
dumpRPr_
);
}
void
docx_conversion_context
::
docx_serialize_paragraph_style
(
std
::
wostream
&
strm
,
const
std
::
wstring
&
ParentId
,
bool
in_styles
)
...
...
@@ -860,7 +866,12 @@ void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & str
}
CP_XML_STREAM
()
<<
paragraph_style
.
str
();
docx_serialize_list_properties
(
CP_XML_STREAM
());
if
(
!
get_text_tracked_context
().
dumpPPr_
.
empty
())
{
CP_XML_STREAM
()
<<
get_text_tracked_context
().
dumpPPr_
;
get_text_tracked_context
().
dumpPPr_
.
clear
();
}
if
(
run_style
.
tellp
()
>
0
&&
in_styles
==
false
)
{
CP_XML_NODE
(
L"w:rPr"
)
...
...
@@ -1286,18 +1297,70 @@ void docx_conversion_context::start_changes()
{
text_tracked_context
::
_state
&
state
=
it
->
second
;
if
(
state
.
type
==
3
)
continue
;
//format change ... todooo
if
(
state
.
type
==
0
)
continue
;
//unknown change ... todooo
if
(
state
.
type
==
1
)
output_stream
()
<<
L"<w:ins"
;
if
(
state
.
type
==
2
)
output_stream
()
<<
L"<w:del"
;
std
::
wstring
change_attr
;
change_attr
+=
L" w:date=
\"
"
+
state
.
date
+
L"
\"
"
;
change_attr
+=
L" w:author=
\"
"
+
state
.
author
+
L"
\"
"
;
change_attr
+=
L" w:id=
\"
"
+
std
::
to_wstring
(
current_id_changes
++
)
+
L"
\"
"
;
output_stream
()
<<
L" w:date=
\"
"
<<
state
.
date
<<
"
\"
"
;
output_stream
()
<<
L" w:author=
\"
"
<<
state
.
author
<<
"
\"
"
;
output_stream
()
<<
L" w:id=
\"
"
<<
std
::
to_wstring
(
current_id_changes
++
)
<<
"
\"
"
;
output_stream
()
<<
L">"
;
if
(
state
.
type
==
1
)
{
output_stream
()
<<
L"<w:ins"
<<
change_attr
<<
L">
"
;
}
if
(
state
.
type
==
2
)
output_stream
()
<<
state
.
content
;
if
(
state
.
type
==
2
)
{
output_stream
()
<<
L"<w:del"
<<
change_attr
<<
L">"
;
output_stream
()
<<
state
.
content
;
}
if
(
state
.
type
==
3
)
{
odf_reader
::
style_instance
*
styleInst
=
root
()
->
odf_context
().
styleContainer
().
style_by_name
(
state
.
style_name
,
odf_types
::
style_family
::
Paragraph
,
false
);
if
(
styleInst
)
{
odf_reader
::
style_paragraph_properties
*
props
=
NULL
;
props
=
styleInst
->
content
()
->
get_style_paragraph_properties
();
if
(
props
)
{
props
->
docx_convert
(
*
this
);
odf_reader
::
style_text_properties
*
t_props
=
NULL
;
t_props
=
styleInst
->
content
()
->
get_style_text_properties
();
if
(
t_props
)
props
->
docx_convert
(
*
this
);
std
::
wstring
attr
=
get_styles_context
().
paragraph_attr
().
str
();
text_tracked_context_
.
dumpPPr_
=
L"<w:pPrChange"
+
change_attr
+
(
attr
.
empty
()
?
L">"
:
(
L" "
+
attr
+
L">"
));
text_tracked_context_
.
dumpPPr_
+=
get_styles_context
().
paragraph_nodes
().
str
();
if
(
t_props
)
{
text_tracked_context_
.
dumpPPr_
+=
L"<w:rPr>"
;
text_tracked_context_
.
dumpPPr_
+=
get_styles_context
().
text_style
().
str
();
text_tracked_context_
.
dumpPPr_
+=
L"</w:rPr>"
;
}
text_tracked_context_
.
dumpPPr_
+=
L"</w:pPrChange>"
;
}
else
text_tracked_context_
.
dumpPPr_
=
L"<w:pPrChange/>"
;
}
else
if
(
styleInst
=
root
()
->
odf_context
().
styleContainer
().
style_by_name
(
state
.
style_name
,
odf_types
::
style_family
::
Text
,
false
))
{
odf_reader
::
style_text_properties
*
props
=
NULL
;
props
=
styleInst
->
content
()
->
get_style_text_properties
();
if
(
props
)
{
props
->
docx_convert
(
*
this
);
text_tracked_context_
.
dumpRPr_
=
L"<w:rPrChange"
+
change_attr
+
L">"
;
text_tracked_context_
.
dumpRPr_
+=
get_styles_context
().
text_style
().
str
();
text_tracked_context_
.
dumpRPr_
+=
L"</w:rPrChange>"
;
}
else
text_tracked_context_
.
dumpRPr_
=
L"<w:rPrChange/>"
;
}
else
{
}
}
}
}
...
...
@@ -1307,12 +1370,15 @@ void docx_conversion_context::end_changes()
{
text_tracked_context
::
_state
&
state
=
it
->
second
;
if
(
state
.
type
==
3
)
continue
;
//format change ... todooo
if
(
state
.
type
==
0
)
continue
;
//unknown change ... todooo
if
(
state
.
type
==
0
)
continue
;
//unknown change ... libra format change skip
if
(
state
.
type
==
3
)
continue
;
if
(
state
.
type
==
1
)
output_stream
()
<<
L"</w:ins>"
;
if
(
state
.
type
==
2
)
output_stream
()
<<
L"</w:del>"
;
}
text_tracked_context_
.
dumpPPr_
.
clear
();
text_tracked_context_
.
dumpRPr_
.
clear
();
}
void
docx_conversion_context
::
end_text_changes
(
std
::
wstring
id
)
{
...
...
ASCOfficeOdfFile/src/docx/docx_conversion_context.h
View file @
42d1b8df
...
...
@@ -494,7 +494,8 @@ public:
std
::
wstring
author
;
std
::
wstring
date
;
int
type
;
std
::
wstring
content
;
//delete elements
std
::
wstring
content
;
//delete elements
std
::
wstring
style_name
;
void
clear
()
{
...
...
@@ -505,6 +506,8 @@ public:
content
.
clear
();
}
};
std
::
wstring
dumpPPr_
;
std
::
wstring
dumpRPr_
;
text_tracked_context
(
docx_conversion_context
&
context
);
...
...
@@ -516,6 +519,7 @@ public:
void
set_user_info
(
std
::
wstring
&
author
,
std
::
wstring
&
date
);
void
set_type
(
int
type
);
void
set_style_name
(
std
::
wstring
style_name
);
_state
&
get_tracked_change
(
std
::
wstring
id
);
...
...
ASCOfficeOdfFile/src/docx/oox_conversion_context.cpp
View file @
42d1b8df
...
...
@@ -99,7 +99,7 @@ std::wstringstream & styles_context::list_style()
return
list_style_
;
}
void
styles_context
::
docx_serialize_text_style
(
std
::
wostream
&
strm
,
std
::
wstring
parenStyleId
)
void
styles_context
::
docx_serialize_text_style
(
std
::
wostream
&
strm
,
std
::
wstring
parenStyleId
,
std
::
wstring
&
strChange
)
{
if
(
!
text_style_
.
str
().
empty
())
{
...
...
@@ -107,12 +107,18 @@ void styles_context::docx_serialize_text_style(std::wostream & strm, std::wstrin
{
CP_XML_NODE
(
L"w:rPr"
)
{
if
(
parenStyleId
.
length
()
>
0
)
if
(
!
parenStyleId
.
empty
()
)
{
CP_XML_STREAM
()
<<
L"<w:rStyle w:val=
\"
"
<<
parenStyleId
<<
L"
\"
/>"
;
}
const
std
::
wstring
&
test_str
=
text_style_
.
str
();
CP_XML_STREAM
()
<<
test_str
;
if
(
!
strChange
.
empty
())
//rPrChange
{
CP_XML_STREAM
()
<<
strChange
;
strChange
.
clear
();
}
}
}
}
...
...
ASCOfficeOdfFile/src/docx/oox_conversion_context.h
View file @
42d1b8df
...
...
@@ -58,7 +58,7 @@ public:
std
::
wstringstream
&
table_style
();
std
::
wstringstream
&
list_style
();
void
docx_serialize_text_style
(
std
::
wostream
&
strm
,
std
::
wstring
parenStyleId
);
void
docx_serialize_text_style
(
std
::
wostream
&
strm
,
std
::
wstring
parenStyleId
,
std
::
wstring
&
strChange
);
void
docx_serialize_table_style
(
std
::
wostream
&
strm
);
void
pptx_serialize_table_style
(
std
::
wostream
&
strm
);
...
...
ASCOfficeOdfFile/src/docx/xlsx_font.cpp
View file @
42d1b8df
...
...
@@ -325,12 +325,11 @@ xlsx_font::xlsx_font ( const odf_reader::text_format_properties_content * textP
// sz = 10.;//kDefaultFontSize; //todooo ... вытащить как в math
//}
if
(
textProp
->
style_text_underline_type_
&&
textProp
->
style_text_underline_type_
->
get_type
()
!=
odf_types
::
line_type
::
Non
||
if
(
(
textProp
->
style_text_underline_type_
&&
textProp
->
style_text_underline_type_
->
get_type
()
!=
odf_types
::
line_type
::
Non
e
)
||
textProp
->
style_text_underline_style_
&&
textProp
->
style_text_underline_style_
->
get_type
()
!=
odf_types
::
line_style
::
None
)
(
textProp
->
style_text_underline_style_
&&
textProp
->
style_text_underline_style_
->
get_type
()
!=
odf_types
::
line_style
::
None
))
{
if
(
textProp
->
style_text_underline_type_
&&
textProp
->
style_text_underline_type_
->
get_type
()
==
odf_types
::
line_type
::
Double
)
...
...
@@ -338,12 +337,12 @@ xlsx_font::xlsx_font ( const odf_reader::text_format_properties_content * textP
else
u
=
XUNDERLINE_SINGLE
;
}
if
((
textProp
->
style_text_line_through_type_
&&
textProp
->
style_text_line_through_type_
->
get_type
()
!=
odf_types
::
line_type
::
None
)
||
if
(
textProp
->
style_text_line_through_type_
&&
textProp
->
style_text_line_through_type_
->
get_type
()
!=
odf_types
::
line_type
::
Non
||
textProp
->
style_text_line_through_style_
&&
textProp
->
style_text_line_through_style_
->
get_type
()
!=
odf_types
::
line_style
::
None
)
(
textProp
->
style_text_line_through_style_
&&
textProp
->
style_text_line_through_style_
->
get_type
()
!=
odf_types
::
line_style
::
None
))
{
strike
=
true
;
}
...
...
ASCOfficeOdfFile/src/odf/datatypes/linetype.cpp
View file @
42d1b8df
...
...
@@ -40,7 +40,7 @@ std::wostream & operator << (std::wostream & _Wostream, const line_type & _Val)
{
switch
(
_Val
.
get_type
())
{
case
line_type
:
:
Non
:
case
line_type
:
:
Non
e
:
_Wostream
<<
"none"
;
break
;
case
line_type
:
:
Single
:
...
...
@@ -61,15 +61,14 @@ line_type line_type::parse(const std::wstring & Str)
boost
::
algorithm
::
to_lower
(
tmp
);
if
(
tmp
==
L"none"
)
return
line_type
(
Non
);
return
line_type
(
Non
e
);
else
if
(
tmp
==
L"single"
)
return
line_type
(
Single
);
else
if
(
tmp
==
L"double"
)
return
line_type
(
Double
);
else
{
BOOST_THROW_EXCEPTION
(
errors
::
invalid_attribute
()
);
return
Non
;
return
None
;
}
}
...
...
ASCOfficeOdfFile/src/odf/datatypes/linetype.h
View file @
42d1b8df
...
...
@@ -29,12 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef _CPDOCCORE_ODF_LINETYPE_H_
#define _CPDOCCORE_ODF_LINETYPE_H_
#ifdef _MSC_VER
#pragma once
#endif
#include <string>
#include <iosfwd>
...
...
@@ -48,7 +43,7 @@ class line_type
public:
enum
type
{
Non
,
Non
e
,
Single
,
Double
};
...
...
@@ -78,5 +73,3 @@ std::wostream & operator << (std::wostream & _Wostream, const line_type & _Val);
APPLY_PARSE_XML_ATTRIBUTES
(
odf_types
::
line_type
);
}
#endif
ASCOfficeOdfFile/src/odf/odfcontext.cpp
View file @
42d1b8df
...
...
@@ -184,7 +184,7 @@ const std::wstring & style_instance::data_style_name() const
return
data_style_name_
;
}
style_instance
*
styles_container
::
style_by_name
(
const
std
::
wstring
&
Name
,
style_family
::
type
Type
,
bool
object_in_styles
)
const
style_instance
*
styles_container
::
style_by_name
(
const
std
::
wstring
&
Name
,
style_family
::
type
Type
,
bool
object_in_styles
)
const
{
std
::
wstring
n
=
L""
;
if
(
object_in_styles
)
n
=
L"common:"
;
...
...
@@ -200,7 +200,7 @@ style_instance * styles_container::style_by_name(const std::wstring & Name, styl
else
return
NULL
;
}
style_instance
*
styles_container
::
style_by_display_name
(
const
std
::
wstring
&
Name
,
style_family
::
type
Type
,
bool
object_in_styles
)
const
style_instance
*
styles_container
::
style_by_display_name
(
const
std
::
wstring
&
Name
,
style_family
::
type
Type
,
bool
object_in_styles
)
const
{
std
::
wstring
n
=
L""
;
if
(
object_in_styles
)
n
=
L"common:"
;
...
...
ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
View file @
42d1b8df
...
...
@@ -88,17 +88,18 @@ void text::add_text(const std::wstring & Text)
void
text
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
Context
.
add_element_to_run
();
std
::
wostream
&
_Wostrea
m
=
Context
.
output_stream
();
std
::
wostream
&
str
m
=
Context
.
output_stream
();
std
::
wstring
textNode
=
L"w:t"
;
if
(
Context
.
get_delete_text_state
())
textNode
=
L"w:delText"
;
_Wostream
<<
L"<"
<<
textNode
;
if
(
preserve_
&&
!
Context
.
get_delete_text_state
())
_Wostream
<<
L" xml:space=
\"
preserve
\"
>"
;
_Wostream
<<
L">"
;
strm
<<
L"<"
<<
textNode
;
if
(
preserve_
&&
!
Context
.
get_delete_text_state
())
strm
<<
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L">"
;
_Wostrea
m
<<
xml
::
utils
::
replace_text_to_xml
(
text_
);
_Wostrea
m
<<
L"</"
<<
textNode
<<
L">"
;
str
m
<<
xml
::
utils
::
replace_text_to_xml
(
text_
);
str
m
<<
L"</"
<<
textNode
<<
L">"
;
}
void
text
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
...
...
@@ -150,8 +151,8 @@ void s::docx_convert(oox::docx_conversion_context & Context)
if
(
Context
.
get_delete_text_state
())
textNode
=
L"w:delText"
;
strm
<<
L"<"
<<
textNode
;
if
(
!
Context
.
get_delete_text_state
())
L" xml:space=
\"
preserve
\"
"
;
if
(
!
Context
.
get_delete_text_state
())
strm
<<
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L">"
;
text_to_stream
(
strm
);
strm
<<
L"</"
<<
textNode
<<
L">"
;
...
...
@@ -739,7 +740,7 @@ void title::docx_convert(oox::docx_conversion_context & Context)
strm
<<
L"<"
<<
textNode
;
if
(
!
Context
.
get_delete_text_state
())
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L">"
;
text_to_stream
(
strm
);
strm
<<
L"</"
<<
textNode
<<
L">"
;
...
...
@@ -803,7 +804,7 @@ void subject::docx_convert(oox::docx_conversion_context & Context)
strm
<<
L"<"
<<
textNode
;
if
(
!
Context
.
get_delete_text_state
())
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L">"
;
text_to_stream
(
strm
);
strm
<<
L"</"
<<
textNode
<<
L">"
;
...
...
@@ -866,7 +867,7 @@ void chapter::docx_convert(oox::docx_conversion_context & Context)
strm
<<
L"<"
<<
textNode
;
if
(
!
Context
.
get_delete_text_state
())
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L">"
;
text_to_stream
(
strm
);
strm
<<
L"</"
<<
textNode
<<
L">"
;
...
...
@@ -1098,7 +1099,7 @@ void text_date::docx_convert(oox::docx_conversion_context & Context)
strm
<<
L"<"
<<
textNode
;
if
(
!
Context
.
get_delete_text_state
())
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L">"
;
text_to_stream
(
strm
);
strm
<<
L"</"
<<
textNode
<<
L">"
;
...
...
@@ -1210,7 +1211,7 @@ void text_time::docx_convert(oox::docx_conversion_context & Context)
strm
<<
L"<"
<<
textNode
;
if
(
!
Context
.
get_delete_text_state
())
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L" xml:space=
\"
preserve
\"
"
;
strm
<<
L">"
;
text_to_stream
(
strm
);
strm
<<
L"</"
<<
textNode
<<
L">"
;
...
...
ASCOfficeOdfFile/src/odf/style_paragraph_properties_docx.cpp
View file @
42d1b8df
...
...
@@ -473,15 +473,12 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context)
{
std
::
wstring
leader
;
if
(
style_leader_type_
&&
style_leader_type_
->
get_type
()
==
line_type
::
Non
||
style_leader_style_
&&
style_leader_style_
->
get_type
()
==
line_style
::
None
)
if
(
(
style_leader_type_
&&
style_leader_type_
->
get_type
()
==
line_type
::
None
)
||
(
style_leader_style_
&&
style_leader_style_
->
get_type
()
==
line_style
::
None
)
)
{
leader
=
L"none"
;
}
else
if
(
!
style_leader_type_
||
style_leader_type_
&&
style_leader_type_
->
get_type
()
!=
line_type
::
Non
)
else
if
(
!
style_leader_type_
||
style_leader_type_
&&
style_leader_type_
->
get_type
()
!=
line_type
::
None
)
{
if
(
style_leader_style_
)
{
...
...
ASCOfficeOdfFile/src/odf/style_text_properties.cpp
View file @
42d1b8df
...
...
@@ -344,28 +344,26 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
}
}
// underline
line_width
under
=
style_text_underline_width_
.
get_value_or
(
line_width
::
Auto
);
bool
underlineBold
=
under
.
get_type
()
==
line_width
::
Bold
||
under
.
get_type
()
==
line_width
::
Thick
;
line_width
under
=
style_text_underline_width_
.
get_value_or
(
line_width
::
Auto
);
bool
underlineBold
=
under
.
get_type
()
==
line_width
::
Bold
||
under
.
get_type
()
==
line_width
::
Thick
;
std
::
wstring
underline
=
L""
;
if
(
style_text_underline_type_
&&
style_text_underline_type_
->
get_type
()
==
line_type
::
Non
||
style_text_underline_style_
&&
style_text_underline_style_
->
get_type
()
==
line_style
::
None
)
if
((
style_text_underline_type_
&&
style_text_underline_type_
->
get_type
()
==
line_type
::
None
)
||
(
style_text_underline_style_
&&
style_text_underline_style_
->
get_type
()
==
line_style
::
None
))
{
underline
=
L"none"
;
}
else
if
(
style_text_underline_type_
&&
(
!
style_text_underline_style_
||
style_text_underline_style_
&&
style_text_underline_style_
->
get_type
()
==
line_style
::
Solid
)
)
{
if
(
underlineBold
)
underline
=
L"thick"
;
if
(
underlineBold
)
underline
=
L"thick"
;
switch
(
style_text_underline_type_
->
get_type
())
{
case
line_type
:
:
Single
:
underline
=
L"sng"
;
break
;
case
line_type
:
:
Double
:
underline
=
L"double"
;
break
;
case
line_type
:
:
Single
:
underline
=
L"sng"
;
break
;
case
line_type
:
:
Double
:
underline
=
L"double"
;
break
;
}
}
else
if
(
style_text_underline_style_
)
...
...
@@ -520,8 +518,6 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
{
_rPr
<<
L"<w:rStyle w:val=
\"
"
<<
*
r_style_
<<
L"
\"
/>"
;
}
// 17.3.2.1
{
const
int
W
=
process_font_weight
(
fo_font_weight_
);
if
(
W
)
...
...
@@ -543,14 +539,10 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
_rPr
<<
L"<w:bCs w:val=
\"
false
\"
/>"
;
}
}
// 17.3.2.5
if
(
fo_text_transform_
)
{
_rPr
<<
(
fo_text_transform_
->
get_type
()
==
text_transform
::
Uppercase
?
L"<w:caps w:val=
\"
true
\"
/>"
:
L"<w:caps w:val=
\"
false
\"
/>"
);
}
// 17.3.2.16
{
const
int
fontStyle
=
process_font_style
(
fo_font_style_
);
if
(
fontStyle
)
...
...
@@ -572,15 +564,10 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
_rPr
<<
L"<w:iCs w:val=
\"
false
\"
/>"
;
}
}
// 17.3.2.33
if
(
fo_font_variant_
)
{
_rPr
<<
(
fo_font_variant_
->
get_type
()
==
font_variant
::
SmallCaps
?
L"<w:smallCaps w:val=
\"
true
\"
/>"
:
L"<w:smallCaps w:val=
\"
true
\"
/>"
);
}
// 17.3.2.13
// 17.3.2.18
if
(
style_font_relief_
)
{
if
(
style_font_relief_
->
get_type
()
==
font_relief
::
Embossed
)
...
...
@@ -593,27 +580,20 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
_rPr
<<
L"<w:imprint w:val=
\"
false
\"
/>"
;
}
}
// 17.3.2.23
if
(
style_text_outline_
)
{
_rPr
<<
((
*
style_text_outline_
==
true
)
?
L"<w:outline w:val=
\"
true
\"
/>"
:
L"<w:outline w:val=
\"
false
\"
/>"
);
}
// 17.3.2.31
if
(
fo_text_shadow_
)
{
_rPr
<<
((
fo_text_shadow_
->
get_type
()
==
shadow_type
::
Enable
)
?
L"<w:shadow w:val=
\"
true
\"
/>"
:
L"<w:shadow w:val=
\"
false
\"
/>"
);
}
// 17.3.2.41
if
(
text_display_
)
{
if
(
text_display_
->
get_type
()
==
text_display
::
None
)
_rPr
<<
L"<w:vanish />"
;
}
// 17.3.2.40
// underline
{
line_width
under
=
style_text_underline_width_
.
get_value_or
(
line_width
::
Auto
);
...
...
@@ -621,9 +601,8 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
under
.
get_type
()
==
line_width
::
Thick
;
std
::
wstring
underline
=
L""
;
if
(
style_text_underline_type_
&&
style_text_underline_type_
->
get_type
()
==
line_type
::
Non
||
style_text_underline_style_
&&
style_text_underline_style_
->
get_type
()
==
line_style
::
None
)
if
((
style_text_underline_type_
&&
style_text_underline_type_
->
get_type
()
==
line_type
::
None
)
||
(
style_text_underline_style_
&&
style_text_underline_style_
->
get_type
()
==
line_style
::
None
))
{
// подчеркивание выключено
underline
=
L"none"
;
...
...
@@ -709,13 +688,9 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
_rPr
<<
L"/>"
;
}
}
// 17.3.2.9
// 17.3.2.37
{
if
(
style_text_line_through_type_
&&
style_text_line_through_type_
->
get_type
()
==
line_type
::
Non
||
style_text_line_through_style_
&&
style_text_line_through_style_
->
get_type
()
==
line_style
::
None
)
if
((
style_text_line_through_type_
&&
style_text_line_through_type_
->
get_type
()
==
line_type
::
None
)
||
(
style_text_line_through_style_
&&
style_text_line_through_style_
->
get_type
()
==
line_style
::
None
))
{
_rPr
<<
L"<w:dstrike w:val=
\"
false
\"
/>"
;
_rPr
<<
L"<w:strike w:val=
\"
false
\"
/>"
;
...
...
@@ -1116,9 +1091,8 @@ void text_format_properties_content::oox_convert (std::wostream & _rPr, bool gra
under
.
get_type
()
==
line_width
::
Thick
;
std
::
wstring
underline
=
L""
;
if
(
style_text_underline_type_
&&
style_text_underline_type_
->
get_type
()
==
line_type
::
Non
||
style_text_underline_style_
&&
style_text_underline_style_
->
get_type
()
==
line_style
::
None
)
if
((
style_text_underline_type_
&&
style_text_underline_type_
->
get_type
()
==
line_type
::
None
)
||
(
style_text_underline_style_
&&
style_text_underline_style_
->
get_type
()
==
line_style
::
None
))
{
// подчеркивание выключено
underline
=
L"none"
;
...
...
@@ -1204,9 +1178,8 @@ void text_format_properties_content::oox_convert (std::wostream & _rPr, bool gra
_rPr
<<
L"/>"
;
}
}
if
(
style_text_line_through_type_
&&
style_text_line_through_type_
->
get_type
()
==
line_type
::
Non
||
style_text_line_through_style_
&&
style_text_line_through_style_
->
get_type
()
==
line_style
::
None
)
if
((
style_text_line_through_type_
&&
style_text_line_through_type_
->
get_type
()
==
line_type
::
None
)
||
(
style_text_line_through_style_
&&
style_text_line_through_style_
->
get_type
()
==
line_style
::
None
))
{
_rPr
<<
L"<w:dstrike w:val=
\"
false
\"
/>"
;
_rPr
<<
L"<w:strike w:val=
\"
false
\"
/>"
;
...
...
ASCOfficeOdfFile/src/odf/style_text_properties.h
View file @
42d1b8df
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFile/src/odf/styles_list.cpp
View file @
42d1b8df
...
...
@@ -441,14 +441,16 @@ void text_list_level_style_number::docx_convert(oox::docx_conversion_context & C
CP_XML_ATTR
(
L"w:hanging"
,((
int
)(
hanging
+
0.5
)));
}
}
}
}
}
if
(
style_text_properties
*
textProperties
=
dynamic_cast
<
style_text_properties
*>
(
style_text_properties_
.
get
()))
{
Context
.
get_styles_context
().
start
();
textProperties
->
content
().
docx_convert
(
Context
);
//to style_context
Context
.
get_styles_context
().
docx_serialize_text_style
(
CP_XML_STREAM
(),
_T
(
""
));
//serialize style_context
//to style_context
textProperties
->
content
().
docx_convert
(
Context
);
//serialize style_context
Context
.
get_styles_context
().
docx_serialize_text_style
(
CP_XML_STREAM
(),
L""
,
Context
.
get_text_tracked_context
().
dumpRPr_
);
}
}
}
...
...
@@ -640,7 +642,7 @@ void text_list_level_style_bullet::docx_convert(oox::docx_conversion_context & C
{
Context
.
get_styles_context
().
start
();
textProperties
->
content
().
docx_convert
(
Context
);
Context
.
get_styles_context
().
docx_serialize_text_style
(
CP_XML_STREAM
(),
_T
(
""
)
);
Context
.
get_styles_context
().
docx_serialize_text_style
(
CP_XML_STREAM
(),
L""
,
Context
.
get_text_tracked_context
().
dumpRPr_
);
}
}
}
...
...
@@ -778,7 +780,7 @@ void text_list_level_style_image::docx_convert(oox::docx_conversion_context & Co
{
Context
.
get_styles_context
().
start
();
textProperties
->
content
().
docx_convert
(
Context
);
Context
.
get_styles_context
().
docx_serialize_text_style
(
CP_XML_STREAM
(),
_T
(
""
)
);
Context
.
get_styles_context
().
docx_serialize_text_style
(
CP_XML_STREAM
(),
L""
,
Context
.
get_text_tracked_context
().
dumpRPr_
);
}
}
}
...
...
ASCOfficeOdfFile/src/odf/text_elements.cpp
View file @
42d1b8df
...
...
@@ -133,13 +133,14 @@ void process_paragraph_drop_cap_attr(const paragraph_attrs & Attr, oox::docx_con
}
return
;
}
typedef
std
::
map
<
std
::
wstring
,
oox
::
text_tracked_context
::
_state
>::
iterator
map_changes_iterator
;
int
process_paragraph_attr
(
const
paragraph_attrs
&
Attr
,
oox
::
docx_conversion_context
&
Context
)
{
if
(
!
Attr
.
text_style_name_
.
empty
())
{
if
(
style_instance
*
styleInst
=
Context
.
root
()
->
odf_context
().
styleContainer
().
style_by_name
(
Attr
.
text_style_name_
.
style_name
(),
style_family
::
Paragraph
,
Context
.
process_headers_footers_
)
Context
.
root
()
->
odf_context
().
styleContainer
().
style_by_name
(
Attr
.
text_style_name_
.
style_name
(),
style_family
::
Paragraph
,
Context
.
process_headers_footers_
)
)
{
process_page_break_after
(
styleInst
,
Context
);
...
...
@@ -186,7 +187,7 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co
{
const
std
::
wstring
id
=
Context
.
styles_map_
.
get
(
styleInst
->
name
(),
styleInst
->
type
()
);
Context
.
output_stream
()
<<
L"<w:pPr>"
;
//todooo причесать
//todooo причесать
if
(
Context
.
is_paragraph_header
()
&&
!
Context
.
get_section_context
().
dump_
.
empty
())
{
Context
.
output_stream
()
<<
Context
.
get_section_context
().
dump_
;
...
...
@@ -204,6 +205,13 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co
}
Context
.
output_stream
()
<<
L"<w:pStyle w:val=
\"
"
<<
id
<<
L"
\"
/>"
;
if
(
!
Context
.
output_stream
()
<<
Context
.
get_text_tracked_context
().
dumpPPr_
.
empty
())
{
Context
.
output_stream
()
<<
Context
.
get_text_tracked_context
().
dumpPPr_
;
Context
.
get_text_tracked_context
().
dumpPPr_
.
clear
();
}
Context
.
docx_serialize_list_properties
(
Context
.
output_stream
());
if
((
Attr
.
outline_level_
)
&&
(
*
Attr
.
outline_level_
>
0
))
...
...
@@ -1082,10 +1090,18 @@ void text_deletion::docx_convert(oox::docx_conversion_context & Context)
const
wchar_t
*
text_format_change
::
ns
=
L"text"
;
const
wchar_t
*
text_format_change
::
name
=
L"format-change"
;
void
text_format_change
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
{
CP_APPLY_ATTR
(
L"text:style-name"
,
text_style_name_
);
}
void
text_format_change
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
Context
.
get_text_tracked_context
().
set_type
(
3
);
if
(
text_style_name_
)
Context
.
get_text_tracked_context
().
set_style_name
(
*
text_style_name_
);
text_unknown_base_change
::
docx_convert
(
Context
);
}
//----------------------------------------------------------------------------------------------------------
...
...
ASCOfficeOdfFile/src/odf/text_elements.h
View file @
42d1b8df
...
...
@@ -501,7 +501,10 @@ public:
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
static
const
ElementType
type
=
typeTextFormatChange
;
virtual
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
virtual
void
docx_convert
(
oox
::
docx_conversion_context
&
Context
);
_CP_OPT
(
std
::
wstring
)
text_style_name_
;
//не по снецификации ... но КАК сохранить то что было изменено в формате?????
};
CP_REGISTER_OFFICE_ELEMENT2
(
text_format_change
);
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_conversion_context.cpp
View file @
42d1b8df
...
...
@@ -319,7 +319,7 @@ void odf_conversion_context::add_tab(_CP_OPT(int) type, _CP_OPT(length) _length,
case
3
:
tab
->
style_leader_type_
=
line_type
::
Single
;
tab
->
style_leader_style_
=
line_style
::
LongDash
;
break
;
// tabtlcMiddleDot = 3,
case
4
:
tab
->
style_leader_type_
=
line_type
::
Non
;
case
4
:
tab
->
style_leader_type_
=
line_type
::
Non
e
;
break
;
// tabtlcNone = 4,
case
5
:
tab
->
style_leader_type_
=
line_type
::
Single
;
tab
->
style_leader_style_
=
line_style
::
Solid
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
View file @
42d1b8df
...
...
@@ -90,7 +90,6 @@ odt_conversion_context::odt_conversion_context(package::odf_document * outputDoc
is_paragraph_in_current_section_
=
false
;
text_changes_state_
.
main_text_context
=
NULL
;
//header, footer, drawing, main, ..
text_changes_state_
.
level
=
0
;
drop_cap_state_
.
clear
();
}
...
...
@@ -288,9 +287,6 @@ void odt_conversion_context::start_paragraph(bool styled)
}
void
odt_conversion_context
::
add_paragraph_break
(
int
type
)
{
//office_element_ptr elm;
//create_element(L"text", L"soft-page-break", elm, this);
if
(
current_root_elements_
.
size
()
>
0
)
{
//text_p* para = NULL;
...
...
@@ -798,14 +794,16 @@ void odt_conversion_context::end_note()
text_context
()
->
current_level_
.
pop_back
();
}
//--------------------------------------------------------------------------------------------------------
void
odt_conversion_context
::
start_change
(
int
id
,
int
type
,
std
::
wstring
&
author
,
std
::
wstring
&
userId
,
std
::
wstring
&
date
)
void
odt_conversion_context
::
start_change
(
int
id
,
int
type
,
std
::
wstring
&
author
,
std
::
wstring
&
userId
,
std
::
wstring
&
date
,
std
::
wstring
style_name
)
{
if
(
!
text_changes_state_
.
main_text_context
)
{
text_changes_state_
.
main_text_context
=
text_context
();
}
text_changes_state_
.
level
++
;
if
(
!
text_changes_state_
.
main_text_context
)
return
;
if
(
id
<
0
)
return
;
//if (!text_changes_state_.main_text_context)
//{
// text_changes_state_.main_text_context = text_context();
//}
//if (!text_changes_state_.main_text_context) return;
text_changes_state_
.
current_types
.
push_back
(
type
);
std
::
wstring
strId
=
L"ct"
+
std
::
to_wstring
(
id
);
//---------------------------------------------------------------------------------
...
...
@@ -818,8 +816,12 @@ void odt_conversion_context::start_change (int id, int type, std::wstring &autho
text_add_change
*
change
=
dynamic_cast
<
text_add_change
*>
(
start_elm
.
get
());
if
(
change
)
change
->
text_change_id_
=
strId
;
text_changes_state_
.
main_text_context
->
start_element
(
start_elm
);
text_changes_state_
.
main_text_context
->
end_element
();
text_context
()
->
start_element
(
start_elm
);
add_to_root
();
//добавление/удаление параграфов и т д
text_context
()
->
end_element
();
//text_changes_state_.main_text_context->start_element(start_elm);
//text_changes_state_.main_text_context->end_element();
//---------------------------------------------------------------------------------
office_element_ptr
region_elm
;
create_element
(
L"text"
,
L"changed-region"
,
region_elm
,
this
);
...
...
@@ -843,18 +845,16 @@ void odt_conversion_context::start_change (int id, int type, std::wstring &autho
info_elm
->
add_child_element
(
creator_elm
);
dc_creator
*
creator
=
dynamic_cast
<
dc_creator
*>
(
creator_elm
.
get
());
if
(
!
creator
)
return
;
creator
->
content_
=
author
;
if
(
creator
)
creator
->
content_
=
author
;
office_element_ptr
date_elm
;
create_element
(
L"dc"
,
L"date"
,
date_elm
,
this
);
info_elm
->
add_child_element
(
date_elm
);
dc_date
*
date_
=
dynamic_cast
<
dc_date
*>
(
date_elm
.
get
());
if
(
!
date_
)
return
;
date_
->
content_
=
date
;
if
(
date_
)
date_
->
content_
=
date
;
}
if
(
is_header_
||
is_footer_
)
page_layout_context
()
->
root_header_footer_
->
add_child_element
(
region_elm
);
...
...
@@ -862,20 +862,31 @@ void odt_conversion_context::start_change (int id, int type, std::wstring &autho
region_elm
->
add_child_element
(
child_elm
);
if
(
type
==
3
&&
!
style_name
.
empty
())
{
//не по спецификации !!!
text_format_change
*
format_change
=
dynamic_cast
<
text_format_change
*>
(
child_elm
.
get
());
if
(
format_change
)
format_change
->
text_style_name_
=
style_name
;
}
if
(
type
==
2
)
//delete
{
start_text_context
();
text_context
()
->
start_element
(
child_elm
);
text_context
()
->
start_paragraph
();
//ваще то не по стандарту .. может мы уже в параграфе (ради Libra! ... гы)
}
}
void
odt_conversion_context
::
end_change
(
int
id
,
int
type
)
{
if
(
!
text_changes_state_
.
main_text_context
)
return
;
//
if (!text_changes_state_.main_text_context) return;
std
::
wstring
strId
=
L"ct"
+
std
::
to_wstring
(
id
);
if
(
type
==
2
)
//delete
{
text_context
()
->
end_paragraph
();
text_context
()
->
end_element
();
end_text_context
();
}
...
...
@@ -887,13 +898,17 @@ void odt_conversion_context::end_change (int id, int type)
text_add_change
*
change
=
dynamic_cast
<
text_add_change
*>
(
end_elm
.
get
());
if
(
change
)
change
->
text_change_id_
=
strId
;
text_changes_state_
.
main_text_context
->
start_element
(
end_elm
);
text_changes_state_
.
main_text_context
->
end_element
();
text_context
()
->
start_element
(
end_elm
);
add_to_root
();
text_context
()
->
end_element
();
}
text_changes_state_
.
level
--
;
text_changes_state_
.
current_types
.
pop_back
();
}
bool
odt_conversion_context
::
is_delete_changes
()
{
if
(
text_changes_state_
.
current_types
.
empty
())
return
false
;
if
(
text_changes_state_
.
level
<
1
)
text_changes_state_
.
main_text_context
=
NULL
;
return
(
text_changes_state_
.
current_types
.
back
()
==
2
);
}
//--------------------------------------------------------------------------------------------------------
void
odt_conversion_context
::
start_image
(
const
std
::
wstring
&
image_file_name
)
...
...
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
View file @
42d1b8df
...
...
@@ -123,8 +123,9 @@ public:
void
end_note_content
();
void
end_note
();
void
start_change
(
int
id
,
int
type
,
std
::
wstring
&
author
,
std
::
wstring
&
userId
,
std
::
wstring
&
date
);
void
start_change
(
int
id
,
int
type
,
std
::
wstring
&
author
,
std
::
wstring
&
userId
,
std
::
wstring
&
date
,
std
::
wstring
style_name
=
L""
);
void
end_change
(
int
id
,
int
type
);
bool
is_delete_changes
();
void
start_table
(
bool
styled
=
false
);
void
start_table_columns
();
...
...
@@ -191,7 +192,7 @@ private:
struct
_text_changes_state
{
odf_text_context
*
main_text_context
;
int
level
;
std
::
vector
<
int
>
current_types
;
}
text_changes_state_
;
bool
is_hyperlink_
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/text_elements.cpp
View file @
42d1b8df
...
...
@@ -484,6 +484,8 @@ void text_format_change::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
CP_XML_ATTR_OPT
(
L"text:style-name"
,
text_style_name_
);
if
(
office_change_info_
)
office_change_info_
->
serialize
(
CP_XML_STREAM
());
...
...
ASCOfficeOdfFileW/source/OdfFormat/text_elements.h
View file @
42d1b8df
...
...
@@ -380,6 +380,9 @@ public:
static
const
ElementType
type
=
typeTextFormatChange
;
virtual
void
serialize
(
std
::
wostream
&
_Wostream
);
_CP_OPT
(
std
::
wstring
)
text_style_name_
;
//не по снецификации ... но КАК сохранить то что было изменено в формате?????
};
CP_REGISTER_OFFICE_ELEMENT2
(
text_format_change
);
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
View file @
42d1b8df
...
...
@@ -1270,7 +1270,7 @@ void OoxConverter::convert(OOX::Drawing::CRunProperty * oox_run_pr, odf_writer::
switch
(
type
)
{
case
SimpleTypes
:
:
underlineNone
:
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Non
);
break
;
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Non
e
);
break
;
case
SimpleTypes
:
:
underlineDash
:
case
SimpleTypes
:
:
underlineDashedHeavy
:
text_properties
->
content
().
style_text_underline_style_
=
odf_types
::
line_style
(
odf_types
::
line_style
::
Dash
);
break
;
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
42d1b8df
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
View file @
42d1b8df
...
...
@@ -114,6 +114,7 @@ namespace ComplexTypes
class
CFramePr
;
class
CTblWidth
;
class
CPageBorder
;
class
CTrackChange
;
}
}
namespace
cpdoccore
...
...
@@ -198,6 +199,7 @@ namespace Oox2Odf
void
convert
(
OOX
::
Logic
::
CSmartTag
*
oox_tag
);
void
convert
(
OOX
::
Logic
::
CPTab
*
oox_ptab
);
int
convert
(
ComplexTypes
::
Word
::
CTrackChange
*
oox_change
,
int
type
);
void
convert
(
OOX
::
Logic
::
CIns
*
oox_ins
);
void
convert
(
OOX
::
Logic
::
CDel
*
oox_del
);
int
convert
(
OOX
::
Logic
::
CPPrChange
*
oox_para_prop_change
);
...
...
@@ -206,7 +208,6 @@ namespace Oox2Odf
int
convert
(
OOX
::
Logic
::
CTrPrChange
*
oox_tr_prop_change
);
int
convert
(
OOX
::
Logic
::
CTcPrChange
*
oox_tc_prop_change
);
int
convert
(
OOX
::
Logic
::
CTblPrChange
*
oox_table_prop_change
);
void
convert
(
OOX
::
Logic
::
CAlternateContent
*
oox_alt_content
);
void
convert
(
OOX
::
Logic
::
CDrawing
*
oox_drawing
);
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
View file @
42d1b8df
...
...
@@ -615,7 +615,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRPr *oox_run_pr)
}
convert
(
oox_run_pr
->
m_oColor
.
GetPointer
(),
text_properties
->
content
().
fo_color_
);
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Non
);
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Non
e
);
if
(
oox_run_pr
->
m_oUnderline
.
IsInit
())
{
text_properties
->
content
().
style_text_underline_style_
=
odf_types
::
line_style
(
odf_types
::
line_style
::
Solid
);
...
...
@@ -631,7 +631,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRPr *oox_run_pr)
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Double
);
break
;
case
SimpleTypes
:
:
Spreadsheet
::
underlineNone
:
text_properties
->
content
().
style_text_underline_style_
=
boost
::
none
;
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Non
);
break
;
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Non
e
);
break
;
case
SimpleTypes
:
:
Spreadsheet
::
underlineSingle
:
case
SimpleTypes
:
:
Spreadsheet
::
underlineSingleAccounting
:
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Single
);
break
;
...
...
@@ -1172,7 +1172,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFont * font, odf_writer::style_te
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Double
);
break
;
case
SimpleTypes
:
:
Spreadsheet
::
underlineNone
:
text_properties
->
content
().
style_text_underline_style_
=
boost
::
none
;
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Non
);
break
;
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Non
e
);
break
;
case
SimpleTypes
:
:
Spreadsheet
::
underlineSingle
:
case
SimpleTypes
:
:
Spreadsheet
::
underlineSingleAccounting
:
text_properties
->
content
().
style_text_underline_type_
=
odf_types
::
line_type
(
odf_types
::
line_type
::
Single
);
break
;
...
...
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