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

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 24 11:09:54 UTC 2020


 sw/source/core/unocore/unoobj2.cxx |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

New commits:
commit 93eb6a87e30c8716b5e65ce71e3d1d9deffb6425
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Nov 19 15:38:58 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Tue Nov 24 12:09:11 2020 +0100

    sw: exception messages for SwXTextRange
    
    Change-Id: Iee53473ead4151348c2f02f4a83bd0bd17c46758
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106292
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index bfba1dd85a36..e364bb353f92 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -759,7 +759,7 @@ void SwXTextRange::DeleteAndInsert(
     if (RANGE_IS_TABLE == m_pImpl->m_eRangePosition)
     {
         // setString on table not allowed
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("not possible for table");
     }
 
     const SwPosition aPos(GetDoc().GetNodes().GetEndOfContent());
@@ -872,7 +872,7 @@ SwXTextRange::getStart()
     }
     else
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("disposed?");
     }
     return xRet;
 }
@@ -900,7 +900,7 @@ SwXTextRange::getEnd()
     }
     else
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("disposed?");
     }
     return xRet;
 }
@@ -1184,18 +1184,18 @@ SwXTextRange::createContentEnumeration(const OUString& rServiceName)
 
     if ( rServiceName != "com.sun.star.text.TextContent" )
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("unsupported service");
     }
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     const SwPosition aPos(GetDoc().GetNodes().GetEndOfContent());
     const auto pNewCursor(m_pImpl->m_rDoc.CreateUnoCursor(aPos));
     if (!GetPositions(*pNewCursor))
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no positions");
     }
 
     return SwXParaFrameEnumeration::Create(*pNewCursor, PARAFRAME_PORTION_TEXTRANGE);
@@ -1208,13 +1208,13 @@ SwXTextRange::createEnumeration()
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     const SwPosition aPos(GetDoc().GetNodes().GetEndOfContent());
     auto pNewCursor(m_pImpl->m_rDoc.CreateUnoCursor(aPos));
     if (!GetPositions(*pNewCursor))
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no positions");
     }
     if (!m_pImpl->m_xParentText.is())
     {
@@ -1261,7 +1261,7 @@ SwXTextRange::setPropertyValue(
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     SwPaM aPaM(GetDoc().GetNodes());
     GetPositions(aPaM);
@@ -1276,7 +1276,7 @@ SwXTextRange::getPropertyValue(const OUString& rPropertyName)
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     SwPaM aPaM(GetDoc().GetNodes());
     GetPositions(aPaM);
@@ -1323,7 +1323,7 @@ SwXTextRange::getPropertyState(const OUString& rPropertyName)
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     SwPaM aPaM(GetDoc().GetNodes());
     GetPositions(aPaM);
@@ -1338,7 +1338,7 @@ SwXTextRange::getPropertyStates(const uno::Sequence< OUString >& rPropertyName)
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     SwPaM aPaM(GetDoc().GetNodes());
     GetPositions(aPaM);
@@ -1352,7 +1352,7 @@ void SAL_CALL SwXTextRange::setPropertyToDefault(const OUString& rPropertyName)
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     SwPaM aPaM(GetDoc().GetNodes());
     GetPositions(aPaM);
@@ -1367,7 +1367,7 @@ SwXTextRange::getPropertyDefault(const OUString& rPropertyName)
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     SwPaM aPaM(GetDoc().GetNodes());
     GetPositions(aPaM);
@@ -1384,7 +1384,7 @@ SwXTextRange::makeRedline(
 
     if (!m_pImpl->GetBookmark())
     {
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("range has no mark (table?)");
     }
     SwPaM aPaM(GetDoc().GetNodes());
     SwXTextRange::GetPositions(aPaM);


More information about the Libreoffice-commits mailing list