Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
f319d608
Commit
f319d608
authored
Sep 07, 2018
by
Clément Fauconnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed an issue where pages with a pdf object would not copy the pdf file on the new document
parent
1441c1f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
UBForeignObjectsHandler.cpp
src/core/UBForeignObjectsHandler.cpp
+18
-5
No files found.
src/core/UBForeignObjectsHandler.cpp
View file @
f319d608
...
...
@@ -526,6 +526,10 @@ private:
QString
reqExt
=
element
.
attribute
(
aReqExt
);
if
(
reqExt
==
vReqExt
)
{
//pdf reference
QString
ref
=
element
.
attribute
(
aHref
);
int
i
=
ref
.
indexOf
(
"#page"
);
QString
dest
=
ref
.
replace
(
i
,
ref
.
length
()
-
i
,
""
);
if
(
!
QFileInfo
::
exists
(
dest
))
cureNCopy
(
dest
,
false
);
if
(
ref
.
isEmpty
())
{
return
;
}
...
...
@@ -553,14 +557,23 @@ private:
}
}
QString
cureNCopy
(
const
QString
&
relativePath
)
QString
cureNCopy
(
const
QString
&
relativePath
,
bool
createNewUuid
=
true
)
{
QString
relative
=
relativePath
;
QUuid
newUuid
=
QUuid
::
createUuid
();
QString
newPath
=
relative
.
replace
(
QRegExp
(
"
\\
{.*
\\
}"
),
newUuid
.
toString
());
cp_rf
(
mFromDir
+
"/"
+
relativePath
,
mToDir
+
"/"
+
newPath
);
if
(
createNewUuid
)
{
QUuid
newUuid
=
QUuid
::
createUuid
();
QString
newPath
=
relative
.
replace
(
QRegExp
(
"
\\
{.*
\\
}"
),
newUuid
.
toString
());
return
newPath
;
cp_rf
(
mFromDir
+
"/"
+
relativePath
,
mToDir
+
"/"
+
newPath
);
return
newPath
;
}
else
{
cp_rf
(
mFromDir
+
"/"
+
relativePath
,
mToDir
+
"/"
+
relativePath
);
return
relativePath
;
}
}
private
:
...
...
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