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
This commit is contained in:
niksedk 2012-06-08 13:37:20 +00:00
parent 2668a81056
commit 4b25f1a4ac
2 changed files with 6 additions and 3 deletions

View File

@ -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); 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); 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 else
{ {

View File

@ -4923,7 +4923,8 @@ namespace Nikse.SubtitleEdit.Forms
private void InsertBefore() 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<string> styles = AdvancedSubStationAlpha.GetStylesFromHeader(_subtitle.Header); List<string> styles = AdvancedSubStationAlpha.GetStylesFromHeader(_subtitle.Header);
string style = "Default"; string style = "Default";
if (styles.Count > 0) if (styles.Count > 0)
@ -5016,7 +5017,8 @@ namespace Nikse.SubtitleEdit.Forms
private void InsertAfter() 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<string> styles = AdvancedSubStationAlpha.GetStylesFromHeader(_subtitle.Header); List<string> styles = AdvancedSubStationAlpha.GetStylesFromHeader(_subtitle.Header);
string style = "Default"; string style = "Default";
if (styles.Count > 0) if (styles.Count > 0)