MATLAB MATLAB REPORT GENERATOR - RELEASE NOTES Guide de l'utilisateur Page 463

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 986
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 462
mlreportgen.dom.Paragraph.clone
11-83
When you clone a paragraph, DOM copies all of the children objects of the source
paragraph, but not the parent of the paragraph.
The cloned paragraph includes formats that you set in the source paragraph. The
cloned paragraph formats use the same format objects as the source paragraph. If
you change the format setting in the shared format object, the source and cloned
paragraphs reflect that change.
If you change a format setting in the cloned paragraph, then DOM creates a new
format object for the cloned paragraph, using the new format setting. For that format,
the source and cloned paragraph no longer share the same format object.
This example shows the relationship between the formats for the source and cloned
paragraphs.
1
Create a paragraph that uses a style that sets the Bold and Italic formats to
true.
import mlreportgen.dom.*;
myReport = Document('myDoc','html');
p = Paragraph('This is a paragraph');
append(myReport,p);
MyStyle = {Bold,Italic};
p.Style = MyStyle;
p.Bold
ans =
1
p.Italic
ans =
1
2
Clone the paragraph. The Bold and Italic formats are the same as those of the
source paragraph.
pClone = clone(p);
pClone.Bold
ans =
1
Vue de la page 462
1 2 ... 458 459 460 461 462 463 464 465 466 467 468 ... 985 986

Commentaires sur ces manuels

Pas de commentaire