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

« back to all changes in this revision

Viewing changes to scribus/plugins/gettext/htmlim/htmlreader.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:
47
47
        inH1 = false;
48
48
        inH2 = false;
49
49
        inH3 = false;
 
50
        inH4 = false;
 
51
        inH5 = false;
 
52
        inH6 = false;
50
53
        inA = false;
51
54
        inCode = false;
52
55
        inBody = false;
79
82
        pstyleli->setName("HTML_li_level-0");
80
83
        listStyles.push_back(pstyleli);
81
84
        nextItemNumbers.push_back(1);
 
85
        pstyleh6 = new gtParagraphStyle(*pstyle);
 
86
        pstyleh6->getFont()->setSize(pstyle->getFont()->getSize() + 2.5);
 
87
        pstyleh6->getFont()->setWeight(BOLD);
 
88
        pstyleh6->setSpaceAbove(2.5);
 
89
        pstyleh6->setSpaceBelow(1.25);
 
90
        pstyleh6->setName("HTML_h6");
 
91
        pstyleh5 = new gtParagraphStyle(*pstyle);
 
92
        pstyleh5->getFont()->setSize(pstyle->getFont()->getSize() + 5);
 
93
        pstyleh5->getFont()->setWeight(BOLD);
 
94
        pstyleh5->setSpaceAbove(5.0);
 
95
        pstyleh5->setSpaceBelow(2.5);
 
96
        pstyleh5->setName("HTML_h5");
82
97
        pstyleh4 = new gtParagraphStyle(*pstyle);
83
98
        pstyleh4->getFont()->setSize(pstyle->getFont()->getSize() + 10);
84
99
        pstyleh4->getFont()->setWeight(BOLD);
182
197
                inH3 = true;
183
198
        else if (name == "h4")
184
199
                inH4 = true;
 
200
        else if (name == "h5")
 
201
                inH5 = true;
 
202
        else if (name == "h6")
 
203
                inH6 = true;
185
204
        else if ((name == "b") || (name == "strong"))
186
205
                setBoldFont();
187
206
        else if ((name == "i") || (name == "em"))
287
306
                        writer->append(tmp, pstyleh3);
288
307
                else if (inH4)
289
308
                        writer->append(tmp, pstyleh4);
 
309
                else if (inH5)
 
310
                        writer->append(tmp, pstyleh5);
 
311
                else if (inH6)
 
312
                        writer->append(tmp, pstyleh6);
290
313
                else if (inCenter)
291
314
                        writer->append(tmp, pstylec);
292
315
                else if (inCode)
406
429
        else if (name == "h1")
407
430
        {
408
431
                inH1 = false;
409
 
                writer->append("\n");
 
432
                writer->append("\n", pstyleh1);
410
433
        }
411
434
        else if (name == "h2")
412
435
        {
413
436
                inH2 = false;
414
 
                writer->append("\n");
 
437
                writer->append("\n", pstyleh2);
415
438
        }
416
439
        else if (name == "h3")
417
440
        {
418
441
                inH3 = false;
419
 
                writer->append("\n");
 
442
                writer->append("\n", pstyleh3);
420
443
        }
421
444
        else if (name == "h4")
422
445
        {
423
446
                inH4 = false;
424
 
                writer->append("\n");
 
447
                writer->append("\n", pstyleh4);
 
448
        }
 
449
        else if (name == "h5")
 
450
        {
 
451
                inH5 = false;
 
452
                writer->append("\n", pstyleh5);
 
453
        }
 
454
        else if (name == "h6")
 
455
        {
 
456
                inH6 = false;
 
457
                writer->append("\n", pstyleh6);
425
458
        }
426
459
        else if ((name == "b") || (name == "strong"))
427
460
                unSetBoldFont();
459
492
        pstyleh2->getFont()->toggleEffect(e);
460
493
        pstyleh3->getFont()->toggleEffect(e);
461
494
        pstyleh4->getFont()->toggleEffect(e);
 
495
        pstyleh5->getFont()->toggleEffect(e);
 
496
        pstyleh6->getFont()->toggleEffect(e);
462
497
        pstylecode->getFont()->toggleEffect(e);
463
498
        pstylep->getFont()->toggleEffect(e);
464
499
        pstylepre->getFont()->toggleEffect(e);
474
509
        pstyleh2->getFont()->setSlant(ITALIC);
475
510
        pstyleh3->getFont()->setSlant(ITALIC);
476
511
        pstyleh4->getFont()->setSlant(ITALIC);
 
512
        pstyleh5->getFont()->setSlant(ITALIC);
 
513
        pstyleh6->getFont()->setSlant(ITALIC);
477
514
        pstylecode->getFont()->setSlant(ITALIC);
478
515
        pstylep->getFont()->setSlant(ITALIC);
479
516
        pstylepre->getFont()->setSlant(ITALIC);
489
526
        pstyleh2->getFont()->setSlant(defaultSlant);
490
527
        pstyleh3->getFont()->setSlant(defaultSlant);
491
528
        pstyleh4->getFont()->setSlant(defaultSlant);
 
529
        pstyleh5->getFont()->setSlant(defaultSlant);
 
530
        pstyleh6->getFont()->setSlant(defaultSlant);
492
531
        pstylecode->getFont()->setSlant(defaultSlant);
493
532
        pstylep->getFont()->setSlant(defaultSlant);
494
533
        pstylepre->getFont()->setSlant(defaultSlant);
504
543
        pstyleh2->getFont()->setColor("Blue");
505
544
        pstyleh3->getFont()->setColor("Blue");
506
545
        pstyleh4->getFont()->setColor("Blue");
 
546
        pstyleh5->getFont()->setColor("Blue");
 
547
        pstyleh6->getFont()->setColor("Blue");
507
548
        pstylecode->getFont()->setColor("Blue");
508
549
        pstylep->getFont()->setColor("Blue");
509
550
        pstylepre->getFont()->setColor("Blue");
519
560
        pstyleh2->getFont()->setColor(defaultColor);
520
561
        pstyleh3->getFont()->setColor(defaultColor);
521
562
        pstyleh4->getFont()->setColor(defaultColor);
 
563
        pstyleh5->getFont()->setColor(defaultColor);
 
564
        pstyleh6->getFont()->setColor(defaultColor);
522
565
        pstylecode->getFont()->setColor(defaultColor);
523
566
        pstylep->getFont()->setColor(defaultColor);
524
567
        pstylepre->getFont()->setColor(defaultColor);
549
592
void HTMLReader::parse(QString filename)
550
593
{
551
594
#if defined(_WIN32)
552
 
        QString fname = QDir::convertSeparators(filename);
 
595
        QString fname = QDir::toNativeSeparators(filename);
553
596
        QByteArray fn = (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) ? fname.toUtf8() : fname.toLocal8Bit();
554
597
#else
555
598
        QByteArray fn(filename.toLocal8Bit());
623
666
        delete pstyleh2;
624
667
        delete pstyleh3;
625
668
        delete pstyleh4;
 
669
        delete pstyleh5;
 
670
        delete pstyleh6;
626
671
        delete pstylecode;
627
672
        delete pstylep;
628
673
        delete pstylepre;