Changeset 15 for trunk/DbEngines


Ignore:
Timestamp:
Mar 22, 2018, 8:31:19 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Update Common and CollTranslator packages to fix build under Lazarus 1.8.
  • Fixed: Some memory leaks.
Location:
trunk/DbEngines
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DbEngines/UEngineMySQL.pas

    r14 r15  
    6969var
    7070  DbRows: TDbRows;
    71   DbRows2: TDbRows;
    7271  NewTable: TTable;
    7372  I: Integer;
  • trunk/DbEngines/UEngineXML.pas

    r13 r15  
    7777  while Assigned(Node2) and (Node2.NodeName = 'Value') and (I < Row.Values.Count) do begin
    7878    case TField(Row.Parent.Fields[I]).DataType.FieldType of
    79       ftString: TValueString(Row.Values[I]).Value := Node2.TextContent;
    80       ftInteger: TValueInteger(Row.Values[I]).Value := StrToInt(Node2.TextContent);
     79      ftString: TValueString(Row.Values[I]).Value := string(Node2.TextContent);
     80      ftInteger: TValueInteger(Row.Values[I]).Value := StrToInt(string(Node2.TextContent));
    8181      ftDateTime: if Node2.TextContent <> '' then
    82         TValueDateTime(Row.Values[I]).Value := XMLTimeToDateTime(Node2.TextContent);
    83       ftBoolean: TValueBoolean(Row.Values[I]).Value := StrToBool(Node2.TextContent);
     82        TValueDateTime(Row.Values[I]).Value := XMLTimeToDateTime(string(Node2.TextContent));
     83      ftBoolean: TValueBoolean(Row.Values[I]).Value := StrToBool(string(Node2.TextContent));
    8484    end;
    8585    Node2 := Node2.NextSibling;
     
    9797    Node.AppendChild(NewNode);
    9898    case TField(Row.Parent.Fields[I]).DataType.FieldType of
    99       ftString: NewNode.TextContent := TValueString(Row.Values[I]).Value;
    100       ftInteger: NewNode.TextContent := IntToStr(TValueInteger(Row.Values[I]).Value);
    101       ftDateTime: NewNode.TextContent := DateTimeToXMLTime(TValueDateTime(Row.Values[I]).Value);
    102       ftBoolean: NewNode.TextContent := BoolToStr(TValueBoolean(Row.Values[I]).Value);
    103       ftFloat: NewNode.TextContent := FloatToStr(TValueFloat(Row.Values[I]).Value);
     99      ftString: NewNode.TextContent := UnicodeString(TValueString(Row.Values[I]).Value);
     100      ftInteger: NewNode.TextContent := UnicodeString(IntToStr(TValueInteger(Row.Values[I]).Value));
     101      ftDateTime: NewNode.TextContent := UnicodeString(DateTimeToXMLTime(TValueDateTime(Row.Values[I]).Value));
     102      ftBoolean: NewNode.TextContent := UnicodeString(BoolToStr(TValueBoolean(Row.Values[I]).Value));
     103      ftFloat: NewNode.TextContent := UnicodeString(FloatToStr(TValueFloat(Row.Values[I]).Value));
    104104    end;
    105105  end;
     
    244244  NewNode: TDOMNode;
    245245begin
    246   ReadXMLFile(Doc, UTF8Decode(FileName));
     246  ReadXMLFile(Doc, FileName);
    247247  with Doc do try
    248248    if Doc.DocumentElement.NodeName <> 'MyData' then
     
    275275      SaveNodeTables(Database.Tables, NewNode);
    276276    end;
    277     ForceDirectoriesUTF8(ExtractFileDir(FileName));
    278     WriteXMLFile(Doc, UTF8Decode(FileName));
     277    ForceDirectories(ExtractFileDir(FileName));
     278    WriteXMLFile(Doc, FileName);
    279279  finally
    280280    Doc.Free;
Note: See TracChangeset for help on using the changeset viewer.