Hi,
On Mon, Jun 15, 2009 at 10:16 AM, Ulrich Gerhardt<ulrich.gerhardt@...> wrote:
> I just tried twm's latest experimental GExperts branch. Unfortunately the
formatter doesn't
> work for me (using BDS2006) anymore. I stops by raising the exception "Unable
to get
> contents ...". AFAICT this is because IEditView.Block.Size equals 0 in
> GxOtaGetActiveEditorText and the function therefore returns False. If I
rewrite it to return
> True in this case, the formatter seems to work as expected. Does anybody else
have
> this effect? Is my "workaround" dangerous?
I haven't got BDS2006 but only Turbo Delphi pro. The formatter works
for me there, I just checked again to be sure.
I do find your workaround odd, though, because the formatter calls
that function with UseSelection=false, so it should alway execute the
else part of
if UseSelection and Assigned(IEditView) and
Assigned(IEditView.Block) and (IEditView.Block.Size > 0) then
begin
Lines.Text := GxOtaGetCurrentSelection(False);
Result := True;
end
else
begin
GxOtaLoadSourceEditorToUnicodeStrings(ISourceEditor, Lines);
Result := True;
end;
which returns true anyway.
twm