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
598bb419
Commit
598bb419
authored
Apr 23, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - presentation - fields
parent
087da9d2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
10 deletions
+91
-10
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
+23
-1
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.h
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.h
+4
-2
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
+39
-0
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
+21
-7
ASCOfficePPTXFile/PPTXFormat/Logic/Ph.h
ASCOfficePPTXFile/PPTXFormat/Logic/Ph.h
+4
-0
No files found.
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
View file @
598bb419
...
...
@@ -154,13 +154,35 @@ void odf_text_context::add_text_content(const std::wstring & text)
std
::
wstring
last
=
text
.
substr
(
pos
);
if
(
last
.
length
()
>
0
)
current_level_
.
back
().
elm
->
add_text
(
last
);
}
void
odf_text_context
::
add_text_date
(
const
std
::
wstring
&
text
)
{
office_element_ptr
s_elm
;
create_element
(
L"text"
,
L"date"
,
s_elm
,
odf_context_
);
text_date
*
s
=
dynamic_cast
<
text_date
*>
(
s_elm
.
get
());
if
(
s
)
s
->
add_text
(
text
);
if
(
current_level_
.
size
()
>
0
)
current_level_
.
back
().
elm
->
add_child_element
(
s_elm
);
}
void
odf_text_context
::
add_text_page_number
(
const
std
::
wstring
&
text
)
{
office_element_ptr
s_elm
;
create_element
(
L"text"
,
L"page-number"
,
s_elm
,
odf_context_
);
text_page_number
*
s
=
dynamic_cast
<
text_page_number
*>
(
s_elm
.
get
());
if
(
s
)
s
->
add_text
(
text
);
if
(
current_level_
.
size
()
>
0
)
current_level_
.
back
().
elm
->
add_child_element
(
s_elm
);
}
void
odf_text_context
::
add_text_space
(
int
count
)
{
office_element_ptr
s_elm
;
create_element
(
L"text"
,
L"s"
,
s_elm
,
odf_context_
);
text_s
*
s
=
dynamic_cast
<
text_s
*>
(
s_elm
.
get
());
if
(
s
)
s
->
text_c_
=
count
;
if
(
s
)
s
->
text_c_
=
count
;
//необязательно хранить..
//int level = current_level_.size();
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.h
View file @
598bb419
...
...
@@ -67,6 +67,8 @@ public:
void
add_text_content
(
const
std
::
wstring
&
text
);
void
add_text_space
(
int
count
);
void
add_text_date
(
const
std
::
wstring
&
text
);
void
add_text_page_number
(
const
std
::
wstring
&
text
);
void
set_symbol_font
(
const
std
::
wstring
&
font
);
void
set_symbol_text
(
int
sym
);
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
View file @
598bb419
...
...
@@ -1727,6 +1727,45 @@ void OoxConverter::convert(PPTX::Logic::Run *oox_run)
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Fld
*
oox_fld
)
{
if
(
!
oox_fld
)
return
;
bool
styled
=
false
;
if
(
oox_fld
->
rPr
.
IsInit
())
{
odf_writer
::
style_text_properties
*
text_properties
=
odf_context
()
->
text_context
()
->
get_text_properties
();
if
(
!
text_properties
)
{
odf_context
()
->
styles_context
()
->
create_style
(
L""
,
odf_types
::
style_family
::
Text
,
true
,
false
,
-
1
);
text_properties
=
odf_context
()
->
styles_context
()
->
last_state
()
->
get_text_properties
();
styled
=
true
;
}
convert
(
oox_fld
->
rPr
.
GetPointer
(),
text_properties
);
}
odf_context
()
->
text_context
()
->
start_span
(
styled
);
std
::
wstring
fld_type
=
oox_fld
->
type
.
get_value_or
(
L""
);
if
((
oox_fld
->
rPr
.
IsInit
())
&&
(
oox_fld
->
rPr
->
hlinkClick
.
IsInit
())
&&
(
oox_fld
->
rPr
->
hlinkClick
->
id
.
IsInit
()))
{
std
::
wstring
hlink
=
find_link_by_id
(
oox_fld
->
rPr
->
hlinkClick
->
id
.
get
(),
2
);
odf_context
()
->
text_context
()
->
add_hyperlink
(
hlink
,
oox_fld
->
GetText
());
}
else
if
(
fld_type
==
L"slidenum"
)
{
odf_context
()
->
text_context
()
->
add_text_page_number
(
oox_fld
->
GetText
());
}
else
if
(
fld_type
==
L"datetime1"
)
{
odf_context
()
->
text_context
()
->
add_text_date
(
oox_fld
->
GetText
());
}
else
{
odf_context
()
->
text_context
()
->
add_text_content
(
oox_fld
->
GetText
());
}
odf_context
()
->
text_context
()
->
end_span
();
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Br
*
oox_br
)
{
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
View file @
598bb419
...
...
@@ -319,12 +319,15 @@ void PptxConverter::convert_slides()
if
(
pFind
==
m_mapMasters
.
end
())
{
master_style_name
=
L"MasterPage"
;
if
(
bShowMasterSp
)
{
bool
bShowLayoutMasterAnim
=
slide
->
Layout
->
showMasterPhAnim
.
get_value_or
(
true
);
bool
bShowLayoutMasterSp
=
slide
->
Layout
->
showMasterSp
.
get_value_or
(
true
);
if
(
slide
->
Master
->
cSld
.
attrName
.
IsInit
())
master_style_name
=
slide
->
Master
->
cSld
.
attrName
.
get
();
else
if
(
current_theme
->
name
.
IsInit
())
master_style_name
=
current_theme
->
name
.
get
();
}
master_style_name
+=
L"_"
;
if
(
slide
->
Layout
->
cSld
.
attrName
.
IsInit
())
master_style_name
+=
slide
->
Layout
->
cSld
.
attrName
.
get
();
else
if
(
slide
->
Layout
->
attrType
.
IsInit
())
master_style_name
+=
slide
->
Layout
->
attrType
->
get
();
else
...
...
@@ -334,7 +337,8 @@ void PptxConverter::convert_slides()
convert_common
();
current_slide
=
slide
->
Master
.
operator
->
();
if
(
bShowMasterSp
)
if
(
bShowLayoutMasterSp
&&
bShowMasterSp
)
convert_slide
(
&
slide
->
Master
->
cSld
,
current_txStyles
,
false
);
else
convert
(
slide
->
Master
->
cSld
.
bg
.
GetPointer
());
...
...
@@ -342,6 +346,7 @@ void PptxConverter::convert_slides()
if
(
slide
->
Layout
->
clrMapOvr
.
IsInit
()
&&
slide
->
Layout
->
clrMapOvr
->
overrideClrMapping
.
IsInit
())
current_clrMap
=
slide
->
Layout
->
clrMapOvr
->
overrideClrMapping
.
GetPointer
();
current_slide
=
slide
->
Layout
.
operator
->
();
convert_slide
(
&
slide
->
Layout
->
cSld
,
current_txStyles
,
true
);
//add note master
odp_context
->
end_master_slide
();
...
...
@@ -950,6 +955,8 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
convert
(
oox_slide
->
bg
.
GetPointer
());
bool
bMaster
=
*
odf_context
()
->
drawing_context
()
->
get_presentation
();
for
(
size_t
i
=
0
;
i
<
oox_slide
->
spTree
.
SpTreeElems
.
size
();
i
++
)
{
smart_ptr
<
PPTX
::
WrapperWritingElement
>
pElem
=
oox_slide
->
spTree
.
SpTreeElems
[
i
].
GetElem
();
...
...
@@ -962,7 +969,14 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
pShape
->
FillLevelUp
();
if
(
pShape
->
nvSpPr
.
nvPr
.
ph
->
type
.
IsInit
())
odf_context
()
->
drawing_context
()
->
set_placeholder_type
(
pShape
->
nvSpPr
.
nvPr
.
ph
->
type
->
GetBYTECode
());
{
int
ph_type
=
pShape
->
nvSpPr
.
nvPr
.
ph
->
type
->
GetBYTECode
();
if
(
!
bMaster
&&
(
ph_type
==
5
||
ph_type
==
6
||
ph_type
==
7
||
ph_type
==
12
))
continue
;
odf_context
()
->
drawing_context
()
->
set_placeholder_type
(
ph_type
);
}
else
odf_context
()
->
drawing_context
()
->
set_placeholder_type
(
0
);
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Ph.h
View file @
598bb419
...
...
@@ -63,6 +63,8 @@ namespace PPTX
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"sz"
),
sz
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"type"
),
type
)
WritingElement_ReadAttributes_End
(
oReader
)
if
(
idx
.
IsInit
()
&&
*
idx
==
L"4294967295"
)
idx
=
L"0"
;
//100818_건강보험과_보건의료_김용익_최종.pptx
}
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
{
...
...
@@ -71,6 +73,8 @@ namespace PPTX
node
.
ReadAttributeBase
(
L"orient"
,
orient
);
node
.
ReadAttributeBase
(
L"sz"
,
sz
);
node
.
ReadAttributeBase
(
L"type"
,
type
);
if
(
idx
.
IsInit
()
&&
*
idx
==
L"4294967295"
)
idx
=
L"0"
;
}
virtual
std
::
wstring
toXML
()
const
{
...
...
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