diff options
-rw-r--r-- | sw/source/core/inc/unobookmark.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unobkm.cxx | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/sw/source/core/inc/unobookmark.hxx b/sw/source/core/inc/unobookmark.hxx index 5c38402ba17c..20b984742b73 100644 --- a/sw/source/core/inc/unobookmark.hxx +++ b/sw/source/core/inc/unobookmark.hxx @@ -66,7 +66,7 @@ protected: virtual void attachToRange( const css::uno::Reference< css::text::XTextRange > & xTextRange); - const ::sw::mark::IMark* GetBookmark() const; + ::sw::mark::IMark* GetBookmark() const; IDocumentMarkAccess* GetIDocumentMarkAccess(); diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 51d303b43102..f81ca649384f 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -129,7 +129,7 @@ void SwXBookmark::registerInMark(SwXBookmark & rThis, m_pImpl->registerInMark( rThis, pBkmk ); } -const ::sw::mark::IMark* SwXBookmark::GetBookmark() const +::sw::mark::IMark* SwXBookmark::GetBookmark() const { return m_pImpl->m_pRegisteredBookmark; } @@ -616,8 +616,7 @@ OUString SwXFieldmark::getFieldType() void SwXFieldmark::setFieldType(const OUString & fieldType) { SolarMutexGuard aGuard; - IFieldmark *pBkm = const_cast<IFieldmark*>( - dynamic_cast<const IFieldmark*>(GetBookmark())); + IFieldmark *pBkm = dynamic_cast<IFieldmark*>(GetBookmark()); if(!pBkm) throw uno::RuntimeException(); if(fieldType != getFieldType()) @@ -640,8 +639,7 @@ void SwXFieldmark::setFieldType(const OUString & fieldType) uno::Reference<container::XNameContainer> SwXFieldmark::getParameters() { SolarMutexGuard aGuard; - IFieldmark *pBkm = const_cast<IFieldmark*>( - dynamic_cast<const IFieldmark*>(GetBookmark())); + IFieldmark *pBkm = dynamic_cast<IFieldmark*>(GetBookmark()); if(!pBkm) throw uno::RuntimeException(); return uno::Reference<container::XNameContainer>(new SwXFieldmarkParameters(pBkm)); @@ -687,8 +685,7 @@ SwXFieldmark::getCheckboxFieldmark() ::sw::mark::ICheckboxFieldmark* pCheckboxFm = nullptr; if ( getFieldType() == ODF_FORMCHECKBOX ) { - // evil #TODO #FIXME casting away the const-ness - pCheckboxFm = const_cast<sw::mark::ICheckboxFieldmark*>(dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( GetBookmark())); + pCheckboxFm = dynamic_cast< ::sw::mark::ICheckboxFieldmark* >( GetBookmark()); assert( GetBookmark() == nullptr || pCheckboxFm != nullptr ); // unclear to me whether GetBookmark() can be null here } |