WPCubed Product Support

WPSTY_UPPERCASE (\caps) on Save

When loading RTF that contains:
\wpparflg32\plain\fs24\b\caps1 this line was typed in lowercase

when its displayed in an editor its in upper case as expected.
'THIS LINE WAS TYPED IN LOWERCASE'

I would like to save the RTF file with the case rendered as it was displayed like this:
\wpparflg32\plain\fs24\b\ THIS LINE WAS TYPED IN LOWERCASE

Is this already an option available in formatstrings? I've been unsuccessful with what is documented.

Regards,

#1 ♥ 0
5.3k Views 2 users read 2 min
support

Which WPTools is this?
In the current RTF Reader I see that it adds WPSTY_UPPERCASE which is also beeing saved.

#2 ♥ 0

Hello
The version is 6.29.

When the RTF contains \caps, eg.
\wpparflg32\plain\f1\fs24\b\caps1 section 1\f1\b0 : \f1\caps0 \par

It paints the paragraph in CAPS. However when I save as 'ANSI' it saves it in its original case 'section 1'.

I wanted to know if there was a way to load RTF and save RTF with the caps transform applied. Or apply the caps when saving to ANSI.

I am currently working around it like this:

procedure TRTFDoc.ReplaceCaseAttributes;
begin
  ReadOnly := False;
  BeginUpdate;  
  try
    CPPosition := 0;
    repeat
      if CPAttr.HasStyle(afsUppercaseStyle) then
      begin
        CPAttr.ExcludeStyle(afsUppercaseStyle);
        CPChar := upcase(CPChar);
      end;
    until not CPMoveNext;
  finally
    EndUpdate;
    Refresh;
  end;
end;
#3 ♥ 0
This category is archived. No new posts are possible.