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
85226c08
Commit
85226c08
authored
May 17, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - presentation audio backgrounds
parent
fecefb67
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
15 deletions
+64
-15
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
+19
-2
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.cpp
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.cpp
+2
-2
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
+15
-1
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
+9
-6
ASCOfficePPTXFile/PPTXFormat/FileFactory.cpp
ASCOfficePPTXFile/PPTXFormat/FileFactory.cpp
+2
-0
Common/DocxFormat/Source/DocxFormat/FileTypes.h
Common/DocxFormat/Source/DocxFormat/FileTypes.h
+4
-0
Common/DocxFormat/Source/DocxFormat/Media/Audio.h
Common/DocxFormat/Source/DocxFormat/Media/Audio.h
+0
-2
Common/DocxFormat/Source/DocxFormat/Media/Media.h
Common/DocxFormat/Source/DocxFormat/Media/Media.h
+13
-2
No files found.
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
View file @
85226c08
...
...
@@ -2424,13 +2424,30 @@ void odf_drawing_context::start_action(std::wstring value)
{
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"previousslide"
))
event_
->
attlist_
.
presentation_action_
=
L"previous-page"
;
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"nextslide"
))
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"nextslide"
))
event_
->
attlist_
.
presentation_action_
=
L"next-page"
;
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"firstslide"
))
event_
->
attlist_
.
presentation_action_
=
L"first-page"
;
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"lastslide"
))
event_
->
attlist_
.
presentation_action_
=
L"last-page"
;
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"endshow"
))
event_
->
attlist_
.
presentation_action_
=
L"end"
;
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"endshow"
))
event_
->
attlist_
.
presentation_action_
=
L"end"
;
}
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"hlinksldjump"
))
{
event_
->
attlist_
.
presentation_action_
=
L"previous-page"
;
}
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"macro"
))
{
}
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"hlinkfile"
))
{
}
else
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"hlinkpres"
))
{
}
else
{
//hyperlink
event_
->
attlist_
.
presentation_action_
=
L"show"
;
...
...
@@ -2472,7 +2489,7 @@ void odf_drawing_context::add_sound(std::wstring href)
{
sound
->
common_xlink_attlist_
.
href_
=
href
;
sound
->
common_xlink_attlist_
.
type_
=
xlink_type
::
Simple
;
sound
->
common_xlink_attlist_
.
show_
=
xlink_show
::
New
;
sound
->
common_xlink_attlist_
.
show_
=
xlink_show
::
Embed
;
sound
->
common_xlink_attlist_
.
actuate_
=
xlink_actuate
::
OnRequest
;
}
end_element
();
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.cpp
View file @
85226c08
...
...
@@ -167,7 +167,7 @@ void odp_page_state::set_anim_type(std::wstring val)
anim_levels
.
back
().
attlist
->
presentation_node_type_
=
L"timing-root"
;
if
(
transactions
.
empty
()
==
false
)
{
std
::
wstring
slide_id
=
L"slide
_id"
+
std
::
to_wstring
(
page_id_
)
;
std
::
wstring
slide_id
=
L"slide
"
+
std
::
to_wstring
(
page_id_
)
+
L"id"
;
draw_page
*
page
=
dynamic_cast
<
draw_page
*>
(
page_elm_
.
get
());
if
(
page
)
...
...
@@ -284,7 +284,7 @@ void odp_page_state::set_transition_sound(std::wstring ref, bool loop)
{
sound
->
common_xlink_attlist_
.
href_
=
ref
;
sound
->
common_xlink_attlist_
.
type_
=
xlink_type
::
Simple
;
sound
->
common_xlink_attlist_
.
show_
=
xlink_show
::
New
;
sound
->
common_xlink_attlist_
.
show_
=
xlink_show
::
Embed
;
sound
->
common_xlink_attlist_
.
actuate_
=
xlink_actuate
::
OnRequest
;
}
}
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
View file @
85226c08
...
...
@@ -211,8 +211,22 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture)
std
::
wstring
sID
=
media
.
link
.
get
();
std
::
wstring
pathMedia
=
find_link_by_id
(
sID
,
3
);
double
start
=
-
1
,
end
=
-
1
;
for
(
size_t
i
=
0
;
i
<
oox_picture
->
nvPicPr
.
nvPr
.
extLst
.
size
();
i
++
)
{
PPTX
::
Logic
::
Ext
&
ext
=
oox_picture
->
nvPicPr
.
nvPr
.
extLst
[
i
];
if
(
pathMedia
.
empty
()
&&
ext
.
link
.
IsInit
())
{
pathMedia
=
find_link_by_id
(
ext
.
link
->
get
(),
3
);
//например файлики mp3
}
if
(
ext
.
st
.
IsInit
())
start
=
*
ext
.
st
;
if
(
ext
.
end
.
IsInit
())
end
=
*
ext
.
end
;
}
std
::
wstring
odf_ref
=
odf_context
()
->
add_media
(
pathMedia
);
std
::
wstring
odf_ref
=
odf_context
()
->
add_media
(
pathMedia
);
if
(
!
odf_ref
.
empty
())
{
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
View file @
85226c08
...
...
@@ -311,21 +311,24 @@ std::wstring OoxConverter::find_link_by (smart_ptr<OOX::File> & oFile, int type)
std
::
wstring
ref
;
if
(
type
==
1
&&
OOX
::
FileTypes
::
Image
==
oFile
->
type
())
{
OOX
::
Image
*
pImage
=
(
OOX
::
Image
*
)
oFile
.
operator
->
(
);
OOX
::
Image
*
pImage
=
dynamic_cast
<
OOX
::
Image
*>
(
oFile
.
operator
->
()
);
ref
=
pImage
->
filename
().
GetPath
();
if
(
pImage
)
ref
=
pImage
->
filename
().
GetPath
();
}
if
(
type
==
2
&&
OOX
::
FileTypes
::
HyperLink
==
oFile
->
type
())
{
OOX
::
HyperLink
*
pHyperlink
=
(
OOX
::
HyperLink
*
)
oFile
.
operator
->
();
if
(
pHyperlink
->
bHyperlink
)
OOX
::
HyperLink
*
pHyperlink
=
dynamic_cast
<
OOX
::
HyperLink
*>
(
oFile
.
operator
->
());
if
(
pHyperlink
&&
pHyperlink
->
bHyperlink
)
ref
=
pHyperlink
->
Uri
().
GetPath
();
}
if
(
type
==
3
)
{
OOX
::
Media
*
pMedia
=
(
OOX
::
Media
*
)
oFile
.
operator
->
(
);
OOX
::
Media
*
pMedia
=
dynamic_cast
<
OOX
::
Media
*>
(
oFile
.
operator
->
()
);
ref
=
pMedia
->
filename
().
GetPath
();
if
(
pMedia
)
ref
=
pMedia
->
filename
().
GetPath
();
}
return
ref
;
}
...
...
ASCOfficePPTXFile/PPTXFormat/FileFactory.cpp
View file @
85226c08
...
...
@@ -129,6 +129,8 @@ namespace PPTX
return
smart_ptr
<
OOX
::
File
>
(
new
OOX
::
Image
(
filename
));
else
if
(
relation
.
Type
()
==
OOX
::
FileTypes
::
Audio
)
return
smart_ptr
<
OOX
::
File
>
(
new
OOX
::
Audio
(
filename
));
else
if
(
relation
.
Type
()
==
OOX
::
FileTypes
::
Media
)
return
smart_ptr
<
OOX
::
File
>
(
new
OOX
::
Media
(
filename
));
else
if
(
relation
.
Type
()
==
OOX
::
FileTypes
::
Video
)
return
smart_ptr
<
OOX
::
File
>
(
new
OOX
::
Video
(
filename
));
else
if
(
relation
.
Type
()
==
OOX
::
FileTypes
::
Data
)
...
...
Common/DocxFormat/Source/DocxFormat/FileTypes.h
View file @
85226c08
...
...
@@ -144,6 +144,10 @@ namespace OOX
_T
(
""
),
_T
(
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video"
));
const
FileType
Media
(
L"media"
,
L"media"
,
_T
(
""
),
_T
(
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/media"
));
const
FileType
Data
(
L"diagrams"
,
L"data.xml"
,
_T
(
"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml"
),
_T
(
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData"
));
...
...
Common/DocxFormat/Source/DocxFormat/Media/Audio.h
View file @
85226c08
...
...
@@ -50,8 +50,6 @@ namespace OOX
virtual
~
Audio
()
{
}
public:
virtual
const
FileType
type
()
const
{
return
FileTypes
::
Audio
;
...
...
Common/DocxFormat/Source/DocxFormat/Media/Media.h
View file @
85226c08
...
...
@@ -53,7 +53,10 @@ namespace OOX
virtual
~
Media
()
{
}
virtual
const
FileType
type
()
const
{
return
FileTypes
::
Media
;
}
virtual
void
read
(
const
CPath
&
filename
)
{
m_filename
=
filename
;
...
...
@@ -78,7 +81,15 @@ namespace OOX
void
copy_to
(
const
CPath
&
path
)
const
{
}
virtual
const
CPath
DefaultDirectory
()
const
{
if
(
m_bDocument
)
return
type
().
DefaultDirectory
();
else
return
L"../"
+
type
().
DefaultDirectory
();
}
virtual
const
CPath
DefaultFileName
()
const
{
return
m_filename
.
GetFilename
();
}
protected:
CPath
m_filename
;
bool
m_bDocument
;
//for upper/lower level rels (defaultDirectory)
...
...
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