ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/IBCustomDataSet.pas
(Generate patch)

Comparing ibx/trunk/runtime/IBCustomDataSet.pas (file contents):
Revision 56 by tony, Mon Mar 6 10:20:02 2017 UTC vs.
Revision 60 by tony, Mon Mar 27 15:21:02 2017 UTC

# Line 1089 | Line 1089 | procedure TIBMemoField.SetAsString(const
1089   var s: RawByteString;
1090   begin
1091    s := AValue;
1092 <  if StringCodePage(Value) <> CodePage then
1092 >  if StringCodePage(s) <> CodePage then
1093      SetCodePage(s,CodePage,CodePage<>CP_NONE);
1094    inherited SetAsString(s);
1095   end;
# Line 1208 | Line 1208 | var
1208    s: RawByteString;
1209   begin
1210    Buffer := nil;
1211 <  IBAlloc(Buffer, 0, Size + 1);
1211 >  IBAlloc(Buffer, 0, DataSize);
1212    try
1213      s := Value;
1214      if StringCodePage(s) <> CodePage then
1215        SetCodePage(s,CodePage,CodePage<>CP_NONE);
1216 <    StrLCopy(Buffer, PChar(s), Size);
1216 >    StrLCopy(Buffer, PChar(s), DataSize-1);
1217      if Transliterate then
1218        DataSet.Translate(Buffer, Buffer, True);
1219      SetData(Buffer);
# Line 3819 | Line 3819 | begin
3819             their values }
3820            SQL_VARYING, SQL_TEXT:
3821            begin
3822 <            FirebirdAPI.CharSetWidth(getCharSetID,CharSetSize);
3823 <            CharSetName := FirebirdAPI.GetCharsetName(getCharSetID);
3824 <            FirebirdAPI.CharSetID2CodePage(getCharSetID,FieldCodePage);
3822 >            if not Database.Attachment.CharSetWidth(getCharSetID,CharSetSize) then
3823 >              CharSetSize := 1;
3824 >            CharSetName := Database.Attachment.GetCharsetName(getCharSetID);
3825 >            Database.Attachment.CharSetID2CodePage(getCharSetID,FieldCodePage);
3826              FieldSize := GetSize div CharSetSize;
3827              FieldType := ftString;
3828            end;
# Line 3883 | Line 3884 | begin
3884              FieldSize := sizeof (TISC_QUAD);
3885              if (getSubtype = 1) then
3886              begin
3887 <              FirebirdAPI.CharSetWidth(getCharSetID,CharSetSize);
3888 <              CharSetName := FirebirdAPI.GetCharsetName(getCharSetID);
3889 <              FirebirdAPI.CharSetID2CodePage(getCharSetID,FieldCodePage);
3887 >              if not Database.Attachment.CharSetWidth(getCharSetID,CharSetSize) then
3888 >                CharSetSize := 1;
3889 >              CharSetName := Database.Attachment.GetCharsetName(getCharSetID);
3890 >              Database.Attachment.CharSetID2CodePage(getCharSetID,FieldCodePage);
3891                FieldType := ftMemo;
3892              end
3893              else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines