summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/access/accfrmobj.cxx4
-rw-r--r--sw/source/core/crsr/annotationmark.cxx5
-rw-r--r--sw/source/core/txtnode/atrfld.cxx10
-rw-r--r--sw/source/uibase/app/apphdl.cxx3
4 files changed, 12 insertions, 10 deletions
diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx
index 3057d226957f..5923eb11f2a4 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -244,11 +244,11 @@ SwRect SwAccessibleChild::GetBox( const SwAccessibleMap& rAccMap ) const
}
else if( mpDrawObj )
{
- SwDrawContact const*const pContact(dynamic_cast<SwDrawContact const*>(::GetUserCall(mpDrawObj)));
+ const SwContact* const pContact = ::GetUserCall(mpDrawObj);
// assume that a) the SwVirt* objects that don't have this are handled
// by the mpFrame case above b) for genuine SdrObject this must be set
// if it's connected to layout
- assert(pContact);
+ assert(dynamic_cast<SwDrawContact const*>(pContact));
SwPageFrame const*const pPage(const_cast<SwAnchoredObject *>(
pContact->GetAnchoredObj(mpDrawObj))->FindPageFrameOfAnchor());
if (pPage) // may end up here with partial layout -> not visible
diff --git a/sw/source/core/crsr/annotationmark.cxx b/sw/source/core/crsr/annotationmark.cxx
index 280193f4b3b9..7ba754b1d931 100644
--- a/sw/source/core/crsr/annotationmark.cxx
+++ b/sw/source/core/crsr/annotationmark.cxx
@@ -56,8 +56,9 @@ namespace sw { namespace mark
SwTextField *const pTextField = pTextNode->GetFieldTextAttrAt(
GetMarkEnd().nContent.GetIndex()-1, true);
assert(pTextField != nullptr);
- const SwPostItField* pPostItField = dynamic_cast< const SwPostItField* >(pTextField->GetFormatField().GetField());
- assert(pPostItField != nullptr);
+ const SwField* pField = pTextField->GetFormatField().GetField();
+ assert(dynamic_cast<const SwPostItField*>(pField));
+ const SwPostItField* pPostItField = static_cast<const SwPostItField*>(pField);
// use the annotation mark's name as the annotation name, if
// - the annotation field has an empty annotation name or
// - the annotation mark's name differs (on mark creation a name clash had been detected)
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 3feaa1ea6e6f..cb7ec4c52323 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -582,8 +582,9 @@ void SwTextInputField::UpdateFieldContent()
const sal_Int32 nLen = static_cast<sal_Int32>(std::max<sal_Int32>( 0, ( (*End()) - 1 - nIdx ) ));
const OUString aNewFieldContent = GetTextNode().GetExpandText(nullptr, nIdx, nLen);
- const SwInputField* pInputField = dynamic_cast<const SwInputField*>(GetFormatField().GetField());
- assert(pInputField != nullptr);
+ const SwField* pField = GetFormatField().GetField();
+ assert(dynamic_cast<const SwInputField*>(pField));
+ const SwInputField* pInputField = static_cast<const SwInputField*>(pField);
const_cast<SwInputField*>(pInputField)->applyFieldContent( aNewFieldContent );
// trigger update of fields for scenarios in which the Input Field's content is part of e.g. a table formula
GetTextNode().GetDoc()->getIDocumentFieldsAccess().GetUpdateFields().SetFieldsDirty(true);
@@ -623,8 +624,9 @@ SwTextAnnotationField::~SwTextAnnotationField()
::sw::mark::IMark* SwTextAnnotationField::GetAnnotationMark() const
{
- const SwPostItField* pPostItField = dynamic_cast<const SwPostItField*>(GetFormatField().GetField());
- assert(pPostItField != nullptr);
+ const SwField* pField = GetFormatField().GetField();
+ assert(dynamic_cast<const SwPostItField*>(pField));
+ const SwPostItField* pPostItField = static_cast<const SwPostItField*>(pField);
SwDoc* pDoc = static_cast<const SwPostItFieldType*>(pPostItField->GetTyp())->GetDoc();
assert(pDoc != nullptr);
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 0288b37d61b4..9e52c5b00b29 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -323,9 +323,8 @@ SwView* lcl_LoadDoc(SwView* pView, const OUString& rURL)
SfxViewShell* pViewShell = pShell->GetViewShell();
if(pViewShell)
{
- if( nullptr!= dynamic_cast<SwView*>(pViewShell) )
+ if ((pNewView = dynamic_cast<SwView*>(pViewShell)))
{
- pNewView = dynamic_cast< SwView* >(pViewShell);
pNewView->GetViewFrame()->GetFrame().Appear();
}
else