mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 20:52:44 +01:00
commit
4ab3e063d5
@ -256,7 +256,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
bool newLine = false;
|
||||
int lineNumber = 0;
|
||||
float leftMargin = left;
|
||||
bool italicFromStart = false;
|
||||
int newLinePathPoint = -1;
|
||||
Color c = _subtitleColor;
|
||||
var colorStack = new Stack<Color>();
|
||||
@ -375,7 +374,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
else if (text.Substring(i).StartsWith("<i>", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
italicFromStart = i == 0;
|
||||
if (sb.Length > 0)
|
||||
{
|
||||
TextDraw.DrawText(font, sf, path, sb, isItalic, subtitleFontBold, false, left, top, ref newLine, leftMargin, ref newLinePathPoint);
|
||||
@ -409,8 +407,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
leftMargin = lefts[lineNumber];
|
||||
left = leftMargin;
|
||||
}
|
||||
if (isItalic)
|
||||
italicFromStart = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4820,59 +4820,55 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return;
|
||||
}
|
||||
int replaceCount = 0;
|
||||
bool searchStringFound = true;
|
||||
if (searchStringFound)
|
||||
var searchStringFound = false;
|
||||
int start = textBoxSource.SelectionStart;
|
||||
if (isFirst)
|
||||
{
|
||||
searchStringFound = false;
|
||||
int start = textBoxSource.SelectionStart;
|
||||
if (isFirst)
|
||||
{
|
||||
MakeHistoryForUndo(string.Format(_language.BeforeReplace, _findHelper.FindText));
|
||||
isFirst = false;
|
||||
_makeHistoryPaused = true;
|
||||
if (start >= 0)
|
||||
start--;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (textBoxSource.SelectionLength > 0 && start > 0 && !replaceDialog.FindOnly)
|
||||
start--;
|
||||
}
|
||||
MakeHistoryForUndo(string.Format(_language.BeforeReplace, _findHelper.FindText));
|
||||
isFirst = false;
|
||||
_makeHistoryPaused = true;
|
||||
if (start >= 0)
|
||||
start--;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (textBoxSource.SelectionLength > 0 && start > 0 && !replaceDialog.FindOnly)
|
||||
start--;
|
||||
}
|
||||
|
||||
if (_findHelper.FindNext(textBoxSource.Text, start))
|
||||
if (_findHelper.FindNext(textBoxSource.Text, start))
|
||||
{
|
||||
textBoxSource.SelectionStart = _findHelper.SelectedIndex;
|
||||
textBoxSource.SelectionLength = _findHelper.FindTextLength;
|
||||
if (!replaceDialog.FindOnly)
|
||||
textBoxSource.SelectedText = _findHelper.ReplaceText;
|
||||
textBoxSource.ScrollToCaret();
|
||||
|
||||
replaceCount++;
|
||||
searchStringFound = true;
|
||||
|
||||
if (!replaceDialog.FindOnly)
|
||||
{
|
||||
textBoxSource.SelectionStart = _findHelper.SelectedIndex;
|
||||
textBoxSource.SelectionLength = _findHelper.FindTextLength;
|
||||
if (!replaceDialog.FindOnly)
|
||||
textBoxSource.SelectedText = _findHelper.ReplaceText;
|
||||
textBoxSource.ScrollToCaret();
|
||||
|
||||
replaceCount++;
|
||||
searchStringFound = true;
|
||||
|
||||
if (!replaceDialog.FindOnly)
|
||||
if (_findHelper.FindNext(textBoxSource.Text, start))
|
||||
{
|
||||
if (_findHelper.FindNext(textBoxSource.Text, start))
|
||||
{
|
||||
textBoxSource.SelectionStart = _findHelper.SelectedIndex;
|
||||
textBoxSource.SelectionLength = _findHelper.FindTextLength;
|
||||
textBoxSource.ScrollToCaret();
|
||||
}
|
||||
Replace(replaceDialog);
|
||||
return;
|
||||
textBoxSource.SelectionStart = _findHelper.SelectedIndex;
|
||||
textBoxSource.SelectionLength = _findHelper.FindTextLength;
|
||||
textBoxSource.ScrollToCaret();
|
||||
}
|
||||
}
|
||||
if (replaceDialog.FindOnly)
|
||||
{
|
||||
if (searchStringFound)
|
||||
ShowStatus(string.Format(_language.MatchFoundX, _findHelper.FindText));
|
||||
else
|
||||
ShowStatus(string.Format(_language.NoMatchFoundX, _findHelper.FindText));
|
||||
|
||||
Replace(replaceDialog);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (replaceDialog.FindOnly)
|
||||
{
|
||||
if (searchStringFound)
|
||||
ShowStatus(string.Format(_language.MatchFoundX, _findHelper.FindText));
|
||||
else
|
||||
ShowStatus(string.Format(_language.NoMatchFoundX, _findHelper.FindText));
|
||||
|
||||
Replace(replaceDialog);
|
||||
return;
|
||||
}
|
||||
ReloadFromSourceView();
|
||||
if (replaceCount == 0)
|
||||
ShowStatus(_language.FoundNothingToReplace);
|
||||
|
Loading…
Reference in New Issue
Block a user