r18746 by jghali - #11977 related: fix potential crash in style manager when opening character palette after enabling bullets or numerations
scribus-commit
scribus-commit at lists.scribus.net
Sun Jan 19 00:39:58 UTC 2014
Author: jghali
Date: Sun Jan 19 00:39:58 2014
New Revision: 18746
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18746
Log:
#11977 related: fix potential crash in style manager when opening character palette after enabling bullets or numerations
Modified:
trunk/Scribus/scribus/ui/smpstylewidget.cpp
trunk/Scribus/scribus/ui/smpstylewidget.h
trunk/Scribus/scribus/ui/smtextstyles.cpp
Modified: trunk/Scribus/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18746&path=/trunk/Scribus/scribus/ui/smpstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.cpp Sun Jan 19 00:39:58 2014
@@ -24,9 +24,11 @@
}
-SMPStyleWidget::SMPStyleWidget(ScribusDoc* doc) : QWidget()
+SMPStyleWidget::SMPStyleWidget(ScribusDoc* doc, StyleSet<CharStyle> *cstyles) : QWidget()
{
m_Doc = doc;
+ m_cstyles = cstyles;
+
setupUi(this);
//Not used yet
// optMarginCheckLeftProtruding->setVisible(false);
@@ -1149,7 +1151,7 @@
QString styleName = parEffectCharStyleCombo->currentText();
if (styleName != tr("No Style") && !styleName.isEmpty())
{
- CharStyle chStyle = m_Doc->charStyle(styleName);
+ CharStyle chStyle = m_cstyles->get(styleName);
setCurrentComboItem(m_enhanced->fontSelector, chStyle.font().scName());
}
else if (currPStyle)
Modified: trunk/Scribus/scribus/ui/smpstylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18746&path=/trunk/Scribus/scribus/ui/smpstylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.h Sun Jan 19 00:39:58 2014
@@ -9,17 +9,17 @@
#define SMPSTYLEWIDGET_H
class QEvent;
+class CharStyle;
#include "ui_smpstylewidget.h"
+#include "styles/styleset.h"
#include "ui/charselectenhanced.h"
-// #include "styles/styleset.h"
-
class SMPStyleWidget : public QWidget, Ui::SMPStyleWidget
{
Q_OBJECT
public:
- SMPStyleWidget(ScribusDoc *doc);
+ SMPStyleWidget(ScribusDoc *doc, StyleSet<CharStyle> *cstyles);
~SMPStyleWidget();
virtual void changeEvent(QEvent *e);
@@ -40,6 +40,7 @@
ScribusDoc * m_Doc;
QString currFontName;
ParagraphStyle* currPStyle;
+ StyleSet<CharStyle> *m_cstyles;
void fillBulletStrEditCombo();
void fillNumFormatCombo();
Modified: trunk/Scribus/scribus/ui/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18746&path=/trunk/Scribus/scribus/ui/smtextstyles.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.cpp (original)
+++ trunk/Scribus/scribus/ui/smtextstyles.cpp Sun Jan 19 00:39:58 2014
@@ -45,7 +45,7 @@
m_pwidget(0), m_doc(0), m_selectionIsDirty(false), m_unitRatio(1.0), m_cstyles(cstyles)
{
Q_ASSERT(m_cstyles);
- m_pwidget = new SMPStyleWidget(m_doc);
+ m_pwidget = new SMPStyleWidget(m_doc, m_cstyles);
Q_CHECK_PTR(m_pwidget);
}
More information about the scribus-commit
mailing list