DecomposedMatix::DecomposedMatix(const QTransform &t0) { .... if (!qFuzzyCompare(t.m33(), 1.0)) { const qreal invM33 = 1.0 / t.m33(); for (auto row : rows) { // <= row *= invM33; } } .... }
for (auto &row : rows) { row *= invM33; }
QPolygonF KoColorSpace::estimatedTRCXYY() const { .... for (int j = 5; j>0; j--) { channelValuesF.fill(0.0); channelValuesF[i] = ((max / 4)*(5 - j)); if (colorModelId().id() != "XYZA") { fromNormalisedChannelsValue(data, channelValuesF); convertPixelsTo(....); xyzColorSpace->normalisedChannelsValue(....); } if (j == 0) { // <= colorantY = channelValuesF[1]; if (d->colorants.size()<2) { d->colorants.resize(3 * colorChannelCount()); d->colorants[i] = .... d->colorants[i + 1] = .... d->colorants[i + 2] = .... } } } .... }
qreal KoTextLayoutArea::addLine(QTextLine &line, FrameIterator *cursor, KoTextBlockData &blockData) { if (!d->documentLayout->changeTracker() || !d->documentLayout->changeTracker()->displayChanges() // <= || !d->documentLayout->changeTracker()->... || !d->documentLayout->changeTracker()->... || !d->documentLayout->changeTracker()->elementById(....) || !d->documentLayout->changeTracker()->elementById(....) || .... || d->documentLayout->changeTracker()->displayChanges()) { // <= .... } }
d->documentLayout->changeTracker()->displayChanges() || !d->documentLayout->changeTracker()->displayChanges()
quint32 decode_packbits(const char *src, char* dst, quint16 packed_len, quint32 unpacked_len) { qint32 n; .... while (unpack_left > 0 && pack_left > 0) { n = *src; src++; pack_left--; if (n == 128) // <= continue; else if (n > 128) // <= n -= 256; .... } .... }
psd_status psd_unzip_without_prediction(psd_uchar *src_buf, psd_int src_len, psd_uchar *dst_buf, psd_int dst_len) { do { state = inflate(&stream, Z_PARTIAL_FLUSH); if(state == Z_STREAM_END) break; if(state == Z_DATA_ERROR || state != Z_OK) // <= break; } while (stream.avail_out > 0); }
do { state = inflate(&stream, Z_PARTIAL_FLUSH); if(state != Z_OK) break; } while (stream.avail_out > 0);
void SvgTextEditor::setTextWeightDemi() { if (m_textEditorWidget.richTextEdit->textCursor() .charFormat().fontWeight() > QFont::Normal && m_textEditorWidget.richTextEdit->textCursor() .charFormat().fontWeight() < QFont::Normal) { // <= setTextBold(QFont::Normal); } else { setTextBold(QFont::DemiBold); } }
void KoResourceItemChooser::updatePreview(KoResource *resource) { .... if (image.format() != QImage::Format_RGB32 || // <= image.format() != QImage::Format_ARGB32 || // <= image.format() != QImage::Format_ARGB32_Premultiplied) { image = image.convertToFormat(....); } .... }
QString KoSvgTextShapeMarkupConverter::style(....) { .... if (format.underlineStyle() != QTextCharFormat::NoUnderline || format.underlineStyle() != QTextCharFormat::SpellCheckUnderline) { .... } .... }
void KisPressureSizeOption::lodLimitations(....) const { if (sensor(FUZZY_PER_DAB, true) || sensor(FUZZY_PER_DAB, true)) { l->limitations << KoID("size-fade", i18nc("....")); } if (sensor(FADE, true)) { l->blockers << KoID("....")); } }
enum DynamicSensorType { FUZZY_PER_DAB, FUZZY_PER_STROKE, SPEED, FADE, .... UNKNOWN = 255 };
QList<KoParagraphStyle *> KoTextSharedLoadingData::paragraphStyles(bool stylesDotXml) const { return stylesDotXml ? d->paragraphStylesDotXmlStyles.values() : d->paragraphStylesDotXmlStyles.values(); // <= }
KoParagraphStyle * KoTextSharedLoadingData::paragraphStyle(const QString &name, bool stylesDotXml) const { return stylesDotXml ? d->paragraphStylesDotXmlStyles.value(name) : d->paragraphContentDotXmlStyles.value(name); }
void mirror_impl(KisPaintDeviceSP dev, qreal axis, bool isHorizontal) { .... int leftCenterPoint = qFloor(axis) < axis ? qFloor(axis) : qFloor(axis); // <= int leftEnd = qMin(leftCenterPoint, rightEnd); int rightCenterPoint = qFloor(axis) < axis ? qCeil(axis) : qFloor(axis); int rightStart = qMax(rightCenterPoint, leftStart); .... }
bool KarbonSimplifyPath::isSufficentlyFlat(QPointF curve[4]) { qreal ux = 3 * curve[1].x() - 2 * curve[0].x() - curve[3].x(); qreal uy = 3 * curve[1].y() - 2 * curve[0].y() - curve[3].y(); qreal vx = 3 * curve[2].x() - 2 * curve[3].x() - curve[0].x(); // <= qreal vy = 3 * curve[2].x() - 2 * curve[3].x() - curve[0].x(); // <= .... }
qreal vx = 3 * curve[2].x() - 2 * curve[3].x() - curve[0].x(); qreal vy = vx;
void KoTableCellStyle::loadOdfProperties( KoShapeLoadingContext &context, KoStyleStack &styleStack) { .... if (styleStack.hasProperty(KoXmlNS::style, "print-content")) { setPrintContent(styleStack.property(KoXmlNS::style, "print-content") == "true"); } if (styleStack.hasProperty(KoXmlNS::style, "repeat-content")) // <= { setRepeatContent(styleStack.property(KoXmlNS::style, "repeat-content") == "true"); } if (styleStack.hasProperty(KoXmlNS::style, "repeat-content")) // <= { setRepeatContent(styleStack.property(KoXmlNS::style, "repeat-content") == "true"); } .... }
void KisProcessingApplicator::applyVisitorAllFrames(....) { KisLayerUtils::FrameJobs jobs; if (m_flags.testFlag(RECURSIVE)) { KisLayerUtils::updateFrameJobsRecursive(&jobs, m_node); // <= } else { KisLayerUtils::updateFrameJobsRecursive(&jobs, m_node); // <= } .... }
void KoInlineTextObjectManager::documentInformationUpdated( const QString &info, const QString &data) { if (info == "title") // <= setProperty(KoInlineObject::Title, data); else if (info == "description") setProperty(KoInlineObject::Description, data); else if (info == "abstract") setProperty(KoInlineObject::Comments, data); else if (info == "subject") setProperty(KoInlineObject::Subject, data); else if (info == "keyword") setProperty(KoInlineObject::Keywords, data); else if (info == "creator") setProperty(KoInlineObject::AuthorName, data); else if (info == "initial") setProperty(KoInlineObject::AuthorInitials, data); else if (info == "title") // <= setProperty(KoInlineObject::SenderTitle, data); else if (info == "email") setProperty(KoInlineObject::SenderEmail, data); .... }
bool KisMainWindow::openDocument(const QUrl &url, OpenFlags flags) { if (!QFile(url.toLocalFile()).exists()) { if (!flags && BatchMode) { // <= QMessageBox::critical(0, i18nc("....", "Krita"), i18n("....", url.url())); } .... } .... }
enum OpenFlag { None = 0, Import = 0x1, BatchMode = 0x2, RecoveryFile = 0x4 };
if (flags & BatchMode) { newdoc->setFileBatchMode(true); }
bool KisMainWindow::openDocument(const QUrl &url, OpenFlags flags) { if (!QFile(url.toLocalFile()).exists()) { if (!(flags & BatchMode)) { // <= QMessageBox::critical(0, i18nc("....", "Krita"), i18n("....", url.url())); } .... } .... }
void paint(....) const override { QStyledItemDelegate::paint(painter, option, index); if(!(option.state & (int)(QStyle::State_Active && // <= QStyle::State_Enabled))) // <= { .... } }
void paint(....) const override { QStyledItemDelegate::paint(painter, option, index); if(!(option.state & (int)(QStyle::State_Active | QStyle::State_Enabled))) { .... } }
int KisDraggableToolButton::continueDrag(const QPoint &pos) { .... if (m_orientation == Qt::Horizontal) { value = diff.x(); // <= } else { value = -diff.y(); // <= } value = diff.x() - diff.y(); // <= return value; }
LutKey<float>(float min, float max, float precision) : m_min(min), m_max(max), m_precision(precision) { .... if(m_min > 0 && m_max > 0) { uf.f = m_min; // <= m_tMin_p = uf.i >> m_shift; uf.f = m_max; // <= m_tMax_p = uf.i >> m_shift; m_tMin_n = m_tMax_p; m_tMax_n = m_tMax_p; } else if( m_max < 0) { uf.f = m_min; // <= m_tMax_n = uf.i >> m_shift; uf.f = m_max; // <= m_tMin_n = uf.i >> m_shift; m_tMin_p = m_tMax_n; m_tMax_p = m_tMax_n; } .... }
void SvgStyleWriter::saveSvgBasicStyle(KoShape *shape, SvgSavingContext &context) { if (!shape->isVisible(false)) { .... } if (shape->transparency() > 0.0) { // <= .... } }
void KisNodeManager::moveNodeAt(....) { .... KisLayer *l = qobject_cast<KisLayer*>(parent.data()); KisSelectionMaskSP selMask = l->selectionMask(); // <= if (m && m->active() && l && l->selectionMask()) // <= selMask->setActive(false); .... }
void KisView::slotSavingStatusMessage(const QString &text, int timeout, bool isAutoSaving) { QStatusBar *sb = statusBar(); if (sb) // <= sb->showMessage(text, timeout); KisConfig cfg; if (sb->isHidden() || // <= (!isAutoSaving && cfg.forceShowSaveMessages()) || (cfg.forceShowAutosaveMessages() && isAutoSaving)) { viewManager()->showFloatingMessage(text, QIcon()); } }
KisImportExportFilter::ConversionStatus KisSpriterExport::convert( KisDocument *document, QIODevice *io, KisPropertiesConfigurationSP /*configuration*/) { .... SpriterSlot *slot = 0; // <= // layer.name format: "base_name bone(bone_name) slot(slot_name)" if (file.layerName.contains("slot(")) { int start = file.layerName.indexOf("slot(") + 5; int end = file.layerName.indexOf(')', start); slot->name = file.layerName.mid(start, end - start); // <= slot->defaultAttachmentFlag = .... // <= } .... }
bool SvgParser::parseSymbol(const KoXmlElement &e) { .... KoSvgSymbol *svgSymbol = new KoSvgSymbol(); // <= // ensure that the clip path is loaded in local coordinates system m_context.pushGraphicsContext(e, false); m_context.currentGC()->matrix = QTransform(); m_context.currentGC()->currentBoundingBox = QRectF(0.0, 0.0, 1.0, 1.0); QString title = e.firstChildElement("title").toElement().text(); KoShape *symbolShape = parseGroup(e); m_context.popGraphicsContext(); if (!symbolShape) return false; // <= .... }
bool KoPathShape::separate(QList<KoPathShape*> & separatedPaths) { .... Q_FOREACH (KoSubpath* subpath, d->subpaths) { KoPathShape *shape = new KoPathShape(); if (! shape) continue; // <= .... } }
if (!nodeJuggler || // <= (nodeJuggler && // <= (nodeJuggler->isEnded() || !nodeJuggler->canMergeAction(actionName)))) { .... }
if (!nodeJuggler || (nodeJuggler->isEnded() || !nodeJuggler->canMergeAction(actionName))) { .... }
void KoTextDebug::dumpFrame(const QTextFrame *frame, QTextStream &out) { .... QTextFrame::iterator iterator = frame->begin(); for (; !iterator.atEnd() && !iterator.atEnd(); ++iterator) { // <= .... } .... }
bool testFilter(KisFilterSP f) { .... KisTransaction * cmd = new KisTransaction(kundo2_noi18n(f->name()), dev); // <= // Get the predefined configuration from a file KisFilterConfigurationSP kfc = f->defaultConfiguration(); QFile file(QString(FILES_DATA_DIR) + QDir::separator() + f->id() + ".cfg"); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //dbgKrita << "creating new file for " << f->id(); file.open(QIODevice::WriteOnly | QIODevice::Text); QTextStream out(&file); out.setCodec("UTF-8"); out << kfc->toXML(); } else { QString s; QTextStream in(&file); in.setCodec("UTF-8"); s = in.readAll(); //dbgKrita << "Read for " << f->id() << "\n" << s; kfc->fromXML(s); } dbgKrita << f->id();// << "\n" << kfc->toXML() << "\n"; f->process(dev, QRect(QPoint(0,0), qimage.size()), kfc); QPoint errpoint; delete cmd; // <= .... }
QRect KisEqualizerSlider::Private::boundingRect() const { QRect bounds = q->rect().adjusted(0, 0, -isRightmost, -1); return bounds; }
QRect KisEqualizerSlider::Private::boundingRect() const { QRect bounds = q->rect().adjusted(0, 0, isRightmost ? -1 : 0, -1); return bounds; }
Source: https://habr.com/ru/post/354120/
All Articles