Basically what I'm suggesting is something like this:
Index: WPRteDefs.pas
===================================================================
--- WPRteDefs.pas (revision 9147)
+++ WPRteDefs.pas (working copy)
@@ -37219,7 +37219,7 @@
var par: TParagraph;
i, l, Flagvalue: Integer;
oldundo: Boolean;
- protmode: TWPProtectedMode;
+ protmode, disallowed_protmode: TWPProtectedMode;
par_table: TParagraph;
FOpenObjects: TList;
obj: TWPTextObj;
@@ -37278,6 +37278,10 @@
_SectionIsProtected := FALSE;
Result := FALSE;
+ if((par_s <> nil) and (par_s = par_e) and (par_s.CharCount > 0) and (pos_s >= 0) and (pos_s <= pos_e) and (pos_e <= par_s.CharCount)) then
+ disallowed_protmode := [wpNoOverwrite, wpNoDeleteChar]
+ else
+ disallowed_protmode := [wpNoOverwrite, wpNoDeletePar, wpNoDeleteChar];
if (par_s <> nil) and (par_e <> nil) and not OverrideProtection and
(ppAllExceptForEditFields in ProtectedProp) then
@@ -37334,7 +37338,7 @@
if par.CharCount = 0 then
begin
protmode := FRTFEngine.IsProtected(par, -1, true);
- if (protmode * [wpNoOverwrite, wpNoDeletePar, wpNoDeleteChar]) <> [] then
+ if (protmode * disallowed_protmode) <> [] then
begin
Result := TRUE;
_SectionIsProtected := TRUE;
@@ -37345,7 +37349,7 @@
while i < l do
begin
protmode := FRTFEngine.IsProtected(par, i, true);
- if ((protmode * [wpNoOverwrite, wpNoDeletePar, wpNoDeleteChar]) <> []) and
+ if ((protmode * disallowed_protmode) <> []) and
((ProtectedProp * [ppBookmarkKeepStructure, ppInsertpointKeepStructure]) <> []) then
begin
aObj := par.ObjectRef[i];
@@ -37360,7 +37364,7 @@
end;
end;
- if (protmode * [wpNoOverwrite, wpNoDeletePar, wpNoDeleteChar]) <> [] then
+ if (protmode * disallowed_protmode) <> [] then
begin
Result := TRUE;
_SectionIsProtected := TRUE;
Alles anzeigen
Regards
patrik.nyborg(a)genicore.se