Symptom
A DataWindow in a PowerBuilder application is using Rich Text Format (RTF) based on older templates having input fields.
Sometimes, for example while printing several rich-text documents, the application appears to hang or becomes unresponsive with CPU going to 100%.
Environment
- PowerBuilder
- RTF Control or DataWindow
Reproducing the Issue
- Migrate a PowerBuilder 9 application containing RTF DataWindows having input fields
- Run the application
- Repeatedly print the RTF DataWindows
Cause
The issue can occur when using older versions of input field formats with current rich-text technology.
The build-in rich text control uses \txfielddef format for input fields like in the following example:
{\txfielddef
{\*\txfieldstart\txfieldtype0\txfieldflags128\txfielddata 7b00430046005f005300540052005f0050004c005a005f004f00520054007d000000}
{\*\txfieldtext Contrescarpe 75, 28195 Bremen{\*\txfieldend}}
Contrescarpe 75, 28195 Bremen
}
Older templates, giving problems, could possibly have been generated by much older versions of PowerBuilder like PowerBuilder 9.0 and the source might contain a different conflicting format for the input fields as in the following example:
{\field\fldlock
{\*\fldinst {\{CF_STR_PLZ_ORT\}}}
{\fldrslt{Contrescarpe 75, 28195 Bremen}}
}
Resolution
The rich-text code of the template needs to be corrected so that the format \txfielddef is used:
- Delete the old formats from the template
- Re-insert or newly generate the input fields with the current version of PowerBuilder