~ubuntu-branches/ubuntu/wily/scribus/wily-proposed

« back to all changes in this revision

Viewing changes to scribus/plugins/fileloader/scribus134format/scribus134format.cpp

  • Committer: Package Import Robot
  • Author(s): Oleksandr Moskalenko
  • Date: 2012-02-09 21:50:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120209215056-2wrx1ara0jbm7fi5
Tags: 1.4.0.dfsg+r17287-1
* New upstream stable release upload into Debian (Closes: #654703).
* Applied the Ubuntu armel patch.
* Removed non-free color swatches from resources.
* debian/control:
  - Moved icc-profiles from Recommends to Suggests (Closes: #655885).
  - Updated Standards-Version to 3.9.2.
  - Updated extended description per lintian warning.
* debian/rules:
  - Update mailcap (Closes: #630751). A request for mime.types update has
    been sent to the mime-support maintainer.
  - Added build-arch and build-indep targets per lintian warning.
* debian/patches:
  - top_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't install the non-free "doc" dir.
  - profiles_cmakelists.patch - don't install non-free sRGB profile.
* debian/copyright: 
  - Converted to the DEP5 machine readable foramt.
  - Added licenses for free color swatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
                m_Doc->documentInfo.setComments(dc.attribute("COMMENTS"));
293
293
                m_Doc->documentInfo.setKeywords(dc.attribute("KEYWORDS",""));
294
294
                m_Doc->documentInfo.setTitle(dc.attribute("TITLE"));
 
295
                m_Doc->documentInfo.setSubject(dc.attribute("SUBJECT"));
295
296
                m_Doc->documentInfo.setPublisher(dc.attribute("PUBLISHER", ""));
296
297
                m_Doc->documentInfo.setDate(dc.attribute("DOCDATE", ""));
297
298
                m_Doc->documentInfo.setType(dc.attribute("DOCTYPE", ""));
1031
1032
                                                {
1032
1033
                                                        Neu->itemText.insertChars(Neu->itemText.length(), SpecialChars::PARSEP);
1033
1034
                                                        ParagraphStyle newStyle;
1034
 
                                                        PrefsManager* prefsManager=PrefsManager::instance();
 
1035
                                                        //PrefsManager* prefsManager=PrefsManager::instance();
1035
1036
                                                        readParagraphStyle(newStyle, it, m_Doc);
1036
1037
                                                        Neu->itemText.setStyle(Neu->itemText.length()-1, newStyle);
1037
1038
                                                        Neu->itemText.setCharStyle(Neu->itemText.length()-1, 1, last->Style);
1039
1040
                                                else if (it.tagName() == "trail")
1040
1041
                                                {
1041
1042
                                                        ParagraphStyle newStyle;
1042
 
                                                        PrefsManager* prefsManager = PrefsManager::instance();
 
1043
                                                        //PrefsManager* prefsManager = PrefsManager::instance();
1043
1044
                                                        readParagraphStyle(newStyle, it, m_Doc);
1044
1045
                                                        Neu->itemText.setStyle(Neu->itemText.length(), newStyle);
1045
1046
                                                }
1270
1271
                                                {
1271
1272
                                                        Neu->itemText.insertChars(Neu->itemText.length(), SpecialChars::PARSEP);
1272
1273
                                                        ParagraphStyle newStyle;
1273
 
                                                        PrefsManager* prefsManager=PrefsManager::instance();
 
1274
                                                        //PrefsManager* prefsManager=PrefsManager::instance();
1274
1275
                                                        readParagraphStyle(newStyle, it, m_Doc);
1275
1276
                                                        Neu->itemText.setStyle(Neu->itemText.length()-1, newStyle);
1276
1277
                                                        Neu->itemText.setCharStyle(Neu->itemText.length()-1, 1, last->Style);
1278
1279
                                                else if (it.tagName() == "trail")
1279
1280
                                                {
1280
1281
                                                        ParagraphStyle newStyle;
1281
 
                                                        PrefsManager* prefsManager = PrefsManager::instance();
 
1282
                                                        //PrefsManager* prefsManager = PrefsManager::instance();
1282
1283
                                                        readParagraphStyle(newStyle, it, m_Doc);
1283
1284
                                                        Neu->itemText.setStyle(Neu->itemText.length(), newStyle);
1284
1285
                                                }
1542
1543
        m_Doc->setMasterPageMode(false);
1543
1544
        m_Doc->reformPages();
1544
1545
 
 
1546
        // Some old long doc may have page owner somewhat broken
 
1547
        m_Doc->fixItemPageOwner();
 
1548
 
1545
1549
        if (m_Doc->Layers.count() == 0)
1546
1550
                m_Doc->Layers.newLayer( QObject::tr("Background") );
1547
1551
 
1555
1559
                        {
1556
1560
                                PageItem * Its = m_Doc->DocItems.at(lc.key());
1557
1561
                                PageItem * Itn = m_Doc->DocItems.at(lc.value());
1558
 
                                if (Itn->prevInChain() || Its->nextInChain()) 
 
1562
                                if (!Its->testLinkCandidate(Itn))
1559
1563
                                {
1560
1564
                                        qDebug() << "scribus134format: corruption in linked textframes detected";
1561
1565
                                        continue;
1574
1578
                        {
1575
1579
                                PageItem * Its = m_Doc->MasterItems.at(lc.key());
1576
1580
                                PageItem * Itn = m_Doc->MasterItems.at(lc.value());
1577
 
                                if (Itn->prevInChain() || Its->nextInChain()) 
 
1581
                                if (!Its->testLinkCandidate(Itn))
1578
1582
                                {
1579
1583
                                        qDebug() << "scribus134format: corruption in linked textframes detected";
1580
1584
                                        continue;
1783
1787
                newStyle.setDefaultStyle(false);
1784
1788
 
1785
1789
        GetCharStyle(&it, doc, newStyle);
 
1790
 
 
1791
        // Check that a style is not its own parent
 
1792
        QString parentStyle = newStyle.parent();
 
1793
        if (parentStyle == newStyle.name())
 
1794
                newStyle.setParent(QString());
1786
1795
}
1787
1796
 
1788
1797
void Scribus134Format::GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo, bool VorLFound)
1983
1992
                vg.setDefaultStyle(true);
1984
1993
        else
1985
1994
                vg.setDefaultStyle(false);
 
1995
 
1986
1996
        QString parentStyle = pg.attribute("PARENT", "");
1987
 
        if (!parentStyle.isEmpty())
 
1997
        if (!parentStyle.isEmpty() && (parentStyle != vg.name()))
1988
1998
        {
1989
1999
                if (m_Doc->styleExists(parentStyle))
1990
2000
                        vg.setParent(parentStyle);
1991
2001
                else
1992
2002
                        vg.setParent(CommonStrings::DefaultParagraphStyle);
1993
2003
        }
 
2004
 
1994
2005
        if (pg.hasAttribute("LINESPMode"))
1995
2006
                vg.setLineSpacingMode(static_cast<ParagraphStyle::LineSpacingMode>(pg.attribute("LINESPMode").toInt()));
1996
2007
        if (pg.hasAttribute("LINESP"))
3048
3059
                                                {
3049
3060
                                                        Neu->itemText.insertChars(Neu->itemText.length(), SpecialChars::PARSEP);
3050
3061
                                                        ParagraphStyle newStyle;
3051
 
                                                        PrefsManager* prefsManager=PrefsManager::instance();
 
3062
                                                        //PrefsManager* prefsManager=PrefsManager::instance();
3052
3063
                                                        readParagraphStyle(newStyle, it, m_Doc);
3053
3064
                                                        Neu->itemText.setStyle(Neu->itemText.length()-1, newStyle);
3054
3065
                                                        Neu->itemText.setCharStyle(Neu->itemText.length()-1, 1, last->Style);
3056
3067
                                                else if (it.tagName() == "trail")
3057
3068
                                                {
3058
3069
                                                        ParagraphStyle newStyle;
3059
 
                                                        PrefsManager* prefsManager = PrefsManager::instance();
 
3070
                                                        //PrefsManager* prefsManager = PrefsManager::instance();
3060
3071
                                                        readParagraphStyle(newStyle, it, m_Doc);
3061
3072
                                                        Neu->itemText.setStyle(Neu->itemText.length(), newStyle);
3062
3073
                                                }
3390
3401
                                {
3391
3402
                                        PageItem * Its = m_Doc->DocItems.at(lc.key());
3392
3403
                                        PageItem * Itn = m_Doc->DocItems.at(itemRemap[lc.value()]);
3393
 
                                        if (Itn->prevInChain() || Its->nextInChain()) 
 
3404
                                        if (!Its->testLinkCandidate(Itn))
3394
3405
                                        {
3395
3406
                                                qDebug() << "scribus134format: corruption in linked textframes detected";
3396
3407
                                                continue;
3411
3422
                                {
3412
3423
                                        PageItem * Its = m_Doc->MasterItems.at(lc.key());
3413
3424
                                        PageItem * Itn = m_Doc->MasterItems.at(itemRemapM[lc.value()]);
3414
 
                                        if (Itn->prevInChain() || Its->nextInChain())
 
3425
                                        if (!Its->testLinkCandidate(Itn))
3415
3426
                                        {
3416
3427
                                                qDebug() << "scribus134format: corruption in linked textframes detected";
3417
3428
                                                continue;
3440
3451
        bool fou(false);
3441
3452
        QString tmV;
3442
3453
        const StyleSet<ParagraphStyle> * docParagraphStyles = tempStyles? tempStyles : & doc->paragraphStyles();
3443
 
        PrefsManager* prefsManager=PrefsManager::instance();
 
3454
        //PrefsManager* prefsManager=PrefsManager::instance();
3444
3455
        readParagraphStyle(*vg, *pg, doc);
3445
3456
        for (int xx=0; xx<docParagraphStyles->count(); ++xx)
3446
3457
        {