~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/ipe/styles.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2005-02-24 22:09:16 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050224220916-9vxiiqjz066r5489
Tags: 6.0pre23-2
debian/control: Ipe should depend on exact version of libipe.
Closes: #296771.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "styles.h"
32
32
#include "ipeq.h"
33
33
#include "ipeiml.h"
34
 
#include "ipepdfdoc.h"
35
34
#include "ipestyle.h"
36
 
#include "debugwin.h"
 
35
#include "ipemodel.h"
37
36
 
38
37
#include <qwhatsthis.h>
39
38
#include <qlistbox.h>
52
51
  IpePagePresentation object.  Note that \c data is updated during the
53
52
  execution of the dialog, and must be discarded if the return value
54
53
  of exec() is not QDialog::Accepted. */
55
 
DialogStyles::DialogStyles(QWidget* parent, IpePdfDocument *doc)
 
54
DialogStyles::DialogStyles(QWidget* parent, IpeDocument *doc)
56
55
  : DlgStyles(parent, "dialogstyles", true), iDoc(doc)
57
56
{
58
57
  iDelButton->setAccel(Key_Delete);
98
97
    (QString::null, tr("XML files (*.xml)"), this);
99
98
  if (fn.isEmpty())
100
99
    return;
101
 
  if (!iDoc->AddStyleSheet(fn)) {
 
100
  if (!IpeModel::AddStyleSheet(iDoc, fn)) {
102
101
    ErrMsg(tr("Cannot open or parse file '%1', style sheet not added")
103
102
           .arg(fn));
104
103
    return;
151
150
  // check document
152
151
  IpeAttributeSeq seq;
153
152
  if (!iDoc->CheckStyle(seq)) {
 
153
    IpeString syms;
154
154
    for (IpeAttributeSeq::iterator it = seq.begin(); it != seq.end(); ++it)
155
 
      IPEDBG << "Undefined symbolic attribute '" <<
156
 
        iDoc->Repository()->String(*it) << "'\n";
157
 
    ErrMsg(tr("Removing this style sheet would cause some symbolic "
158
 
              "attributes in your document to become undefined.<br>"
159
 
              "See the message window for a list of these attributes.<br>"
160
 
              "The sheet has not been removed."));
 
155
      syms += iDoc->Repository()->String(*it) + ", ";
 
156
    ErrMsg(tr("Removing this style sheet would cause the following symbolic "
 
157
              "attributes in your document to become undefined:<br>")
 
158
           + QIpe(syms) +
 
159
           tr("<br>The sheet has not been removed."));
161
160
    // Undo operation
162
161
    if (cur == 0)
163
162
      iDoc->SetStyleSheet(delSheet);