mirror of
https://github.com/greenshot/greenshot
synced 2025-07-30 19:50:11 -07:00
Fixed bug #3599278, which most likely is due to a corrupt/invalid configuration.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2408 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
5a93c10c79
commit
e64b5bfd9f
1 changed files with 5 additions and 4 deletions
|
@ -73,20 +73,21 @@ namespace Greenshot.Processors {
|
|||
public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails) {
|
||||
bool changed = false;
|
||||
string title = captureDetails.Title;
|
||||
LOG.Debug("Title before: " + title);
|
||||
if (title != null && title.Length > 0) {
|
||||
if (!string.IsNullOrEmpty(title)) {
|
||||
title = title.Trim();
|
||||
foreach(string titleIdentifier in config.ActiveTitleFixes) {
|
||||
string regexpString = config.TitleFixMatcher[titleIdentifier];
|
||||
string replaceString = config.TitleFixReplacer[titleIdentifier];
|
||||
if (regexpString != null && regexpString.Length > 0) {
|
||||
if (replaceString == null) {
|
||||
replaceString = "";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(regexpString)) {
|
||||
Regex regex = new Regex(regexpString);
|
||||
title = regex.Replace(title, replaceString);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG.Debug("Title after: " + title);
|
||||
captureDetails.Title = title;
|
||||
return changed;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue