mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
parent
9bf5dd71ae
commit
74bda2b8fe
@ -44,6 +44,8 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
public bool ChangeNamesToo => radioButtonFixOnlyNames.Checked || radioButtonNormal.Checked && checkBoxFixNames.Checked;
|
public bool ChangeNamesToo => radioButtonFixOnlyNames.Checked || radioButtonNormal.Checked && checkBoxFixNames.Checked;
|
||||||
|
|
||||||
|
public bool OnlyAllUpper => checkBoxOnlyAllUpper.Checked;
|
||||||
|
|
||||||
private void FixLargeFonts()
|
private void FixLargeFonts()
|
||||||
{
|
{
|
||||||
if (radioButtonNormal.Left + radioButtonNormal.Width + 40 > Width)
|
if (radioButtonNormal.Left + radioButtonNormal.Width + 40 > Width)
|
||||||
|
@ -12746,6 +12746,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
Cursor.Current = Cursors.WaitCursor;
|
Cursor.Current = Cursors.WaitCursor;
|
||||||
var selectedLines = new Subtitle();
|
var selectedLines = new Subtitle();
|
||||||
|
var selectedIndices = SubtitleListview1.SelectedIndices.Cast<int>().ToList();
|
||||||
selectedLines.WasLoadedWithFrameNumbers = _subtitle.WasLoadedWithFrameNumbers;
|
selectedLines.WasLoadedWithFrameNumbers = _subtitle.WasLoadedWithFrameNumbers;
|
||||||
if (onlySelectedLines)
|
if (onlySelectedLines)
|
||||||
{
|
{
|
||||||
@ -12764,6 +12765,27 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
bool saveChangeCaseChanges = true;
|
bool saveChangeCaseChanges = true;
|
||||||
var casingNamesLinesChanged = 0;
|
var casingNamesLinesChanged = 0;
|
||||||
|
|
||||||
|
if (changeCasing.ChangeNamesToo && changeCasing.OnlyAllUpper)
|
||||||
|
{
|
||||||
|
selectedIndices = new List<int>();
|
||||||
|
var allUpperSubtitle = new Subtitle();
|
||||||
|
var sub = onlySelectedLines ? selectedLines : _subtitle;
|
||||||
|
for (var index = 0; index < sub.Paragraphs.Count; index++)
|
||||||
|
{
|
||||||
|
var p = sub.Paragraphs[index];
|
||||||
|
var noTags = HtmlUtil.RemoveHtmlTags(p.Text, true);
|
||||||
|
if (noTags == noTags.ToUpperInvariant())
|
||||||
|
{
|
||||||
|
allUpperSubtitle.Paragraphs.Add(p);
|
||||||
|
selectedIndices.Add(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
selectedLines = allUpperSubtitle;
|
||||||
|
onlySelectedLines = true;
|
||||||
|
selectedLines.WasLoadedWithFrameNumbers = _subtitle.WasLoadedWithFrameNumbers;
|
||||||
|
}
|
||||||
|
|
||||||
changeCasing.FixCasing(selectedLines, LanguageAutoDetect.AutoDetectGoogleLanguage(_subtitle));
|
changeCasing.FixCasing(selectedLines, LanguageAutoDetect.AutoDetectGoogleLanguage(_subtitle));
|
||||||
if (changeCasing.ChangeNamesToo)
|
if (changeCasing.ChangeNamesToo)
|
||||||
{
|
{
|
||||||
@ -12800,7 +12822,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
if (onlySelectedLines)
|
if (onlySelectedLines)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (int index in SubtitleListview1.SelectedIndices)
|
foreach (int index in selectedIndices)
|
||||||
{
|
{
|
||||||
_subtitle.Paragraphs[index].Text = selectedLines.Paragraphs[i].Text;
|
_subtitle.Paragraphs[index].Text = selectedLines.Paragraphs[i].Text;
|
||||||
i++;
|
i++;
|
||||||
|
Loading…
Reference in New Issue
Block a user