Browse Source

--- Merging r14995 into '.':
U rtl/unix/cwstring.pp
U packages/iconvenc/src/iconvenc.pas
--- Merging r14996 into '.':
U packages/fcl-db/src/export/fpdbexport.pp
--- Merging r14999 into '.':
U packages/cairo/src/cairo.pp
--- Merging r15008 into '.':
U utils/fpdoc/dwlinear.pp
U utils/fpdoc/dw_latex.pp
U utils/fpdoc/dwriter.pp
U utils/fpdoc/dglobals.pp
U utils/fpdoc/dw_html.pp
--- Merging r15015 into '.':
A packages/paszlib/examples/extractodt.pas
--- Merging r15018 into '.':
U utils/rstconv.pp
--- Merging r15019 into '.':
U packages/graph/src/go32v2/vesa.inc
--- Merging r15021 into '.':
U packages/opengl/src/glu.pp
--- Merging r15022 into '.':
G packages/opengl/src/glu.pp

# revisions: 14995,14996,14999,15008,15015,15018,15019,15021,15022
------------------------------------------------------------------------
r14995 | jonas | 2010-03-09 10:58:14 +0100 (Tue, 09 Mar 2010) | 6 lines
Changed paths:
M /trunk/packages/iconvenc/src/iconvenc.pas
M /trunk/rtl/unix/cwstring.pp

o patch from Olivier for Haiku libiconv functionality (mantis #15906):
* Haiku's nl_langinfo implementation is now used under Haiku instead of
the BeOS stub.
* Fix linking to iconv in the iconvenc package. The prefix has change
since the previous Haiku's version.

------------------------------------------------------------------------
------------------------------------------------------------------------
r14996 | marco | 2010-03-09 17:02:10 +0100 (Tue, 09 Mar 2010) | 2 lines
Changed paths:
M /trunk/packages/fcl-db/src/export/fpdbexport.pp

* fixed memory leak in the general exporter class. (the -settings were not freed) mantis 15934

------------------------------------------------------------------------
------------------------------------------------------------------------
r14999 | ivost | 2010-03-10 10:49:28 +0100 (Wed, 10 Mar 2010) | 2 lines
Changed paths:
M /trunk/packages/cairo/src/cairo.pp

* added freepascal helper function

------------------------------------------------------------------------
------------------------------------------------------------------------
r15008 | michael | 2010-03-13 17:03:52 +0100 (Sat, 13 Mar 2010) | 1 line
Changed paths:
M /trunk/utils/fpdoc/dglobals.pp
M /trunk/utils/fpdoc/dw_html.pp
M /trunk/utils/fpdoc/dw_latex.pp
M /trunk/utils/fpdoc/dwlinear.pp
M /trunk/utils/fpdoc/dwriter.pp

* Added support for version tag (same level as errors or seealso tags
------------------------------------------------------------------------
------------------------------------------------------------------------
r15015 | marco | 2010-03-14 12:41:54 +0100 (Sun, 14 Mar 2010) | 2 lines
Changed paths:
A /trunk/packages/paszlib/examples/extractodt.pas

* unzipper unit basic extraction test. (related to mantis 15836)

------------------------------------------------------------------------
------------------------------------------------------------------------
r15018 | marco | 2010-03-14 18:23:05 +0100 (Sun, 14 Mar 2010) | 2 lines
Changed paths:
M /trunk/utils/rstconv.pp

* patch from Maxim Ganetsky for multiline messages (Mantis 10268)

------------------------------------------------------------------------
------------------------------------------------------------------------
r15019 | marco | 2010-03-14 23:28:07 +0100 (Sun, 14 Mar 2010) | 4 lines
Changed paths:
M /trunk/packages/graph/src/go32v2/vesa.inc

* Patch from mantis 11724 that translates some asm and voodoo code to cleaner pascal
at the expense of some extra vars. (probably solves problems caused
by oldfpcpascal change)

------------------------------------------------------------------------
------------------------------------------------------------------------
r15021 | marco | 2010-03-19 17:45:51 +0100 (Fri, 19 Mar 2010) | 2 lines
Changed paths:
M /trunk/packages/opengl/src/glu.pp

* added a warning about callback calling conventions in glu under Windows

------------------------------------------------------------------------
------------------------------------------------------------------------
r15022 | marco | 2010-03-19 18:10:07 +0100 (Fri, 19 Mar 2010) | 2 lines
Changed paths:
M /trunk/packages/opengl/src/glu.pp

* improved comment and added wiki link, due to Crossbuilders improvement remarks on IRC

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@15043 -

marco 15 years ago
parent
commit
d4d3b17705

+ 1 - 0
.gitattributes

@@ -4273,6 +4273,7 @@ packages/paszlib/Makefile.fpc svneol=native#text/plain
 packages/paszlib/examples/Makefile svneol=native#text/plain
 packages/paszlib/examples/Makefile.fpc svneol=native#text/plain
 packages/paszlib/examples/example.pas svneol=native#text/plain
+packages/paszlib/examples/extractodt.pas svneol=native#text/plain
 packages/paszlib/examples/minigzip.pas svneol=native#text/plain
 packages/paszlib/examples/miniunz.pas svneol=native#text/plain
 packages/paszlib/examples/minizip.pas svneol=native#text/plain

+ 15 - 1
packages/cairo/src/cairo.pp

@@ -52,7 +52,9 @@ unit Cairo;
 
 interface
 
-Uses CTypes;
+Uses
+  Classes,
+  CTypes;
 
 const
 {$ifdef win32}
@@ -639,6 +641,10 @@ function  cairo_svg_version_to_string(version: cairo_svg_version_t): PChar; cdec
 
 procedure cairo_debug_reset_static_data; cdecl; external LIB_CAIRO;
 
+
+(* FreePascal helpers *)
+function cairo_write_fpstream_func(closure: Pointer; data: PByte; length: LongWord): cairo_status_t; cdecl;
+
 implementation
 
 procedure cairo_version(out major, minor, micro: LongInt);
@@ -651,4 +657,12 @@ begin
   micro := (version mod ((major * 10000) + (minor * 100)));
 end;
 
+function cairo_write_fpstream_func(closure: Pointer; data: PByte; length: LongWord): cairo_status_t; cdecl;
+var
+  Stream: TStream absolute closure;
+begin
+  Stream.Write(data^, length);
+  Result := CAIRO_STATUS_SUCCESS;
+end;
+
 end.

+ 1 - 0
packages/fcl-db/src/export/fpdbexport.pp

@@ -676,6 +676,7 @@ end;
 destructor TCustomDatasetExporter.Destroy;
 begin
   FreeAndNil(FExportFields);
+  FreeAndNil(FFormatSettings);
   inherited Destroy;
 end;
 

+ 33 - 39
packages/graph/src/go32v2/vesa.inc

@@ -337,34 +337,17 @@ end;
        SearchVESAModes := ModeSupported;
     end;
 
-
-
-  procedure SetBankIndex(win: byte; BankNr: smallint); assembler;
-   asm
-{$IFDEF REGCALL}
-     mov  bl, al
-{$ELSE REGCALL}
-     mov  bl,[Win]
-{$ENDIF REGCALL}
-     mov  ax,4f05h
-     mov  bh,00h
-{$IFNDEF REGCALL}
-     mov  dx,[BankNr]
-{$ENDIF REGCALL}
-{$ifdef fpc}
-     push ebp
-     push esi
-     push edi
-     push ebx
-{$endif fpc}
-     int  10h
-{$ifdef fpc}
-     pop ebx
-     pop edi
-     pop esi
-     pop ebp
-{$endif fpc}
-   end ['EDX','EBX','EAX'];
+procedure SetBankIndex(win: byte; BankNr: smallint);
+{I don't know why but the previous assembler version changed by some mechanism
+ unknown to me some places in memory what lead to changing some variables not
+ belonging to this procedure (Laaca)}
+var r:TDPMIregisters;
+begin
+  r.ax:=$4f05;
+  r.bx:=win;
+  r.dx:=BankNr;
+  RealIntr($10,r);
+end;
 
   {********************************************************}
   { There are two routines for setting banks. This may in  }
@@ -1318,6 +1301,9 @@ end;
   procedure PutPixVESA32kOr64k(x, y : smallint; color : word); {$ifndef fpc}far;{$endif fpc}
   var
      offs : longint;
+     place: word;
+     bank : shortint;
+
   begin
 {$ifdef logging}
      logln('putpixvesa32kor64k('+strf(x)+','+strf(y)+')');
@@ -1334,11 +1320,14 @@ end;
      end;
      Y := Y + YOffset; { adjust pixel for correct virtual page }
      offs := longint(y) * BytesPerLine + 2*x;
-     SetWriteBank(smallint(offs shr 16));
+     bank := offs div 65536;
+     place:= offs mod 65536;
+     SetWriteBank(bank);
+
 {$ifdef logging}
      logln('putpixvesa32kor64k offset: '+strf(word(offs)));
 {$endif logging}
-     memW[WinWriteSeg : word(offs)] := color;
+     memW[WinWriteSeg : place] := color;
   end;
 
   function GetPixVESA32kOr64k(x, y : smallint): word; {$ifndef fpc}far;{$endif fpc}
@@ -1355,29 +1344,34 @@ end;
   procedure DirectPutPixVESA32kOr64k(x, y : smallint); {$ifndef fpc}far;{$endif fpc}
   var
      offs : longint;
-     col : word;
+     bank : smallint;
+     place,col : word;
   begin
 {$ifdef logging}
      logln('directputpixvesa32kor64k('+strf(x)+','+strf(y)+')');
 {$endif logging}
      y:= Y + YOffset;
+
      offs := longint(y) * BytesPerLine + 2*x;
-     SetWriteBank(smallint((offs shr 16) and $ff));
+     bank:=offs div 65536;
+     place:=offs mod 65536;
+
+     SetWriteBank(bank and $FF); // unknown why this and $FF is here.
      Case CurrentWriteMode of
        XorPut:
          Begin
-           SetReadBank(smallint(offs shr 16));
-           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] xor currentcolor;
+           SetReadBank(bank);
+           memW[WinWriteSeg : place] := memW[WinReadSeg : place] xor currentcolor;
          End;
        AndPut:
          Begin
-           SetReadBank(smallint(offs shr 16));
-           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] And currentcolor;
+           SetReadBank(bank);
+           memW[WinWriteSeg : place] := memW[WinReadSeg : place] And currentcolor;
          End;
        OrPut:
          Begin
-           SetReadBank(smallint(offs shr 16));
-           memW[WinWriteSeg : word(offs)] := memW[WinReadSeg : word(offs)] or currentcolor;
+           SetReadBank(bank);
+           memW[WinWriteSeg : place] := memW[WinReadSeg : place] or currentcolor;
          End
        else
          Begin
@@ -1387,7 +1381,7 @@ end;
 {$ifdef logging}
            logln('directputpixvesa32kor64k offset: '+strf(word(offs)));
 {$endif logging}
-           memW[WinWriteSeg : word(offs)] := Col;
+           memW[WinWriteSeg : place] := Col;
          End
      End;
   end;

+ 1 - 1
packages/iconvenc/src/iconvenc.pas

@@ -59,7 +59,7 @@ Const
   {$endif}
 {$endif}
 
-{$if defined(darwin) and defined(cpupowerpc32)}
+{$if (defined(darwin) and defined(cpupowerpc32)) or defined(haiku)}
   iconvprefix='lib';  
 {$else}
   iconvprefix='';

+ 11 - 0
packages/opengl/src/glu.pp

@@ -52,6 +52,17 @@ Abstract:
 { For the latest updates, visit Delphi3D: http://www.delphi3d.net              }
 {******************************************************************************}
 
+
+{******************************************************************************}
+{  									       }
+{ WARNING: CALLBACKS TYPES IN THIS UNIT (TCALLBACK) ARE SOMETIMES CDECL AND    }
+{ SOMETIMES STDCALL, DEPENDING ON THE EXACT DLL USED. THE MOST COMMON ONE SEEMS}
+{ TO USE STDCALL. THIS IS VERIFIED TO BE THE CASE FOR THE TESSELATOR ROUTINES  }
+{ BUT PROBABLY ALSO APPLIES TO THE OTHER CALLBACKS IN THIS UNIT                }               
+{ FOR UP TO DATE INFO SEE http://wiki.freepascal.org/OpenGL                    }
+{                                                                              }
+{******************************************************************************}
+
 {$MACRO ON}
 {$MODE Delphi}
 {$IFDEF Windows}

+ 30 - 0
packages/paszlib/examples/extractodt.pas

@@ -0,0 +1,30 @@
+program ExtractODT;
+// minimal function test zipper unit (related to mantis 15836)
+
+{$mode objfpc}{$H+}
+
+Uses Zipper,sysutils;
+
+procedure usage;
+begin
+  Writeln('ExtractOdt <filename>');
+  halt;
+end;
+
+var unzipper : TUnzipper;
+    EDir,
+    FileName : string;
+begin
+  if paramcount<1 then
+    Usage;
+  FileName:=paramstr(1);
+  if not fileexists(FileName) then
+    Usage;
+  edir:=extractfilename(filename)+'extractiondir';
+  mkdir(edir);
+  unzipper:=TUnzipper.create;
+  unzipper.FileName:=FileName;
+  unzipper.outputpath:=edir;
+  unzipper.UnzipAllFiles;
+ 
+end.

+ 9 - 3
rtl/unix/cwstring.pp

@@ -29,6 +29,7 @@ implementation
 {$if not defined(linux) and not defined(solaris)}  // Linux (and maybe glibc platforms in general), have iconv in glibc.
  {$if defined(haiku)}
    {$linklib textencoding}
+   {$linklib locale}
  {$else}
    {$linklib iconv}
  {$endif}
@@ -132,8 +133,13 @@ type
   piconv_t = ^iconv_t;
   iconv_t = pointer;
   nl_item = cint;
-{$ifndef beos}
-function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
+
+{$ifdef haiku}
+  function nl_langinfo(__item:nl_item):pchar;cdecl;external 'locale' name 'nl_langinfo';
+{$else}
+  {$ifndef beos}
+  function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
+  {$endif}
 {$endif}
 
 {$if (not defined(bsd) and not defined(beos)) or (defined(darwin) and not defined(cpupowerpc32))}
@@ -153,7 +159,7 @@ threadvar
   iconv_ansi2wide,
   iconv_wide2ansi : iconv_t;
 
-{$ifdef beos}
+{$if defined(beos) and not defined(haiku)}
 function nl_langinfo(__item:nl_item):pchar;
 begin
   {$warning TODO BeOS nl_langinfo or more uptodate port of iconv...}

+ 10 - 0
utils/fpdoc/dglobals.pp

@@ -55,6 +55,7 @@ resourcestring
   SDocDeclaration            = 'Declaration';
   SDocDescription            = 'Description';
   SDocErrors                 = 'Errors';
+  SDocVersion                = 'Version info';
   SDocSeeAlso                = 'See also';
   SDocExample                = 'Example';
   SDocArguments              = 'Arguments';
@@ -208,6 +209,8 @@ type
     members, and so on...
   }
 
+  { TDocNode }
+
   TDocNode = class
   private
     FFirstChild, FNextSibling: TDocNode;
@@ -222,6 +225,7 @@ type
     FLink: String;
     FTopicNode : Boolean;
     FRefCount : Integer;
+    FVersion: TDomElement;
   public
     constructor Create(const AName: String; ANode: TDOMElement);
     destructor Destroy; override;
@@ -239,6 +243,7 @@ type
     property ShortDescr: TDOMElement read FShortDescr;
     property Descr: TDOMElement read FDescr;
     property ErrorsDoc: TDOMElement read FErrorsDoc;
+    Property Version : TDomElement Read FVersion;
     property SeeAlso: TDOMElement read FSeeAlso;
     property FirstExample: TDOMElement read FFirstExample;
     property Link: String read FLink;
@@ -1044,6 +1049,11 @@ procedure TFPDocEngine.AddDocFile(const AFilename: String);
           Result.FShortDescr := TDOMElement(Subnode)
         else if Subnode.NodeName = 'descr' then
           Result.FDescr := TDOMElement(Subnode)
+        else if Subnode.NodeName = 'version' then
+          begin
+          Writeln('Detected version',ELement['name']);
+          Result.FVersion := TDOMElement(Subnode)
+          end
         else if Subnode.NodeName = 'errors' then
           Result.FErrorsDoc := TDOMElement(Subnode)
         else if Subnode.NodeName = 'seealso' then

+ 4 - 0
utils/fpdoc/dw_html.pp

@@ -2148,6 +2148,10 @@ begin
     if Assigned(DocNode.ErrorsDoc) then
       AppendDescrSection(AElement, BodyElement, DocNode.ErrorsDoc, SDocErrors);
 
+    // Append Version info
+    if Assigned(DocNode.Version) then
+      AppendDescrSection(AElement, BodyElement, DocNode.Version, SDocVersion);
+
     // Append "See also" section
     AppendSeeAlsoSection(AElement,DocNode);
 

+ 6 - 0
utils/fpdoc/dw_latex.pp

@@ -58,6 +58,7 @@ Type
     Procedure StartDescription; override;
     Procedure StartAccess; override;
     Procedure StartErrors; override;
+    Procedure StartVersion; override;
     Procedure StartSeealso; override;
     Procedure EndSeealso; override;
     procedure StartUnitOverview(AModuleName,AModuleLabel : String);override;
@@ -597,6 +598,11 @@ begin
   Writeln('\Errors');
 end;
 
+procedure TLaTeXWriter.StartVersion;
+begin
+  Writeln('\VersionInfo');
+end;
+
 Procedure TLatexWriter.StartAccess;
 
 begin

+ 74 - 26
utils/fpdoc/dwlinear.pp

@@ -16,6 +16,7 @@ Type
     Module: TPasModule;
     ModuleName: String;
     FLastURL : DomString;
+  private
   Protected
     // Writing support.
     procedure Write(const s: String); virtual;
@@ -54,6 +55,7 @@ Type
     Procedure StartDescription; Virtual;
     Procedure StartAccess; Virtual;
     Procedure StartErrors; Virtual;
+    Procedure StartVersion; Virtual;
     Procedure StartSeealso; Virtual;
     Procedure EndSeealso; Virtual;
     // Procedures which MUST be overridden in descendents;
@@ -305,6 +307,13 @@ begin
   Writeln(SDocErrors+':');
 end;
 
+Procedure TLinearWriter.StartVersion;
+
+begin
+  Writeln('');
+  Writeln(SDocVersion+':');
+end;
+
 Procedure TLinearWriter.StartSeealso;
 
 begin
@@ -353,7 +362,12 @@ begin
     (not IsDescrNodeEmpty(DocNode.ShortDescr))) then
   begin
     StartSubSection(SDocDescription);
-    WriteDescr(ClassDecl);
+    WriteDescr(ClassDecl,DocNode);
+    If Assigned(DocNode.Version) then
+      begin
+      StartSubSection(SDocVersion);
+      WriteDescr(ClassDecl,DocNode.Version);
+      end;
   end;
 
   // Write method overview
@@ -539,6 +553,7 @@ procedure TLinearWriter.WriteResourceStrings(ASection: TPasSection);
 var
   ResStrDecl: TPasResString;
   i: Integer;
+  DocNode : TDocNode;
 begin
   if ASection.ResStrings.Count > 0 then
   begin
@@ -551,7 +566,12 @@ begin
       EndListing;
       WriteLabel(ResStrDecl);
       WriteIndex(ResStrDecl);
-      WriteDescr(ResStrDecl);
+      DocNode:=WriteDescr(ResStrDecl);
+      If Assigned(DocNode) and Assigned(DocNode.Version) then
+        begin
+        Writeln(Format('%s : ',[SDocVersion]));
+        WriteDescr(ResStrDecl, DocNode.Version);
+        end;
     end;
   end;
 end;
@@ -743,8 +763,13 @@ begin
         WriteENumElements(TypeDecl as TPasEnumType);
         end;
       WriteDescr(TypeDecl);
+      If Assigned(DocNode) and Assigned(DocNode.Version) then
+        begin
+        Writeln(Format('%s : ',[SDocVersion]));
+        WriteDescr(TypeDecl, DocNode.Version);
+        end;
       DescrEndParaGraph;
-    end;
+      end;
   end;
 end;
 
@@ -752,6 +777,8 @@ procedure TLinearWriter.WriteVars(ASection: TPasSection);
 var
   VarDecl: TPasVariable;
   i: Integer;
+  DocNode : TDocNode;
+
 begin
   if ASection.Variables.Count > 0 then
   begin
@@ -765,7 +792,12 @@ begin
       EndListing;
       WriteLabel(VarDecl);
       WriteIndex(VarDecl);
-      WriteDescr(VarDecl);
+      DocNode:=WriteDescr(VarDecl);
+      If Assigned(DocNode) and Assigned(DocNode.Version) then
+        begin
+        Writeln(Format('%s : ',[SDocVersion]));
+        WriteDescr(VarDecl, DocNode.Version);
+        end;
       DescrEndParaGraph;
     end;
   end;
@@ -817,19 +849,27 @@ begin
       StartVisibility;
       Writeln(VisibilityNames[Visibility])
       end;
-    if Assigned(DocNode) and Assigned(DocNode.Descr) then
-      begin
-      StartDescription;
-      WriteDescr(ProcDecl);
-      end;
-    if Assigned(DocNode) and Assigned(DocNode.ErrorsDoc) then
+    if Assigned(DocNode) then
       begin
-      StartErrors;
-      WriteDescr(ProcDecl, DocNode.ErrorsDoc);
+      If Assigned(DocNode.Descr) then
+        begin
+        StartDescription;
+        WriteDescr(ProcDecl);
+        end;
+      if Assigned(DocNode.ErrorsDoc) then
+        begin
+        StartErrors;
+        WriteDescr(ProcDecl, DocNode.ErrorsDoc);
+        end;
+      if Assigned(DocNode.Version) then
+        begin
+        StartVersion;
+        WriteDescr(ProcDecl, DocNode.Version);
+        end;
+      WriteSeeAlso(DocNode);
+      EndProcedure;
+      WriteExample(DocNode);
       end;
-    WriteSeeAlso(DocNode);
-    EndProcedure;
-    WriteExample(DocNode);
     end;
 end;
 
@@ -910,19 +950,27 @@ begin
       S:=S+'Write';
       end;
     Writeln(S);
-    if Assigned(DocNode) and Assigned(DocNode.Descr) then
+    if Assigned(DocNode) then
       begin
-      StartDescription;
-      WriteDescr(PropDecl);
-      end;
-    if Assigned(DocNode) and Assigned(DocNode.ErrorsDoc) then
-      begin
-      StartErrors;
-      WriteDescr(PropDecl, DocNode.ErrorsDoc);
+      if Assigned(DocNode.Descr) then
+        begin
+        StartDescription;
+        WriteDescr(PropDecl);
+        end;
+      if Assigned(DocNode.ErrorsDoc) then
+        begin
+        StartErrors;
+        WriteDescr(PropDecl, DocNode.ErrorsDoc);
+        end;
+      if Assigned(DocNode.Version) then
+        begin
+        StartVersion;
+        WriteDescr(PropDecl, DocNode.Version);
+        end;
+      WriteSeeAlso(DocNode);
+      EndProperty;
+      WriteExample(DocNode);
       end;
-    WriteSeeAlso(DocNode);
-    EndProperty;
-    WriteExample(DocNode);
     end;
 end;
 

+ 4 - 3
utils/fpdoc/dwriter.pp

@@ -158,7 +158,7 @@ type
     Function InterpretOption(Const Cmd,Arg : String) : Boolean; Virtual;
     Class Procedure Usage(List : TStrings); virtual;
     procedure WriteDoc; virtual; Abstract;
-    procedure WriteDescr(Element: TPasElement);
+    Function WriteDescr(Element: TPasElement) : TDocNode;
     procedure WriteDescr(Element: TPasElement; DocNode: TDocNode);
     procedure WriteDescr(AContext: TPasElement; DescrNode: TDOMElement); virtual;
     Procedure FPDocError(Msg : String);
@@ -1038,10 +1038,11 @@ begin
   Inherited;
 end;
 
-procedure TFPDocWriter.WriteDescr(Element: TPasElement);
+Function TFPDocWriter.WriteDescr(Element: TPasElement) : TDocNode;
 
 begin
-  WriteDescr(ELement,Engine.FindDocNode(Element));
+  Result:=Engine.FindDocNode(Element);
+  WriteDescr(ELement,Result);
 end;
 
 procedure TFPDocWriter.WriteDescr(Element: TPasElement; DocNode: TDocNode);

+ 13 - 1
utils/rstconv.pp

@@ -168,7 +168,19 @@ begin
 
     // Write msg entry
     WriteLn(f, '#: ', item.ModuleName, ':', item.ConstName);
-    WriteLn(f, 'msgid "', s, '"');
+    j := Pos('\n', s);
+    if j > 0 then begin
+      WriteLn(f, 'msgid ""');
+      while j > 0 do begin
+        Writeln(f, '"',copy(s, 1, j+1),'"');
+        Delete(s, 1, j+1);
+        j := Pos('\n', s);
+      end;
+      if s <> '' then
+        Writeln(f, '"',s,'"');
+    end
+    else
+      WriteLn(f, 'msgid "', s, '"');
     WriteLn(f, 'msgstr ""');
     WriteLn(f);
   end;