r22582 by jghali - XtgScanner does not need to keep the available codec list: remove m_codecList
scribus-commit
scribus-commit at lists.scribus.net
Sat Jun 16 23:00:16 UTC 2018
Author: jghali
Date: Sat Jun 16 23:00:16 2018
New Revision: 22582
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22582
Log:
XtgScanner does not need to keep the available codec list: remove m_codecList
Modified:
trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp
trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.h
Modified: trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22582&path=/trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp Sat Jun 16 23:00:16 2018
@@ -69,12 +69,9 @@
initLanguages();
prevMode = textMode;
styleEffects = ScStyle_None;
- m_codecList = QTextCodec::availableCodecs();
- if (m_codecList.contains("cp1252"))
- m_codec = QTextCodec::codecForName("cp1252"); // Default ANSI codec
- else
+ m_codec = QTextCodec::codecForName("cp1252");
+ if (!m_codec)
m_codec = QTextCodec::codecForLocale();
-
}
/** Initialise a QHash which maps the values of n## to corresponding language strings
@@ -874,10 +871,11 @@
encTest = "windows-949";
else if (enc == 20)
encTest = "KSC_5601";
- if (m_codecList.contains(encTest))
- m_codec = QTextCodec::codecForName(encTest);
- else
+ m_codec = QTextCodec::codecForName(encTest);
+ if (!m_codec)
m_codec = QTextCodec::codecForName("cp1252");
+ if (!m_codec)
+ m_codec = QTextCodec::codecForLocale();
}
/** Functions corresponding to tokens in textMode
Modified: trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22582&path=/trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.h
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.h (original)
+++ trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.h Sat Jun 16 23:00:16 2018
@@ -32,8 +32,13 @@
#include "pageitem.h"
+#include <QByteArray>
#include <QHash>
+#include <QString>
+#include <QSet>
#include <QTextCodec>
+
+
/**
Enum datatype for determining the Scanner mode
*/
@@ -107,7 +112,6 @@
*/
int define;
QTextCodec *m_codec;
- QList<QByteArray> m_codecList;
bool m_isBold;
bool m_isItalic;
More information about the scribus-commit
mailing list