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
ce19969b
Commit
ce19969b
authored
Jun 01, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PptxFormat - fix objects without replacement image
parent
e9805cef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
25 deletions
+39
-25
ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp
ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp
+35
-24
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
+4
-1
No files found.
ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp
View file @
ce19969b
...
...
@@ -346,8 +346,11 @@ namespace NSBinPptxRW
{
oPathOutput
=
m_strDstMedia
+
FILE_SEPARATOR_STR
+
strImage
+
strExts
;
if
(
oPathOutput
.
GetPath
()
!=
strInput
)
CDirectory
::
CopyFile
(
strInput
,
oPathOutput
.
GetPath
());
if
(
oPathOutput
.
GetPath
()
!=
strInput
&&
NSFile
::
CFileBinary
::
Exists
(
strInput
))
{
NSFile
::
CFileBinary
::
Copy
(
strInput
,
oPathOutput
.
GetPath
());
oImageManagerInfo
.
sFilepathImage
=
oPathOutput
.
GetPath
();
}
}
else
{
...
...
@@ -355,8 +358,8 @@ namespace NSBinPptxRW
strExts
=
_T
(
".png"
);
oPathOutput
=
m_strDstMedia
+
FILE_SEPARATOR_STR
+
strImage
+
strExts
;
SaveImageAsPng
(
strInput
,
oPathOutput
.
GetPath
());
}
oImageManagerInfo
.
sFilepathImage
=
oPathOutput
.
GetPath
();
}
if
((
!
strAdditionalImage
.
empty
()
||
!
oleData
.
empty
()
)
&&
(
nAdditionalType
==
1
))
{
...
...
@@ -374,13 +377,14 @@ namespace NSBinPptxRW
if
(
!
oleData
.
empty
())
{
WriteOleData
(
strAdditionalImageOut
,
oleData
);
oImageManagerInfo
.
sFilepathAdditional
=
strAdditionalImageOut
;
}
else
else
if
(
NSFile
::
CFileBinary
::
Exists
(
strAdditionalImage
))
{
CDirectory
::
CopyFile
(
strAdditionalImage
,
strAdditionalImageOut
);
NSFile
::
CFileBinary
::
Copy
(
strAdditionalImage
,
strAdditionalImageOut
);
oImageManagerInfo
.
sFilepathAdditional
=
strAdditionalImageOut
;
}
oImageManagerInfo
.
sFilepathAdditional
=
strAdditionalImageOut
;
}
else
if
(
!
strAdditionalImage
.
empty
()
&&
nAdditionalType
==
2
)
{
...
...
@@ -395,9 +399,12 @@ namespace NSBinPptxRW
std
::
wstring
strAdditionalImageOut
=
pathOutput
.
GetPath
();
CDirectory
::
CopyFile
(
strAdditionalImage
,
strAdditionalImageOut
);
if
(
NSFile
::
CFileBinary
::
Exists
(
strAdditionalImage
))
{
NSFile
::
CFileBinary
::
Copy
(
strAdditionalImage
,
strAdditionalImageOut
);
oImageManagerInfo
.
sFilepathAdditional
=
strAdditionalImageOut
;
}
}
return
oImageManagerInfo
;
}
...
...
@@ -1236,6 +1243,10 @@ namespace NSBinPptxRW
if
(
m_pManager
->
m_nDocumentType
==
XMLWRITER_DOC_TYPE_DOCX
)
strImageRelsPath
=
L"media/"
;
else
strImageRelsPath
=
L"../media/"
;
_relsGeneratorInfo
oRelsGeneratorInfo
;
if
(
!
oImageManagerInfo
.
sFilepathImage
.
empty
())
{
strImageRelsPath
+=
OOX
::
CPath
(
oImageManagerInfo
.
sFilepathImage
).
GetFilename
();
std
::
map
<
std
::
wstring
,
_relsGeneratorInfo
>::
iterator
pPair
=
m_mapImages
.
find
(
strImageRelsPath
);
...
...
@@ -1244,7 +1255,6 @@ namespace NSBinPptxRW
{
return
pPair
->
second
;
}
_relsGeneratorInfo
oRelsGeneratorInfo
;
oRelsGeneratorInfo
.
nImageRId
=
m_lNextRelsID
++
;
oRelsGeneratorInfo
.
sFilepathImage
=
oImageManagerInfo
.
sFilepathImage
;
...
...
@@ -1254,6 +1264,7 @@ namespace NSBinPptxRW
m_pWriter
->
WriteString
(
L"<Relationship Id=
\"
"
+
strRid
+
L"
\"
Type=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships/image
\"
Target=
\"
"
+
strImageRelsPath
+
L"
\"
/>"
);
}
if
(
additionalFile
.
is
<
OOX
::
OleObject
>
())
{
...
...
@@ -1285,7 +1296,7 @@ namespace NSBinPptxRW
}
}
}
if
(
additionalFile
.
is
<
OOX
::
Media
>
())
else
if
(
additionalFile
.
is
<
OOX
::
Media
>
())
{
smart_ptr
<
OOX
::
Media
>
mediaFile
=
additionalFile
.
smart_dynamic_cast
<
OOX
::
Media
>
();
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
View file @
ce19969b
...
...
@@ -447,7 +447,10 @@ namespace PPTX
if
(
!
blip
.
is_init
())
blip
=
new
PPTX
::
Logic
::
Blip
();
if
(
oRelsGeneratorInfo
.
nImageRId
>=
0
)
{
blip
->
embed
=
new
OOX
::
RId
((
size_t
)
oRelsGeneratorInfo
.
nImageRId
);
}
if
(
oRelsGeneratorInfo
.
nOleRId
>
0
)
{
...
...
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