[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra] libs: Don't use dynamic_cast if the result is not checked
From: Friedrich W. H. Kossebau <kossebau () kde ! org>
Date: 2015-09-01 1:59:39
Message-ID: E1ZWarL-0006D6-A0 () scm ! kde ! org
[Download RAW message or body]
Git commit 8c4c01decec422bbaded6d004311ee23425b0aa2 by Friedrich W. H. Kossebau.
Committed on 01/09/2015 at 01:11.
Pushed by kossebau into branch 'master'.
Don't use dynamic_cast if the result is not checked
M +1 -1 libs/kopageapp/KoPADocumentStructureDocker.cpp
M +1 -1 libs/kopageapp/KoPAOdfPageSaveHelper.cpp
M +1 -1 libs/kopageapp/KoPAView.cpp
M +1 -1 libs/kotext/KoTextPaste.cpp
M +1 -1 libs/kotext/styles/KoListLevelProperties.cpp
M +1 -1 libs/widgets/KoResourceItemChooser.cpp
http://commits.kde.org/calligra/8c4c01decec422bbaded6d004311ee23425b0aa2
diff --git a/libs/kopageapp/KoPADocumentStructureDocker.cpp \
b/libs/kopageapp/KoPADocumentStructureDocker.cpp index 9319b26..c86fbd8 100644
--- a/libs/kopageapp/KoPADocumentStructureDocker.cpp
+++ b/libs/kopageapp/KoPADocumentStructureDocker.cpp
@@ -685,7 +685,7 @@ void KoPADocumentStructureDocker::editPaste()
}
else {
// Paste Pages
- KoPACanvas * canvas = dynamic_cast<KoPACanvas \
*>(KoToolManager::instance()->activeCanvasController()->canvas()); + \
KoPACanvas * canvas = static_cast<KoPACanvas \
*>(KoToolManager::instance()->activeCanvasController()->canvas()); \
canvas->koPAView()->pagePaste(); }
}
diff --git a/libs/kopageapp/KoPAOdfPageSaveHelper.cpp \
b/libs/kopageapp/KoPAOdfPageSaveHelper.cpp index c60d0d8..92c6dfd 100644
--- a/libs/kopageapp/KoPAOdfPageSaveHelper.cpp
+++ b/libs/kopageapp/KoPAOdfPageSaveHelper.cpp
@@ -46,7 +46,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, \
QList<KoPAPage
// this might result in a different order of master pages when copying to a \
different document QSet<KoPAPageBase *> masterPages;
foreach( KoPAPageBase * page, m_pages ) {
- KoPAPage * p = dynamic_cast<KoPAPage *>( page );
+ KoPAPage * p = static_cast<KoPAPage *>( page );
masterPages.insert( p->masterPage() );
}
m_masterPages = masterPages.toList();
diff --git a/libs/kopageapp/KoPAView.cpp b/libs/kopageapp/KoPAView.cpp
index 259b106..032f192 100644
--- a/libs/kopageapp/KoPAView.cpp
+++ b/libs/kopageapp/KoPAView.cpp
@@ -912,7 +912,7 @@ void KoPAView::insertPage()
page = masterPage;
}
else {
- KoPAPage * activePage = dynamic_cast<KoPAPage*>( d->activePage );
+ KoPAPage * activePage = static_cast<KoPAPage*>( d->activePage );
KoPAMasterPage * masterPage = activePage->masterPage();
page = d->doc->newPage( masterPage );
}
diff --git a/libs/kotext/KoTextPaste.cpp b/libs/kotext/KoTextPaste.cpp
index b4874ed..18b1daf 100644
--- a/libs/kotext/KoTextPaste.cpp
+++ b/libs/kotext/KoTextPaste.cpp
@@ -107,7 +107,7 @@ bool KoTextPaste::process(const KoXmlElement &body, \
KoOdfReadStore &odfStore) }
#endif
- KoTextSharedLoadingData *sharedData = dynamic_cast<KoTextSharedLoadingData \
*>(context.sharedData(KOTEXT_SHARED_LOADING_ID)); + KoTextSharedLoadingData \
*sharedData = static_cast<KoTextSharedLoadingData \
*>(context.sharedData(KOTEXT_SHARED_LOADING_ID));
// add shapes to the document
foreach (KoShape *shape, sharedData->insertedShapes()) {
diff --git a/libs/kotext/styles/KoListLevelProperties.cpp \
b/libs/kotext/styles/KoListLevelProperties.cpp index 7de741b..60e740a 100644
--- a/libs/kotext/styles/KoListLevelProperties.cpp
+++ b/libs/kotext/styles/KoListLevelProperties.cpp
@@ -852,7 +852,7 @@ void KoListLevelProperties::saveOdf(KoXmlWriter *writer, \
KoShapeSavingContext &c
KoTextSharedSavingData *sharedSavingData = 0;
if (d->stylesPrivate.contains(KoListStyle::CharacterStyleId) && \
(characterStyleId() != 0) &&
- (sharedSavingData = dynamic_cast<KoTextSharedSavingData \
*>(context.sharedData(KOTEXT_SHARED_SAVING_ID)))) { + (sharedSavingData = \
static_cast<KoTextSharedSavingData *>(context.sharedData(KOTEXT_SHARED_SAVING_ID)))) \
{
QString styleName = sharedSavingData->styleName(characterStyleId());
// dynamic_cast<KoTextSharedSavingData \
*>(context.sharedData(KOTEXT_SHARED_SAVING_ID))->styleName(characterStyleId()); if \
(!styleName.isEmpty()) {
diff --git a/libs/widgets/KoResourceItemChooser.cpp \
b/libs/widgets/KoResourceItemChooser.cpp index 6db8080..7b9c4a1 100644
--- a/libs/widgets/KoResourceItemChooser.cpp
+++ b/libs/widgets/KoResourceItemChooser.cpp
@@ -593,7 +593,7 @@ bool KoResourceItemChooser::eventFilter(QObject *object, QEvent \
*event) {
if (d->synced && event->type() == QEvent::Wheel) {
KoResourceItemChooserSync *chooserSync = \
KoResourceItemChooserSync::instance();
- QWheelEvent *qwheel = dynamic_cast<QWheelEvent *>(event);
+ QWheelEvent *qwheel = static_cast<QWheelEvent *>(event);
if (qwheel->modifiers() & Qt::ControlModifier) {
int degrees = qwheel->delta() / 8;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic