r19291 by jghali - #12440: para styles using "Based On:" character inheritance trigger incorrect text display
scribus-commit
scribus-commit at lists.scribus.net
Sat Jun 28 15:37:41 UTC 2014
Author: jghali
Date: Sat Jun 28 15:37:41 2014
New Revision: 19291
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19291
Log:
#12440: para styles using "Based On:" character inheritance trigger incorrect text display
Modified:
branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
branches/Version14x/Scribus/scribus/smfontcomboh.cpp
branches/Version14x/Scribus/scribus/smtextstyles.cpp
Modified: branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19291&path=/branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Sat Jun 28 15:37:41 2014
@@ -1705,8 +1705,12 @@
newStyle.setParent(it->attribute("CPARENT"));
if (it->hasAttribute("FONT"))
- newStyle.setFont(m_AvailableFonts->findFont(it->attribute("FONT"),doc));
-
+ {
+ const ScFace& face = m_AvailableFonts->findFont(it->attribute("FONT"), doc);
+ if (!face.isNone())
+ newStyle.setFont(face);
+ }
+
if (it->hasAttribute("FONTSIZE"))
newStyle.setFontSize(qRound(ScCLocale::toDoubleC(it->attribute("FONTSIZE")) * 10));
Modified: branches/Version14x/Scribus/scribus/smfontcomboh.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19291&path=/branches/Version14x/Scribus/scribus/smfontcomboh.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/smfontcomboh.cpp (original)
+++ branches/Version14x/Scribus/scribus/smfontcomboh.cpp Sat Jun 28 15:37:41 2014
@@ -51,13 +51,15 @@
if (useParentValue_ && hasParent_)
{
- ret = fontFamily->currentIndex() == (fontFamily->count() - 1) ||
- fontStyle->currentIndex() == (fontStyle->count() - 1);
+ ret = fontFamily->currentText() == usePFont_ ||
+ fontStyle->currentText() == usePFont_;
if (ret)
{
- fontFamily->removeItem(fontFamily->count() - 1);
- fontStyle->removeItem(fontStyle->count() - 1);
+ if (fontFamily->itemText(fontFamily->count() - 1) == usePFont_)
+ fontFamily->removeItem(fontFamily->count() - 1);
+ if (fontStyle->itemText(fontStyle->count() - 1) == usePFont_)
+ fontStyle->removeItem(fontStyle->count() - 1);
setFont(false);
setCurrentFont(pFont_, true);
useParentValue_ = false;
Modified: branches/Version14x/Scribus/scribus/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19291&path=/branches/Version14x/Scribus/scribus/smtextstyles.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/smtextstyles.cpp (original)
+++ branches/Version14x/Scribus/scribus/smtextstyles.cpp Sat Jun 28 15:37:41 2014
@@ -552,7 +552,6 @@
connect(pwidget_->cpage->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
connect(pwidget_->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
connect(pwidget_->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
- connect(pwidget_->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
connect(pwidget_->cpage->parentCombo, SIGNAL(activated(const QString&)),
this, SLOT(slotCharParentChanged(const QString&)));
}
@@ -622,7 +621,6 @@
disconnect(pwidget_->cpage->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
disconnect(pwidget_->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
disconnect(pwidget_->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
- disconnect(pwidget_->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
disconnect(pwidget_->cpage->parentCombo, SIGNAL(activated(const QString&)),
this, SLOT(slotCharParentChanged(const QString&)));
}
@@ -1875,7 +1873,6 @@
connect(page_->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
connect(page_->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
connect(page_->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
- connect(page_->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
connect(page_->parentCombo, SIGNAL(activated(const QString&)),
this, SLOT(slotParentChanged(const QString&)));
}
@@ -1912,7 +1909,6 @@
disconnect(page_->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
disconnect(page_->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
disconnect(page_->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
- disconnect(page_->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
disconnect(page_->parentCombo, SIGNAL(activated(const QString&)),
this, SLOT(slotParentChanged(const QString&)));
}
@@ -2273,12 +2269,11 @@
void SMCharacterStyle::slotFont(QString s)
{
- ScFace sf;
if (page_->fontFace_->useParentFont())
for (int i = 0; i < selection_.count(); ++i)
selection_[i]->resetFont();
else {
- sf = PrefsManager::instance()->appPrefs.AvailFonts[s];
+ ScFace sf = PrefsManager::instance()->appPrefs.AvailFonts[s];
for (int i = 0; i < selection_.count(); ++i)
selection_[i]->setFont(sf);
More information about the scribus-commit
mailing list