From 4b25f1a4acabc7ae02d2e194ca123c8ea43d0976 Mon Sep 17 00:00:00 2001 From: niksedk Date: Fri, 8 Jun 2012 13:37:20 +0000 Subject: [PATCH] Fixed bug regarding inserting of lines + bug regarding drawing unfocused selected text in list view git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1242 99eadd0c-20b8-1223-b5c4-2a2b2df33de2 --- src/Controls/SubtitleListView.cs | 3 ++- src/Forms/Main.cs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Controls/SubtitleListView.cs b/src/Controls/SubtitleListView.cs index b9e463052..7e530fd07 100644 --- a/src/Controls/SubtitleListView.cs +++ b/src/Controls/SubtitleListView.cs @@ -158,7 +158,8 @@ namespace Nikse.SubtitleEdit.Controls } rect = new Rectangle(e.Bounds.Left + 4, e.Bounds.Top+2, e.Bounds.Width - 3, e.Bounds.Height); Font f = new System.Drawing.Font(SubtitleFontName, SubtitleFontSize, e.Item.Font.Style); - e.Graphics.DrawString(e.SubItem.Text, f, new SolidBrush(e.Item.ForeColor), rect, sf); + //e.Graphics.DrawString(e.SubItem.Text, f, new SolidBrush(e.Item.ForeColor), rect, sf); + TextRenderer.DrawText(e.Graphics, e.Item.SubItems[e.ColumnIndex].Text, f, new Point(e.Bounds.Left + 3, e.Bounds.Top + 2), e.Item.ForeColor, TextFormatFlags.Default); } else { diff --git a/src/Forms/Main.cs b/src/Forms/Main.cs index 63728ca7b..c4565bf8b 100644 --- a/src/Forms/Main.cs +++ b/src/Forms/Main.cs @@ -4923,7 +4923,8 @@ namespace Nikse.SubtitleEdit.Forms private void InsertBefore() { - bool useExtraForStyle = _oldSubtitleFormat.GetType() == typeof(AdvancedSubStationAlpha) || _oldSubtitleFormat.GetType() == typeof(SubStationAlpha); + var format = GetCurrentSubtitleFormat(); + bool useExtraForStyle = format.GetType() == typeof(AdvancedSubStationAlpha) || format.GetType() == typeof(SubStationAlpha); List styles = AdvancedSubStationAlpha.GetStylesFromHeader(_subtitle.Header); string style = "Default"; if (styles.Count > 0) @@ -5016,7 +5017,8 @@ namespace Nikse.SubtitleEdit.Forms private void InsertAfter() { - bool useExtraForStyle = _oldSubtitleFormat.GetType() == typeof(AdvancedSubStationAlpha) || _oldSubtitleFormat.GetType() == typeof(SubStationAlpha); + var format = GetCurrentSubtitleFormat(); + bool useExtraForStyle = format.GetType() == typeof(AdvancedSubStationAlpha) || format.GetType() == typeof(SubStationAlpha); List styles = AdvancedSubStationAlpha.GetStylesFromHeader(_subtitle.Header); string style = "Default"; if (styles.Count > 0)