[Libreoffice-commits] core.git: sw/source

Stephan Bergmann sbergman at redhat.com
Mon Nov 17 02:05:31 PST 2014


 sw/source/core/unocore/unoobj2.cxx      |    6 +++---
 sw/source/core/unocore/unoparagraph.cxx |    2 +-
 sw/source/core/unocore/unoportenum.cxx  |    2 +-
 sw/source/core/unocore/unorefmk.cxx     |    2 +-
 sw/source/uibase/uno/unotxvw.cxx        |    2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 1b3f795c8e993fa9a8b76f84292041d3d22523dc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 17 11:04:56 2014 +0100

    suspicious cast from 'bool' to 'sal_Bool' [loplugin:salbool]
    
    Change-Id: I28b52faa71bb198ee34ae4893e4610aa83773645

diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index ed2db72..adc6bd0 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -538,7 +538,7 @@ SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException, std::ex
 {
     SolarMutexGuard aGuard;
 
-    return static_cast<sal_Bool>(m_pImpl->m_bFirstParagraph || m_pImpl->m_xNextPara.is());
+    return m_pImpl->m_bFirstParagraph || m_pImpl->m_xNextPara.is();
 }
 
 //!! compare to SwShellTableCrsr::FillRects() in viscrs.cxx
@@ -1861,8 +1861,8 @@ SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException, std::ex
     if (!m_pImpl->GetCursor())
         throw uno::RuntimeException();
 
-    return static_cast<sal_Bool>(m_pImpl->m_xNextObject.is() ||
-        lcl_CreateNextObject(*m_pImpl->GetCursor(),m_pImpl->m_xNextObject, m_pImpl->m_Frames));
+    return m_pImpl->m_xNextObject.is() ||
+        lcl_CreateNextObject(*m_pImpl->GetCursor(),m_pImpl->m_xNextObject, m_pImpl->m_Frames);
 }
 
 uno::Any SAL_CALL SwXParaFrameEnumeration::nextElement()
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index a7a7395..3acacd7 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -1328,7 +1328,7 @@ uno::Type SAL_CALL SwXParagraph::getElementType() throw (uno::RuntimeException,
 sal_Bool SAL_CALL SwXParagraph::hasElements() throw (uno::RuntimeException, std::exception)
 {
     SolarMutexGuard aGuard;
-    return static_cast<sal_Bool>(GetTxtNode() != nullptr);
+    return GetTxtNode() != nullptr;
 }
 
 uno::Reference< text::XText > SAL_CALL
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 90e9700..039e60f 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -399,7 +399,7 @@ throw( uno::RuntimeException, std::exception )
 {
     SolarMutexGuard aGuard;
 
-    return static_cast<sal_Bool>(m_Portions.size() > 0);
+    return m_Portions.size() > 0;
 }
 
 uno::Any SwXTextPortionEnumeration::nextElement()
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index ec1c4c4..9cc6a33 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -1234,7 +1234,7 @@ SwXMeta::hasElements() throw (uno::RuntimeException, std::exception)
 {
     SolarMutexGuard g;
 
-    return static_cast<sal_Bool>(m_pImpl->GetRegisteredIn() != nullptr);
+    return m_pImpl->GetRegisteredIn() != nullptr;
 }
 
 // XEnumerationAccess
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 7f6682e..8d31246 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -483,7 +483,7 @@ sal_Bool SAL_CALL SwXTextView::isFormDesignMode(  ) throw (uno::RuntimeException
     SolarMutexGuard aGuard;
     SwView* pView2 = GetView();
     FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL;
-    return static_cast<sal_Bool>(!pFormShell || pFormShell->IsDesignMode());
+    return !pFormShell || pFormShell->IsDesignMode();
 }
 
 void SAL_CALL SwXTextView::setFormDesignMode( sal_Bool _DesignMode ) throw (RuntimeException, std::exception)


More information about the Libreoffice-commits mailing list