Skip to content

Commit

Permalink
fixed crash when editbox caption is blank
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbannon committed Jul 23, 2018
1 parent d7b756c commit b695bdf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package/package_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# and that a 'Release' mode exists.

PRODUCT="tomboy-ng"
VERSION="0.16"
VERSION="0.16a"

SOURCE_DIR="../tomboy-ng"
ICON_DIR="../glyphs"
Expand Down
1 change: 1 addition & 0 deletions tomboy-ng/Tomboy_NG.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="--config-dir=/home/dbannon/Desktop --debug-index"/>
</local>
</RunParams>
<RequiredPackages Count="3">
Expand Down
8 changes: 6 additions & 2 deletions tomboy-ng/editbox.pas
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@
2018/06/22 DRB added LoadSingleNote and related to do just that. Needs more testing.
2018/07/05 Changed MonospaceFont to 'Monaco' on the Mac, apparently universal...
2018/07/20 Force copy on selection paste to always paste to left of a newline.
2018/07/23 If a note has no title in content but does have one in xml, caption is
left blank and that crashes things that look for * in first char. Fixed
}


Expand Down Expand Up @@ -559,7 +561,7 @@ procedure TEditBoxForm.PrimaryPaste(SelIndex : integer);
{$ifdef LINUX}
MonospaceFont = 'monospace';
{$else}
MonospaceFont = 'Lucida Console';
//MonospaceFont = 'Lucida Console';
MonospaceFont = 'Monaco'; // might be a better choice
{$ifend}

Expand Down Expand Up @@ -847,13 +849,15 @@ procedure TEditBoxForm.MarkDirty();
begin
{if not Dirty then} TimerSave.Enabled := true;
Dirty := true;
if Caption[1] <> '*' then
if Caption = '' then Caption := '*'
else if Caption[1] <> '*' then
Caption := '* ' + Caption;
end;


function TEditBoxForm.CleanCaption(): ANSIString;
begin
if Caption = '' then exit('');
if Caption[1] = '*' then
Result := Copy(Caption, 3, 256)
else Result := Caption;
Expand Down

0 comments on commit b695bdf

Please sign in to comment.