summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-21 21:59:32 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-21 23:06:09 +0100
commitb7574264b5a554683bfbf9316cf4b5a502e90575 (patch)
tree8707847035b656600c55e1bde06aa3e3f9537729
parent6fb943be1cd9d41e173914176698a9b162618447 (diff)
SwXTextField::getAnchor: avoid pointless dynamic_cast<>
Change-Id: I4cc96b8e1dee423216e528410953108c64ac5d63
-rw-r--r--sw/source/core/unocore/unofield.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 07a996cef162..93fae3bb3879 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2079,8 +2079,9 @@ SwXTextField::getAnchor() throw (uno::RuntimeException, std::exception)
return 0;
// If this is a postit field, then return the range of its annotation mark if it has one.
- if (const SwPostItField* pPostItField = dynamic_cast<const SwPostItField*>(pField))
+ if (pField->Which() == RES_POSTITFLD)
{
+ const SwPostItField* pPostItField = static_cast<const SwPostItField*>(pField);
IDocumentMarkAccess* pMarkAccess = m_pImpl->m_pDoc->getIDocumentMarkAccess();
for (IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAnnotationMarksBegin(); ppMark != pMarkAccess->getAnnotationMarksEnd(); ++ppMark)
{