~paulbrianstewart/ubuntu/oneiric/tellico/852247-Formatting-Fix

« back to all changes in this revision

Viewing changes to src/translators/tellicoxmlexporter.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Regis Boudin
  • Date: 2008-05-23 21:28:59 UTC
  • mfrom: (0.1.14 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20080523212859-n0gl4ap37xb0uj1a
Tags: 1.3.2-1
* New upstream release.
* Recommend khelpcenter for acces to the help (Closes: #478975).

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
TellicoXMLExporter::TellicoXMLExporter() : Exporter(),
46
46
      m_includeImages(false), m_includeGroups(false), m_widget(0) {
47
 
  setOptions(options() | Export::ExportImages); // not included by default
 
47
  setOptions(options() | Export::ExportImages | Export::ExportImageSize); // not included by default
48
48
}
49
49
 
50
50
TellicoXMLExporter::TellicoXMLExporter(Data::CollPtr coll) : Exporter(coll),
51
51
      m_includeImages(false), m_includeGroups(false), m_widget(0) {
52
 
  setOptions(options() | Export::ExportImages); // not included by default
 
52
  setOptions(options() | Export::ExportImages | Export::ExportImageSize); // not included by default
53
53
}
54
54
 
55
55
QString TellicoXMLExporter::formatString() const {
361
361
    imgElem.appendChild(dom_.createTextNode(QString::fromLatin1(imgText)));
362
362
  } else {
363
363
    const Data::ImageInfo& info = ImageFactory::imageInfo(id_);
364
 
    if(info.id.isEmpty()) {
 
364
    if(info.isNull()) {
365
365
      return;
366
366
    }
367
367
    imgElem.setAttribute(QString::fromLatin1("format"), info.format);
368
368
    imgElem.setAttribute(QString::fromLatin1("id"),     info.id);
369
 
    imgElem.setAttribute(QString::fromLatin1("width"),  info.width);
370
 
    imgElem.setAttribute(QString::fromLatin1("height"), info.height);
 
369
    // only load the images to read the size if necessary
 
370
    const bool loadImageIfNecessary = options() & Export::ExportImageSize;
 
371
    imgElem.setAttribute(QString::fromLatin1("width"),  info.width(loadImageIfNecessary));
 
372
    imgElem.setAttribute(QString::fromLatin1("height"), info.height(loadImageIfNecessary));
371
373
    if(info.linkOnly) {
372
374
      imgElem.setAttribute(QString::fromLatin1("link"), QString::fromLatin1("true"));
373
375
    }