View Issue Details

IDProjectCategoryView StatusLast Update
0033556LazarusLazReportpublic2018-04-12 20:30
ReporterLagunov AlekseyAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.9 (SVN)Product Build 
Target Version1.8.4Fixed in Version1.9 (SVN) 
Summary0033556: LazReport patch
Description1. In dialog controls fix drawing lrRadioGroup without caption
2. In lr_class fix wrap text on printing
3. In lr_class fix show on windows printer reports with russian characters in name
4. In lr_designer fix refresh data nspector
TagsNo tags attached.
Fixed in Revision57630
LazTarget1.8.4
Widgetset
Attached Files
  • lr.diff (3,561 bytes)
    Index: source/addons/DialogControls/lrdialogcontrols.pas
    ===================================================================
    --- source/addons/DialogControls/lrdialogcontrols.pas	(revision 57600)
    +++ source/addons/DialogControls/lrdialogcontrols.pas	(working copy)
    @@ -510,9 +510,11 @@
       AY:=DRect.Top + 3;
       aH:=Canvas.TextHeight('Wg');
     
    -  Canvas.TextRect(DRect, DRect.Left + 3, AY, Text);
    -  inc(AY, aH + 3);
    -
    +  if Text<>'' then
    +  begin
    +    Canvas.TextRect(DRect, DRect.Left + 3, AY, Text);
    +    inc(AY, aH + 3);
    +  end;
       i:=0;
     
       Details := ThemeServices.GetElementDetails(tbRadioButtonUncheckedNormal);
    Index: source/lr_class.pas
    ===================================================================
    --- source/lr_class.pas	(revision 57600)
    +++ source/lr_class.pas	(working copy)
    @@ -4168,7 +4168,7 @@
           Ts: TTextStyle;
         begin
           SetLength(str, Length(str) - 2);
    -      if str[Length(str)] = #1 then
    +      if (Str>'') and (str[Length(str)] = #1) then
             SetLength(str, Length(str) - 1);
           cury := 0;
     
    @@ -11608,10 +11608,18 @@
       {$IFDEF DebugLR}
       DebugPrnInfo('=== AFTER EMFPages[0]^');
       {$ENDIF}
    +
    +  {$IFDEF WINDOWS}
       if Title <> '' then
    +    Printer.Title:=UTF8ToWinCP(Format('%s',[Title]))
    +  else
    +    Printer.Title:=UTF8ToWinCP(Format('LazReport : %s',[sUntitled]));
    +  {$ELSE}
    +  if Title <> '' then
         Printer.Title:=Format('%s',[Title])
       else
         Printer.Title:=Format('LazReport : %s',[sUntitled]);
    +  {$ENDIF}
     
       Printer.BeginDoc;
       f:= True;
    Index: source/lr_dbcomponent.pas
    ===================================================================
    --- source/lr_dbcomponent.pas	(revision 57600)
    +++ source/lr_dbcomponent.pas	(working copy)
    @@ -115,6 +115,7 @@
       FDS.Name:=Name;
       FlrDBDataSet.Name:='_'+Name;
       FlrDataSource.Name:='ds'+Name;
    +  AfterChange;
     end;
     
     procedure TLRDataSetControl.AfterLoad;
    Index: source/lr_desgn.pas
    ===================================================================
    --- source/lr_desgn.pas	(revision 57600)
    +++ source/lr_desgn.pas	(working copy)
    @@ -553,6 +553,7 @@
         procedure DuplicateSelection;
         procedure ObjInspSelect(Obj:TObject);
         procedure ObjInspRefresh;
    +    procedure DataInspectorRefresh;
     
         procedure GetFontList;
         procedure SetMenuBitmaps;
    @@ -5312,6 +5313,12 @@
       {$ENDIF}
     end;
     
    +procedure TfrDesignerForm.DataInspectorRefresh;
    +begin
    +  if Assigned(lrFieldsList) then
    +    lrFieldsList.RefreshDSList;
    +end;
    +
     procedure TfrDesignerForm.ClB1Click(Sender: TObject);
     var p  : TPoint;
         t  : TfrView;
    @@ -5809,6 +5816,7 @@
       PageView.NPDrawSelection;
       PageView.NPDrawLayerObjects(0, TopSelected);
       ObjInspRefresh;
    +  DataInspectorRefresh;
     end;
     
     //Move selected object from front
    @@ -7967,9 +7975,6 @@
       FSaveGetPValue:TGetPValueEvent;
       FSaveFunEvent:TFunctionEvent;
       FSaveReportEvent: TSaveReportEvent;
    -
    -  ///***DocMode: (dmDesigning, dmPrinting);             // current mode
    -
     begin
       if (GetComponent(0) is TfrCustomMemoView) and Assigned(CurReport) then
       begin
    @@ -7987,7 +7992,7 @@
         FSaveView:=CurView;
         FSaveBand:=CurBand;
         FSavePage:=CurPage;
    -  // DocMode: (dmDesigning, dmPrinting);             // current mode
    +
         frDesigner:=nil;
     
         CurReport:=TfrReport.Create(nil);
    @@ -8012,7 +8017,6 @@
         FSaveReportEvent:=frDesignerComp.OnSaveReport;
         frDesignerComp.OnSaveReport:=@DoSaveReportEvent;
     
    -    //FDetailReport:=TStringStream.Create(Trim(FEditView.DetailReport.Text));
         try
           FDetailRrep.ReportBody.Position:=0;
           if FDetailRrep.ReportBody.Size > 0 then
    
    lr.diff (3,561 bytes)

Activities

Lagunov Aleksey

2018-04-04 08:00

reporter  

lr.diff (3,561 bytes)
Index: source/addons/DialogControls/lrdialogcontrols.pas
===================================================================
--- source/addons/DialogControls/lrdialogcontrols.pas	(revision 57600)
+++ source/addons/DialogControls/lrdialogcontrols.pas	(working copy)
@@ -510,9 +510,11 @@
   AY:=DRect.Top + 3;
   aH:=Canvas.TextHeight('Wg');
 
-  Canvas.TextRect(DRect, DRect.Left + 3, AY, Text);
-  inc(AY, aH + 3);
-
+  if Text<>'' then
+  begin
+    Canvas.TextRect(DRect, DRect.Left + 3, AY, Text);
+    inc(AY, aH + 3);
+  end;
   i:=0;
 
   Details := ThemeServices.GetElementDetails(tbRadioButtonUncheckedNormal);
Index: source/lr_class.pas
===================================================================
--- source/lr_class.pas	(revision 57600)
+++ source/lr_class.pas	(working copy)
@@ -4168,7 +4168,7 @@
       Ts: TTextStyle;
     begin
       SetLength(str, Length(str) - 2);
-      if str[Length(str)] = #1 then
+      if (Str>'') and (str[Length(str)] = #1) then
         SetLength(str, Length(str) - 1);
       cury := 0;
 
@@ -11608,10 +11608,18 @@
   {$IFDEF DebugLR}
   DebugPrnInfo('=== AFTER EMFPages[0]^');
   {$ENDIF}
+
+  {$IFDEF WINDOWS}
   if Title <> '' then
+    Printer.Title:=UTF8ToWinCP(Format('%s',[Title]))
+  else
+    Printer.Title:=UTF8ToWinCP(Format('LazReport : %s',[sUntitled]));
+  {$ELSE}
+  if Title <> '' then
     Printer.Title:=Format('%s',[Title])
   else
     Printer.Title:=Format('LazReport : %s',[sUntitled]);
+  {$ENDIF}
 
   Printer.BeginDoc;
   f:= True;
Index: source/lr_dbcomponent.pas
===================================================================
--- source/lr_dbcomponent.pas	(revision 57600)
+++ source/lr_dbcomponent.pas	(working copy)
@@ -115,6 +115,7 @@
   FDS.Name:=Name;
   FlrDBDataSet.Name:='_'+Name;
   FlrDataSource.Name:='ds'+Name;
+  AfterChange;
 end;
 
 procedure TLRDataSetControl.AfterLoad;
Index: source/lr_desgn.pas
===================================================================
--- source/lr_desgn.pas	(revision 57600)
+++ source/lr_desgn.pas	(working copy)
@@ -553,6 +553,7 @@
     procedure DuplicateSelection;
     procedure ObjInspSelect(Obj:TObject);
     procedure ObjInspRefresh;
+    procedure DataInspectorRefresh;
 
     procedure GetFontList;
     procedure SetMenuBitmaps;
@@ -5312,6 +5313,12 @@
   {$ENDIF}
 end;
 
+procedure TfrDesignerForm.DataInspectorRefresh;
+begin
+  if Assigned(lrFieldsList) then
+    lrFieldsList.RefreshDSList;
+end;
+
 procedure TfrDesignerForm.ClB1Click(Sender: TObject);
 var p  : TPoint;
     t  : TfrView;
@@ -5809,6 +5816,7 @@
   PageView.NPDrawSelection;
   PageView.NPDrawLayerObjects(0, TopSelected);
   ObjInspRefresh;
+  DataInspectorRefresh;
 end;
 
 //Move selected object from front
@@ -7967,9 +7975,6 @@
   FSaveGetPValue:TGetPValueEvent;
   FSaveFunEvent:TFunctionEvent;
   FSaveReportEvent: TSaveReportEvent;
-
-  ///***DocMode: (dmDesigning, dmPrinting);             // current mode
-
 begin
   if (GetComponent(0) is TfrCustomMemoView) and Assigned(CurReport) then
   begin
@@ -7987,7 +7992,7 @@
     FSaveView:=CurView;
     FSaveBand:=CurBand;
     FSavePage:=CurPage;
-  // DocMode: (dmDesigning, dmPrinting);             // current mode
+
     frDesigner:=nil;
 
     CurReport:=TfrReport.Create(nil);
@@ -8012,7 +8017,6 @@
     FSaveReportEvent:=frDesignerComp.OnSaveReport;
     frDesignerComp.OnSaveReport:=@DoSaveReportEvent;
 
-    //FDetailReport:=TStringStream.Create(Trim(FEditView.DetailReport.Text));
     try
       FDetailRrep.ReportBody.Position:=0;
       if FDetailRrep.ReportBody.Size > 0 then
lr.diff (3,561 bytes)

Jesus Reyes

2018-04-05 02:50

developer   ~0107620

Hi Aleksey!,

The change in Printer.Title seems suspicious, Printer.Title is supposed to be LCL and hold UTF8 enconding, maybe this requires a change in the windows printer backend?

Lagunov Aleksey

2018-04-05 07:34

reporter   ~0107623

In principle, this is logical. But is there any certainty that printers always work in UTF8 environments? Do not break compatibility for other developers?

Jesus Reyes

2018-04-09 00:32

developer   ~0107706

Yes, Printer.Title is definitively LCL and it should be encoded in UTF8, the changes you propose should be made in Printer4Lazarus windows backend, if that has been coded otherwise, it needs to be fixed.

Applied the patch with changes, please check.

Thank You.

Issue History

Date Modified Username Field Change
2018-04-04 08:00 Lagunov Aleksey New Issue
2018-04-04 08:00 Lagunov Aleksey File Added: lr.diff
2018-04-05 02:41 Jesus Reyes Assigned To => Jesus Reyes
2018-04-05 02:41 Jesus Reyes Status new => assigned
2018-04-05 02:50 Jesus Reyes LazTarget => -
2018-04-05 02:50 Jesus Reyes Note Added: 0107620
2018-04-05 02:50 Jesus Reyes Status assigned => feedback
2018-04-05 07:34 Lagunov Aleksey Note Added: 0107623
2018-04-05 07:34 Lagunov Aleksey Status feedback => assigned
2018-04-09 00:32 Jesus Reyes Fixed in Revision => 57630
2018-04-09 00:32 Jesus Reyes LazTarget - => 1.8.4
2018-04-09 00:32 Jesus Reyes Note Added: 0107706
2018-04-09 00:32 Jesus Reyes Status assigned => resolved
2018-04-09 00:32 Jesus Reyes Fixed in Version => 1.9 (SVN)
2018-04-09 00:32 Jesus Reyes Resolution open => fixed
2018-04-09 00:32 Jesus Reyes Target Version => 1.8.4
2018-04-12 20:30 Lagunov Aleksey Status resolved => closed