View Issue Details

IDProjectCategoryView StatusLast Update
0026693LazarusLazReportpublic2014-09-11 17:17
ReporterJesus ReyesAssigned ToJesus Reyes 
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.3 (SVN)Product Build 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0026693: LazReport crash after exporting from Preview window
DescriptionOnce a report has been exported (tried cairo export linux and windows)
After closing the preview window the program crash.

This is a regression.
TagsNo tags attached.
Fixed in Revision46178
LazTarget1.4
WidgetsetGTK 2, Win32/Win64
Attached Files
  • fix_26693.diff (14,551 bytes)
    Index: addons/lrOfficeImport/lrspreadsheetimportunit.pas
    ===================================================================
    --- addons/lrOfficeImport/lrspreadsheetimportunit.pas	(revisión: 46167)
    +++ addons/lrOfficeImport/lrspreadsheetimportunit.pas	(copia de trabajo)
    @@ -167,7 +167,7 @@
     
             T.MonitorFontChanges;
             T.Memo.Text:=FWorksheet.ReadAsUTF8Text(Cell);
    -//        frDesigner.Page.Objects.Add(t);
    +        frDesigner.Page.Objects.Add(t);
     
           end
           else
    Index: fr3tolrf.pas
    ===================================================================
    --- fr3tolrf.pas	(revisión: 46167)
    +++ fr3tolrf.pas	(copia de trabajo)
    @@ -516,7 +516,7 @@
       if View<>nil then
       begin
         View.BeginUpdate;
    -//    Page.Objects.Add(View);
    +    Page.Objects.Add(View);
         LoadView(Node, Page, View, ParentView);
         View.EndUpdate;
         // process any child
    Index: lr_class.pas
    ===================================================================
    --- lr_class.pas	(revisión: 46167)
    +++ lr_class.pas	(copia de trabajo)
    @@ -7245,10 +7245,9 @@
         bt :=TfrView(Objects[i]);
         if not (doChildComponent in bt.DesignOptions) then
         begin
    -      t := frCreateObject(bt.Typ, bt.ClassName, nil);
    +      t := frCreateObject(bt.Typ, bt.ClassName, Self);
           t.Assign(bt);
           t.StreamMode := smPrinting;
    -      T.OwnerPage:=Self;
           RTObjects.Add(t);
     
           if (t.Flags and flWantHook) <> 0 then
    @@ -8412,9 +8411,8 @@
       procedure AddObject(ot: Byte; clname: String);
       begin
         Stream.Read(b, 1);
    -    t :=frCreateObject(ot, clname, Pages[b]);
    -{    Pages[b].Objects.Add(frCreateObject(ot, clname, Pages[b]));
    -    t :=TfrView(Pages[b].Objects.Items[Pages[b].Objects.Count - 1]);}
    +    Pages[b].Objects.Add(frCreateObject(ot, clname, Pages[b]));
    +    t :=TfrView(Pages[b].Objects.Items[Pages[b].Objects.Count - 1]);
       end;
     
     begin
    @@ -8482,9 +8480,8 @@
       t: TfrView;
       procedure AddObject(aPage: TFrPage; ot: Byte; clname: String);
       begin
    -{    aPage.Objects.Add(frCreateObject(ot, clname, aPage));
    -    t :=TfrView(aPage.Objects.Items[aPage.Objects.Count - 1]);}
    -    t:=frCreateObject(ot, clname, aPage);
    +    aPage.Objects.Add(frCreateObject(ot, clname, aPage));
    +    t :=TfrView(aPage.Objects.Items[aPage.Objects.Count - 1]);
       end;
     var
       i,j,aCount,oCount: Integer;
    @@ -8782,7 +8779,7 @@
           t.StreamMode := smPrinting;
           t.LoadFromStream(Stream);
           t.StreamMode := smDesigning;
    -//      Page.Objects.Add(t);
    +      Page.Objects.Add(t);
         end;
       end;
     end;
    @@ -12554,9 +12551,6 @@
       fMemo:=TfrMemoStrings.Create;
       fScript:=TfrScriptStrings.Create;
       FDesignOptions:=[];
    -
    -  if Assigned(OwnerPage) then
    -    OwnerPage.Objects.Add(Self);
     end;
     
     destructor TfrObject.Destroy;
    Index: lr_crosstab.pas
    ===================================================================
    --- lr_crosstab.pas	(revisión: 46167)
    +++ lr_crosstab.pas	(copia de trabajo)
    @@ -733,6 +733,7 @@
         FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView;
         FView.Assign(FTotalRHCell);
         FView.SetBounds(FXPos, FYPos, FTotalRHCell.DX, FTotalRHCell.dy);
    +    FPage.Objects.Add(FView);
       end;
     
     
    @@ -747,11 +748,13 @@
         FBandDataHeader.SetBounds(XX, 0, 1000, 18);
         FBandDataHeader.Name:=Name+'_DataHeader';
         FBandDataHeader.Stretched:=true;
    +    FPage.Objects.add(FBandDataHeader);
     
         FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView;
         FView.Assign(FColTitleCell);
         FView.SetBounds(XX, FYPos, FDataCell.DX, FColTitleCell.dy);
         FView.Memo.Text:='-ColTitle-';
    +    FPage.Objects.Add(FView);
         FYPos := FYPos + FColTitleCell.dY + 2;
       end;
     
    @@ -761,6 +764,7 @@
         FBandCrossHeader.BandType := btCrossHeader;
         FBandCrossHeader.SetBounds(FXPos, 0, FRowTitleCell.DX, 1000);
         FBandCrossHeader.Name:=Name+'_CrossHeader';
    +    FPage.Objects.Add(FBandCrossHeader);
     
         if FShowRowHeader then
         begin
    @@ -768,6 +772,7 @@
           FView.Assign(FRowTitleCell);
           FView.SetBounds(FXPos, FYPos, FRowTitleCell.DX, FRowTitleCell.dy);
           FView.Memo.Text:='-RowTitle-';
    +      FPage.Objects.Add(FView);
         end;
         FXPos:=FXPos + FRowTitleCell.DX + 2;
       end;
    @@ -779,6 +784,7 @@
       FBandDataRow.SetBounds(0, FYPos, 1000, 18);
       FBandDataRow.Flags:=FBandDataRow.Flags or flStretched;
       FBandDataRow.Name:=Name+'_MasterData';
    +  FPage.Objects.Add(FBandDataRow);
     
       FBandCrossRow := TfrBandView(frCreateObject(gtBand, '', FPage));
       FBandCrossRow.BandType := btCrossData;
    @@ -785,11 +791,13 @@
       FBandCrossRow.Dataset := IntToStr(ColCount);
       FBandCrossRow.SetBounds(FXPos, 0, FDataCell.DX, 1000);
       FBandCrossRow.Name:=Name+'_CrossData';
    +  FPage.Objects.Add(FBandCrossRow);
     
       FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView;
       FView.Assign(FDataCell);
       FView.SetBounds(FXPos, FYPos, FDataCell.DX, FDataCell.dy);
       FView.Memo.Text:='-Cell-';
    +  FPage.Objects.Add(FView);
     
       if FShowRowTotal or FShowGrandTotal then
       begin
    @@ -799,6 +807,7 @@
         FBandCrossFooter.SetBounds(XX, 0, FRowTotalCell.DX, 1000);
         FBandCrossFooter.Flags:=FBandDataRow.Flags or flStretched;
         FBandCrossFooter.Name:=Name+'_CrossFooter';
    +    FPage.Objects.Add(FBandCrossFooter);
     
         if FShowRowTotal then
         begin
    @@ -806,6 +815,7 @@
           FView.Assign(FRowTotalCell);
           FView.SetBounds(XX, FYPos, FRowTotalCell.DX, FRowTotalCell.dy);
           FView.Memo.Text:='-RowFooter-';
    +      FPage.Objects.Add(FView);
         end;
       end;
     
    @@ -817,6 +827,7 @@
         FBandDataFooter.SetBounds(0, YY, 1000, FColTotalCell.DY);
         FBandDataFooter.Flags:=FBandDataRow.Flags or flStretched;
         FBandDataFooter.Name:=Name+'_BandDataFooter';
    +    FPage.Objects.Add(FBandDataFooter);
     
         if FShowColumnTotal then
         begin
    @@ -824,6 +835,7 @@
           FView.Assign(FColTotalCell);
           FView.SetBounds(FXPos, YY, FColTotalCell.DX, FColTotalCell.DY);
           FView.Memo.Text:='-ColFooter-';
    +      FPage.Objects.Add(FView);
         end;
       end;
     
    @@ -835,6 +847,7 @@
         FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView;
         FView.Assign(FTotalCHCell);
         FView.SetBounds(XX, YY, FTotalCHCell.DX, FTotalCHCell.DY);
    +    FPage.Objects.Add(FView);
       end;
     
       if FShowGrandTotal then
    @@ -846,6 +859,7 @@
         FView.Assign(FGrandTotalCell);
         FView.SetBounds(XX, YY, FGrandTotalCell.DX, FGrandTotalCell.DY);
         FView.Memo.Text:='-GrandTotal-';
    +    FPage.Objects.Add(FView);
       end;
     
     
    Index: lr_desgn.pas
    ===================================================================
    --- lr_desgn.pas	(revisión: 46167)
    +++ lr_desgn.pas	(copia de trabajo)
    @@ -1745,9 +1745,8 @@
       
       procedure AddObject(ot: Byte);
       begin
    -{    Objects.Add(frCreateObject(ot, '', FDesigner.Page));
    -    t := TfrView(Objects.Last);}
    -    t:=frCreateObject(ot, '', FDesigner.Page);
    +    Objects.Add(frCreateObject(ot, '', FDesigner.Page));
    +    t := TfrView(Objects.Last);
         if t is TfrCustomMemoView then
           TfrCustomMemoView(t).MonitorFontChanges;
       end;
    @@ -1761,9 +1760,8 @@
           ObjectInserted := frBandTypesForm.ShowModal = mrOk;
           if ObjectInserted then
           begin
    -{        Objects.Add(TfrBandView.Create(FDesigner.Page));
    -        t := TfrView(Objects.Last);}
    -        t:=TfrBandView.Create(FDesigner.Page);
    +        Objects.Add(TfrBandView.Create(FDesigner.Page));
    +        t := TfrView(Objects.Last);
             (t as TfrBandView).BandType := frBandTypesForm.SelectedTyp;
             s := frGetBandName(frBandTypesForm.SelectedTyp);
             THackView(t).BaseName := s;
    @@ -1776,9 +1774,8 @@
       
       procedure CreateSubReport;
       begin
    -{    Objects.Add(TfrSubReportView.Create(FDesigner.Page));
    -    t := TfrView(Objects.Last);}
    -    t:=TfrSubReportView.Create(FDesigner.Page);
    +    Objects.Add(TfrSubReportView.Create(FDesigner.Page));
    +    t := TfrView(Objects.Last);
         (t as TfrSubReportView).SubPage := CurReport.Pages.Count;
         CurReport.Pages.Add;
       end;
    @@ -1849,9 +1846,8 @@
                       if Tag >= gtAddIn then
                       begin
                         k := Tag - gtAddIn;
    -{                    Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page));
    -                    t := TfrView(Objects.Last);}
    -                    t:=frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page);
    +                    Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page));
    +                    t := TfrView(Objects.Last);
                       end
                       else
                         AddObject(Tag);
    @@ -1878,9 +1874,8 @@
                     if Tag >= gtAddIn then
                     begin
                       k := Tag - gtAddIn;
    -{                  Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page));
    -                  t := TfrView(Objects.Last);}
    -                  t:=frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page);
    +                  Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page));
    +                  t := TfrView(Objects.Last);
                     end
                     else
                       AddObject(Tag);
    @@ -3885,7 +3880,7 @@
         t := TfrView(Objects[i]);
         if t.Selected and not (doChildComponent in T.DesignOptions)  then
         begin
    -      ClipBd.Add(frCreateObject(t.Typ, t.ClassName, nil));
    +      ClipBd.Add(frCreateObject(t.Typ, t.ClassName, Page));
           TfrView(ClipBd.Last).Assign(t);
         end;
       end;
    @@ -4435,7 +4430,7 @@
       if CurReport.FindObject(t.Name) <> nil then
         t.CreateUniqueName;
     
    -//  Objects.Add(t);
    +  Objects.Add(t);
     end;
     
     procedure TfrDesignerForm.ResetDuplicateCount;
    @@ -5466,7 +5461,7 @@
           acInsert: p^.ObjID := t.ID;
           acDelete, acEdit:
             begin
    -          t1 := frCreateObject(t.Typ, t.ClassName, nil);
    +          t1 := frCreateObject(t.Typ, t.ClassName, Page);
               t1.Assign(t);
               t1.ID := t.ID;
               p^.ObjID := t.ID;
    @@ -5686,6 +5681,7 @@
         t1.Assign(t);
         if CurReport.FindObject(t1.Name) <> nil then
           t1.CreateUniqueName;
    +    Objects.Add(t1);
       end;
       SelectionChanged;
       SendBandsToDown;
    @@ -5973,9 +5969,8 @@
       if Assigned(lrFieldsList) and ((Control = lrFieldsList.lbFieldsList) or (Control = lrFieldsList.ValList)) then
       begin
     
    -{    Objects.Add(frCreateObject(gtMemo, '', Page));
    -    t:=TfrCustomMemoView(Objects.Last);}
    -    t:=frCreateObject(gtMemo, '', Page) as TfrCustomMemoView;
    +    Objects.Add(frCreateObject(gtMemo, '', Page));
    +    t:=TfrCustomMemoView(Objects.Last);
         if Assigned(t) then
         begin
           t.MonitorFontChanges;
    @@ -7923,7 +7918,7 @@
                 t.dx := (fSize * TfrDesignerForm(frDesigner).PageView.Canvas.TextWidth('=')) div TfrDesignerForm(frDesigner).GridSize * TfrDesignerForm(frDesigner).GridSize;
               end;
               dx := t.dx;
    -//          TfrDesignerForm(frDesigner).Page.Objects.Add(t);
    +          TfrDesignerForm(frDesigner).Page.Objects.Add(t);
               if HeaderCB.Checked then
                 HeaderL.Add(t) else
                 DataL.Add(t);
    @@ -7948,7 +7943,7 @@
                 t.Memo.Add('[' + DatasetCB.Items[DatasetCB.ItemIndex] +
                   '."' + FieldsL.Items[i] + '"]');
                 t.dx := (fSize * TfrDesignerForm(frDesigner).PageView.Canvas.TextWidth('=')) div TfrDesignerForm(frDesigner).GridSize * TfrDesignerForm(frDesigner).GridSize;
    -//            TfrDesignerForm(frDesigner).Page.Objects.Add(t);
    +            TfrDesignerForm(frDesigner).Page.Objects.Add(t);
                 DataL.Add(t);
               end;
               if HorzRB.Checked then
    @@ -8001,7 +7996,7 @@
             Inc(TfrDesignerForm(frDesigner).SelNum);
             if not HeaderCB.Checked or not HorzRB.Checked then
             begin
    -//          TfrDesignerForm(frDesigner).Page.Objects.Add(b);
    +          TfrDesignerForm(frDesigner).Page.Objects.Add(b);
               b.BandType := btMasterData;
               b.DataSet := FindDataset(DataSet);
             end
    @@ -8015,7 +8010,7 @@
               else
               begin
                 b.BandType := btPageHeader;
    -//            TfrDesignerForm(frDesigner).Page.Objects.Add(b);
    +            TfrDesignerForm(frDesigner).Page.Objects.Add(b);
               end;
               b := frCreateObject(gtBand, '', TfrDesignerForm(frDesigner).Page) as TfrBandView;
               b.BandType := btMasterData;
    @@ -8025,7 +8020,7 @@
               b.dy := dy;
               b.Selected := True;
               Inc(TfrDesignerForm(frDesigner).SelNum);
    -//          TfrDesignerForm(frDesigner).Page.Objects.Add(b);
    +          TfrDesignerForm(frDesigner).Page.Objects.Add(b);
             end;
           end;
           TfrDesignerForm(frDesigner).SelectionChanged;
    Index: lr_pgrid.pas
    ===================================================================
    --- lr_pgrid.pas	(revisión: 46167)
    +++ lr_pgrid.pas	(copia de trabajo)
    @@ -303,13 +303,13 @@
           b := TfrBandView(frCreateObject(gtBand, '', Page));
           b.SetBounds(10, 20, 1000, 25);
           b.BandType := btReportTitle;
    -//      Page.Objects.Add(b);
    +      Page.Objects.Add(b);
           v := frCreateObject(gtMemo, '', Page);
           v.SetBounds(20, 20, Page.PrnInfo.PgW - 40, 25);
           TfrMemoView(v).Alignment:=taCenter;
           TfrMemoView(v).Font.Assign(FTitleFont);
           v.Memo.Add(FCaption);
    -//      Page.Objects.Add(v);
    +      Page.Objects.Add(v);
         end;
     
         // if we have a template we need to be sure that bands on template
    @@ -323,7 +323,7 @@
           b.Flags:=b.Flags+flBandRepeatHeader;
         b.SetBounds(XPos, YPos, 1000, 20);
         b.Flags:=b.Flags or flStretched;
    -//    Page.Objects.Add(b);
    +    Page.Objects.Add(b);
     
         v := frCreateObject(gtMemo, '', Page);
         v.SetBounds(XPos, YPos, 20, 20);
    @@ -333,7 +333,7 @@
         TfrMemoView(v).Frames:=frAllFrames;
         TfrMemoView(v).Layout:=tlTop;
         v.Memo.Add('[Header]');
    -//    Page.Objects.Add(v);
    +    Page.Objects.Add(v);
     
         YPos := YPos + 22;
     
    @@ -342,13 +342,13 @@
         b.Dataset := FReportDataSet.Name;
         b.SetBounds(0, YPos, 1000, 18);
         b.Flags:=b.Flags or flStretched;
    -//    Page.Objects.Add(b);
    +    Page.Objects.Add(b);
     
         b := TfrBandView(frCreateObject(gtBand, '', Page));
         b.BandType := btCrossData;
         b.Dataset := FColumnDataSet.Name;
         b.SetBounds(XPos, 0, 20, 1000);
    -//    Page.Objects.Add(b);
    +    Page.Objects.Add(b);
     
         v := frCreateObject(gtMemo, '', Page);
         v.SetBounds(XPos, YPos, 20, 18);
    @@ -357,7 +357,7 @@
         TfrMemoView(v).Font.Assign(FFont);
         TfrMemoView(v).Frames:=frAllFrames;
         TfrMemoView(v).Layout:=tlTop;
    -//    Page.Objects.Add(v);
    +    Page.Objects.Add(v);
     
         FDataSet.DisableControls;
         BM:=FDataSet.GetBookmark;
    
    fix_26693.diff (14,551 bytes)
  • lr.diff.rar (309 bytes)

Activities

Jesus Reyes

2014-09-10 07:53

developer  

fix_26693.diff (14,551 bytes)
Index: addons/lrOfficeImport/lrspreadsheetimportunit.pas
===================================================================
--- addons/lrOfficeImport/lrspreadsheetimportunit.pas	(revisión: 46167)
+++ addons/lrOfficeImport/lrspreadsheetimportunit.pas	(copia de trabajo)
@@ -167,7 +167,7 @@
 
         T.MonitorFontChanges;
         T.Memo.Text:=FWorksheet.ReadAsUTF8Text(Cell);
-//        frDesigner.Page.Objects.Add(t);
+        frDesigner.Page.Objects.Add(t);
 
       end
       else
Index: fr3tolrf.pas
===================================================================
--- fr3tolrf.pas	(revisión: 46167)
+++ fr3tolrf.pas	(copia de trabajo)
@@ -516,7 +516,7 @@
   if View<>nil then
   begin
     View.BeginUpdate;
-//    Page.Objects.Add(View);
+    Page.Objects.Add(View);
     LoadView(Node, Page, View, ParentView);
     View.EndUpdate;
     // process any child
Index: lr_class.pas
===================================================================
--- lr_class.pas	(revisión: 46167)
+++ lr_class.pas	(copia de trabajo)
@@ -7245,10 +7245,9 @@
     bt :=TfrView(Objects[i]);
     if not (doChildComponent in bt.DesignOptions) then
     begin
-      t := frCreateObject(bt.Typ, bt.ClassName, nil);
+      t := frCreateObject(bt.Typ, bt.ClassName, Self);
       t.Assign(bt);
       t.StreamMode := smPrinting;
-      T.OwnerPage:=Self;
       RTObjects.Add(t);
 
       if (t.Flags and flWantHook) <> 0 then
@@ -8412,9 +8411,8 @@
   procedure AddObject(ot: Byte; clname: String);
   begin
     Stream.Read(b, 1);
-    t :=frCreateObject(ot, clname, Pages[b]);
-{    Pages[b].Objects.Add(frCreateObject(ot, clname, Pages[b]));
-    t :=TfrView(Pages[b].Objects.Items[Pages[b].Objects.Count - 1]);}
+    Pages[b].Objects.Add(frCreateObject(ot, clname, Pages[b]));
+    t :=TfrView(Pages[b].Objects.Items[Pages[b].Objects.Count - 1]);
   end;
 
 begin
@@ -8482,9 +8480,8 @@
   t: TfrView;
   procedure AddObject(aPage: TFrPage; ot: Byte; clname: String);
   begin
-{    aPage.Objects.Add(frCreateObject(ot, clname, aPage));
-    t :=TfrView(aPage.Objects.Items[aPage.Objects.Count - 1]);}
-    t:=frCreateObject(ot, clname, aPage);
+    aPage.Objects.Add(frCreateObject(ot, clname, aPage));
+    t :=TfrView(aPage.Objects.Items[aPage.Objects.Count - 1]);
   end;
 var
   i,j,aCount,oCount: Integer;
@@ -8782,7 +8779,7 @@
       t.StreamMode := smPrinting;
       t.LoadFromStream(Stream);
       t.StreamMode := smDesigning;
-//      Page.Objects.Add(t);
+      Page.Objects.Add(t);
     end;
   end;
 end;
@@ -12554,9 +12551,6 @@
   fMemo:=TfrMemoStrings.Create;
   fScript:=TfrScriptStrings.Create;
   FDesignOptions:=[];
-
-  if Assigned(OwnerPage) then
-    OwnerPage.Objects.Add(Self);
 end;
 
 destructor TfrObject.Destroy;
Index: lr_crosstab.pas
===================================================================
--- lr_crosstab.pas	(revisión: 46167)
+++ lr_crosstab.pas	(copia de trabajo)
@@ -733,6 +733,7 @@
     FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView;
     FView.Assign(FTotalRHCell);
     FView.SetBounds(FXPos, FYPos, FTotalRHCell.DX, FTotalRHCell.dy);
+    FPage.Objects.Add(FView);
   end;
 
 
@@ -747,11 +748,13 @@
     FBandDataHeader.SetBounds(XX, 0, 1000, 18);
     FBandDataHeader.Name:=Name+'_DataHeader';
     FBandDataHeader.Stretched:=true;
+    FPage.Objects.add(FBandDataHeader);
 
     FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView;
     FView.Assign(FColTitleCell);
     FView.SetBounds(XX, FYPos, FDataCell.DX, FColTitleCell.dy);
     FView.Memo.Text:='-ColTitle-';
+    FPage.Objects.Add(FView);
     FYPos := FYPos + FColTitleCell.dY + 2;
   end;
 
@@ -761,6 +764,7 @@
     FBandCrossHeader.BandType := btCrossHeader;
     FBandCrossHeader.SetBounds(FXPos, 0, FRowTitleCell.DX, 1000);
     FBandCrossHeader.Name:=Name+'_CrossHeader';
+    FPage.Objects.Add(FBandCrossHeader);
 
     if FShowRowHeader then
     begin
@@ -768,6 +772,7 @@
       FView.Assign(FRowTitleCell);
       FView.SetBounds(FXPos, FYPos, FRowTitleCell.DX, FRowTitleCell.dy);
       FView.Memo.Text:='-RowTitle-';
+      FPage.Objects.Add(FView);
     end;
     FXPos:=FXPos + FRowTitleCell.DX + 2;
   end;
@@ -779,6 +784,7 @@
   FBandDataRow.SetBounds(0, FYPos, 1000, 18);
   FBandDataRow.Flags:=FBandDataRow.Flags or flStretched;
   FBandDataRow.Name:=Name+'_MasterData';
+  FPage.Objects.Add(FBandDataRow);
 
   FBandCrossRow := TfrBandView(frCreateObject(gtBand, '', FPage));
   FBandCrossRow.BandType := btCrossData;
@@ -785,11 +791,13 @@
   FBandCrossRow.Dataset := IntToStr(ColCount);
   FBandCrossRow.SetBounds(FXPos, 0, FDataCell.DX, 1000);
   FBandCrossRow.Name:=Name+'_CrossData';
+  FPage.Objects.Add(FBandCrossRow);
 
   FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView;
   FView.Assign(FDataCell);
   FView.SetBounds(FXPos, FYPos, FDataCell.DX, FDataCell.dy);
   FView.Memo.Text:='-Cell-';
+  FPage.Objects.Add(FView);
 
   if FShowRowTotal or FShowGrandTotal then
   begin
@@ -799,6 +807,7 @@
     FBandCrossFooter.SetBounds(XX, 0, FRowTotalCell.DX, 1000);
     FBandCrossFooter.Flags:=FBandDataRow.Flags or flStretched;
     FBandCrossFooter.Name:=Name+'_CrossFooter';
+    FPage.Objects.Add(FBandCrossFooter);
 
     if FShowRowTotal then
     begin
@@ -806,6 +815,7 @@
       FView.Assign(FRowTotalCell);
       FView.SetBounds(XX, FYPos, FRowTotalCell.DX, FRowTotalCell.dy);
       FView.Memo.Text:='-RowFooter-';
+      FPage.Objects.Add(FView);
     end;
   end;
 
@@ -817,6 +827,7 @@
     FBandDataFooter.SetBounds(0, YY, 1000, FColTotalCell.DY);
     FBandDataFooter.Flags:=FBandDataRow.Flags or flStretched;
     FBandDataFooter.Name:=Name+'_BandDataFooter';
+    FPage.Objects.Add(FBandDataFooter);
 
     if FShowColumnTotal then
     begin
@@ -824,6 +835,7 @@
       FView.Assign(FColTotalCell);
       FView.SetBounds(FXPos, YY, FColTotalCell.DX, FColTotalCell.DY);
       FView.Memo.Text:='-ColFooter-';
+      FPage.Objects.Add(FView);
     end;
   end;
 
@@ -835,6 +847,7 @@
     FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView;
     FView.Assign(FTotalCHCell);
     FView.SetBounds(XX, YY, FTotalCHCell.DX, FTotalCHCell.DY);
+    FPage.Objects.Add(FView);
   end;
 
   if FShowGrandTotal then
@@ -846,6 +859,7 @@
     FView.Assign(FGrandTotalCell);
     FView.SetBounds(XX, YY, FGrandTotalCell.DX, FGrandTotalCell.DY);
     FView.Memo.Text:='-GrandTotal-';
+    FPage.Objects.Add(FView);
   end;
 
 
Index: lr_desgn.pas
===================================================================
--- lr_desgn.pas	(revisión: 46167)
+++ lr_desgn.pas	(copia de trabajo)
@@ -1745,9 +1745,8 @@
   
   procedure AddObject(ot: Byte);
   begin
-{    Objects.Add(frCreateObject(ot, '', FDesigner.Page));
-    t := TfrView(Objects.Last);}
-    t:=frCreateObject(ot, '', FDesigner.Page);
+    Objects.Add(frCreateObject(ot, '', FDesigner.Page));
+    t := TfrView(Objects.Last);
     if t is TfrCustomMemoView then
       TfrCustomMemoView(t).MonitorFontChanges;
   end;
@@ -1761,9 +1760,8 @@
       ObjectInserted := frBandTypesForm.ShowModal = mrOk;
       if ObjectInserted then
       begin
-{        Objects.Add(TfrBandView.Create(FDesigner.Page));
-        t := TfrView(Objects.Last);}
-        t:=TfrBandView.Create(FDesigner.Page);
+        Objects.Add(TfrBandView.Create(FDesigner.Page));
+        t := TfrView(Objects.Last);
         (t as TfrBandView).BandType := frBandTypesForm.SelectedTyp;
         s := frGetBandName(frBandTypesForm.SelectedTyp);
         THackView(t).BaseName := s;
@@ -1776,9 +1774,8 @@
   
   procedure CreateSubReport;
   begin
-{    Objects.Add(TfrSubReportView.Create(FDesigner.Page));
-    t := TfrView(Objects.Last);}
-    t:=TfrSubReportView.Create(FDesigner.Page);
+    Objects.Add(TfrSubReportView.Create(FDesigner.Page));
+    t := TfrView(Objects.Last);
     (t as TfrSubReportView).SubPage := CurReport.Pages.Count;
     CurReport.Pages.Add;
   end;
@@ -1849,9 +1846,8 @@
                   if Tag >= gtAddIn then
                   begin
                     k := Tag - gtAddIn;
-{                    Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page));
-                    t := TfrView(Objects.Last);}
-                    t:=frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page);
+                    Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page));
+                    t := TfrView(Objects.Last);
                   end
                   else
                     AddObject(Tag);
@@ -1878,9 +1874,8 @@
                 if Tag >= gtAddIn then
                 begin
                   k := Tag - gtAddIn;
-{                  Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page));
-                  t := TfrView(Objects.Last);}
-                  t:=frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page);
+                  Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page));
+                  t := TfrView(Objects.Last);
                 end
                 else
                   AddObject(Tag);
@@ -3885,7 +3880,7 @@
     t := TfrView(Objects[i]);
     if t.Selected and not (doChildComponent in T.DesignOptions)  then
     begin
-      ClipBd.Add(frCreateObject(t.Typ, t.ClassName, nil));
+      ClipBd.Add(frCreateObject(t.Typ, t.ClassName, Page));
       TfrView(ClipBd.Last).Assign(t);
     end;
   end;
@@ -4435,7 +4430,7 @@
   if CurReport.FindObject(t.Name) <> nil then
     t.CreateUniqueName;
 
-//  Objects.Add(t);
+  Objects.Add(t);
 end;
 
 procedure TfrDesignerForm.ResetDuplicateCount;
@@ -5466,7 +5461,7 @@
       acInsert: p^.ObjID := t.ID;
       acDelete, acEdit:
         begin
-          t1 := frCreateObject(t.Typ, t.ClassName, nil);
+          t1 := frCreateObject(t.Typ, t.ClassName, Page);
           t1.Assign(t);
           t1.ID := t.ID;
           p^.ObjID := t.ID;
@@ -5686,6 +5681,7 @@
     t1.Assign(t);
     if CurReport.FindObject(t1.Name) <> nil then
       t1.CreateUniqueName;
+    Objects.Add(t1);
   end;
   SelectionChanged;
   SendBandsToDown;
@@ -5973,9 +5969,8 @@
   if Assigned(lrFieldsList) and ((Control = lrFieldsList.lbFieldsList) or (Control = lrFieldsList.ValList)) then
   begin
 
-{    Objects.Add(frCreateObject(gtMemo, '', Page));
-    t:=TfrCustomMemoView(Objects.Last);}
-    t:=frCreateObject(gtMemo, '', Page) as TfrCustomMemoView;
+    Objects.Add(frCreateObject(gtMemo, '', Page));
+    t:=TfrCustomMemoView(Objects.Last);
     if Assigned(t) then
     begin
       t.MonitorFontChanges;
@@ -7923,7 +7918,7 @@
             t.dx := (fSize * TfrDesignerForm(frDesigner).PageView.Canvas.TextWidth('=')) div TfrDesignerForm(frDesigner).GridSize * TfrDesignerForm(frDesigner).GridSize;
           end;
           dx := t.dx;
-//          TfrDesignerForm(frDesigner).Page.Objects.Add(t);
+          TfrDesignerForm(frDesigner).Page.Objects.Add(t);
           if HeaderCB.Checked then
             HeaderL.Add(t) else
             DataL.Add(t);
@@ -7948,7 +7943,7 @@
             t.Memo.Add('[' + DatasetCB.Items[DatasetCB.ItemIndex] +
               '."' + FieldsL.Items[i] + '"]');
             t.dx := (fSize * TfrDesignerForm(frDesigner).PageView.Canvas.TextWidth('=')) div TfrDesignerForm(frDesigner).GridSize * TfrDesignerForm(frDesigner).GridSize;
-//            TfrDesignerForm(frDesigner).Page.Objects.Add(t);
+            TfrDesignerForm(frDesigner).Page.Objects.Add(t);
             DataL.Add(t);
           end;
           if HorzRB.Checked then
@@ -8001,7 +7996,7 @@
         Inc(TfrDesignerForm(frDesigner).SelNum);
         if not HeaderCB.Checked or not HorzRB.Checked then
         begin
-//          TfrDesignerForm(frDesigner).Page.Objects.Add(b);
+          TfrDesignerForm(frDesigner).Page.Objects.Add(b);
           b.BandType := btMasterData;
           b.DataSet := FindDataset(DataSet);
         end
@@ -8015,7 +8010,7 @@
           else
           begin
             b.BandType := btPageHeader;
-//            TfrDesignerForm(frDesigner).Page.Objects.Add(b);
+            TfrDesignerForm(frDesigner).Page.Objects.Add(b);
           end;
           b := frCreateObject(gtBand, '', TfrDesignerForm(frDesigner).Page) as TfrBandView;
           b.BandType := btMasterData;
@@ -8025,7 +8020,7 @@
           b.dy := dy;
           b.Selected := True;
           Inc(TfrDesignerForm(frDesigner).SelNum);
-//          TfrDesignerForm(frDesigner).Page.Objects.Add(b);
+          TfrDesignerForm(frDesigner).Page.Objects.Add(b);
         end;
       end;
       TfrDesignerForm(frDesigner).SelectionChanged;
Index: lr_pgrid.pas
===================================================================
--- lr_pgrid.pas	(revisión: 46167)
+++ lr_pgrid.pas	(copia de trabajo)
@@ -303,13 +303,13 @@
       b := TfrBandView(frCreateObject(gtBand, '', Page));
       b.SetBounds(10, 20, 1000, 25);
       b.BandType := btReportTitle;
-//      Page.Objects.Add(b);
+      Page.Objects.Add(b);
       v := frCreateObject(gtMemo, '', Page);
       v.SetBounds(20, 20, Page.PrnInfo.PgW - 40, 25);
       TfrMemoView(v).Alignment:=taCenter;
       TfrMemoView(v).Font.Assign(FTitleFont);
       v.Memo.Add(FCaption);
-//      Page.Objects.Add(v);
+      Page.Objects.Add(v);
     end;
 
     // if we have a template we need to be sure that bands on template
@@ -323,7 +323,7 @@
       b.Flags:=b.Flags+flBandRepeatHeader;
     b.SetBounds(XPos, YPos, 1000, 20);
     b.Flags:=b.Flags or flStretched;
-//    Page.Objects.Add(b);
+    Page.Objects.Add(b);
 
     v := frCreateObject(gtMemo, '', Page);
     v.SetBounds(XPos, YPos, 20, 20);
@@ -333,7 +333,7 @@
     TfrMemoView(v).Frames:=frAllFrames;
     TfrMemoView(v).Layout:=tlTop;
     v.Memo.Add('[Header]');
-//    Page.Objects.Add(v);
+    Page.Objects.Add(v);
 
     YPos := YPos + 22;
 
@@ -342,13 +342,13 @@
     b.Dataset := FReportDataSet.Name;
     b.SetBounds(0, YPos, 1000, 18);
     b.Flags:=b.Flags or flStretched;
-//    Page.Objects.Add(b);
+    Page.Objects.Add(b);
 
     b := TfrBandView(frCreateObject(gtBand, '', Page));
     b.BandType := btCrossData;
     b.Dataset := FColumnDataSet.Name;
     b.SetBounds(XPos, 0, 20, 1000);
-//    Page.Objects.Add(b);
+    Page.Objects.Add(b);
 
     v := frCreateObject(gtMemo, '', Page);
     v.SetBounds(XPos, YPos, 20, 18);
@@ -357,7 +357,7 @@
     TfrMemoView(v).Font.Assign(FFont);
     TfrMemoView(v).Frames:=frAllFrames;
     TfrMemoView(v).Layout:=tlTop;
-//    Page.Objects.Add(v);
+    Page.Objects.Add(v);
 
     FDataSet.DisableControls;
     BM:=FDataSet.GetBookmark;
fix_26693.diff (14,551 bytes)

Jesus Reyes

2014-09-10 07:59

developer   ~0077020

The problem is the crosstab patch (r46125). t changed the semantics of the frCreateObject function. But something is not working everywhere.

There are at least two ways to fix it. (a) revert the change and (b) find the problem of the changed code.

The attached patch fix_26693 does (a). Just taking the change on lr_class.pas it makes the problem disappear. But for really fix it all units need to be updated. This patch tries to do it.

Lagunov Aleksey

2014-09-10 09:42

reporter  

lr.diff.rar (309 bytes)

Lagunov Aleksey

2014-09-10 09:43

reporter   ~0077025

Please - try my patch for fix error.
My mistake.

Jesus Reyes

2014-09-11 17:17

developer   ~0077089

Applied Aleksey's patch.
Thanks.

Issue History

Date Modified Username Field Change
2014-09-09 07:35 Jesus Reyes New Issue
2014-09-09 07:35 Jesus Reyes Status new => assigned
2014-09-09 07:35 Jesus Reyes Assigned To => Jesus Reyes
2014-09-09 07:36 Jesus Reyes Severity minor => block
2014-09-09 07:36 Jesus Reyes Description Updated View Revisions
2014-09-10 07:53 Jesus Reyes File Added: fix_26693.diff
2014-09-10 07:59 Jesus Reyes Note Added: 0077020
2014-09-10 09:42 Lagunov Aleksey File Added: lr.diff.rar
2014-09-10 09:43 Lagunov Aleksey Note Added: 0077025
2014-09-11 17:17 Jesus Reyes Fixed in Revision => 46178
2014-09-11 17:17 Jesus Reyes LazTarget - => 1.4
2014-09-11 17:17 Jesus Reyes Note Added: 0077089
2014-09-11 17:17 Jesus Reyes Status assigned => resolved
2014-09-11 17:17 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-09-11 17:17 Jesus Reyes Resolution open => fixed