View Issue Details

IDProjectCategoryView StatusLast Update
0017999LazarusPatchpublic2010-11-23 08:15
ReporterJuha ManninenAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0017999: Remove a nonsense assertion in synedit
DescriptionThe assertion does not work with latest FPC version because it aligns sets differently. By default the size is more than 1 byte.
It could be fixed using {$packset 1} (see related issue) but makes no sense either because sets of up to 8 items have size of 1 byte. The assertion claims to check for > 4 items (???)
TagsNo tags attached.
Fixed in Revision28373
LazTarget0.9.30
Widgetset
Attached Files
  • 0001-Removed-a-non-sense-assertion-from-synedit.patch (1,404 bytes)
    From 7a7ca5caf243d43f5e5638703747d5d24a3f862e Mon Sep 17 00:00:00 2001
    From: Juha Manninen <juha@JuhanLinux.(none)>
    Date: Sat, 20 Nov 2010 15:16:15 +0200
    Subject: [PATCH] Removed a non-sense assertion from synedit.
    
    ---
     components/synedit/syntextdrawer.pp |    7 -------
     lcl/include/imglist.inc             |    2 +-
     2 files changed, 1 insertions(+), 8 deletions(-)
    
    diff --git a/components/synedit/syntextdrawer.pp b/components/synedit/syntextdrawer.pp
    index f259504..039bb40 100644
    --- a/components/synedit/syntextdrawer.pp
    +++ b/components/synedit/syntextdrawer.pp
    @@ -891,13 +891,6 @@ var
       hOldFont: HFONT;
       p: PheFontData;
     begin
    -  {$IFDEF HE_ASSERT}
    -  ASSERT(SizeOf(TFontStyles) = 1,
    -    'TheTextDrawer.SetStyle: There''s more than four font styles but the current '+
    -    'code expects only four styles.');
    -  {$ELSE}
    -  ASSERT(SizeOf(TFontStyles) = 1);
    -  {$ENDIF}
       {$IFDEF SYN_LAZARUS}
       idx := GetStyleIndex(Value);
       {$ELSE}
    diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc
    index 52aa79d..8f687d1 100644
    --- a/lcl/include/imglist.inc
    +++ b/lcl/include/imglist.inc
    @@ -174,7 +174,7 @@ procedure TCustomImageList.AllocData(ACount: Integer);
     var
       n: Integer;
     begin
    -  Assert(FAllocCount >= FCount, 'Less space allocated than images');
    +  Assert(FAllocCount >= FCount-1, 'Less space allocated than images');
       if FAllocCount >= ACount
       then Exit;
     
    -- 
    1.7.2.3
    
    

Relationships

related to 0015167 closedLuiz Americo Lazarus CCR Changed the latest version 4.8.6 so that it works with FPC 2.5.1. 
related to 0017456 closedPaul Ishenin Lazarus Assertion in ImageList fails on 64-bit Linux 

Activities

2010-11-20 14:39

 

0001-Removed-a-non-sense-assertion-from-synedit.patch (1,404 bytes)
From 7a7ca5caf243d43f5e5638703747d5d24a3f862e Mon Sep 17 00:00:00 2001
From: Juha Manninen <juha@JuhanLinux.(none)>
Date: Sat, 20 Nov 2010 15:16:15 +0200
Subject: [PATCH] Removed a non-sense assertion from synedit.

---
 components/synedit/syntextdrawer.pp |    7 -------
 lcl/include/imglist.inc             |    2 +-
 2 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/components/synedit/syntextdrawer.pp b/components/synedit/syntextdrawer.pp
index f259504..039bb40 100644
--- a/components/synedit/syntextdrawer.pp
+++ b/components/synedit/syntextdrawer.pp
@@ -891,13 +891,6 @@ var
   hOldFont: HFONT;
   p: PheFontData;
 begin
-  {$IFDEF HE_ASSERT}
-  ASSERT(SizeOf(TFontStyles) = 1,
-    'TheTextDrawer.SetStyle: There''s more than four font styles but the current '+
-    'code expects only four styles.');
-  {$ELSE}
-  ASSERT(SizeOf(TFontStyles) = 1);
-  {$ENDIF}
   {$IFDEF SYN_LAZARUS}
   idx := GetStyleIndex(Value);
   {$ELSE}
diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc
index 52aa79d..8f687d1 100644
--- a/lcl/include/imglist.inc
+++ b/lcl/include/imglist.inc
@@ -174,7 +174,7 @@ procedure TCustomImageList.AllocData(ACount: Integer);
 var
   n: Integer;
 begin
-  Assert(FAllocCount >= FCount, 'Less space allocated than images');
+  Assert(FAllocCount >= FCount-1, 'Less space allocated than images');
   if FAllocCount >= ACount
   then Exit;
 
-- 
1.7.2.3

Juha Manninen

2010-11-20 14:43

developer   ~0043301

The patch includes fix for the related issue 17456, too.

Martin Friebe

2010-11-20 21:32

manager   ~0043315

Fixed the SynEdit part. Thanks

Issue History

Date Modified Username Field Change
2010-11-20 14:39 Juha Manninen New Issue
2010-11-20 14:39 Juha Manninen File Added: 0001-Removed-a-non-sense-assertion-from-synedit.patch
2010-11-20 14:39 Juha Manninen LazTarget => -
2010-11-20 14:40 Juha Manninen Relationship added related to 0015167
2010-11-20 14:40 Juha Manninen Relationship added related to 0017456
2010-11-20 14:43 Juha Manninen Note Added: 0043301
2010-11-20 18:28 Maxim Ganetsky Status new => assigned
2010-11-20 18:28 Maxim Ganetsky Assigned To => Martin Friebe
2010-11-20 18:29 Maxim Ganetsky LazTarget - => 0.9.30
2010-11-20 18:29 Maxim Ganetsky Target Version => 0.9.30
2010-11-20 21:32 Martin Friebe Fixed in Revision => 28373
2010-11-20 21:32 Martin Friebe Status assigned => resolved
2010-11-20 21:32 Martin Friebe Fixed in Version => 0.9.29 (SVN)
2010-11-20 21:32 Martin Friebe Resolution open => fixed
2010-11-20 21:32 Martin Friebe Note Added: 0043315
2010-11-23 08:15 Juha Manninen Status resolved => closed