/trunk/Scribus/scribus/appmodehelper.cpp |
---|
147,7 → 147,7 |
scmw->pageSelector->setFocusPolicy(Qt::ClickFocus); |
(*a_scrActions)["editClearContents"]->setEnabled(false); |
(*a_scrActions)["editTruncateContents"]->setEnabled(false); |
scmw->charPalette->setEnabled(false, 0); |
scmw->charPalette->setEnabled(false, nullptr); |
if (currItem != nullptr) |
{ |
currItem->update(); |
630,7 → 630,7 |
(*a_scrActions)["insertSampleText"]->setEnabled(true); |
//scrMenuMgr->setMenuEnabled("InsertMark",true); |
if ((currItem->nextInChain() != 0) || (currItem->prevInChain() != 0)) |
if ((currItem->nextInChain() != nullptr) || (currItem->prevInChain() != nullptr)) |
{ |
(*a_scrActions)["itemConvertToBezierCurve"]->setEnabled(false); |
(*a_scrActions)["itemConvertToImageFrame"]->setEnabled(false); |
641,7 → 641,7 |
(*a_scrActions)["toolsUnlinkTextFrame"]->setEnabled(true); |
(*a_scrActions)["toolsUnlinkTextFrameAndCutText"]->setEnabled(true); |
// FIXME: once there's one itemtext per story, always enable editcontents |
if ((currItem->prevInChain() != 0) && (currItem->itemText.length() == 0)) |
if ((currItem->prevInChain() != nullptr) && (currItem->itemText.length() == 0)) |
(*a_scrActions)["toolsEditContents"]->setEnabled(false); |
else |
(*a_scrActions)["toolsEditContents"]->setEnabled(true); |
867,10 → 867,10 |
if (item1->asTextFrame() && (item2->asPolygon() || item2->asPolyLine() || item2->asSpiral() || item2->asArc() || item2->asRegularPolygon())) |
{ |
canAttachTextToPath = true; |
canAttachTextToPath &= (item1->nextInChain() == 0); |
canAttachTextToPath &= (item1->prevInChain() == 0); |
canAttachTextToPath &= (item2->nextInChain() == 0); |
canAttachTextToPath &= (item2->prevInChain() == 0); |
canAttachTextToPath &= (item1->nextInChain() == nullptr); |
canAttachTextToPath &= (item1->prevInChain() == nullptr); |
canAttachTextToPath &= (item2->nextInChain() == nullptr); |
canAttachTextToPath &= (item2->prevInChain() == nullptr); |
canAttachTextToPath &= (!item1->isGroup() && !item2->isGroup()); |
} |
(*a_scrActions)["itemAttachTextToPath"]->setEnabled(canAttachTextToPath); |
/trunk/Scribus/scribus/canvas.cpp |
---|
512,8 → 512,7 |
{ |
if ((m_doc->drawAsPreview && !m_doc->editOnPreview) && !ret->isAnnotation()) |
return nullptr; |
else |
return ret; |
return ret; |
} |
} |
return currItem; |
532,9 → 531,7 |
qreal right = left + sideLength; |
qreal top = frame->yPos() + frame->height() - sideLength;// * 1.5; |
qreal bottom = top + sideLength; |
if(mp.x()>left && mp.x()<right && mp.y()>top && mp.y()<bottom) |
return true; |
return false; |
return mp.x()>left && mp.x()<right && mp.y()>top && mp.y()<bottom; |
} |
bool Canvas::cursorOverFrameControl(QPoint globalPos, QRectF targetRect, PageItem* frame) |
2179,7 → 2176,7 |
for (int lks = 0; lks < m_viewMode.linkedFramesToShow.count(); ++lks) |
{ |
nextItem = m_viewMode.linkedFramesToShow.at(lks); |
while (nextItem != 0) |
while (nextItem != nullptr) |
{ |
if (nextItem->nextInChain() != nullptr) |
{ |
/trunk/Scribus/scribus/canvasgesture_resize.cpp |
---|
351,8 → 351,8 |
// We do not want to scale the text of a linked frame |
// as it would alter text in other frames of the string |
else if((currItem->itemType() == PageItem::TextFrame) |
&& (currItem->nextInChain() == 0) |
&& (currItem->prevInChain() == 0) |
&& (currItem->nextInChain() == nullptr) |
&& (currItem->prevInChain() == nullptr) |
&& scaleContent) |
{ |
double divX = (currItem->width() != 0) ? currItem->width() : 1.0; |
/trunk/Scribus/scribus/canvasmode.cpp |
---|
108,8 → 108,7 |
CanvasMode::~CanvasMode() |
{ |
if (m_panGesture) |
delete m_panGesture; |
delete m_panGesture; |
} |
CanvasMode* CanvasMode::createForAppMode(ScribusView* view, int appMode) |
/trunk/Scribus/scribus/canvasmode_create.cpp |
---|
796,13 → 796,13 |
{ |
m_view->requestMode(submodePaintingDone); |
delete dia; |
dia = 0; |
dia = nullptr; |
break; |
} |
int numRows = dia->Rows->value(); |
int numColumns = dia->Cols->value(); |
delete dia; |
dia = 0; |
dia = nullptr; |
// Add the table item. |
// TODO: This should be done in an undo transaction. |
m_doc->dontResize = true; |
/trunk/Scribus/scribus/canvasmode_drawbezier.cpp |
---|
148,7 → 148,7 |
Selection tempSelection(m_doc, false); |
tempSelection.addItem(currItem); |
m_doc->itemSelection_DeleteItem(&tempSelection, true); |
currItem = 0; |
currItem = nullptr; |
} |
} |
189,7 → 189,7 |
m_view->stopGesture(); |
undoManager->setUndoEnabled(true); |
currItem = m_doc->m_Selection->itemAt(0); |
if (currItem != 0) |
if (currItem != nullptr) |
finalizeItem(currItem); |
if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools) |
m_view->requestMode(modeNormal); |
213,7 → 213,7 |
//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas |
m_view->m_ScMW->zoomSpinBox->clearFocus(); |
m_view->m_ScMW->pageSelector->clearFocus(); |
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action |
if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action |
{ |
currItem = m_doc->m_Selection->itemAt(0); |
m_doc->nodeEdit.finishTransaction(currItem); |
444,7 → 444,7 |
{ |
undoManager->setUndoEnabled(true); |
currItem = m_doc->m_Selection->itemAt(0); |
if (currItem != 0) |
if (currItem != nullptr) |
{ |
finalizeItem(currItem); |
} |
488,7 → 488,7 |
//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas |
m_view->m_ScMW->zoomSpinBox->clearFocus(); |
m_view->m_ScMW->pageSelector->clearFocus(); |
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action |
if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action |
{ |
currItem = m_doc->m_Selection->itemAt(0); |
m_doc->nodeEdit.finishTransaction(currItem); |
/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp |
---|
322,7 → 322,7 |
//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas |
m_view->m_ScMW->zoomSpinBox->clearFocus(); |
m_view->m_ScMW->pageSelector->clearFocus(); |
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action |
if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action |
{ |
currItem = m_doc->m_Selection->itemAt(0); |
m_doc->nodeEdit.finishTransaction(currItem); |
/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp |
---|
312,7 → 312,7 |
//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas |
m_view->m_ScMW->zoomSpinBox->clearFocus(); |
m_view->m_ScMW->pageSelector->clearFocus(); |
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action |
if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action |
{ |
currItem = m_doc->m_Selection->itemAt(0); |
m_doc->nodeEdit.finishTransaction(currItem); |
/trunk/Scribus/scribus/canvasmode_edit.cpp |
---|
287,7 → 287,7 |
m_view->update(); |
} |
mRulerGuide = -1; |
PageItem * it(0); |
PageItem * it(nullptr); |
if (GetItem(&it)) |
{ |
if (it->asTextFrame()) |
319,7 → 319,7 |
m->accept(); |
m_canvas->m_viewMode.m_MouseButtonPressed = false; |
m_canvas->resetRenderMode(); |
PageItem *currItem = 0; |
PageItem *currItem = nullptr; |
if (GetItem(&currItem) && (m_doc->appMode == modeEdit) && currItem->asTextFrame()) |
{ |
//CB if annotation, open the annotation dialog |
943,7 → 943,7 |
//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas |
m_view->m_ScMW->zoomSpinBox->clearFocus(); |
m_view->m_ScMW->pageSelector->clearFocus(); |
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action |
if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action |
{ |
currItem = m_doc->m_Selection->itemAt(0); |
m_doc->nodeEdit.finishTransaction(currItem); |
/trunk/Scribus/scribus/canvasmode_editarc.cpp |
---|
67,7 → 67,7 |
m_arcPoint = noPointDefined; |
m_startAngle = m_endAngle = 0; |
vectorDialog = 0; |
vectorDialog = nullptr; |
} |
inline bool CanvasMode_EditArc::GetItem(PageItem** pi) |
/trunk/Scribus/scribus/canvasmode_editgradient.cpp |
---|
272,7 → 272,7 |
m_canvas->m_viewMode.m_MouseButtonPressed = false; |
m_canvas->resetRenderMode(); |
// m_view->stopDragTimer(); |
PageItem *currItem = 0; |
PageItem *currItem = nullptr; |
if ((m_doc->m_Selection->isMultipleSelection()) || (m_doc->appMode != modeNormal)) |
{ |
if ((m_doc->m_Selection->isMultipleSelection()) && (m_doc->appMode == modeNormal)) |
/trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp |
---|
532,7 → 532,7 |
m->accept(); |
m_canvas->m_viewMode.m_MouseButtonPressed = false; |
m_canvas->resetRenderMode(); |
PageItem *currItem = 0; |
PageItem *currItem = nullptr; |
if ((m_doc->m_Selection->isMultipleSelection()) || (m_doc->appMode != modeNormal)) |
{ |
if ((m_doc->m_Selection->isMultipleSelection()) && (m_doc->appMode == modeNormal)) |
/trunk/Scribus/scribus/canvasmode_edittable.cpp |
---|
41,7 → 41,7 |
#endif |
CanvasMode_EditTable::CanvasMode_EditTable(ScribusView* view) : CanvasMode(view), |
m_table(0), |
m_table(nullptr), |
m_canvasUpdateTimer(new QTimer(view)), |
m_longBlink(false), |
m_cursorVisible(false), |
/trunk/Scribus/scribus/canvasmode_editweldpoint.cpp |
---|
448,49 → 448,49 |
y = 0.0; |
return; |
} |
else if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs(0.0 - y) < radius)) |
if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs(0.0 - y) < radius)) |
{ |
x = m_currItem->width() / 2.0; |
y = 0.0; |
return; |
} |
else if ((qAbs(m_currItem->width() - x) < radius) && (qAbs(0.0 - y) < radius)) |
if ((qAbs(m_currItem->width() - x) < radius) && (qAbs(0.0 - y) < radius)) |
{ |
x = m_currItem->width(); |
y = 0.0; |
return; |
} |
else if ((qAbs(0.0 - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius)) |
if ((qAbs(0.0 - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius)) |
{ |
x = 0.0; |
y = m_currItem->height() / 2.0; |
return; |
} |
else if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius)) |
if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius)) |
{ |
x = m_currItem->width() / 2.0; |
y = m_currItem->height() / 2.0; |
return; |
} |
else if ((qAbs(m_currItem->width() - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius)) |
if ((qAbs(m_currItem->width() - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius)) |
{ |
x = m_currItem->width(); |
y = m_currItem->height() / 2.0; |
return; |
} |
else if ((qAbs(0.0 - x) < radius) && (qAbs(m_currItem->height() - y) < radius)) |
if ((qAbs(0.0 - x) < radius) && (qAbs(m_currItem->height() - y) < radius)) |
{ |
x = 0.0; |
y = m_currItem->height(); |
return; |
} |
else if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs(m_currItem->height() - y) < radius)) |
if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs(m_currItem->height() - y) < radius)) |
{ |
x = m_currItem->width() / 2.0; |
y = m_currItem->height(); |
return; |
} |
else if ((qAbs(m_currItem->width() - x) < radius) && (qAbs(m_currItem->height() - y) < radius)) |
if ((qAbs(m_currItem->width() - x) < radius) && (qAbs(m_currItem->height() - y) < radius)) |
{ |
x = m_currItem->width(); |
y = m_currItem->height(); |
/trunk/Scribus/scribus/canvasmode_framelinks.cpp |
---|
297,7 → 297,7 |
SeleItem(m); |
if (GetItem(&currItem) && (currItem->asTextFrame())) |
{ |
if (currItem->prevInChain() != 0) |
if (currItem->prevInChain() != nullptr) |
{ |
currItem->prevInChain()->unlink(); |
} |
329,7 → 329,7 |
if ((m_doc->appMode == modeLinkFrames) || (m_doc->appMode == modeUnlinkFrames)) |
{ |
m_view->updateContents(); |
if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools || m_doc->ElemToLink == 0) |
if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools || m_doc->ElemToLink == nullptr) |
m_view->requestMode(submodePaintingDone); |
return; |
} |
/trunk/Scribus/scribus/canvasmode_nodeedit.cpp |
---|
491,7 → 491,7 |
//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas |
m_view->m_ScMW->zoomSpinBox->clearFocus(); |
m_view->m_ScMW->pageSelector->clearFocus(); |
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action |
if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action |
{ |
currItem = m_doc->m_Selection->itemAt(0); |
m_doc->nodeEdit.finishTransaction(currItem); |
/trunk/Scribus/scribus/canvasmode_normal.cpp |
---|
151,7 → 151,7 |
void CanvasMode_Normal::mouseDoubleClickEvent(QMouseEvent *m) |
{ |
PageItem *currItem = 0; |
PageItem *currItem = nullptr; |
m->accept(); |
m_canvas->m_viewMode.m_MouseButtonPressed = false; |
if (m_doc->drawAsPreview) |
226,10 → 226,10 |
m_view->requestMode(submodeStatusPic); |
else if (currItem->imageVisible()) |
m_view->requestMode(modeEdit); |
} |
else if (currItem->itemType() == PageItem::TextFrame) |
} |
else if (currItem->itemType() == PageItem::TextFrame) |
{ |
m_view->requestMode(modeEdit); |
m_view->requestMode(modeEdit); |
} |
else |
{ |
492,7 → 492,7 |
m_doc->DragP = false; |
m_doc->leaveDrag = false; |
m_canvas->m_viewMode.m_MouseButtonPressed = false; |
m_doc->DraggedElem = 0; |
m_doc->DraggedElem = nullptr; |
m_doc->DragElements.clear(); |
m_view->setCursor(QCursor(Qt::ArrowCursor)); |
m_view->updateContents(); |
632,8 → 632,8 |
if (abs(dX)>abs(dY)) |
dY=0; |
else |
if (abs(dY)>abs(dX)) |
dX=0; |
if (abs(dY)>abs(dX)) |
dX=0; |
erf=false; |
dX+=m_dragConstrainInitPtX-qRound(gx); |
dY+=m_dragConstrainInitPtY-qRound(gy); |
930,7 → 930,7 |
m_view->updatesOn(true); |
m_doc->m_Selection->delaySignalsOff(); |
} |
if ((currItem && !currItem->locked() && m_frameResizeHandle > 0) == false && (!m_doc->drawAsPreview)) |
if (!(currItem && !currItem->locked() && m_frameResizeHandle > 0) && (!m_doc->drawAsPreview)) |
{ |
m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc; |
} |
1260,7 → 1260,7 |
m_view->m_ScMW->pageSelector->clearFocus(); |
if (m_doc->m_Selection->count() > 0) |
{ |
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action |
if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action |
{ |
currItem = m_doc->m_Selection->itemAt(0); |
m_doc->nodeEdit.finishTransaction(currItem); |
1763,13 → 1763,10 |
m_doc->m_Selection->connectItemToGUI(); |
return true; |
} |
else |
{ |
// If we call startGesture now, a new guide is created each time. |
// ### could be a weakness to avoid calling it tho. |
// m_view->startGesture(guideMoveGesture); |
m_guideMoveGesture->mouseSelectGuide(m); |
} |
// If we call startGesture now, a new guide is created each time. |
// ### could be a weakness to avoid calling it tho. |
// m_view->startGesture(guideMoveGesture); |
m_guideMoveGesture->mouseSelectGuide(m); |
} |
m_doc->m_Selection->connectItemToGUI(); |
if ( !(m->modifiers() & SELECT_MULTIPLE)) |
1794,7 → 1791,7 |
QStringList formats; |
int fmtCode = FORMATID_FIRSTUSER; |
const FileFormat *fmt = LoadSavePlugin::getFormatById(fmtCode); |
while (fmt != 0) |
while (fmt != nullptr) |
{ |
if (fmt->load) |
{ |
/trunk/Scribus/scribus/chartablemodel.cpp |
---|
36,7 → 36,7 |
QVariant CharTableModel::data(const QModelIndex &index, int role) const |
{ |
if (!index.isValid() || m_doc == 0) |
if (!index.isValid() || m_doc == nullptr) |
return QVariant(); |
int ix = index.row() * m_cols + index.column(); |
/trunk/Scribus/scribus/chartableview.cpp |
---|
17,7 → 17,7 |
CharTableView::CharTableView(QWidget * parent) |
: QTableView(parent), |
zoom(0) |
zoom(nullptr) |
{ |
deleteAct = new QAction( tr("Delete"), this); |
connect(deleteAct, SIGNAL(triggered()), this, SLOT(removeCharacter())); |
137,7 → 137,7 |
{ |
zoom->close(); |
delete zoom; |
zoom = 0; |
zoom = nullptr; |
} |
} |
/trunk/Scribus/scribus/collect4output.cpp |
---|
32,7 → 32,7 |
CollectForOutput::CollectForOutput(ScribusDoc* doc, QString outputDirectory, bool withFonts, bool withProfiles, bool compressDoc) |
: QObject(ScCore), |
m_Doc(0), |
m_Doc(nullptr), |
m_outputDirectory(QString::null), |
profileCount(0), |
itemCount(0), |
379,16 → 379,16 |
QString fontDir = itf.absolutePath(); |
QString fontFile = itf.fileName(); |
metrics += findFontMetrics(fontDir, fontFile); |
if ( metrics.size() <= 0 ) |
if ( metrics.empty() ) |
{ |
QDir dir; |
if (dir.exists(fontDir + "/AFMs")) |
metrics += findFontMetrics(fontDir + "/AFMs", fontFile); |
if (dir.exists(fontDir + "/afm") && metrics.size() <= 0) |
if (dir.exists(fontDir + "/afm") && metrics.empty()) |
metrics += findFontMetrics(fontDir + "/afm", fontFile); |
if (dir.exists(fontDir + "/Pfm") && metrics.size() <= 0) |
if (dir.exists(fontDir + "/Pfm") && metrics.empty()) |
metrics += findFontMetrics(fontDir + "/Pfm", fontFile); |
if (dir.exists(fontDir + "/pfm") && metrics.size() <= 0) |
if (dir.exists(fontDir + "/pfm") && metrics.empty()) |
metrics += findFontMetrics(fontDir + "/pfm", fontFile); |
} |
for (int a = 0; a < metrics.size(); a++) |
/trunk/Scribus/scribus/colormgmt/scciedata.cpp |
---|
24,7 → 24,7 |
if (ScCIEData::m_instance) |
{ |
delete ScCIEData::m_instance; |
ScCIEData::m_instance = 0; |
ScCIEData::m_instance = nullptr; |
} |
} |
/trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp |
---|
27,11 → 27,7 |
{ |
ScColorTransform colorTransform; |
if (m_profile) |
{ |
colorTransform = m_profile.engine().createTransform(m_profile, m_colorFormat, |
outputProfile, outputFormat, renderIntent, |
transformFlags); |
} |
colorTransform = m_profile.engine().createTransform(m_profile, m_colorFormat, outputProfile, outputFormat, renderIntent, transformFlags); |
return colorTransform; |
} |
105,4 → 101,4 |
free(dataBuffer); |
} |
return success; |
} |
} |
/trunk/Scribus/scribus/colormgmt/sccolortransform.cpp |
---|
7,7 → 7,7 |
#include "sccolortransform.h" |
ScColorTransform::ScColorTransform() : m_data(NULL) |
ScColorTransform::ScColorTransform() : m_data(nullptr) |
{ |
} |
32,4 → 32,4 |
bool ScColorTransform::operator==(const ScColorTransform& other) const |
{ |
return m_data == other.m_data; |
} |
} |
/trunk/Scribus/scribus/colormgmt/sccolortransformpool.cpp |
---|
15,7 → 15,7 |
} |
void ScColorTransformPool::clear(void) |
void ScColorTransformPool::clear() |
{ |
m_pool.clear(); |
} |
57,7 → 57,7 |
ScColorTransform ScColorTransformPool::findTransform(const ScColorTransformInfo& info) const |
{ |
ScColorTransform transform(NULL); |
ScColorTransform transform(nullptr); |
QList< QWeakPointer<ScColorTransformData> >::ConstIterator it = m_pool.begin(); |
for ( ; it != m_pool.end(); ++it) |
{ |
72,4 → 72,4 |
} |
} |
return transform; |
} |
} |
/trunk/Scribus/scribus/colormgmt/sccolortransformpool.h |
---|
20,7 → 20,7 |
public: |
ScColorTransformPool (int engineID); |
void clear(void); |
void clear(); |
void addTransform(const ScColorTransform& transform, bool force = false); |
void removeTransform(const ScColorTransform& transform); |
void removeTransform(const ScColorTransformInfo& info); |
/trunk/Scribus/scribus/colormgmt/sce308tables.cpp |
---|
20,7 → 20,6 |
} |
ScE308Table5_D50_2deg::ScE308Table5_D50_2deg() |
: ScE308Table() |
{ |
m_wx[360] = 0.000, m_wy[360] = 0.000, m_wz[360] = 0.001; |
m_wx[370] = 0.001, m_wy[370] = 0.000, m_wz[370] = 0.005; |
76,7 → 75,6 |
} |
ScE308Table5_D50_10deg::ScE308Table5_D50_10deg() |
: ScE308Table() |
{ |
m_wx[360] = 0.000, m_wy[360] = 0.000, m_wz[360] = 0.000; |
m_wx[370] = 0.000, m_wy[370] = 0.000, m_wz[370] = 0.000; |
132,7 → 130,6 |
} |
ScE308Table6_D50_2deg::ScE308Table6_D50_2deg() |
: ScE308Table() |
{ |
m_wx[360] = 0.000, m_wy[360] = 0.000, m_wz[360] = 0.000; |
m_wx[370] = 0.001, m_wy[370] = 0.000, m_wz[370] = 0.005; |
188,7 → 185,6 |
} |
ScE308Table6_D50_10deg::ScE308Table6_D50_10deg() |
: ScE308Table() |
{ |
m_wx[360] = 0.000, m_wy[360] = 0.000, m_wz[360] = 0.000; |
m_wx[370] = 0.000, m_wy[370] = 0.000, m_wz[370] = 0.000; |
241,4 → 237,4 |
m_wx[760] = 0.001, m_wy[760] = 0.000, m_wz[760] = 0.000; |
m_wx[770] = 0.000, m_wy[770] = 0.000, m_wz[770] = 0.000; |
m_wx[780] = 0.000, m_wy[780] = 0.000, m_wz[780] = 0.000; |
} |
} |
/trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp |
---|
58,7 → 58,7 |
QFileInfo fi(directory + "/" + file); |
if (fi.isDir() && !recursive) |
continue; |
else if (fi.isDir() && !file.startsWith('.')) |
if (fi.isDir() && !file.startsWith('.')) |
{ |
QList<ScColorProfileInfo> profileInfos2 = getAvailableProfileInfo(fi.filePath()+"/", true); |
profileInfos.append(profileInfos2); |
/trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp |
---|
81,7 → 81,7 |
return m_productDescription; |
} |
void ScLcms2ColorProfileImpl::closeProfile(void) |
void ScLcms2ColorProfileImpl::closeProfile() |
{ |
if (m_profileHandle) |
{ |
/trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.cpp |
---|
44,7 → 44,7 |
return false; |
} |
void ScLcms2ColorTransformImpl::deleteTransform(void) |
void ScLcms2ColorTransformImpl::deleteTransform() |
{ |
if (m_transformHandle) |
{ |
/trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.h |
---|
28,7 → 28,7 |
protected: |
cmsHTRANSFORM m_transformHandle; |
void deleteTransform(void); |
void deleteTransform(); |
}; |
#endif |
/trunk/Scribus/scribus/colorsetmanager.cpp |
---|
110,9 → 110,9 |
lf.fromQColor(QColor(pg.attribute("RGB"))); |
else |
{ |
double L = pg.attribute("L", 0).toDouble(); |
double a = pg.attribute("A", 0).toDouble(); |
double b = pg.attribute("B", 0).toDouble(); |
double L = pg.attribute("L", nullptr).toDouble(); |
double a = pg.attribute("A", nullptr).toDouble(); |
double b = pg.attribute("B", nullptr).toDouble(); |
lf.setLabColor(L, a, b); |
} |
if (pg.hasAttribute("Spot")) |
329,7 → 329,7 |
const FileFormat *fmt = LoadSavePlugin::getFormatById(FORMATID_SLA150IMPORT); |
if (fmt) |
{ |
fmt->setupTargets(doc, 0, doc->scMW(), 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts)); |
fmt->setupTargets(doc, nullptr, doc->scMW(), nullptr, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts)); |
fmt->loadPalette(paletteFileName); |
} |
else |
/trunk/Scribus/scribus/desaxe/digester.cpp |
---|
202,15 → 202,15 |
{ |
if (pattern1 == "") |
return pattern2; |
else if (pattern2 == "") |
if (pattern2 == "") |
return pattern1; |
else if ( (pattern1[pattern1.length()-1] != '/') && (pattern2[0] != '/') ) |
if ( (pattern1[pattern1.length()-1] != '/') && (pattern2[0] != '/') ) |
// insert "/" as separator |
return pattern1 + "/" + pattern2; |
else if ( (pattern1[pattern1.length()-1]=='/') || (pattern2[0]=='/') ) |
if ( (pattern1[pattern1.length()-1]=='/') || (pattern2[0]=='/') ) |
return pattern1 + pattern2; |
else // cut off one "/" |
return pattern1 + QString::fromStdString(std::string(static_cast<const std::string&>(pattern2.toStdString()), 1, std::string::npos)); |
// cut off one "/" |
return pattern1 + QString::fromStdString(std::string(static_cast<const std::string&>(pattern2.toStdString()), 1, std::string::npos)); |
} |
225,14 → 225,12 |
if (dfa) |
{ |
std::set<dfa_state_t> morituri(dfa->states()); |
for (auto i = morituri.begin(); i != morituri.end(); ++i) { |
for (auto i = morituri.begin(); i != morituri.end(); ++i) |
delete *i; |
} |
delete dfa; |
} |
} |
void RuleState::addRule(const Xml_string& pattern, Action action) |
{ |
rules.push_back(std::pair<Xml_string, Action>(pattern,action)); |
/trunk/Scribus/scribus/downloadmanager/scdlthread.cpp |
---|
14,7 → 14,7 |
ScDLThread::ScDLThread(QObject *parent) : QThread(parent), |
m_downloadedCount(0), m_totalCount(0) |
{ |
m_currentDownload = 0; |
m_currentDownload = nullptr; |
connect(this, SIGNAL(runSignal()), this, SLOT(runSlot())); |
} |
128,7 → 128,7 |
m_currentDownload = m_manager.get(request); |
connect(m_currentDownload, SIGNAL(finished()), this, SLOT(downloadFinished())); |
connect(m_currentDownload, SIGNAL(readyRead()), this, SLOT(downloadReadyRead())); |
connect(m_currentDownload, SIGNAL(downloadProgress(qint64, qint64)), this, SIGNAL(fileDownloadProgress(qint64, qint64))); |
connect(m_currentDownload, SIGNAL(downloadProgress(qint64,qint64)),this,SIGNAL(fileDownloadProgress(qint64,qint64))); |
//qDebug()<<"Downloading:"<<urlPair.first.toEncoded().constData(); |
} |
204,15 → 204,10 |
startNextDownload(); |
} |
bool ScDLThread::urlOK(QUrl url) |
bool ScDLThread::urlOK(const QUrl& url) |
{ |
//TODO: Add some more URL checks |
if (!url.isValid() || url.isEmpty() || url.host().isEmpty()) |
{ |
//qDebug()<<"URL invalid:"<<url; |
return false; |
} |
return true; |
return !(!url.isValid() || url.isEmpty() || url.host().isEmpty()); |
} |
/trunk/Scribus/scribus/downloadmanager/scdlthread.h |
---|
39,7 → 39,7 |
void runSlot(); |
private: |
bool urlOK(QUrl url); |
bool urlOK(const QUrl& url); |
QStringList m_urlList; |
QFile m_output; |
QQueue<QPair<QUrl, QString> > m_downloadQueue; |
/trunk/Scribus/scribus/fileloader.cpp |
---|
59,7 → 59,7 |
\retval None |
*/ |
FileLoader::FileLoader(const QString & fileName) : |
QObject(0), |
QObject(nullptr), |
formatSLA12x(LoadSavePlugin::getFormatById(FORMATID_SLA12XIMPORT)), |
formatSLA13x(LoadSavePlugin::getFormatById(FORMATID_SLA13XIMPORT)), |
formatSLA134(LoadSavePlugin::getFormatById(FORMATID_SLA134IMPORT)), |
132,7 → 132,7 |
QString ext = it->fileExtensions[a].toLower(); |
if (lwrFileName.endsWith("." + ext)) // Beware of file names containing multiple points |
{ |
if (it->plug->fileSupported(0, m_fileName)) |
if (it->plug->fileSupported(nullptr, m_fileName)) |
{ |
ret = it->formatId; |
found = true; |
157,7 → 157,7 |
QString exts = it->fileExtensions[a].toLower(); |
if (ext == exts) |
{ |
if (it->plug->fileSupported(0, m_fileName)) |
if (it->plug->fileSupported(nullptr, m_fileName)) |
{ |
ret = it->formatId; |
found = true; |
191,7 → 191,7 |
} |
if (m_fileType == FORMATID_SLA13XIMPORT || m_fileType == FORMATID_SLA134IMPORT || m_fileType == FORMATID_SLA150IMPORT) |
{ |
it->plug->setupTargets(currDoc, 0, currDoc->scMW(), currDoc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts)); |
it->plug->setupTargets(currDoc, nullptr, currDoc->scMW(), currDoc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts)); |
ret = it->plug->loadPage(m_fileName, PageToLoad, Mpage, renamedPageName); |
// if (ret) |
// it->plug->getReplacedFontData(newReplacement, ReplacedFonts, dummyScFaces); |
256,7 → 256,7 |
case FORMATID_SLA134IMPORT: |
case FORMATID_SLA150IMPORT: |
{ |
it->setupTargets(currDoc, 0, currDoc->scMW(), currDoc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts)); |
it->setupTargets(currDoc, nullptr, currDoc->scMW(), currDoc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts)); |
ret=it->loadFile(m_fileName, LoadSavePlugin::lfCreateDoc); |
// if (ret) |
// it->getReplacedFontData(newReplacement, ReplacedFonts, dummyScFaces); |
290,7 → 290,7 |
QList<FileFormat>::const_iterator it; |
if (findFormat(m_fileType, it)) |
{ |
it->plug->setupTargets(doc, 0, doc->scMW(), doc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts)); |
it->plug->setupTargets(doc, nullptr, doc->scMW(), doc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts)); |
return it->readStyles(m_fileName, doc, docParagraphStyles); |
} |
return false; |
301,7 → 301,7 |
QList<FileFormat>::const_iterator it; |
if (findFormat(m_fileType, it)) |
{ |
it->plug->setupTargets(doc, 0, doc->scMW(), doc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts)); |
it->plug->setupTargets(doc, nullptr, doc->scMW(), doc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts)); |
return it->readCharStyles(m_fileName, doc, docCharStyles); |
} |
return false; |
/trunk/Scribus/scribus/fontlistmodel.cpp |
---|
211,15 → 211,13 |
{ |
if (isLive()) |
return (font.usable() ? Qt::Checked : Qt::Unchecked); |
else |
return (m_enabledFonts[index.row()] ? Qt::Checked : Qt::Unchecked); |
return (m_enabledFonts[index.row()] ? Qt::Checked : Qt::Unchecked); |
} |
if (role == Qt::CheckStateRole && index.column() == FontListModel::FontSubset) |
{ |
if (isLive()) |
return (font.subset() ? Qt::Checked : Qt::Unchecked); |
else |
return ((m_embedFlags[index.row()] & SubsetPDF) ? Qt::Checked : Qt::Unchecked); |
return ((m_embedFlags[index.row()] & SubsetPDF) ? Qt::Checked : Qt::Unchecked); |
} |
return QVariant(); |
/trunk/Scribus/scribus/fonts/cff.cpp |
---|
88,16 → 88,11 |
int idx = id & 0xff; |
if (idx >= 0 && idx <= 38) |
return cffDictKeys0c[idx]; |
else |
return ""; |
return ""; |
} |
else |
{ |
if ( /* id >= 0 && */ id <= 21) |
return cffDictKeys[id]; |
else |
return ""; |
} |
if ( /* id >= 0 && */ id <= 21) |
return cffDictKeys[id]; |
return ""; |
} |
static const char* stdStrings[] = { |
1083,7 → 1078,7 |
write(out, " <Encoding>\n "); |
pos = encOffset; |
QList<uint> enc = readEncoding(pos); |
write(out, readSegment(encOffset, pos-encOffset).toHex()); |
write(out, readSegment(encOffset, pos - encOffset).toHex()); |
write(out, "\n </Encoding>\n"); |
} |
else |
1155,12 → 1150,11 |
{ |
if (dataLength < 255) |
return 1; |
else if (dataLength < 65535) |
if (dataLength < 65535) |
return 2; |
else if (dataLength < 0xFFFFFF) |
if (dataLength < 0xFFFFFF) |
return 3; |
else |
return 4; |
return 4; |
} |
1715,7 → 1709,7 |
uint privateOffset = result.writeSegment(privateBytes); |
// write local subr |
if (localSubrs.size() > 0) |
if (!localSubrs.empty()) |
{ |
uint localSubrOffset = result.writeSegment(makeIndex(localSubrs)); |
/trunk/Scribus/scribus/fonts/cff.h |
---|
137,7 → 137,8 |
}; |
enum CFF_Variant_Type { |
enum CFF_Variant_Type |
{ |
cff_varnt_Error = 0, |
cff_varnt_Bool = 1, |
cff_varnt_Card = 2, |
149,7 → 150,8 |
}; |
struct CFF_Number { |
struct CFF_Number |
{ |
long long card; |
int exponent; |
uchar type; |
156,10 → 158,12 |
bool isCardinal() const; |
double toDouble() const; |
int toCardinal() const; |
CFF_Number() : card(0),exponent(0),type(0) {}; |
}; |
struct CFF_Variant { |
struct CFF_Variant |
{ |
uchar type; |
QList<CFF_Number> array; |
CFF_Variant() : type(cff_varnt_Error) {} |
/trunk/Scribus/scribus/fonts/fontfeatures.cpp |
---|
65,7 → 65,7 |
FontFeatures::StyleSet11 + FontFeatures::StyleSet12 + FontFeatures::StyleSet13 + FontFeatures::StyleSet14 + FontFeatures::StyleSet15 + |
FontFeatures::StyleSet16 + FontFeatures::StyleSet17 + FontFeatures::StyleSet18 + FontFeatures::StyleSet19 + FontFeatures::StyleSet20; |
quint64 FontFeatures::fontFlagsFromList(QStringList features) |
quint64 FontFeatures::fontFlagsFromList(const QStringList& features) |
{ |
quint64 flags = 0; |
165,7 → 165,7 |
return flags; |
} |
quint64 FontFeatures::textFlagsFromList(QStringList features) |
quint64 FontFeatures::textFlagsFromList(const QStringList& features) |
{ |
quint64 flags = 0; |
flags |= CommonLigatures; |
265,4 → 265,4 |
} |
return flags; |
} |
} |
/trunk/Scribus/scribus/fonts/fontfeatures.h |
---|
65,8 → 65,8 |
static quint64 NumeralFractionsMask; |
static quint64 StyleSetsMask; |
static quint64 fontFlagsFromList(QStringList features); |
static quint64 textFlagsFromList(QStringList features); |
static quint64 fontFlagsFromList(const QStringList& features); |
static quint64 textFlagsFromList(const QStringList& features); |
}; |
#endif |
/trunk/Scribus/scribus/fonts/ftface.cpp |
---|
40,23 → 40,21 |
unicode emulate: spaces, hyphen, ligatures?, diacritics? |
*****/ |
FtFace::FtFace(QString fam, QString sty, QString vari, QString scname, |
QString psname, QString path, int face, QStringList features) |
: ScFaceData(), |
m_face(nullptr), |
m_isBold(false), |
m_isItalic(false), |
m_encoding(0.0), |
m_uniEM(0.0), |
m_ascent(0.0), |
m_descent(0.0), |
m_height(0.0), |
m_xHeight(0.0), |
m_capHeight(0.0), |
m_maxAdvanceWidth(0.0), |
m_underlinePos(0.0), |
m_strikeoutPos(0.0), |
m_strokeWidth(0.0) |
FtFace::FtFace(const QString& fam, const QString& sty, const QString& vari, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features) |
: m_face(nullptr), |
m_isBold(false), |
m_isItalic(false), |
m_encoding(0.0), |
m_uniEM(0.0), |
m_ascent(0.0), |
m_descent(0.0), |
m_height(0.0), |
m_xHeight(0.0), |
m_capHeight(0.0), |
m_maxAdvanceWidth(0.0), |
m_underlinePos(0.0), |
m_strikeoutPos(0.0), |
m_strokeWidth(0.0) |
{ |
family = fam; |
style = sty; |
66,10 → 64,9 |
fontFile = path; |
faceIndex = face; |
fontFeatures = features; |
if (!m_library) { |
if (!m_library) |
if (FT_Init_FreeType( &m_library )) |
sDebug(QObject::tr("Freetype2 library not available")); |
} |
} |
78,16 → 75,18 |
} |
FT_Face FtFace::ftFace() const { |
if (!m_face) { |
if (FT_New_Face( m_library, QFile::encodeName(fontFile), faceIndex, & m_face )) { |
FT_Face FtFace::ftFace() const |
{ |
if (!m_face) |
{ |
if (FT_New_Face( m_library, QFile::encodeName(fontFile), faceIndex, & m_face )) |
{ |
status = ScFace::BROKEN; |
m_face = nullptr; |
sDebug(QObject::tr("Font %1(%2) is broken").arg(fontFile).arg(faceIndex)); |
} |
else { |
else |
load(); |
} |
} |
return m_face; |
} |
97,7 → 96,8 |
ScFaceData::load(); |
if (!m_face) { |
if (FT_New_Face( m_library, QFile::encodeName(fontFile), faceIndex, & m_face )) { |
if (FT_New_Face( m_library, QFile::encodeName(fontFile), faceIndex, & m_face )) |
{ |
status = ScFace::BROKEN; |
m_face = nullptr; |
sDebug(QObject::tr("Font %1(%2) is broken").arg(fontFile).arg(faceIndex)); |
/trunk/Scribus/scribus/fonts/ftface.h |
---|
53,8 → 53,8 |
struct SCRIBUS_API FtFace : public ScFace::ScFaceData |
{ |
FtFace(QString fam, QString sty, QString variant, QString scname, |
QString psname, QString path, int face, QStringList features); |
FtFace(const QString& fam, const QString& sty, const QString& variant, const QString& scname, |
const QString& psname, const QString& path, int face, const QStringList& features); |
FT_Face ftFace() const; |
/trunk/Scribus/scribus/fonts/scface.cpp |
---|
128,14 → 128,14 |
{ |
GlyphMetrics res; |
if (gl >= CONTROL_GLYPHS) |
{ res.width = glyphWidth(gl, sz); |
{ |
res.width = glyphWidth(gl, sz); |
res.ascent = (gl == 0? ascent(sz) : 0); |
res.descent = 0; |
return res; |
} |
else if (! m_glyphWidth.contains(gl)) { |
if (! m_glyphWidth.contains(gl)) |
loadGlyph(gl); |
} |
const struct GlyphData & data(m_glyphOutline[gl]); |
res.width = data.bbox_width * sz; |
res.ascent = data.bbox_ascent * sz; |
148,9 → 148,8 |
{ |
if (gl >= CONTROL_GLYPHS) |
return 0.0; |
else if (! m_glyphWidth.contains(gl)) { |
if (! m_glyphWidth.contains(gl)) |
loadGlyph(gl); |
} |
return m_glyphWidth[gl] * size; |
} |
159,9 → 158,8 |
{ |
if (gl >= CONTROL_GLYPHS) |
return FPointArray(); |
else if (! m_glyphWidth.contains(gl)) { |
if (! m_glyphWidth.contains(gl)) |
loadGlyph(gl); |
} |
FPointArray res = m_glyphOutline[gl].Outlines.copy(); |
if (sz != 1.0) |
res.scale(sz, sz); |
173,9 → 171,8 |
{ |
if (gl >= CONTROL_GLYPHS) |
return FPoint(0,0); |
else if (! m_glyphWidth.contains(gl)) { |
if (! m_glyphWidth.contains(gl)) |
loadGlyph(gl); |
} |
const struct GlyphData & res(m_glyphOutline[gl]); |
return FPoint(res.x, res.y) * sz; |
} |
219,10 → 216,11 |
ScFace::~ScFace() |
{ |
if ( m_m && --(m_m->refs) == 0 ) { |
if ( m_m && --(m_m->refs) == 0 ) |
{ |
m_m->unload(); |
delete m_m; |
m_m = 0; |
m_m = nullptr; |
} |
} |
233,7 → 231,8 |
{ |
if (other.m_m) |
++(other.m_m->refs); |
if ( m_m && --(m_m->refs) == 0 ) { |
if ( m_m && --(m_m->refs) == 0 ) |
{ |
m_m->unload(); |
delete m_m; |
} |
432,14 → 431,13 |
if (ch == SpecialChars::LINEBREAK || ch == SpecialChars::PARSEP |
|| ch == SpecialChars::FRAMEBREAK || ch == SpecialChars::COLBREAK |
|| ch == SpecialChars::TAB || ch == SpecialChars::SHYPHEN |
|| ch == SpecialChars::ZWSPACE || ch == SpecialChars::ZWNBSPACE || ch==SpecialChars::OBJECT) |
|| ch == SpecialChars::ZWSPACE || ch == SpecialChars::ZWNBSPACE || ch==SpecialChars::OBJECT) |
return CONTROL_GLYPHS + ch; |
else if (ch == SpecialChars::NBSPACE) |
if (ch == SpecialChars::NBSPACE) |
return m_m->char2CMap(' '); |
else if(ch == SpecialChars::NBHYPHEN) |
if(ch == SpecialChars::NBHYPHEN) |
return hyphenGlyph(); |
else |
return 0; |
return 0; |
} |
ScFace::gid_type ScFace::hyphenGlyph() const |
{ |
473,9 → 471,8 |
ScFace::gid_type ScFace::char2CMap(uint ch) const |
{ |
if (m_m->status == ScFace::UNKNOWN) { |
if (m_m->status == ScFace::UNKNOWN) |
m_m->load(); |
} |
if (ch == SpecialChars::SHYPHEN) |
return emulateGlyph(ch); |
484,8 → 481,7 |
if (gl == 0) |
return emulateGlyph(ch); |
else |
return gl; |
return gl; |
} |
493,25 → 489,21 |
{ |
if (!usable()) |
return false; |
else { |
gid_type gl = char2CMap(ch.unicode()); // calls load() |
if (gl >= CONTROL_GLYPHS) // those are always empty |
return true; |
else if (gl != 0) { |
m_m->loadGlyph(gl); |
return ! m_m->m_glyphOutline[gl].broken; |
} |
else { |
return false; |
} |
gid_type gl = char2CMap(ch.unicode()); // calls load() |
if (gl >= CONTROL_GLYPHS) // those are always empty |
return true; |
if (gl != 0) |
{ |
m_m->loadGlyph(gl); |
return !m_m->m_glyphOutline[gl].broken; |
} |
return false; |
} |
bool ScFace::embedFont(QByteArray &str) |
{ |
if (m_m->status == ScFace::UNKNOWN) { |
if (m_m->status == ScFace::UNKNOWN) |
m_m->load(); |
} |
return m_m->embedFont(str); |
} |
518,9 → 510,8 |
bool ScFace::glyphNames(FaceEncoding& gList) |
{ |
if (m_m->status == ScFace::UNKNOWN) { |
if (m_m->status == ScFace::UNKNOWN) |
m_m->load(); |
} |
return m_m->glyphNames(gList); |
} |
527,22 → 518,21 |
void ScFace::rawData(QByteArray & bb) |
{ |
if (m_m->status == ScFace::UNKNOWN) { |
if (m_m->status == ScFace::UNKNOWN) |
m_m->load(); |
} |
m_m->rawData(bb); |
} |
void ScFace::checkAllGlyphs() |
{ |
if (m_m->status == ScFace::UNKNOWN) { |
if (m_m->status == ScFace::UNKNOWN) |
m_m->load(); |
} |
if (m_m->status != ScFace::LOADED) { |
if (m_m->status != ScFace::LOADED) |
return; |
} |
for (gid_type gl=0; gl <= m_m->maxGlyph; ++gl) { |
if (! m_m->m_glyphWidth.contains(gl)) { |
for (gid_type gl=0; gl <= m_m->maxGlyph; ++gl) |
{ |
if (! m_m->m_glyphWidth.contains(gl)) |
{ |
m_m->loadGlyph(gl); |
m_m->m_glyphWidth.remove(gl); |
m_m->m_glyphOutline.remove(gl); |
/trunk/Scribus/scribus/fonts/scface.h |
---|
33,7 → 33,8 |
class CharStyle; |
struct GlyphMetrics { |
struct GlyphMetrics |
{ |
qreal width; |
qreal ascent; |
qreal descent; |
/trunk/Scribus/scribus/fonts/scface_ps.cpp |
---|
24,16 → 24,16 |
metricsFiles += findFontMetrics(fontDir, fontFile); |
//if no metrics found look in afm and pfm subdirs |
if ( metricsFiles.size() <= 0 ) |
if ( metricsFiles.empty() ) |
{ |
QDir dir; |
if (dir.exists(fontDir + "/AFMs")) |
metricsFiles += findFontMetrics(fontDir + "/AFMs", fontFile); |
if (dir.exists(fontDir + "/afm") && metricsFiles.size() <= 0) |
if (dir.exists(fontDir + "/afm") && metricsFiles.empty()) |
metricsFiles += findFontMetrics(fontDir + "/afm", fontFile); |
if (dir.exists(fontDir + "/Pfm") && metricsFiles.size() <= 0) |
if (dir.exists(fontDir + "/Pfm") && metricsFiles.empty()) |
metricsFiles += findFontMetrics(fontDir + "/Pfm", fontFile); |
if (dir.exists(fontDir + "/pfm") && metricsFiles.size() <= 0) |
if (dir.exists(fontDir + "/pfm") && metricsFiles.empty()) |
metricsFiles += findFontMetrics(fontDir + "/pfm", fontFile); |
} |
return metricsFiles; |
82,7 → 82,7 |
{ |
bool metricsFound = false; |
QStringList fontMetrics = findFontMetrics(fontPath); |
if (fontMetrics.size() > 0) |
if (!fontMetrics.empty()) |
{ |
bool brokenMetric = false; |
QString metricsFile; |
/trunk/Scribus/scribus/fonts/scface_ttf.cpp |
---|
21,7 → 21,7 |
#include FT_TRUETYPE_IDS_H |
ScFace_ttf::ScFace_ttf (QString fam, QString sty, QString alt, QString scname, QString psname, QString path, int face, QStringList features ) |
ScFace_ttf::ScFace_ttf (const QString& fam, const QString& sty, const QString& alt, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features ) |
: FtFace (fam, sty, alt, scname, psname, path, face, features) |
{ |
formatCode = ScFace::SFNT; |
166,7 → 166,8 |
{ |
QByteArray bb; |
FtFace::rawData(bb); |
if (formatCode == ScFace::TYPE42) { |
if (formatCode == ScFace::TYPE42) |
{ |
//easy: |
str = bb; |
return true; |
180,13 → 181,12 |
FT_ULong charcode; |
FT_UInt gindex; |
FT_Face face = ftFace(); |
if (!face) { |
if (!face) |
return false; |
} |
const FT_Stream fts = face->stream; |
if (ftIOFunc(fts, 0L, NULL, 0)) { |
if (ftIOFunc(fts, 0L, nullptr, 0)) |
return(false); |
} |
str+="%!PS-TrueTypeFont\n"; |
str+="11 dict begin\n"; |
str+="/FontName /" + psName + " def\n"; |
234,7 → 234,8 |
poso = 0; |
str += "00\n>"; |
} |
else { |
else |
{ |
sDebug(QObject::tr("Font %1 is broken (read stream), no embedding").arg(fontFile)); |
str += "\n] def\n"; |
status = qMax(status,ScFace::BROKENGLYPHS); |
/trunk/Scribus/scribus/fonts/scface_ttf.h |
---|
21,7 → 21,7 |
class SCRIBUS_API ScFace_ttf : public FtFace |
{ |
public: |
ScFace_ttf (QString fam, QString sty, QString alt, QString scname, QString psname, QString path, int face, QStringList features); |
ScFace_ttf (const QString& fam, const QString& sty, const QString& alt, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features); |
~ScFace_ttf(); |
void load () const; |
/trunk/Scribus/scribus/fonts/scfontmetrics.cpp |
---|
81,7 → 81,7 |
// the following line, assuming that the default charmap has the index 0 |
int defaultchmap = 0; |
FT_ULong dbgInfo = 0; |
FT_Load_Sfnt_Table( face, FT_MAKE_TAG('p','o','s','t'), 0, NULL, &dbgInfo ); |
FT_Load_Sfnt_Table( face, FT_MAKE_TAG('p','o','s','t'), 0, nullptr, &dbgInfo ); |
qDebug() << "setBestEncoding for " << FT_Get_Postscript_Name(face) << " with " << face->num_glyphs << "glyphs, hasNames=" << FT_HAS_GLYPH_NAMES(face) << ", POST size=" << dbgInfo ; |
for(int u = 0; u < face->num_charmaps; u++) |
{ |
108,7 → 108,7 |
qDebug() << "found Custom enc for" << face->family_name << face->style_name; |
break; |
} |
else if (charmap->encoding == FT_ENCODING_MS_SYMBOL) |
if (charmap->encoding == FT_ENCODING_MS_SYMBOL) |
{ |
qDebug() << "found Symbol enc for" << face->family_name << face->style_name; |
228,7 → 228,7 |
} |
QPixmap FontSample(const ScFace& fnt, int s, QVector<uint> ts, QColor back, bool force) |
QPixmap FontSample(const ScFace& fnt, int s, QVector<uint> ts, const QColor& back, bool force) |
{ |
FT_Face face; |
FT_Library library; |
474,15 → 474,18 |
QString result; |
if (adobeGlyphNames.contains(charcode)) |
return adobeGlyphNames[charcode]; |
else if (charcode < 0x10000) { |
if (charcode < 0x10000) |
{ |
result = QString("uni") + HEX[charcode>>12 & 0xF] |
+ HEX[charcode>> 8 & 0xF] |
+ HEX[charcode>> 4 & 0xF] |
+ HEX[charcode & 0xF]; |
} |
else { |
else |
{ |
result = QString("u"); |
for (int i= 28; i >= 0; i-=4) { |
for (int i= 28; i >= 0; i-=4) |
{ |
if (charcode & (0xF << i)) |
result += HEX[charcode >> i & 0xF]; |
} |
/trunk/Scribus/scribus/fonts/scfontmetrics.h |
---|
33,7 → 33,7 |
FPointArray SCRIBUS_API traceChar(FT_Face face, ScFace::ucs4_type chr, int chs, qreal *x, qreal *y, bool *err); |
FPointArray SCRIBUS_API traceGlyph(FT_Face face, ScFace::gid_type gl, int chs, qreal *x, qreal *y, bool *err); |
QPixmap SCRIBUS_API FontSample(const ScFace& fnt, int s, QVector<uint> ts, QColor back, bool force = false); |
QPixmap SCRIBUS_API FontSample(const ScFace& fnt, int s, QVector<uint> ts, const QColor& back, bool force = false); |
//bool SCRIBUS_API GlyphNames(const FtFace& fnt, ScFace::FaceEncoding& GList); |
#endif |
/trunk/Scribus/scribus/fonts/sfnt.cpp |
---|
311,24 → 311,16 |
{ |
if (m_names.length() > 0) |
return m_names.length(); |
else |
return post_format10_names_count; |
return post_format10_names_count; |
} |
QString PostTable::nameFor(uint glyph) const |
{ |
if (glyph < (uint) m_names.length()) |
{ |
return m_names[glyph]; |
} |
else if (glyph < sfnt::post_format10_names_count) |
{ |
if (glyph < sfnt::post_format10_names_count) |
return post_format10_names[glyph]; |
} |
else |
{ |
return ".notdef"; |
} |
return ".notdef"; |
} |