Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
78f5b9df
Commit
78f5b9df
authored
Nov 20, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix cut subtitle
parent
ca2c198e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/timelinecontroller.cpp
View file @
78f5b9df
...
...
@@ -1451,7 +1451,6 @@ void TimelineController::cutClipUnderCursor(int position, int track)
void
TimelineController
::
cutSubtitle
(
int
id
,
int
cursorPos
)
{
qDebug
()
<<
"== READY TO CUT AT: "
<<
cursorPos
;
Q_ASSERT
(
m_model
->
isSubTitle
(
id
));
if
(
cursorPos
<=
0
)
{
return
requestClipCut
(
id
,
-
1
);
...
...
@@ -1465,13 +1464,11 @@ void TimelineController::cutSubtitle(int id, int cursorPos)
if
(
position
>
start
&&
position
<
subData
.
end
())
{
QString
originalText
=
subData
.
subtitle
();
QString
firstText
=
originalText
;
QString
secondText
=
originalText
;
QString
secondText
=
originalText
.
right
(
originalText
.
length
()
-
cursorPos
)
;
firstText
.
truncate
(
cursorPos
);
secondText
.
remove
(
0
,
originalText
.
length
()
-
cursorPos
);
Fun
undo
=
[]()
{
return
true
;
};
Fun
redo
=
[]()
{
return
true
;
};
bool
res
=
subtitleModel
->
cutSubtitle
(
timelinePos
,
undo
,
redo
);
qDebug
()
<<
"== DO CUT SUCCESS: "
<<
res
;
if
(
res
)
{
Fun
local_redo
=
[
subtitleModel
,
start
,
position
,
firstText
,
secondText
]()
{
subtitleModel
->
editSubtitle
(
start
,
firstText
);
...
...
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