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

« back to all changes in this revision

Viewing changes to scribus/storyeditor.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:
124
124
        QPoint viewPos   = editor->viewport()->mapFromGlobal(globalPos);
125
125
        int p = editor->cursorForPosition(QPoint(2, viewPos.y())).position();
126
126
        CurrentPar = editor->StyledText.nrOfParagraph(p);
127
 
        int pos = editor->StyledText.startOfParagraph(p);
 
127
        int pos = editor->StyledText.startOfParagraph( editor->StyledText.nrOfParagraph(p) );
128
128
 
 
129
        QString styleName = "";
129
130
        ParaStyleComboBox* paraStyleCombo = new ParaStyleComboBox(this);
130
131
        paraStyleCombo->setDoc(editor->doc);
131
132
        if ((CurrentPar < static_cast<int>(editor->StyledText.nrOfParagraphs())) && (editor->StyledText.length() != 0))
132
133
        {
133
134
                int len = editor->StyledText.endOfParagraph(CurrentPar) - editor->StyledText.startOfParagraph(CurrentPar);
134
135
                if (len > 0)
135
 
                        paraStyleCombo->setFormat(editor->StyledText.paragraphStyle(pos).displayName());
136
 
                else
137
 
                        paraStyleCombo->setFormat("");
 
136
                        styleName = editor->StyledText.paragraphStyle(pos).parent(); //FIXME ParaStyleComboBox and use localized style name
138
137
        }
139
 
        else
140
 
                paraStyleCombo->setFormat("");
 
138
        paraStyleCombo->setFormat(styleName);
141
139
        connect(paraStyleCombo, SIGNAL(newStyle(const QString&)), this, SLOT(setPStyle(const QString&)));
142
140
        pmen->clear();
143
141
        paraStyleAct = new QWidgetAction(this);
269
267
        setAutoFillBackground(true);
270
268
        connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(ClipChange()));
271
269
        connect(this->document(), SIGNAL(contentsChange(int, int, int)), this, SLOT(handleContentsChange(int, int, int)));
 
270
        SuspendContentsChange = 0;
272
271
}
273
272
 
274
273
void SEditor::setCurrentDocument(ScribusDoc *docc)
280
279
void SEditor::inputMethodEvent(QInputMethodEvent *event)
281
280
{
282
281
        QString uc = event->commitString();
283
 
        if ((!uc.isEmpty()) && ((*doc->AllFonts)[CurrFont].canRender(uc[0])))
 
282
        SuspendContentsChange = 1;      // prevent our handler from doing anything
 
283
        bool changed = false;
 
284
        int pos;
 
285
        if(textCursor().hasSelection())
 
286
        {
 
287
                pos =  textCursor().selectionStart();
 
288
                StyledText.removeChars(pos, textCursor().selectionEnd() - pos);
 
289
                changed = true;
 
290
        }
 
291
        pos = -1;
 
292
        if(!uc.isEmpty())
 
293
        {
 
294
                if ((*doc->AllFonts)[CurrFont].canRender(uc[0]))
 
295
                {
 
296
                        pos = textCursor().hasSelection() ? textCursor().selectionStart() : textCursor().position();
 
297
                        pos = qMin(pos, StyledText.length());
 
298
                }
 
299
                else
 
300
                {
 
301
                        event->setCommitString("");
 
302
                }
 
303
        }
 
304
        QTextEdit::inputMethodEvent(event);
 
305
        SuspendContentsChange = 0;
 
306
        if(pos >= 0)
 
307
        {
 
308
                handleContentsChange(pos, 0, uc.length());
 
309
                changed = true;
 
310
        }
 
311
        if(changed)
 
312
        {
 
313
                emit SideBarUp(true);
 
314
                emit SideBarUpdate();
 
315
        }
 
316
/*      if ((!uc.isEmpty()) && ((*doc->AllFonts)[CurrFont].canRender(uc[0])))
284
317
        {
285
318
                // Should be processed by the handleContentsChange slot
286
319
                // insertCharsInternal(event->commitString());
287
320
                QTextEdit::inputMethodEvent(event);
288
321
                emit SideBarUp(true);
289
322
                emit SideBarUpdate();
290
 
        }
 
323
        } */
291
324
}
292
325
 
293
326
void SEditor::keyPressEvent(QKeyEvent *k)
447
480
 
448
481
void SEditor::handleContentsChange(int position, int charsRemoved, int charsAdded)
449
482
{
 
483
        // As of Qt 4.7.4, Cococa-QTextEdit output of input method is broken.
 
484
        // We need a workaround to avoit the bug.
 
485
        if(SuspendContentsChange != 0)
 
486
                return;
450
487
        if (blockContentsChangeHook <= 0)
451
488
        {
452
489
                if (charsRemoved > 0 && StyledText.length() > 0)
564
601
 
565
602
void SEditor::saveItemText(PageItem *currItem)
566
603
{
567
 
        currItem->CPos = 0;
568
604
        currItem->itemText.clear();
569
605
        currItem->itemText.setDefaultStyle(StyledText.defaultStyle());
570
606
        currItem->itemText.append(StyledText);
597
633
 
598
634
void SEditor::setAlign(int align)
599
635
{
 
636
        QTextCursor tCursor = this->textCursor();
 
637
        setAlign(tCursor, align);
 
638
}
 
639
 
 
640
void SEditor::setAlign(QTextCursor& tCursor, int align)
 
641
{
600
642
        ++blockContentsChangeHook;
 
643
        QTextBlockFormat blockFormat;
601
644
        switch (align)
602
645
        {
603
646
        case 0:
604
 
                setAlignment(Qt::AlignLeft);
 
647
                blockFormat.setAlignment(Qt::AlignLeft);
605
648
                break;
606
649
        case 1:
607
 
                setAlignment(Qt::AlignCenter);
 
650
                blockFormat.setAlignment(Qt::AlignCenter);
608
651
                break;
609
652
        case 2:
610
 
                setAlignment(Qt::AlignRight);
 
653
                blockFormat.setAlignment(Qt::AlignRight);
611
654
                break;
612
655
        case 3:
613
656
        case 4:
614
 
                setAlignment(Qt::AlignJustify);
 
657
                blockFormat.setAlignment(Qt::AlignJustify);
615
658
                break;
616
659
        default:
617
660
                break;
618
661
        }
 
662
        tCursor.setBlockFormat(blockFormat);
619
663
        --blockContentsChangeHook;
620
664
}
621
665
 
629
673
        updateAll();
630
674
        int npars = currItem->itemText.nrOfParagraphs();
631
675
        SelParaStart = 0;
632
 
        while (currItem->CPos >= (SelCharStart = currItem->itemText.endOfParagraph(SelParaStart))
 
676
        while (currItem->itemText.cursorPosition() >= (SelCharStart = currItem->itemText.endOfParagraph(SelParaStart))
633
677
                   && SelParaStart < npars)
634
678
                ++SelParaStart;
635
 
        if (currItem->CPos < SelCharStart)
636
 
                SelCharStart = currItem->CPos;
 
679
        if (currItem->itemText.cursorPosition() < SelCharStart)
 
680
                SelCharStart = currItem->itemText.cursorPosition();
637
681
        SelCharStart -= currItem->itemText.startOfParagraph(SelParaStart);
638
682
        StoredSel = false;
639
683
        //qDebug() << "SE::loadItemText: cursor";
680
724
        int cSty = StyledText.charStyle(position).effects();
681
725
        int pAli = StyledText.paragraphStyle(position).alignment();
682
726
        setAlign(pAli);
683
 
        setStyle(cSty);
 
727
        setEffects(cSty);
684
728
        for (int pos = position; pos < end; ++pos)
685
729
        {
686
730
                const CharStyle& cstyle(StyledText.charStyle(pos));
691
735
                        const ParagraphStyle& pstyle(StyledText.paragraphStyle(pos));
692
736
                        pAli = pstyle.alignment();
693
737
                        setAlign(pAli);
694
 
                        setStyle(cSty);
 
738
                        setEffects(cSty);
695
739
                        insertPlainText(text);
696
740
                        cSty = cstyle.effects();
697
741
                        text = "";
708
752
                                ch == SpecialChars::LINEBREAK)
709
753
                {
710
754
                        setAlign(pAli);
711
 
                        setStyle(cSty);
 
755
                        setEffects(cSty);
712
756
                        insertPlainText(text);
713
757
                        cSty = cstyle.effects();
714
758
                        text = "";
769
813
                const ParagraphStyle& pstyle(StyledText.paragraphStyle(end - 1));
770
814
                setAlign(pstyle.alignment());
771
815
        }
772
 
        setStyle(cSty);
 
816
        setEffects(cSty);
773
817
        insertPlainText(text);
774
818
        QTextCursor tCursor = textCursor();
775
819
        tCursor.setPosition(cursorPos);
787
831
void SEditor::updateFromChars(int pa)
788
832
{
789
833
        int start = StyledText.startOfParagraph(pa);
790
 
        int end = StyledText.endOfParagraph(pa);
 
834
        int end   = StyledText.endOfParagraph(pa);
791
835
        if (start >= end)
792
836
                return;
793
837
        setUpdatesEnabled(false);
794
838
        int SelStart = start;
795
 
        int SelEnd = 0;
 
839
        int SelEnd   = start;
796
840
        int pos = textCursor().position();
797
841
        textCursor().clearSelection();
798
 
        int Csty = StyledText.charStyle(start).effects();
 
842
        int effects = StyledText.charStyle(start).effects();
799
843
        for (int a = start; a < end; ++a)
800
844
        {
801
 
                if (Csty == StyledText.charStyle(a).effects())
 
845
                if (effects == StyledText.charStyle(a).effects())
802
846
                        SelEnd++;
803
847
                else
804
848
                {
805
849
                        textCursor().setPosition(SelStart);
806
850
                        textCursor().setPosition(SelEnd, QTextCursor::KeepAnchor);
807
 
                        setStyle(Csty);
 
851
                        setEffects(effects);
808
852
                        textCursor().clearSelection();
809
 
                        Csty = StyledText.charStyle(a).effects();
 
853
                        effects = StyledText.charStyle(a).effects();
810
854
                        SelStart = SelEnd;
811
855
                        SelEnd++;
812
856
                }
813
857
        }
814
 
        textCursor().setPosition(SelStart);
815
 
        textCursor().setPosition(SelEnd, QTextCursor::KeepAnchor);
816
 
        setStyle(Csty);
817
 
        textCursor().clearSelection();
818
 
        setAlign(StyledText.paragraphStyle(start).alignment());
 
858
        QTextCursor tCursor = textCursor();
 
859
        tCursor.setPosition(SelStart);
 
860
        tCursor.setPosition(SelEnd, QTextCursor::KeepAnchor);
 
861
        setEffects(tCursor, effects);
 
862
        setAlign(tCursor, StyledText.paragraphStyle(start).alignment());
 
863
        tCursor.clearSelection();
819
864
        setUpdatesEnabled(true);
820
 
        QTextCursor tCursor = textCursor();
 
865
        tCursor = textCursor();
821
866
        tCursor.setPosition(pos);
822
867
        setTextCursor(tCursor);
823
868
}
868
913
        StoredSel = false;
869
914
}
870
915
 
871
 
void SEditor::setStyle(int Csty)
 
916
void SEditor::setEffects(int effects)
 
917
{
 
918
        QTextCursor tCursor = textCursor();
 
919
        setEffects(tCursor, effects);
 
920
        //setTextCursor(tCursor);
 
921
}
 
922
 
 
923
void SEditor::setEffects(QTextCursor& tCursor, int effects)
872
924
{
873
925
        ++blockContentsChangeHook;
874
926
        QTextCharFormat charF;
875
 
        if (Csty & 8)
 
927
        if (effects & 8)
876
928
                charF.setFontUnderline(true);
877
929
        else
878
930
                charF.setFontUnderline(false);
879
 
        if (Csty & 16)
 
931
        if (effects & 16)
880
932
                charF.setFontStrikeOut(true);
881
933
        else
882
934
                charF.setFontStrikeOut(false);
883
 
        if (Csty & 1)
 
935
        if (effects & 1)
884
936
                charF.setVerticalAlignment(QTextCharFormat::AlignSuperScript);
885
 
        else if (Csty & 2)
 
937
        else if (effects & 2)
886
938
                charF.setVerticalAlignment(QTextCharFormat::AlignSubScript);
887
939
        else
888
940
                charF.setVerticalAlignment(QTextCharFormat::AlignNormal);
889
 
        QTextCursor tCursor = textCursor();
890
941
        tCursor.setCharFormat(charF);
891
 
        setTextCursor(tCursor);
892
942
        --blockContentsChangeHook;
893
943
}
894
944
 
1520
1570
void StoryEditor::showEvent(QShowEvent *)
1521
1571
{
1522
1572
        charSelect = new CharSelect(this);
1523
 
        charSelect->userTableModel()->setCharacters(
1524
 
            ScCore->primaryMainWindow()->charPalette->userTableModel()->characters());
 
1573
        charSelect->userTableModel()->setCharactersAndFonts(ScCore->primaryMainWindow()->charPalette->userTableModel()->characters(), ScCore->primaryMainWindow()->charPalette->userTableModel()->fonts());
1525
1574
        connect(charSelect, SIGNAL(insertSpecialChar()),
1526
1575
             this, SLOT(slot_insertSpecialChar()));
1527
 
        connect(charSelect, SIGNAL(insertUserSpecialChar(QChar)),
1528
 
             this, SLOT(slot_insertUserSpecialChar(QChar)));
 
1576
        connect(charSelect, SIGNAL(insertUserSpecialChar(QChar, QString)),
 
1577
             this, SLOT(slot_insertUserSpecialChar(QChar, QString)));
1529
1578
}
1530
1579
 
1531
1580
void StoryEditor::hideEvent(QHideEvent *)
1534
1583
        {
1535
1584
                if (charSelectUsed)
1536
1585
                {
1537
 
                        ScCore->primaryMainWindow()->charPalette->userTableModel()->setCharacters(
1538
 
                                        charSelect->userTableModel()->characters());
 
1586
                        ScCore->primaryMainWindow()->charPalette->userTableModel()->setCharactersAndFonts(charSelect->userTableModel()->characters(), charSelect->userTableModel()->fonts());
1539
1587
                }
1540
1588
                if (charSelect->isVisible())
1541
1589
                        charSelect->close();
1542
1590
                disconnect(charSelect, SIGNAL(insertSpecialChar()),
1543
1591
                                        this, SLOT(slot_insertSpecialChar()));
1544
 
                disconnect(charSelect, SIGNAL(insertUserSpecialChar(QChar)),
1545
 
                                        this, SLOT(slot_insertUserSpecialChar(QChar)));
 
1592
                disconnect(charSelect, SIGNAL(insertUserSpecialChar(QChar, QString)),
 
1593
                                        this, SLOT(slot_insertUserSpecialChar(QChar, QString)));
1546
1594
                delete charSelect;
1547
1595
                charSelect = NULL;
1548
1596
        }
1836
1884
        FillTools->setAllowedAreas(Qt::TopToolBarArea);
1837
1885
        
1838
1886
        addToolBar(FileTools);
 
1887
        addToolBarBreak();
1839
1888
        addToolBar(FontTools);
1840
1889
        addToolBar(AlignTools);
 
1890
        addToolBarBreak();
1841
1891
        addToolBar(StyleTools);
1842
1892
        addToolBar(StrokeTools);
1843
1893
        addToolBar(FillTools);
1996
2046
        connect(Editor, SIGNAL(SideBarUp(bool )), EditorBar, SLOT(setRepaint(bool )));
1997
2047
        connect(Editor, SIGNAL(SideBarUpdate( )), EditorBar, SLOT(doRepaint()));
1998
2048
        connect(Editor->document(), SIGNAL(contentsChange(int, int, int)), Editor, SLOT(handleContentsChange(int, int, int)));
 
2049
        Editor->SuspendContentsChange = 0;
1999
2050
        // 10/12/2004 - pv - #1203: wrong selection on double click
2000
2051
//      connect(Editor, SIGNAL(doubleClicked(int, int)), this, SLOT(doubleClick(int, int)));
2001
2052
        connect(EditorBar, SIGNAL(ChangeStyle(int, const QString& )), this, SLOT(changeStyleSB(int, const QString&)));
2259
2310
 
2260
2311
void StoryEditor::newTxStyle(int s)
2261
2312
{
2262
 
        Editor->CurrentStyle = static_cast<StyleFlag>(s);
 
2313
        Editor->CurrentEffects = static_cast<StyleFlag>(s);
2263
2314
        CharStyle charStyle;
2264
 
        charStyle.setFeatures(Editor->CurrentStyle.featureList());
 
2315
        charStyle.setFeatures(Editor->CurrentEffects.featureList());
2265
2316
        Editor->updateSel(charStyle);
2266
 
        Editor->setStyle(s);
 
2317
        Editor->setEffects(s);
2267
2318
        if ((s & ScStyle_Outline) || (s & ScStyle_Shadowed))
2268
2319
        {
2269
2320
                StrokeTools->TxStroke->setEnabled(true);
2383
2434
                {
2384
2435
                        const CharStyle& curstyle(pos < Editor->StyledText.length()? currItem->itemText.charStyle(pos) : currItem->itemText.defaultStyle().charStyle());
2385
2436
                        const ParagraphStyle parStyle(pos < Editor->StyledText.length()? currItem->itemText.paragraphStyle(pos) : currItem->itemText.defaultStyle());
 
2437
                        Editor->currentParaStyle = parStyle.parent();
2386
2438
                        Editor->CurrAlign = parStyle.alignment();
2387
2439
                        Editor->CurrTextFill = curstyle.fillColor();
2388
2440
                        Editor->CurrTextFillSh = curstyle.fillShade();
2390
2442
                        Editor->CurrTextStrokeSh = curstyle.strokeShade();
2391
2443
                        Editor->prevFont = Editor->CurrFont;
2392
2444
                        Editor->CurrFont = curstyle.font().scName();
2393
 
                        Editor->CurrFontSize = curstyle.fontSize();
2394
 
                        Editor->CurrentStyle = curstyle.effects();
2395
 
                        Editor->currentParaStyle = curstyle.parent();
2396
 
                        Editor->CurrTextKern = curstyle.tracking();
2397
 
                        Editor->CurrTextScale = curstyle.scaleH();
 
2445
                        Editor->CurrFontSize   = curstyle.fontSize();
 
2446
                        Editor->CurrentEffects = curstyle.effects();
 
2447
                        Editor->CurrTextKern   = curstyle.tracking();
 
2448
                        Editor->CurrTextScale  = curstyle.scaleH();
2398
2449
                        Editor->CurrTextScaleV = curstyle.scaleV();
2399
2450
                        Editor->CurrTextBase = curstyle.baselineOffset();
2400
2451
                        Editor->CurrTextShadowX = curstyle.shadowXOffset();
2435
2486
                        AlignTools->SetAlign(Editor->CurrAlign);
2436
2487
                        AlignTools->SetParaStyle(Editor->currentParaStyle);
2437
2488
                        StyleTools->SetKern(Editor->CurrTextKern);
2438
 
                        StyleTools->SetStyle(Editor->CurrentStyle);
 
2489
                        StyleTools->SetStyle(Editor->CurrentEffects);
2439
2490
                        StyleTools->SetShadow(Editor->CurrTextShadowX, Editor->CurrTextShadowY);
2440
2491
                        StyleTools->setOutline(Editor->CurrTextOutline);
2441
2492
                        StyleTools->setUnderline(Editor->CurrTextUnderPos, Editor->CurrTextUnderWidth);
2445
2496
                        FontTools->SetScale(Editor->CurrTextScale);
2446
2497
                        FontTools->SetScaleV(Editor->CurrTextScaleV);
2447
2498
                }
2448
 
                if ((Editor->CurrentStyle & ScStyle_Outline) || (Editor->CurrentStyle & ScStyle_Shadowed))
 
2499
                if ((Editor->CurrentEffects & ScStyle_Outline) || (Editor->CurrentEffects & ScStyle_Shadowed))
2449
2500
                {
2450
2501
                        StrokeTools->TxStroke->setEnabled(true);
2451
2502
                        StrokeTools->PM1->setEnabled(true);
2455
2506
                        StrokeTools->TxStroke->setEnabled(false);
2456
2507
                        StrokeTools->PM1->setEnabled(false);
2457
2508
                }
2458
 
                Editor->setStyle(Editor->CurrentStyle);
 
2509
                Editor->setEffects(Editor->CurrentEffects);
2459
2510
                firstSet = true;
2460
2511
                updateUnicodeActions();
2461
2512
                return;
2462
2513
        }
2463
2514
        int parStart = Editor->StyledText.startOfParagraph(p);
2464
2515
        const ParagraphStyle& parStyle(Editor->StyledText.paragraphStyle(parStart));
2465
 
        Editor->currentParaStyle = parStyle.displayName();
 
2516
        Editor->currentParaStyle = parStyle.parent(); //FIXME ParaStyleComboBox and use localized style name
2466
2517
        if (Editor->StyledText.endOfParagraph(p) <= parStart)
2467
2518
        {
2468
2519
                Editor->prevFont = Editor->CurrFont;
2469
2520
                Editor->CurrFont = parStyle.charStyle().font().scName();
2470
 
                Editor->CurrFontSize = parStyle.charStyle().fontSize();
2471
 
                Editor->CurrentStyle = parStyle.charStyle().effects();
2472
 
                Editor->CurrTextFill = parStyle.charStyle().fillColor();
 
2521
                Editor->CurrFontSize   = parStyle.charStyle().fontSize();
 
2522
                Editor->CurrentEffects = parStyle.charStyle().effects();
 
2523
                Editor->CurrTextFill   = parStyle.charStyle().fillColor();
2473
2524
                Editor->CurrTextFillSh = parStyle.charStyle().fillShade();
2474
2525
                Editor->CurrTextStroke = parStyle.charStyle().strokeColor();
2475
2526
                Editor->CurrTextStrokeSh = parStyle.charStyle().strokeShade();
2481
2532
                Editor->CurrTextStrikePos = parStyle.charStyle().strikethruOffset();
2482
2533
                Editor->CurrTextStrikeWidth = parStyle.charStyle().strikethruWidth();
2483
2534
                Editor->setAlign(Editor->CurrAlign);
2484
 
                Editor->setStyle(Editor->CurrentStyle);
 
2535
                Editor->setEffects(Editor->CurrentEffects);
2485
2536
        }
2486
2537
        else
2487
2538
        {
2513
2564
                Editor->prevFont = Editor->CurrFont;
2514
2565
                Editor->CurrFont = charStyle.font().scName();
2515
2566
                Editor->CurrFontSize = charStyle.fontSize();
2516
 
                Editor->CurrentStyle = charStyle.effects() & static_cast<StyleFlag>(1919);
2517
 
                Editor->CurrTextKern = charStyle.tracking();
2518
 
                Editor->CurrTextScale = charStyle.scaleH();
 
2567
                Editor->CurrentEffects = charStyle.effects() & static_cast<StyleFlag>(1919);
 
2568
                Editor->CurrTextKern   = charStyle.tracking();
 
2569
                Editor->CurrTextScale  = charStyle.scaleH();
2519
2570
                Editor->CurrTextScaleV = charStyle.scaleV();
2520
2571
                Editor->CurrTextBase = charStyle.baselineOffset();
2521
2572
                Editor->CurrTextShadowX = charStyle.shadowXOffset();
2553
2604
                }
2554
2605
        }
2555
2606
        StrokeTools->SetColor(c);
2556
 
        if ((Editor->CurrentStyle & ScStyle_Outline) || (Editor->CurrentStyle & ScStyle_Shadowed))
 
2607
        if ((Editor->CurrentEffects & ScStyle_Outline) || (Editor->CurrentEffects & ScStyle_Shadowed))
2557
2608
        {
2558
2609
                StrokeTools->TxStroke->setEnabled(true);
2559
2610
                StrokeTools->PM1->setEnabled(true);
2564
2615
                StrokeTools->PM1->setEnabled(false);
2565
2616
        }
2566
2617
        StyleTools->SetKern(Editor->CurrTextKern);
2567
 
        StyleTools->SetStyle(Editor->CurrentStyle);
 
2618
        StyleTools->SetStyle(Editor->CurrentEffects);
2568
2619
        StyleTools->SetShadow(Editor->CurrTextShadowX, Editor->CurrTextShadowY);
2569
2620
        StyleTools->setOutline(Editor->CurrTextOutline);
2570
2621
        StyleTools->setUnderline(Editor->CurrTextUnderPos, Editor->CurrTextUnderWidth);
2631
2682
        blockUpdate = false;
2632
2683
}
2633
2684
 
2634
 
void StoryEditor::slot_insertUserSpecialChar(QChar c)
 
2685
void StoryEditor::slot_insertUserSpecialChar(QChar c, QString)
2635
2686
{
2636
2687
        blockUpdate = true;
2637
2688
        Editor->insertPlainText(c);
2861
2912
                        }
2862
2913
                }
2863
2914
                nb2->itemText.clear();
2864
 
                        nb2->CPos = 0;
2865
2915
                        nb2->Dirty = false;
2866
2916
                        nb2 = nb2->nextInChain();
2867
2917
                }
2984
3034
                Editor->prevFont = Editor->CurrFont;
2985
3035
                Editor->CurrFont = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().font().scName();
2986
3036
                Editor->CurrFontSize = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().fontSize();
2987
 
                Editor->CurrentStyle = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().effects();
2988
 
                Editor->CurrTextFill = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().fillColor();
 
3037
                Editor->CurrentEffects = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().effects();
 
3038
                Editor->CurrTextFill   = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().fillColor();
2989
3039
                Editor->CurrTextFillSh = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().fillShade();
2990
3040
                Editor->CurrTextStroke = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().strokeColor();
2991
3041
                Editor->CurrTextStrokeSh = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().strokeShade();
2997
3047
                Editor->CurrTextStrikePos = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().strikethruOffset();
2998
3048
                Editor->CurrTextStrikeWidth = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().strikethruWidth();
2999
3049
 
3000
 
                Editor->setStyle(Editor->CurrentStyle);
3001
 
                if ((Editor->CurrentStyle & ScStyle_Outline) || (Editor->CurrentStyle & ScStyle_Shadowed))
 
3050
                Editor->setEffects(Editor->CurrentEffects);
 
3051
                if ((Editor->CurrentEffects & ScStyle_Outline) || (Editor->CurrentEffects & ScStyle_Shadowed))
3002
3052
                {
3003
3053
                        StrokeTools->TxStroke->setEnabled(true);
3004
3054
                        StrokeTools->PM1->setEnabled(true);
3072
3122
                Editor->prevFont = Editor->CurrFont;
3073
3123
                Editor->CurrFont = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().font().scName();
3074
3124
                Editor->CurrFontSize = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().fontSize();
3075
 
                Editor->CurrentStyle = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().effects();
3076
 
                Editor->CurrTextFill = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().fillColor();
 
3125
                Editor->CurrentEffects = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().effects();
 
3126
                Editor->CurrTextFill   = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().fillColor();
3077
3127
                Editor->CurrTextFillSh = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().fillShade();
3078
3128
                Editor->CurrTextStroke = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().strokeColor();
3079
3129
                Editor->CurrTextStrokeSh = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().strokeShade();
3085
3135
                Editor->CurrTextStrikePos = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().strikethruOffset();
3086
3136
                Editor->CurrTextStrikeWidth = currDoc->paragraphStyles().get(Editor->currentParaStyle).charStyle().strikethruWidth();
3087
3137
 
3088
 
                Editor->setStyle(Editor->CurrentStyle);
3089
 
                if ((Editor->CurrentStyle & ScStyle_Outline) || (Editor->CurrentStyle & ScStyle_Shadowed))
 
3138
                Editor->setEffects(Editor->CurrentEffects);
 
3139
                if ((Editor->CurrentEffects & ScStyle_Outline) || (Editor->CurrentEffects & ScStyle_Shadowed))
3090
3140
                {
3091
3141
                        StrokeTools->TxStroke->setEnabled(true);
3092
3142
                        StrokeTools->PM1->setEnabled(true);