[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/textshape-styleManager-PierreSt] plugins/textshape/dialogs: tempo
From:       Pierre Stirnweiss <pstirnweiss () googlemail ! com>
Date:       2012-06-13 20:02:42
Message-ID: 20120613200242.3A1C1A60BB () git ! kde ! org
[Download RAW message or body]

Git commit fc8aa7a750715baa237e5110b5b2b606b86d22d6 by Pierre Stirnweiss.
Committed on 01/05/2012 at 21:09.
Pushed by pstirnweiss into branch 'textshape-styleManager-PierreSt'.

tempo

M  +117  -75   plugins/textshape/dialogs/CharacterHighlighting.cpp
M  +1    -3    plugins/textshape/dialogs/CharacterHighlighting.h
M  +13   -84   plugins/textshape/dialogs/FontDecorations.cpp
M  +0    -3    plugins/textshape/dialogs/FontDecorations.h
M  +18   -0    plugins/textshape/dialogs/ParagraphIndentSpacing.cpp
M  +3    -1    plugins/textshape/dialogs/ParagraphLayout.cpp
M  +4    -0    plugins/textshape/dialogs/ParagraphSettingsDialog.cpp

http://commits.kde.org/calligra/fc8aa7a750715baa237e5110b5b2b606b86d22d6

diff --git a/plugins/textshape/dialogs/CharacterHighlighting.cpp \
b/plugins/textshape/dialogs/CharacterHighlighting.cpp index 5ed904b..6840da1 100644
--- a/plugins/textshape/dialogs/CharacterHighlighting.cpp
+++ b/plugins/textshape/dialogs/CharacterHighlighting.cpp
@@ -142,30 +142,29 @@ int \
CharacterHighlighting::lineStyleToIndex(KoCharacterStyle::LineStyle type)  
 void CharacterHighlighting::capitalisationChanged(int item)
 {
-    if (widget.normal->isChecked()) {
-        emit capitalizationChanged(QFont::MixedCase);
-        if (!m_ignoreSignals)
+    if (m_uniqueFormat || widget.capitalizationList->currentIndex() >= 0) {
+        switch (item) {
+        case 0:
+            emit capitalizationChanged(QFont::MixedCase);
             m_mixedCaseInherited = false;
-    }
-    else if (widget.smallcaps->isChecked()) {
-        emit capitalizationChanged(QFont::SmallCaps);
-        if (!m_ignoreSignals)
+            break;
+        case 1:
+            emit capitalizationChanged(QFont::SmallCaps);
             m_smallCapsInherited = false;
-    }
-    else if (widget.uppercase->isChecked()) {
-        emit capitalizationChanged(QFont::AllUppercase);
-        if (!m_ignoreSignals)
+            break;
+        case 2:
+            emit capitalizationChanged(QFont::AllUppercase);
             m_allUpperCaseInherited = false;
-    }
-    else if (widget.lowercase->isChecked()) {
-        emit capitalizationChanged(QFont::AllLowercase);
-        if (!m_ignoreSignals)
+            break;
+        case 3:
+            emit capitalizationChanged(QFont::AllLowercase);
             m_allLowerCaseInherited = false;
-    }
-    else if (widget.capitalize->isChecked()) {
-        emit capitalizationChanged(QFont::Capitalize);
-        if (!m_ignoreSignals)
+            break;
+        case 4:
+            emit capitalizationChanged(QFont::Capitalize);
             m_capitalizInherited = false;
+            break;
+        }
     }
 }
 
@@ -178,8 +177,7 @@ void CharacterHighlighting::underlineTypeChanged(int item)
 {
     widget.underlineLineStyle->setEnabled(item > 0);
     widget.underlineColor->setEnabled(item > 0);
-    if (!m_ignoreSignals)
-        m_underlineTypeInherited = false;
+    m_underlineTypeInherited = false;
     emit underlineChanged(indexToLineType(item), \
indexToLineStyle(widget.underlineLineStyle->currentIndex()), \
widget.underlineColor->color());  }
 
@@ -187,24 +185,20 @@ void CharacterHighlighting::underlineStyleChanged(int item)
 {
     if (widget.underlineStyle->currentIndex())
         emit underlineChanged(indexToLineType(widget.underlineStyle->currentIndex()), \
                indexToLineStyle(item), widget.underlineColor->color());
-    if (!m_ignoreSignals)
-        m_underlineStyleInherited = false;
+    m_underlineStyleInherited = false;
 }
 
 void CharacterHighlighting::underlineColorChanged(QColor color)
 {
     if (widget.underlineStyle->currentIndex())
         emit underlineChanged(indexToLineType(widget.underlineStyle->currentIndex()), \
                indexToLineStyle(widget.underlineLineStyle->currentIndex()), color);
-    if (!m_ignoreSignals)
-        m_underlineColorInherited = false;
 }
 
 void CharacterHighlighting::strikethroughTypeChanged(int item)
 {
     widget.strikethroughLineStyle->setEnabled(item > 0);
     widget.strikethroughColor->setEnabled(item > 0);
-    if (!m_ignoreSignals)
-        m_strikeoutTypeInherited = false;
+    m_strikeoutTypeInherited = false;
     emit strikethroughChanged(indexToLineType(item), \
indexToLineStyle(widget.strikethroughLineStyle->currentIndex()), \
widget.strikethroughColor->color());  }
 
@@ -212,16 +206,14 @@ void CharacterHighlighting::strikethroughStyleChanged(int item)
 {
     if (widget.strikethroughStyle->currentIndex())
         emit strikethroughChanged(indexToLineType(widget.strikethroughStyle->currentIndex()), \
                indexToLineStyle(item), widget.strikethroughColor->color());
-    if (!m_ignoreSignals)
-        m_strikeoutStyleInherited = false;
+    m_strikeoutStyleInherited = false;
 }
 
 void CharacterHighlighting::strikethroughColorChanged(QColor color)
 {
     if (widget.strikethroughStyle->currentIndex())
         emit strikethroughChanged(indexToLineType(widget.strikethroughStyle->currentIndex()), \
                indexToLineStyle(widget.strikethroughLineStyle->currentIndex()), \
                color);
-    if (!m_ignoreSignals)
-        m_strikeoutColorInherited = false;
+    m_strikeoutcolorInherited = false;
 }
 
 void CharacterHighlighting::backgroundColorChanged()
@@ -287,14 +279,36 @@ void CharacterHighlighting::setDisplay(KoCharacterStyle *style)
 {
     if (style == 0)
         return;
-    m_ignoreSignals = true;
+
+    QFont font = style->font();
+    QFontDatabase dbase;
+    QStringList availableStyles = dbase.styles(font.family());
+    if (font.italic() && !(availableStyles.contains(QString("Italic"))) && \
availableStyles.contains(QString("Oblique"))) +        \
font.setStyle(QFont::StyleOblique); +    m_fontChooser->setFont(font);
+
+    m_positionInherited  = !style->hasProperty(QTextFormat::TextVerticalAlignment);
+    switch (style->verticalAlignment()) {
+    case QTextCharFormat::AlignSuperScript:
+        widget.positionList->setCurrentIndex(1);
+        break;
+    case QTextCharFormat::AlignSubScript:
+        widget.positionList->setCurrentIndex(2);
+        break;
+    default:
+        // TODO check if its custom instead.
+        widget.positionList->setCurrentIndex(0);
+    }
+    if (!m_uniqueFormat){
+        widget.positionList->setEnabled(false);
+        widget.positionList->setCurrentIndex(-1);
+    }
 
     m_underlineStyleInherited = \
                !style->hasProperty(KoCharacterStyle::UnderlineStyle);
     m_underlineTypeInherited = !style->hasProperty(KoCharacterStyle::UnderlineType);
-    m_underlineColorInherited = \
                !style->hasProperty(QTextCharFormat::TextUnderlineColor);
     m_strikeoutStyleInherited = \
                !style->hasProperty(KoCharacterStyle::StrikeOutStyle);
     m_strikeoutTypeInherited = !style->hasProperty(KoCharacterStyle::StrikeOutType);
-    m_strikeoutColorInherited = \
!style->hasProperty(KoCharacterStyle::StrikeOutColor); +    m_strikeoutcolorInherited \
= !style->hasProperty(KoCharacterStyle::StrikeOutColor);  m_mixedCaseInherited = \
!style->hasProperty(QFont::MixedCase);  m_smallCapsInherited = \
!style->hasProperty(QFont::SmallCaps);  m_allUpperCaseInherited = \
!style->hasProperty(QFont::AllUppercase); @@ -336,9 +350,35 @@ void \
CharacterHighlighting::setDisplay(KoCharacterStyle *style)  break;
     }
 
-    capitalisationChanged();
+    if(m_uniqueFormat)
+        capitalisationChanged(index);
+    else{
+        widget.capitalizationList->setCurrentIndex(-1);
+        widget.capitalizationList->setEnabled(false);
+    }
 
-    m_ignoreSignals = false;
+    //Set font decoration display
+    widget.enableText->setVisible(!m_uniqueFormat);
+    widget.enableText->setChecked(m_uniqueFormat);
+    textToggled(m_uniqueFormat);
+    widget.enableBackground->setVisible(!m_uniqueFormat);
+    widget.enableBackground->setChecked(m_uniqueFormat);
+    backgroundToggled(m_uniqueFormat);
+
+    m_textColorChanged = false;
+    m_backgroundColorChanged = false;
+    m_textColorReset = ! style->hasProperty(QTextFormat::ForegroundBrush);
+    if (m_textColorReset || (style->foreground().style() == Qt::NoBrush)) {
+        clearTextColor();
+    } else {
+        widget.textColor->setColor(style->foreground().color());
+    }
+    m_backgroundColorReset = ! style->hasProperty(QTextFormat::BackgroundBrush);
+    if (m_backgroundColorReset || (style->background().style() == Qt::NoBrush)) {
+        clearBackgroundColor();
+    } else {
+        widget.backgroundColor->setColor(style->background().color());
+    }
 }
 
 void CharacterHighlighting::save(KoCharacterStyle *style)
@@ -346,55 +386,57 @@ void CharacterHighlighting::save(KoCharacterStyle *style)
     if (style == 0)
         return;
 
-    if (!m_underlineStyleInherited || !m_underlineTypeInherited || \
                !m_underlineColorInherited) {
-        if (widget.underlineStyle->currentIndex() == 0) {
-            style->setUnderlineType(KoCharacterStyle::NoLineType);
-            style->setUnderlineStyle(KoCharacterStyle::NoLineStyle);
-        } else if (widget.underlineStyle->currentIndex() > 0) {
-            if (!m_underlineTypeInherited) {
-                style->setUnderlineType(indexToLineType(widget.underlineStyle->currentIndex()));
                
-            }
-            if (!m_underlineStyleInherited) {
-                style->setUnderlineStyle(indexToLineStyle(widget.underlineLineStyle->currentIndex()));
                
-            }
-            if (!m_underlineColorInherited) {
-                style->setUnderlineColor(widget.underlineColor->color());
-            }
+
+    KFontChooser::FontDiffFlags fontDiff = m_fontChooser->fontDiffFlags();
+    if (m_uniqueFormat || (fontDiff & KFontChooser::FontDiffFamily)){
+        style->setFontFamily(m_fontChooser->font().family());
+    }
+    if (m_uniqueFormat || (fontDiff & KFontChooser::FontDiffSize)){
+        style->setFontPointSize(m_fontChooser->font().pointSize());
+    }
+    if (m_uniqueFormat || (fontDiff & KFontChooser::FontDiffStyle)) {
+        style->setFontWeight(m_fontChooser->font().weight());
+        style->setFontItalic(m_fontChooser->font().italic()); //TODO should set \
style instead of italic +    }
+
+    if (widget.underlineStyle->currentIndex() == 0) {
+        style->setUnderlineType(KoCharacterStyle::NoLineType);
+        style->setUnderlineStyle(KoCharacterStyle::NoLineStyle);
+    } else if (widget.underlineStyle->currentIndex() > 0) {
+        if (!m_underlineTypeInherited) {
+            style->setUnderlineType(indexToLineType(widget.underlineStyle->currentIndex()));
 +        }
+        if (!m_underlineStyleInherited) {
+            style->setUnderlineStyle(indexToLineStyle(widget.underlineLineStyle->currentIndex()));
  }
+        style->setUnderlineColor(widget.underlineColor->color());
     }
 
-    if (!m_strikeoutStyleInherited || !m_strikeoutTypeInherited || \
                !m_strikeoutColorInherited) {
-        if (widget.strikethroughStyle->currentIndex() == 0) {
-            style->setStrikeOutType(KoCharacterStyle::NoLineType);
-            style->setStrikeOutStyle(KoCharacterStyle::NoLineStyle);
-        } else if (widget.strikethroughStyle->currentIndex() > 0) {
-            if (!m_strikeoutTypeInherited) {
-                style->setStrikeOutType(indexToLineType(widget.strikethroughStyle->currentIndex()));
                
-            }
-            if (!m_strikeoutStyleInherited) {
-                style->setStrikeOutStyle(indexToLineStyle(widget.strikethroughLineStyle->currentIndex()));
                
-            }
-            if (!m_strikeoutColorInherited) {
-                style->setStrikeOutColor(widget.strikethroughColor->color());
-            }
+    if (widget.strikethroughStyle->currentIndex() == 0) {
+        style->setStrikeOutType(KoCharacterStyle::NoLineType);
+        style->setStrikeOutStyle(KoCharacterStyle::NoLineStyle);
+    } else if (widget.strikethroughStyle->currentIndex() > 0) {
+        if (!m_strikeoutTypeInherited) {
+            style->setStrikeOutType(indexToLineType(widget.strikethroughStyle->currentIndex()));
 +        }
+        if (!m_strikeoutStyleInherited) {
+            style->setStrikeOutStyle(indexToLineStyle(widget.strikethroughLineStyle->currentIndex()));
 +        }
+        if (!m_strikeoutcolorInherited) {
+            style->setStrikeOutColor(widget.strikethroughColor->color());
         }
     }
-    if (!m_mixedCaseInherited || !m_smallCapsInherited || !m_allUpperCaseInherited \
                || !m_allLowerCaseInherited || !m_capitalizInherited) {
-        if (widget.normal->isChecked()) {
+    if (m_uniqueFormat || widget.capitalizationList->currentIndex() >= 0) {
+        if (widget.capitalizationList->currentIndex() == 0 && !m_mixedCaseInherited)
             style->setFontCapitalization(QFont::MixedCase);
-        }
-        else if (widget.smallcaps->isChecked()) {
+        else if (widget.capitalizationList->currentIndex() == 1 && \
!m_smallCapsInherited)  style->setFontCapitalization(QFont::SmallCaps);
-        }
-        else if (widget.uppercase->isChecked()) {
+        else if (widget.capitalizationList->currentIndex() == 2 && \
!m_allUpperCaseInherited)  style->setFontCapitalization(QFont::AllUppercase);
-        }
-        else if (widget.lowercase->isChecked()) {
+        else if (widget.capitalizationList->currentIndex() == 3 && \
!m_allLowerCaseInherited)  style->setFontCapitalization(QFont::AllLowercase);
-        }
-        else if (widget.capitalize->isChecked()) {
+        else if (widget.capitalizationList->currentIndex() == 4 && \
!m_capitalizInherited)  style->setFontCapitalization(QFont::Capitalize);
-        }
     }
 
 
diff --git a/plugins/textshape/dialogs/CharacterHighlighting.h \
b/plugins/textshape/dialogs/CharacterHighlighting.h index f84f998..d8711e6 100644
--- a/plugins/textshape/dialogs/CharacterHighlighting.h
+++ b/plugins/textshape/dialogs/CharacterHighlighting.h
@@ -79,13 +79,11 @@ private:
      KFontChooser *m_fontChooser;
 
     bool m_uniqueFormat;
-    bool m_ignoreSignals;
     bool m_underlineStyleInherited;
     bool m_underlineTypeInherited;
-    bool m_underlineColorInherited;
     bool m_strikeoutStyleInherited;
+    bool m_strikeoutcolorInherited;
     bool m_strikeoutTypeInherited;
-    bool m_strikeoutColorInherited;
     bool m_mixedCaseInherited;
     bool m_smallCapsInherited;
     bool m_allUpperCaseInherited;
diff --git a/plugins/textshape/dialogs/FontDecorations.cpp \
b/plugins/textshape/dialogs/FontDecorations.cpp index 270c348..f28e2a8 100644
--- a/plugins/textshape/dialogs/FontDecorations.cpp
+++ b/plugins/textshape/dialogs/FontDecorations.cpp
@@ -21,56 +21,19 @@
 
 #include "FontDecorations.h"
 
-#include <KDebug>
-
 FontDecorations::FontDecorations(bool uniqueFormat, QWidget* parent)
         : QWidget(parent),
         m_uniqueFormat(uniqueFormat)
 {
     widget.setupUi(this);
 
-    widget.resetTextColor->setIcon(KIcon("edit-clear"));
-    widget.resetBackground->setIcon(KIcon("edit-clear"));
-
-    connect(widget.textColor, SIGNAL(changed(const QColor&)), this, \
                SLOT(textColorChanged()));
-    connect(widget.backgroundColor, SIGNAL(changed(const QColor&)), this, \
                SLOT(backgroundColorChanged()));
-
-    connect(widget.resetTextColor, SIGNAL(clicked()), this, SLOT(clearTextColor()));
-    connect(widget.resetBackground, SIGNAL(clicked()), this, \
SLOT(clearBackgroundColor())); +    connect(widget.hyphenate, \
SIGNAL(stateChanged(int)), this, SLOT(hyphenateStateChanged()));  
     widget.shadowGroupBox->setVisible(false);
     widget.positionGroupBox->setVisible(false);
 }
 
-void FontDecorations::backgroundColorChanged()
-{
-    m_backgroundColorReset = false; m_backgroundColorChanged = true;
-    if (!m_ignoreSignals) {
-        m_backgroundColorInherited = false;
-    }
-    if (widget.backgroundColor->color().isValid()) {
-        emit backgroundColorChanged(widget.backgroundColor->color());
-    }
-}
-
-void FontDecorations::textColorChanged()
-{
-    m_textColorReset = false; m_textColorChanged = true;
-    if (!m_ignoreSignals) {
-        m_foregroundColorInherited = false;
-    }
-    if (widget.textColor->color().isValid()) {
-        emit textColorChanged(widget.textColor->color());
-    }
-}
-
-void FontDecorations::textToggled(bool state)
-{
-    widget.textColor->setEnabled(state);
-    widget.resetTextColor->setEnabled(state);
-}
-
-void FontDecorations::backgroundToggled(bool state)
+void FontDecorations::hyphenateStateChanged()
 {
     m_hyphenateInherited = false;
 }
@@ -80,24 +43,13 @@ void FontDecorations::setDisplay(KoCharacterStyle *style)
     if (!style)
         return;
 
-    m_ignoreSignals = true;
-    m_textColorChanged = false;
-    m_backgroundColorChanged = false;
-    m_textColorReset = !style->hasProperty(QTextFormat::ForegroundBrush);
-    m_foregroundColorInherited = m_textColorReset;
-    if (m_textColorReset || (style->foreground().style() == Qt::NoBrush)) {
-        clearTextColor();
-    } else {
-        widget.textColor->setColor(style->foreground().color());
+    m_hyphenateInherited = !style->hasProperty(KoCharacterStyle::HasHyphenation);
+    if (!m_uniqueFormat) {
+        widget.hyphenate->setTristate(true);
+        widget.hyphenate->setCheckState(Qt::PartiallyChecked);
     }
-    m_backgroundColorReset = !style->hasProperty(QTextFormat::BackgroundBrush);
-    m_backgroundColorInherited = m_backgroundColorReset;
-    if (m_backgroundColorReset || (style->background().style() == Qt::NoBrush)) {
-        clearBackgroundColor();
-    } else {
-        widget.backgroundColor->setColor(style->background().color());
-    }
-    m_ignoreSignals = false;
+    else
+        widget.hyphenate->setChecked(style->hasHyphenation());
 }
 
 void FontDecorations::save(KoCharacterStyle *style) const
@@ -105,36 +57,13 @@ void FontDecorations::save(KoCharacterStyle *style) const
     if (!style)
         return;
 
-    if (!m_backgroundColorInherited && m_backgroundColorReset) {
-        style->setBackground(QBrush(Qt::NoBrush));
-    }
-    else if (!m_backgroundColorInherited && m_backgroundColorChanged) {
-        style->setBackground(QBrush(widget.backgroundColor->color()));
-    }
-    if (!m_foregroundColorInherited && m_textColorReset) {
-        style->setForeground(QBrush(Qt::NoBrush));
+    if (!m_hyphenateInherited) {
+        if (widget.hyphenate->checkState() == Qt::Checked)
+            style->setHasHyphenation(true);
+        else if (widget.hyphenate->checkState() == Qt::Unchecked)
+            style->setHasHyphenation(false);
     }
-    else if (!m_foregroundColorInherited && m_textColorChanged) {
-        style->setForeground(QBrush(widget.textColor->color()));
-    }
-}
-
-void FontDecorations::clearTextColor()
-{
-    widget.textColor->setColor(widget.textColor->defaultColor());
-    m_textColorReset = true;
-    if (!m_ignoreSignals)
-        m_foregroundColorInherited = false;
-    emit textColorChanged(QColor(Qt::black));
-}
 
-void FontDecorations::clearBackgroundColor()
-{
-    widget.backgroundColor->setColor(widget.backgroundColor->defaultColor());
-    m_backgroundColorReset = true;
-    if (!m_ignoreSignals)
-        m_backgroundColorInherited = false;
-    emit backgroundColorChanged(QColor(Qt::transparent));
 }
 
 #include <FontDecorations.moc>
diff --git a/plugins/textshape/dialogs/FontDecorations.h \
b/plugins/textshape/dialogs/FontDecorations.h index 1bf5a3b..aa96348 100644
--- a/plugins/textshape/dialogs/FontDecorations.h
+++ b/plugins/textshape/dialogs/FontDecorations.h
@@ -45,9 +45,6 @@ private:
 
     bool m_hyphenateInherited;
     bool m_uniqueFormat;
-    bool m_foregroundColorInherited;
-    bool m_backgroundColorInherited;
-    bool m_ignoreSignals;
 };
 
 #endif
diff --git a/plugins/textshape/dialogs/ParagraphIndentSpacing.cpp \
b/plugins/textshape/dialogs/ParagraphIndentSpacing.cpp index 58e9708..99d0bf9 100644
--- a/plugins/textshape/dialogs/ParagraphIndentSpacing.cpp
+++ b/plugins/textshape/dialogs/ParagraphIndentSpacing.cpp
@@ -150,6 +150,7 @@ void ParagraphIndentSpacing::setDisplay(KoParagraphStyle *style)
 
 void ParagraphIndentSpacing::lineSpacingChanged(int row)
 {
+    kDebug(32500) << "entering lineSpacing changed: " << row;
     qreal fixedLineHeight = 0, lineSpacing = 0, minimumLineSpacing = 0;
     int percentHeight = 0;
     bool useFontMetrics = (row != 5) && (widget.useFont->isChecked());
@@ -210,7 +211,16 @@ void ParagraphIndentSpacing::lineSpacingChanged(int row)
         m_lineSpacingInherited = false;
     }
 
+    kDebug(32500) << "fixedLineHeight: " << fixedLineHeight;
+    kDebug(32500) << "lineSpacing: " << lineSpacing;
+    kDebug(32500) << "minimumLineSpacing: " << minimumLineSpacing;
+    kDebug(32500) << "percentHeight: " << percentHeight;
+    kDebug(32500) << "useFontMetrics: " << useFontMetrics;
+    kDebug(32500) << "m_lineSpacingInherited: " << m_lineSpacingInherited;
+
     emit lineSpacingChanged(fixedLineHeight, lineSpacing, minimumLineSpacing, \
percentHeight, useFontMetrics); +
+    kDebug(32500) << "end lineSpacingChanged";
 }
 
 void ParagraphIndentSpacing::spacingPercentChanged(int percent)
@@ -238,6 +248,7 @@ void ParagraphIndentSpacing::spacingValueChanged(qreal value)
 
 void ParagraphIndentSpacing::save(KoParagraphStyle *style)
 {
+    kDebug(32500) << "save start";
     // general note; we have to unset values by setting it to zero instead of \
                removing the item
     // since this dialog may be used on a copy style, which will be applied later. \
And removing  // items doesn't work for that.
@@ -260,6 +271,7 @@ void ParagraphIndentSpacing::save(KoParagraphStyle *style)
         style->setAutoTextIndent(widget.autoTextIndent->isChecked());
     }
     if (!m_lineSpacingInherited) {
+        kDebug(32500) << "lineSpacing changed currentIndex: " << \
                widget.lineSpacing->currentIndex();
         style->setLineHeightAbsolute(0); // since it trumps percentage based line \
                heights, unset it.
         style->setMinimumLineHeight(QTextLength(QTextLength::FixedLength, 0));
         style->setLineSpacing(0);
@@ -284,6 +296,12 @@ void ParagraphIndentSpacing::save(KoParagraphStyle *style)
             style->setMinimumLineHeight(QTextLength(QTextLength::FixedLength, \
widget.minimumLineSpacing->value()));  }
         style->setLineSpacingFromFont(widget.lineSpacing->currentIndex() != 5 && \
widget.useFont->isChecked()); +
+        kDebug(32500) << "style.lineHeightPercent: " << style->lineHeightPercent();
+        kDebug(32500) << "style.lineSpacing: " << style->lineSpacing();
+        kDebug(32500) << "style.lineHeightAbsolute: " << \
style->lineHeightAbsolute(); +        kDebug(32500) << "style.minimumLineHeight: " << \
style->minimumLineHeight(); +        kDebug(32500) << "style.lineSpacingFromFont: " \
<< style->lineSpacingFromFont();  }
 }
 
diff --git a/plugins/textshape/dialogs/ParagraphLayout.cpp \
b/plugins/textshape/dialogs/ParagraphLayout.cpp index 3878a04..8f58788 100644
--- a/plugins/textshape/dialogs/ParagraphLayout.cpp
+++ b/plugins/textshape/dialogs/ParagraphLayout.cpp
@@ -79,7 +79,9 @@ void ParagraphLayout::breakBeforeChanged()
 
 void ParagraphLayout::thresholdValueChanged()
 {
-    m_orphanThresholdInherited = false;
+    if (!m_ignoreSignals) {
+        m_orphanThresholdInherited = false;
+    }
 }
 
 void ParagraphLayout::setDisplay(KoParagraphStyle *style)
diff --git a/plugins/textshape/dialogs/ParagraphSettingsDialog.cpp \
b/plugins/textshape/dialogs/ParagraphSettingsDialog.cpp index befcaca..bda33ff 100644
--- a/plugins/textshape/dialogs/ParagraphSettingsDialog.cpp
+++ b/plugins/textshape/dialogs/ParagraphSettingsDialog.cpp
@@ -75,6 +75,10 @@ void ParagraphSettingsDialog::slotApply()
     chosenStyle.KoCharacterStyle::applyStyle(cformat);
     chosenStyle.applyStyle(format);
 
+    kDebug(32500) << "slotApply after save";
+    kDebug(32500) << "format.lineSpacing: " << \
format.property(KoParagraphStyle::LineSpacing); +    kDebug(32500) << \
"format.lineHeight: " << format.property(KoParagraphStyle::LineHeight); +
     m_editor->mergeAutoStyle(cformat, format);
     if (chosenStyle.listStyle()) {
         KoTextEditor::ChangeListFlags flags(KoTextEditor::AutoListStyle | \
KoTextEditor::DontUnsetIfSame);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic