diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-19 09:15:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-19 10:26:50 +0100 |
commit | 67820a90370513cd65cd7f042c1d0dea6fb0965f (patch) | |
tree | 7d53cf940b8e4457af578e25e7a4a6fb0b012bf7 /sw/source/uibase/uno | |
parent | 9191f44fed1e1ede6a5efcaac6bc92bbe74305ec (diff) |
coverity#705037 Unchecked dynamic_cast
Change-Id: I9f6c8ceafd09b4a5d4e951e01e1a06b2b5265181
Diffstat (limited to 'sw/source/uibase/uno')
-rw-r--r-- | sw/source/uibase/uno/unodefaults.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/uibase/uno/unodefaults.cxx b/sw/source/uibase/uno/unodefaults.cxx index 3529b2f7e146..a1cc59ca1f74 100644 --- a/sw/source/uibase/uno/unodefaults.cxx +++ b/sw/source/uibase/uno/unodefaults.cxx @@ -18,8 +18,8 @@ */ #include <unodefaults.hxx> -#include <svx/svdmodel.hxx> #include <svx/unoprov.hxx> +#include <drawdoc.hxx> #include <doc.hxx> #include <IDocumentDrawModelAccess.hxx> diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index c020b75d662a..cc8e06692e1b 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1921,7 +1921,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& SwDrawDocument * pDrawDoc; bool bAuto = *(sal_Bool*) aValue.getValue(); - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * >( pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) ) + if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) pDrawDoc->SetAutoControlFocus( bAuto ); else if (bAuto) { @@ -1931,7 +1931,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& // SdrModel and we are leaving the default at false, // we don't need to make an SdrModel and can do nothing // #i52858# - method name changed - pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel() ); + pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); pDrawDoc->SetAutoControlFocus ( bAuto ); } } @@ -1941,7 +1941,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& SwDrawDocument * pDrawDoc; bool bMode = *(sal_Bool*)aValue.getValue(); - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) ) + if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) pDrawDoc->SetOpenInDesignMode( bMode ); else if (!bMode) { @@ -1952,7 +1952,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& // we don't need to make an SdrModel and can do // nothing // #i52858# - method name changed - pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel() ); + pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); pDrawDoc->SetOpenInDesignMode ( bMode ); } } @@ -2091,7 +2091,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) { SwDrawDocument * pDrawDoc; bool bAuto; - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) ) + if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) bAuto = pDrawDoc->GetAutoControlFocus(); else bAuto = false; @@ -2102,7 +2102,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) { SwDrawDocument * pDrawDoc; bool bMode; - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) ) + if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) bMode = pDrawDoc->GetOpenInDesignMode(); else bMode = true; |