Commit 0710ca79 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix GCC warnings about implicit fall-through in switch

parent abac56c1
......@@ -389,12 +389,16 @@ QDebug operator<<(QDebug dbg, const KoColor &color)
const quint32 *ptr = reinterpret_cast<const quint32*>(color.data() + ch->pos());
dbg.nospace() << *ptr;
break;
#ifdef HAVE_OPENEXR
} case KoChannelInfo::FLOAT16: {
#ifdef HAVE_OPENEXR
const half *ptr = reinterpret_cast<const half*>(color.data() + ch->pos());
dbg.nospace() << *ptr;
break;
#else
const quint16 *ptr = reinterpret_cast<const quint16*>(color.data() + ch->pos());
dbg.nospace() << "UNSUPPORTED_F16(" << *ptr << ")";
#endif
break;
} case KoChannelInfo::FLOAT32: {
const float *ptr = reinterpret_cast<const float*>(color.data() + ch->pos());
dbg.nospace() << *ptr;
......
......@@ -124,6 +124,9 @@ bool KisReferenceImagesDecoration::documentHasReferenceImages() const
void KisReferenceImagesDecoration::drawDecoration(QPainter &gc, const QRectF &updateRect, const KisCoordinatesConverter */*converter*/, KisCanvas2 */*canvas*/)
{
// TODO: can we use partial updates here?
Q_UNUSED(updateRect);
KisSharedPtr<KisReferenceImagesLayer> layer = d->layer.toStrongRef();
if (!layer.isNull()) {
......
......@@ -192,13 +192,15 @@ Exiv2::Value* kmdValueToExivValue(const KisMetaData::Value& value, Exiv2::TypeId
break;
default:
dbgMetaData << type << " " << value;
//Q_ASSERT(false);
KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(0 && "Unknown alternative array type", 0);
break;
}
/* Falls through */
}
default:
dbgMetaData << type << " " << value;
//Q_ASSERT(false);
KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(0 && "Unknown array type", 0);
break;
}
return 0;
}
......
......@@ -96,7 +96,7 @@ protected:
while (it.nextPixel()) {
if (cs->opacityU8(it.rawDataConst()) > 0) {
KIS_DUMP_DEVICE_2(dev, QRect(0,0,1024,1024), "image", "dd");
qFatal(QString("failed: %1").arg(name).toLatin1().data());
qFatal("%s", QString("failed: %1").arg(name).toLatin1().data());
}
}
}
......
......@@ -90,10 +90,12 @@ QVariant KisMetaDataModel::data(const QModelIndex &index, int role) const
case 2:
return m_store->entries()[index.row()].value().toString();
}
break;
}
default:
return QVariant();
}
return QVariant();
}
QVariant KisMetaDataModel::headerData(int section, Qt::Orientation orientation, int role) const
......
......@@ -24,6 +24,7 @@
#include "KoParagraphStyle.h"
#include "ToCBibGeneratorInfo.h"
#include "KoTableOfContentsGeneratorInfo.h"
#include "kis_assert.h"
#include <QPair>
......@@ -106,20 +107,18 @@ QVariant TableOfContentsStyleModel::data(const QModelIndex &index, int role) con
}
} else {
KoParagraphStyle *paragStyle = m_styleManager->paragraphStyle(id);
KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(paragStyle, QVariant());
switch (role) {
case Qt::DisplayRole: {
if (paragStyle) {
if (QVariant(static_cast< QPair<int, int> *>(index.internalPointer())->second).value<int>() == 0) {
return QVariant(i18n("Disabled"));
} else {
return QVariant(static_cast< QPair<int, int> *>(index.internalPointer())->second);
}
if (QVariant(static_cast< QPair<int, int> *>(index.internalPointer())->second).value<int>() == 0) {
return QVariant(i18n("Disabled"));
} else {
return QVariant(static_cast< QPair<int, int> *>(index.internalPointer())->second);
}
}
case Qt::EditRole: {
if (paragStyle) {
return QVariant(static_cast< QPair<int, int> *>(index.internalPointer())->second);
}
return QVariant(static_cast< QPair<int, int> *>(index.internalPointer())->second);
}
default: break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment