Code: Select all
SRichViewEdit1.CanUpdate := False;
DeleteBlankLines(SRichViewEdit1.ActiveEditor.RVData);
SRichViewEdit1.ActiveEditor.ClearUndo;
SRichViewEdit1.Format;
SRichViewEdit1.CanUpdate := True;
Code: Select all
SRichViewEdit1.CanUpdate := False;
DeleteBlankLines(SRichViewEdit1.ActiveEditor.RVData);
SRichViewEdit1.ActiveEditor.ClearUndo;
SRichViewEdit1.Format;
SRichViewEdit1.CanUpdate := True;
Code: Select all
procedure MakeSoftLineBreaksEd(rve: TCustomRichViewEdit);
var ItemNo1, Offs1, ItemNo2, Offs2: Integer;
Whole, FR: Boolean;
i: Integer;
begin
rve := rve.TopLevelEditor;
if not rve.BeforeChange(False) then
exit;
rve.GetSelectionBounds(ItemNo1, Offs1, ItemNo2, Offs2, True);
Whole := (ItemNo1<0) or ((ItemNo1=ItemNo2) and (Offs1=Offs2));
if Whole then
begin
ItemNo1 := 0;
ItemNo2 := rve.ItemCount-1;
end
// ADDED
else
inc(ItemNo1);
// END ADDED
rve.BeginUndoGroup(rvutPara);
rve.SetUndoGroupMode(True);
if ItemNo1<1 then
ItemNo1 := 1;
for i := ItemNo2 downto ItemNo1 do
if rve.IsParaStart(i) and (rve.GetItemStyle(i)<>rvsListMarker) and
not rve.GetItem(i-1).GetBoolValue(rvbpFullWidth) then
TRVEditRVData(rve.RVData).Do_BR(i, True, FR);
rve.SetUndoGroupMode(False);
rve.Change;
rve.Reformat;
end;