From ec2a2fa1e3f8342a954f27573322776cda89393f Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Fri, 11 Jan 2008 19:45:15 +0000 Subject: [PATCH] Modified "split at cursor" so it trims off whitespace around the split point. Fixes #523. Originally committed to SVN as r1689. --- aegisub/changelog.txt | 1 + aegisub/subs_grid.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aegisub/changelog.txt b/aegisub/changelog.txt index ac5b51eac..66802feb4 100644 --- a/aegisub/changelog.txt +++ b/aegisub/changelog.txt @@ -123,6 +123,7 @@ Please visit http://aegisub.net to download latest version o Tweaked the behavior of the margin boxes, now they no longer show padding zeros. (AMZ) o Actor and Effect fields now show a "ghosted" caption saying their name when they are not focused on and blank. (AMZ) o Added a "Commit" button that duplicates the Enter/Ctrl+Enter functionality, since those shortcuts were not obvious to everyone. (AMZ) + o The "Split at cursor" functions now trims off leading/trailing whitespace around the split point. (TheFluff) - Changes to Fonts Collector: o Changed the font searching engine to something slower, but far more reliable. (jfs/AMZ) o Added option to just verify if you have the fonts. (AMZ) diff --git a/aegisub/subs_grid.cpp b/aegisub/subs_grid.cpp index 4138a603c..2e8d7f62d 100644 --- a/aegisub/subs_grid.cpp +++ b/aegisub/subs_grid.cpp @@ -1260,8 +1260,8 @@ void SubtitlesGrid::SplitLine(int n,int pos,int mode) { // Modify text wxString orig = n1->Text; - n1->Text = orig.Left(pos); - n2->Text = orig.Mid(pos); + n1->Text = orig.Left(pos).Trim(true); // Trim off trailing whitespace + n2->Text = orig.Mid(pos).Trim(false); // Trim off leading whitespace // Modify time if (mode == 1) {