r20116 by jghali - fix use of space instead of tabs for indentation
scribus-commit
scribus-commit at lists.scribus.net
Fri May 22 22:10:07 UTC 2015
Author: jghali
Date: Fri May 22 22:10:07 2015
New Revision: 20116
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20116
Log:
fix use of space instead of tabs for indentation
Modified:
trunk/Scribus/scribus/fontlistmodel.cpp
trunk/Scribus/scribus/fonts/ftface.cpp
Modified: trunk/Scribus/scribus/fontlistmodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20116&path=/trunk/Scribus/scribus/fontlistmodel.cpp
==============================================================================
--- trunk/Scribus/scribus/fontlistmodel.cpp (original)
+++ trunk/Scribus/scribus/fontlistmodel.cpp Fri May 22 22:10:07 2015
@@ -23,22 +23,21 @@
psFont = loadIcon("font_type1_16.png");
substFont = loadIcon("font_subst16.png");
m_font_values = m_fonts.values();
- m_font_names = m_fonts.keys();
+ m_font_names = m_fonts.keys();
}
void FontListModel::setFonts(QList<QString> f)
{
beginResetModel();
- m_font_names = f;
- m_font_values.clear();
- m_embedMethod.clear();
- for (int i = 0; i < m_font_names.length(); ++i)
- {
- ScFace font = m_fonts[m_font_names[i]];
- m_font_values.append(font);
- m_embedMethod.append(font.subset()? SubsetFont : font.embedPs()? EmbedFont : DontEmbed);
-
- }
+ m_font_names = f;
+ m_font_values.clear();
+ m_embedMethod.clear();
+ for (int i = 0; i < m_font_names.length(); ++i)
+ {
+ ScFace font = m_fonts[m_font_names[i]];
+ m_font_values.append(font);
+ m_embedMethod.append(font.subset()? SubsetFont : font.embedPs()? EmbedFont : DontEmbed);
+ }
endResetModel();
}
@@ -64,48 +63,48 @@
if (orientation == Qt::Vertical)
return QVariant(); // no verticals
// TODO for tooltips etc.
-
- bool isDisplayRole = (role == Qt::DisplayRole);
- switch(role)
- {
- case Qt::DisplayRole:
- case Qt::ToolTipRole:
- switch (section)
- {
- case FontListModel::FontName:
- return tr("Font Name");
- case FontListModel::FontUsable:
- return isDisplayRole? QString("â") : tr("Use Font");
-// case FontListModel::FontFamily:
-// return tr("Family");
-// case FontListModel::FontStyle:
-// return tr("Style");
-// case FontListModel::FontVariant:
-// return tr("Variant");
- case FontListModel::FontType:
- return isDisplayRole? QString("a") : tr("Type");
- case FontListModel::FontFormat:
- return isDisplayRole? QString("b") : tr("Format");
- case FontListModel::FontEmbed:
- return isDisplayRole? QString("c") : tr("Embed in PostScript");
- case FontListModel::FontSubset:
- return isDisplayRole? QString("d") : tr("Subset");
- case FontListModel::FontOutline:
- return isDisplayRole? QString("e") : tr("Outline");
- case FontListModel::FontAccess:
- return isDisplayRole? QString("f") : tr("Access");
- case FontListModel::FontInDoc:
- return isDisplayRole? QString("g") : tr("Used in Doc");
- case FontListModel::FontFile:
- return tr("Path to Font File");
- default:
- return "Never should be shown";
- };
-
- default:
- // dummy return
- return QVariant();
- }
+
+ bool isDisplayRole = (role == Qt::DisplayRole);
+ switch(role)
+ {
+ case Qt::DisplayRole:
+ case Qt::ToolTipRole:
+ switch (section)
+ {
+ case FontListModel::FontName:
+ return tr("Font Name");
+ case FontListModel::FontUsable:
+ return isDisplayRole? QString("â") : tr("Use Font");
+// case FontListModel::FontFamily:
+// return tr("Family");
+// case FontListModel::FontStyle:
+// return tr("Style");
+// case FontListModel::FontVariant:
+// return tr("Variant");
+ case FontListModel::FontType:
+ return isDisplayRole? QString("a") : tr("Type");
+ case FontListModel::FontFormat:
+ return isDisplayRole? QString("b") : tr("Format");
+ case FontListModel::FontEmbed:
+ return isDisplayRole? QString("c") : tr("Embed in PostScript");
+ case FontListModel::FontSubset:
+ return isDisplayRole? QString("d") : tr("Subset");
+ case FontListModel::FontOutline:
+ return isDisplayRole? QString("e") : tr("Outline");
+ case FontListModel::FontAccess:
+ return isDisplayRole? QString("f") : tr("Access");
+ case FontListModel::FontInDoc:
+ return isDisplayRole? QString("g") : tr("Used in Doc");
+ case FontListModel::FontFile:
+ return tr("Path to Font File");
+ default:
+ return "Never should be shown";
+ };
+
+ default:
+ // dummy return
+ return QVariant();
+ }
}
QVariant FontListModel::data(const QModelIndex & index,
@@ -131,17 +130,17 @@
};
}
- if (role == Qt::DisplayRole || role == Qt::ToolTipRole)
+ if (role == Qt::DisplayRole || role == Qt::ToolTipRole)
{
switch (index.column())
{
case FontListModel::FontName:
- if (role == Qt::DisplayRole)
- return font.scName();
- return
- tr("Family") + ":\t" + font.family() + "\n"
- + tr("Style") + ":\t" + font.style() + "\n"
- + tr("Variant") + ":\t" + font.variant();
+ if (role == Qt::DisplayRole)
+ return font.scName();
+ return
+ tr("Family") + ":\t" + font.family() + "\n"
+ + tr("Style") + ":\t" + font.style() + "\n"
+ + tr("Variant") + ":\t" + font.variant();
// case FontListModel::FontFamily:
// return font.family();
// case FontListModel::FontStyle:
@@ -150,9 +149,9 @@
// return font.variant();
case FontListModel::FontType:
{
- if (role == Qt::DisplayRole)
- return QVariant();
-
+ if (role == Qt::DisplayRole)
+ return QVariant();
+
switch (font.type())
{
case ScFace::TYPE0:
@@ -198,50 +197,50 @@
case FontListModel::FontFile:
return font.fontPath();
case FontListModel::SortIndex:
- if (font.scName()[0] == QChar('.'))
- return font.scName().mid(1).toLower();
+ if (font.scName()[0] == QChar('.'))
+ return font.scName().mid(1).toLower();
return font.scName().toLower();
default:
- if (role == Qt::ToolTipRole
- &&
- (index.column() == FontListModel::FontUsable
- || index.column() == FontListModel::FontEmbed
- || index.column() == FontListModel::FontSubset
- || index.column() == FontListModel::FontOutline
- )
- )
- {
- return tr("Click to change the value");
- }
+ if (role == Qt::ToolTipRole
+ &&
+ (index.column() == FontListModel::FontUsable
+ || index.column() == FontListModel::FontEmbed
+ || index.column() == FontListModel::FontSubset
+ || index.column() == FontListModel::FontOutline
+ )
+ )
+ {
+ return tr("Click to change the value");
+ }
return QVariant();
};
}
-
+
if (role == Qt::CheckStateRole && index.column() == FontListModel::FontUsable)
return !isLive() || (font.usable() ? Qt::Checked : Qt::Unchecked);
if (role == Qt::CheckStateRole && index.column() == FontListModel::FontEmbed)
- {
- if (isLive())
- return (font.embedPs() ? Qt::Checked : Qt::Unchecked);
- else
- return (m_embedMethod[index.row()] >= EmbedFont ? Qt::Checked : Qt::Unchecked);
- }
+ {
+ if (isLive())
+ return (font.embedPs() ? Qt::Checked : Qt::Unchecked);
+ else
+ return (m_embedMethod[index.row()] >= EmbedFont ? Qt::Checked : Qt::Unchecked);
+ }
if (role == Qt::CheckStateRole && index.column() == FontListModel::FontSubset)
- {
- if (isLive())
- return (font.subset() ? Qt::Checked : Qt::Unchecked);
- else
- return (m_embedMethod[index.row()] >= SubsetFont ? Qt::Checked : Qt::Unchecked);
- }
- if (role == Qt::CheckStateRole && index.column() == FontListModel::FontOutline)
- {
- if (isLive())
- return (font.outline() ? Qt::Checked : Qt::Unchecked);
- else
- return (m_embedMethod[index.row()] >= OutlineFont ? Qt::Checked : Qt::Unchecked);
- }
+ {
+ if (isLive())
+ return (font.subset() ? Qt::Checked : Qt::Unchecked);
+ else
+ return (m_embedMethod[index.row()] >= SubsetFont ? Qt::Checked : Qt::Unchecked);
+ }
+ if (role == Qt::CheckStateRole && index.column() == FontListModel::FontOutline)
+ {
+ if (isLive())
+ return (font.outline() ? Qt::Checked : Qt::Unchecked);
+ else
+ return (m_embedMethod[index.row()] >= OutlineFont ? Qt::Checked : Qt::Unchecked);
+ }
return QVariant();
}
@@ -254,8 +253,8 @@
return QAbstractTableModel::flags(index);
if (index.column() == FontListModel::FontUsable
|| index.column() == FontListModel::FontEmbed
- || index.column() == FontListModel::FontOutline
- || index.column() == FontListModel::FontSubset)
+ || index.column() == FontListModel::FontOutline
+ || index.column() == FontListModel::FontSubset)
return Qt::ItemIsUserCheckable | /*Qt::ItemIsEditable |*/ defaultFlags;
else
return defaultFlags;
@@ -284,45 +283,46 @@
ScFace f = m_font_values[idx.row()];
- if (isLive())
- {
- if (idx.column() == FontListModel::FontUsable)
- f.usable(!f.usable());
- else if (idx.column() == FontListModel::FontEmbed)
- f.embedPs(!f.embedPs());
- else if (idx.column() == FontListModel::FontSubset)
- f.subset(!f.subset());
- else if (idx.column() == FontListModel::FontOutline)
- f.outline(!f.outline());
- else
- qDebug("FontListModel::setData() out of defined editable columns");
- }
- else
- {
- if (idx.column() == FontListModel::FontEmbed)
- {
- if (m_embedMethod[idx.row()] == EmbedFont)
- m_embedMethod[idx.row()] = DontEmbed;
- else
- m_embedMethod[idx.row()] = EmbedFont;
- }
- else if (idx.column() == FontListModel::FontSubset)
- {
- if (m_embedMethod[idx.row()] == SubsetFont)
- m_embedMethod[idx.row()] = EmbedFont;
- else
- m_embedMethod[idx.row()] = SubsetFont;
- }
- else if (idx.column() == FontListModel::FontOutline)
- {
- if (m_embedMethod[idx.row()] == OutlineFont)
- m_embedMethod[idx.row()] = SubsetFont;
- else
- m_embedMethod[idx.row()] = OutlineFont;
- }else
- qDebug("FontListModel::setData() out of defined editable columns");
- }
- emit dataChanged(index(idx.row(),FontListModel::FontEmbed), index(idx.row(),FontListModel::FontOutline));
+ if (isLive())
+ {
+ if (idx.column() == FontListModel::FontUsable)
+ f.usable(!f.usable());
+ else if (idx.column() == FontListModel::FontEmbed)
+ f.embedPs(!f.embedPs());
+ else if (idx.column() == FontListModel::FontSubset)
+ f.subset(!f.subset());
+ else if (idx.column() == FontListModel::FontOutline)
+ f.outline(!f.outline());
+ else
+ qDebug("FontListModel::setData() out of defined editable columns");
+ }
+ else
+ {
+ if (idx.column() == FontListModel::FontEmbed)
+ {
+ if (m_embedMethod[idx.row()] == EmbedFont)
+ m_embedMethod[idx.row()] = DontEmbed;
+ else
+ m_embedMethod[idx.row()] = EmbedFont;
+ }
+ else if (idx.column() == FontListModel::FontSubset)
+ {
+ if (m_embedMethod[idx.row()] == SubsetFont)
+ m_embedMethod[idx.row()] = EmbedFont;
+ else
+ m_embedMethod[idx.row()] = SubsetFont;
+ }
+ else if (idx.column() == FontListModel::FontOutline)
+ {
+ if (m_embedMethod[idx.row()] == OutlineFont)
+ m_embedMethod[idx.row()] = SubsetFont;
+ else
+ m_embedMethod[idx.row()] = OutlineFont;
+ }
+ else
+ qDebug("FontListModel::setData() out of defined editable columns");
+ }
+ emit dataChanged(index(idx.row(),FontListModel::FontEmbed), index(idx.row(),FontListModel::FontOutline));
return true;
}
Modified: trunk/Scribus/scribus/fonts/ftface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20116&path=/trunk/Scribus/scribus/fonts/ftface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.cpp (original)
+++ trunk/Scribus/scribus/fonts/ftface.cpp Fri May 22 22:10:07 2015
@@ -309,7 +309,7 @@
QString FtFace::adobeGlyphName(FT_ULong charcode)
{
- return ::adobeGlyphName(charcode);
+ return ::adobeGlyphName(charcode);
}
More information about the scribus-commit
mailing list