Fix GCC 8 warning: catching polymorphic type by value [-Wcatch-value=]

This commit is contained in:
Mateusz Skowroński 2018-12-23 18:06:57 +01:00
parent 543710dc8b
commit 8b09176b59
3 changed files with 5 additions and 5 deletions

View File

@ -1372,7 +1372,7 @@ QObject *BaseDesignIntf::createElement(const QString& /*collectionName*/, const
obj = LimeReport::DesignElementsFactory::instance().objectCreator(elementType)(this, this); obj = LimeReport::DesignElementsFactory::instance().objectCreator(elementType)(this, this);
connect(obj,SIGNAL(propertyChanged(QString,QVariant,QVariant)),page(),SLOT(slotItemPropertyChanged(QString,QVariant,QVariant))); connect(obj,SIGNAL(propertyChanged(QString,QVariant,QVariant)),page(),SLOT(slotItemPropertyChanged(QString,QVariant,QVariant)));
} }
} catch (ReportError error){ } catch (ReportError &error){
qDebug()<<error.what(); qDebug()<<error.what();
} }
return obj; return obj;

View File

@ -307,7 +307,7 @@ void DataSourceManager::connectAllDatabases()
foreach(ConnectionDesc* conn,m_connections){ foreach(ConnectionDesc* conn,m_connections){
try{ try{
connectConnection(conn); connectConnection(conn);
} catch (ReportError e){ } catch (ReportError &e){
putError(e.what()); putError(e.what());
setLastError(e.what()); setLastError(e.what());
qDebug()<<e.what(); qDebug()<<e.what();
@ -323,7 +323,7 @@ bool DataSourceManager::addModel(const QString &name, QAbstractItemModel *model,
try{ try{
putHolder(name, mh); putHolder(name, mh);
connect(mh, SIGNAL(modelStateChanged()), this, SIGNAL(datasourcesChanged())); connect(mh, SIGNAL(modelStateChanged()), this, SIGNAL(datasourcesChanged()));
} catch (ReportError e){ } catch (ReportError &e){
putError(e.what()); putError(e.what());
setLastError(e.what()); setLastError(e.what());
return false; return false;
@ -871,7 +871,7 @@ void DataSourceManager::connectAutoConnections()
if (conn->autoconnect()) { if (conn->autoconnect()) {
try { try {
connectConnection(conn); connectConnection(conn);
} catch(ReportError e){ } catch(ReportError &e){
setLastError(e.what()); setLastError(e.what());
putError(e.what()); putError(e.what());
qDebug()<<e.what(); qDebug()<<e.what();

View File

@ -383,7 +383,7 @@ QString ScriptEngineManager::expandUserVariables(QString context, RenderPass /*
} }
pos=0; pos=0;
} catch (ReportError e){ } catch (ReportError &e){
dataManager()->putError(e.what()); dataManager()->putError(e.what());
if (!dataManager()->reportSettings() || dataManager()->reportSettings()->suppressAbsentFieldsAndVarsWarnings()) if (!dataManager()->reportSettings() || dataManager()->reportSettings()->suppressAbsentFieldsAndVarsWarnings())
context.replace(rx.cap(0),e.what()); context.replace(rx.cap(0),e.what());