Autor Thema: Kopieren von RichText Item verändert die Formatierung des RichText Item  (Gelesen 6410 mal)

Offline flaite

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 2.966
    • mein del.icio.us
Hi,

ist darüber etwas bekannt?
Wenn ich über notesDoc.appendRichTextItem(richTextItemAusAnderemDokument) ein RichText-Item kopiere, dann scheint dies in bestimmten wirren Fällen die Formatierung des RichTextItems zu ändern?

Z.B. wird Text in fontA.Bold zu Courier?

Axel
Ich stimm nicht mit allen überein, aber mit vielen und sowieso unterhaltsam -> https://www.youtube.com/channel/UCr9qCdqXLm2SU0BIs6d_68Q

---

Aquí no se respeta ni la ley de la selva.
(Hier respektiert man nicht einmal das Gesetz des Dschungels)

Nicanor Parra, San Fabian, Región del Bio Bio, República de Chile

Offline flaite

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 2.966
    • mein del.icio.us
hochinteressant:
http://www.openntf.org/Projects/codebin/codebin.nsf/CodeByDate/51431EB3A1BED88888256BDC000CBFD7

Hat jemand schon mal davon gehört?
Zitat
LotusScript Notes AppendRTItem Method - Copy RichtextItem Font Information Problem: When you use AppendRTItem to copy a rich text item, you will lose your font name attribute of the item.
[...]
Solution: Here is a workaround for this particular case. Before calling the AppendRTItem method, you must copy the $fonts item from the source document to the destination document.
Scheint tatsächlich so zu sein.
Ich kopiere ein RichTextItem aus einem anderen Dokument in das gerade geöffnete Dokument (mit dem entsprechenden Dokument wieder neu im Frontend reinladen Trick).
Nun geht aber bei diesem Kopieren die Fontinformation verloren, sobald in dem kopierten RichTextItem ein Font verwendet wird, den es im Zieldokument des Kopiervorgangs nicht gibt!!!
Ich hab den Trick mit dem $Fonts nicht ausprobiert und es sind da ja auch evtl. ungünstige Nebenwirkungen zu befürchten.
Was ich ausprobiert habe: Vor dem Aufrufen des Agenten, der das Kopieren durchführt, ein Wort in dem Font eingeben, der im später kopierten RTItem ist, speichern und Agenten Aufrufen.
Was passiert?
Das kopierte RichTextItem hat dann die korrekte Fontinformation.

Bitte. Das ist eine von Lotus äusserst schlampig implementierte Methode. Wieviel Methoden gibt es in den LotusScript-Klassen? 250 schätze ich.
Kann man da nicht erwarten, dass die es in 8 Jahren schaffen, diese wenigen Funktionen sauber zu implementieren?

Wie lange mache ich Notes-Programmierung? 7 Jahre schätze ich.
Ich hab das nicht gewusst.

Gruß Axel


Ich stimm nicht mit allen überein, aber mit vielen und sowieso unterhaltsam -> https://www.youtube.com/channel/UCr9qCdqXLm2SU0BIs6d_68Q

---

Aquí no se respeta ni la ley de la selva.
(Hier respektiert man nicht einmal das Gesetz des Dschungels)

Nicanor Parra, San Fabian, Región del Bio Bio, República de Chile

Glombi

  • Gast
Laut KBASE sollte es eigentlich gefixt sein. Ich stelle mal die Artikel hier ein:

Product Area:   Domino Designer, Notes   Date:   16.07.2001
Product Release:   Notes Client 4.6x, Notes Client 4.5x   Document #:   147944
Category:   Workstation/Desktop\\Application Development\\Macro/Agent/LotusScript      
.   This document is based on the following
   Software Problem Report(s):   About SPRs
SPR Number:
MBEN3AAS7D   SPR Status:
   Resolved/Fixed   Fixed in:
      Domino Designer 5.0, Notes Client 5.0

LotusScript Notes AppendRTItem Method Does not Preserve Font in New Document

Problem:

When you use AppendRTItem to copy a rich text item in Notes 4.5x/4.6x, the font name attribute of the item is lost.

For example, the code below copies an item successfully, keeping several text attributes (size and color), but it loses the font name.

Sub Click(Source As Button)
     Dim session As New NotesSession
     Dim workspace As New NOTESUIWORKSPACE
     Dim db As NOTESDATABASE
     Dim uidoc As NOTESUIDOCUMENT
     Dim doc As NOTESDOCUMENT
     Dim currentdoc As NOTESDOCUMENT
     Dim view As NOTESVIEW
     Dim memodoc As NOTESDOCUMENT
     Dim memodoc2 As NOTESDOCUMENT
     Dim item As Variant
     Dim item2 As Variant
     Dim richy As NOTESRICHTEXTITEM
     Set db = session.CURRENTDATABASE
     Set uidoc = workspace.CURRENTDOCUMENT
     Set memodoc = New NOTESDOCUMENT(db)
     Set memodoc2 = New NOTESDOCUMENT(db)
     Set currentdoc = uidoc.DOCUMENT
     memodoc.form = "Fax request"
     memodoc.subject = uidoc.FIELDGETTEXT("subject")
     memodoc2.form = "Fax request"
     Set item2 = currentdoc.GETFIRSTITEM("FaxBody")
     Set richy = New NOTESRICHTEXTITEM (Memodoc,"Body")
     Call richy.AddNewLine (1)     
     Call richy.APPENDRTITEM(item2)
     Call memodoc.save (True,True)     
End Sub

Solution:

This issue was reported to Lotus Quality Engineering, and was addressed in Notes 5.0 Client and Domino 5.0 Designer.

Here is a workaround for this particular case.  Before calling the AppendRTItem method, you must copy the $Fonts item from the source document to the destination document.

IMPORTANT NOTE:  The scripts above and below are provided only to illustrate one way this issue can occur.    Notes Support will not be able to customize these scripts for a customer's own configuration.

Sub Click(Source As Button)
     Dim session As New NotesSession
     Dim workspace As New NOTESUIWORKSPACE
     Dim db As NOTESDATABASE
     Dim uidoc As NOTESUIDOCUMENT
     Dim doc As NOTESDOCUMENT
     Dim currentdoc As NOTESDOCUMENT
     Dim view As NOTESVIEW
     Dim memodoc As NOTESDOCUMENT
     Dim memodoc2 As NOTESDOCUMENT
     Dim item As Variant
     Dim item2 As Variant
     Dim richy As NOTESRICHTEXTITEM
     Set db = session.CURRENTDATABASE
     Set uidoc = workspace.CURRENTDOCUMENT
     Set memodoc = New NOTESDOCUMENT(db)
     Set memodoc2 = New NOTESDOCUMENT(db)
     Set currentdoc = uidoc.DOCUMENT
     memodoc.form = "Fax request"
     memodoc.subject = uidoc.FIELDGETTEXT("subject")
     memodoc2.form = "Fax request"
     Set item2 = currentdoc.GETFIRSTITEM("FaxBody")
     Set richy = Memodoc.CREATERICHTEXTITEM("Body")
%REM
     'Here we copy the font information located in the $fonts item
%END REM     
     Set font = currentdoc.GETFIRSTITEM("$Fonts")
     Call font.CopyItemToDocument( memodoc, "" )
     Call richy.AddNewLine (1)
     Call richy.APPENDRTITEM(item2)
     Call memodoc.save (True,True)     
 End Sub

Glombi

  • Gast
und

Title:   
   Rich Text Fields That are Copied Using LotusScript Do Not Preserve Section Fonts
Product:   Lotus Notes  >  Lotus Notes  >  Versions 5.x, 4.x
Platform(s):   Platform Independent
Date:   13.01.2005
Doc Number:   1094020

Problem
An agent that uses LotusScript to copy a Rich Text Field from one document to another does not work as expected when the field contains Sections.   The copied field's font for the section's body and/or title is not the font set in the original field.  This occurs when using the following LotusScript methods to copy the information:

CopyItemToDocument (NotesItem class)
CopyAllitems (NotesDocument class)
AppendRTItem (NotesRichTextItem class)



Solution
This issue has been reported to Lotus Quality Engineering.

Note: Copying the $Fonts field from the source document does not work around this issue.

Supporting Information:

There was an AppendRTItem method issue in Notes Releases 4.x which was resolved in Notes R5.  More information on this issue can be found in document number 147944 () "LotusScript Notes AppendRTItem Method Does not Preserve Font in New Document".  This issue could be worked around by copying the $Fonts field from the old document to the new document.

Related Documents:

LotusScript Notes AppendRTItem Method Does not Preserve Font in New Document
Document #:  147944   

Font Changes to Bullet or Number List Are Lost after Save, or When Opening and Closing Section
Document #:  164985   

The NotesItem Class AppendRTItem Method Does Not Correctly Duplicate OLE Objects
Document #:  159909   

AppendRTItem Does Not Copy File Attachment That Has a Name Beginning with a Zero (0TEST.TIF)
Document #:  167853   

Glombi

  • Gast
Ich erinnere mich nun aber wieder, dass ich genau das Problem letztes Jahr bei einem Kunden unter R5 hatte. Damals habe ich dann die Methode mit dem $Fonts kopieren verwendet und es hat funktioniert.

Warum IBM das nicht schafft ist mir auch unklar. Rich Text Felder scheinen ja besonders tricky implementiert zu sein. So tröpfchenweise gibt es ja dann in jedem Release neue Klassen und Methoden.

Die hier sind fit was RTF betrifft:
http://www.geniisoft.com/showcase.nsf/Genii

Andreas

Offline Manfred Dillmann

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 857
  • Geschlecht: Männlich
    • www.madicon.de
Hallo zusammen,

ist dieses Problem unter ND6.x auch noch aufgetreten? Mir ist da nichts mehr aufgefallen...

Gruß
Manfred

Support, Beratung, Schulung, Anwendungsentwicklung oder Tipps & Tricks zu Lotus Notes/Domino?
www.madicon.de

Personalisierte Notes/Domino Serienmails?
madicon easyMail


Offline flaite

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 2.966
    • mein del.icio.us
Ist auch ein leicht falsches Forum, da mit 4.6 kompiliert.
So it-intensive Branchen wie Banken haben einfach kein Zeit für so Schnick-Schnack wie Domino 6 (Ironie). Wobei das Thema jetzt hier verschärft angegangen wird. Diese Upgrade-Langsamkeit (teilweise OS/2 verursacht) ist wirklich nicht mehr normal.
Jedenfalls vielen Dank für die Beiträge.
Mich wundert, dass es so lange (40 Minuten) gebraucht hab, bis ich über google endlich den entsprechenden Link gefunden habe.
Ich find das ziemlich gravierend und fundamental. Da sollte es mehr Referenzen geben.

Gruß Axel
« Letzte Änderung: 03.08.05 - 12:51:23 von kennwort »
Ich stimm nicht mit allen überein, aber mit vielen und sowieso unterhaltsam -> https://www.youtube.com/channel/UCr9qCdqXLm2SU0BIs6d_68Q

---

Aquí no se respeta ni la ley de la selva.
(Hier respektiert man nicht einmal das Gesetz des Dschungels)

Nicanor Parra, San Fabian, Región del Bio Bio, República de Chile

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz