Beiträge von ggerbi

    Some of our customer are requesting the ability to insert characters into their document that is created within WPTools, similiar to how they can in MS Word. To that end, I had added the TWPSymbolDlg control to our application.

    Unfortunately, the character set available does not include the desired characters. The grid in your dialog only appears to display characters from the Basic Latin and Latin-1 character sets. I need to use characters from the Latin Extended-A character set.

    I am using WPTools 5.47.5 and Delphi 2005.

    It appears that the TWPSymbolDlg control always uses the DEFAULT_CHARSET. I have not found a constant defined for the Latin Extended-A set.

    Is the issue caused by a lack of support for UNICODE? Or can I access these additonal characters in some way?

    We have upgraded to WPTools 5.47.5, and tested this issue. It still uses the formating of the first part of the document in the last section of the document.

    We have downloaded the demo, and built it using Delphi 2005. I did not see the purpose of using the Save+Load String button, or the WPT checkbox. Therefore, my testing did not utilize those controls. Without any changes to the demo code, we were seeing the same format problem as in our application. The preview within the demo looks correct, but the resulting RTF file created by the Save button results in the problem formatting seen in MS Word.

    After seeing the problem in the demo, I added code to insert more text when the new section is appended. When the RTF from this demo is viewed in Word, it also shows an additional blank page at the start of each section (in addition to the wrong layout of the last section).

    I am sending you an email containing the modified demo, and the resulting RTF files.

    We have recently upgraded from WPTools version 5.40 to 5.47.5. In testing this problem, we are still seeing that underline format is missing from part of the text under the circumstances stated above.

    For previews, we use the TWPPreview. For printers, we sometime use CutePDF as a printer and generate a PDF file. When doing either of these, or sending directly to a printer, the report is missing the underline for the dynamic portion of elements mentioned above.

    Julian,

    Upon further examination of your code, it appears that the reason our code broke is the change you made to the TWPPageProp.btnOKClick event.

    You added a try-finally, and are now calling ChangeApplied. The ChangeApplied in the finally block is invoking the OnChange event. Since version 5.40 was not calling ChangeApplied, the OnChange event did not get run when the TWPPageProp was viewed but not edited. Now the OnChange event is getting fired when the TWPPageProp is only viewed.

    Here is some more information about our problem. On Nov 24, 2008, your suggested code was

    Zitat

    if WPPagePropDlg.Execute.Execute then
    WPRichText.Modified := true;

    If I compiled WPPagePropDlg.Execute.Execute, I got an error.

    Therefore, I used

    Zitat

    if WPPagePropDlg.Execute then

    in my code with version 5.40 when it was working. This statement has not changed in our code.

    Was your original suggested fragment a mistake? Or should it compile with

    Zitat

    .Execute.Execute

    ?

    After implementing code similar to what you recommended on Nov 24, 2008, our program was working using WPTools 5.40. If we did not actually make any changes, our "changes were made" message dialog did not get displayed. This was true whether we clicked the OK button, Cancel button, or the X button to close the TWPPagePropDlg (GOOD). I installed version 5.47.5, and our program is again displaying our "changes were made" message when no changes have been made. But now it only occurs after the OK button is clicked.

    It appears that this newer version once again fires the OnChange event, which was not firing in 5.40. The OnChange event is making WPRichText.Modified := true and causes our message dialog to be displayed.

    Was this change accidental, or was it on purpose?

    How do you suggest we proceed?

    In version 5.40, we are still experiencing the issue where the dynamic portion of the text in a footer is not getting underlined. It is effecting the time portion of a date/time, as well as the pages portion of a "page of pages".

    If a report that contains the above mentioned data is previewed, printed to paper, or printed to PDF, the underlines are not present for the part of the footer mentioned above. If the same report is printed to RTF, the underlines are present when the RTF file is opened.

    We have a letter editor that may work with RTF letters or plain text emails, depending upon what is selected from a dropdown. When saving changes to any of the letters, a check is done to ensure that any email with content also has a Subject.

    We are using Editor.SaveToStream to save the editor content back to the appropriate letter/email whenever the combo box changed, or the Done button was clicked. In WPTools 4, this worked. In version 5.20.8, it has the following problem. If we delete the content of an email and its Subject, we receive a warning that no subject exists for an email with content.

    Code
    procedure TsViewEditFormLetterDialog.GetLetterFromEditor;var  lActiveLetter: TStringStream;begin  lActiveLetter := GetActiveLetter();  if StringIsNotEmpty(lActiveLetter.DataString) or StringIsNotEmpty(Editor.Text) then  begin    if fEditorIsInEditMode  then      Editor.SaveToStream(lActiveLetter)    else      fTemplateStorage.RTFText.SaveToStream(lActiveLetter);  end;end;

    We discovered that the blank email was still seen by the system to contain content because of the RTF codes that were still present after deleting all the words.

    I modified the code as shown below to special case the emails to use Editor.SaveToStream(s, 'ANSI').

    When using this code, lActiveLetter did NOT get emptied by the SaveToStream(lActiveletter, 'ANSI') statement when the Editor had no content.

    When SaveToStream is used with no parameters, the visible words DO get removed from lActiveletter when the Editor had no content.

    Is this a bug in the ANSI version of SaveToStream? It appears so to me.