[Libreoffice-commits] core.git: chart2/source editeng/source embeddedobj/source

homeboy445 (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 7 15:04:16 UTC 2021


 chart2/source/tools/Scaling.cxx                 |    4 ++--
 editeng/source/uno/UnoForbiddenCharsTable.cxx   |    6 +++---
 embeddedobj/source/commonembedding/embedobj.cxx |    8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 7bd5c31472804624d740d8c831d3b043f2d3a0be
Author:     homeboy445 <akshitsan13 at gmail.com>
AuthorDate: Wed Dec 23 19:46:09 2020 +0530
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Jan 7 16:03:34 2021 +0100

    tdf#42982 Improved UNO API error reporting
    
    Change-Id: I450ea0b1a19381c47370633d124c2ba906415987
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108356
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    Tested-by: Jenkins

diff --git a/chart2/source/tools/Scaling.cxx b/chart2/source/tools/Scaling.cxx
index 212eadba54ee..b61886c643e8 100644
--- a/chart2/source/tools/Scaling.cxx
+++ b/chart2/source/tools/Scaling.cxx
@@ -167,7 +167,7 @@ uno::Reference< XScaling > SAL_CALL
 {
     // ToDo: ApproxEqual ?
     if( m_fSlope == 0 )
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("Divide by zero exception");
 
     return new LinearScaling( 1.0 / m_fSlope, m_fOffset / m_fSlope );
 }
@@ -218,7 +218,7 @@ uno::Reference< XScaling > SAL_CALL
 {
     // ToDo: ApproxEqual ?
     if( m_fExponent == 0 )
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("Divide by zero exception");
 
     return new PowerScaling( 1.0 / m_fExponent );
 }
diff --git a/editeng/source/uno/UnoForbiddenCharsTable.cxx b/editeng/source/uno/UnoForbiddenCharsTable.cxx
index 8bb83f65583b..474180f2585d 100644
--- a/editeng/source/uno/UnoForbiddenCharsTable.cxx
+++ b/editeng/source/uno/UnoForbiddenCharsTable.cxx
@@ -50,7 +50,7 @@ ForbiddenCharacters SvxUnoForbiddenCharsTable::getForbiddenCharacters( const lan
     SolarMutexGuard aGuard;
 
     if (!mxForbiddenChars)
-        throw RuntimeException();
+        throw RuntimeException("No Forbidden Characters present");
 
     const LanguageType eLang = LanguageTag::convertToLanguageType( rLocale );
     const ForbiddenCharacters* pForbidden = mxForbiddenChars->GetForbiddenCharacters( eLang, false );
@@ -78,7 +78,7 @@ void SvxUnoForbiddenCharsTable::setForbiddenCharacters(const lang::Locale& rLoca
     SolarMutexGuard aGuard;
 
     if (!mxForbiddenChars)
-        throw RuntimeException();
+        throw RuntimeException("No Forbidden Characters present");
 
     const LanguageType eLang = LanguageTag::convertToLanguageType( rLocale );
     mxForbiddenChars->SetForbiddenCharacters( eLang, rForbiddenCharacters );
@@ -91,7 +91,7 @@ void SvxUnoForbiddenCharsTable::removeForbiddenCharacters( const lang::Locale& r
     SolarMutexGuard aGuard;
 
     if (!mxForbiddenChars)
-        throw RuntimeException();
+        throw RuntimeException("No Forbidden Characters present");
 
     const LanguageType eLang = LanguageTag::convertToLanguageType( rLocale );
     mxForbiddenChars->ClearForbiddenCharacters( eLang );
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 669ba884b055..dcba248ca4f7 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -209,7 +209,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
         else
         {
             SAL_WARN( "embeddedobj.common", "Unacceptable state switch!" );
-            throw uno::RuntimeException(); // TODO
+            throw uno::RuntimeException("invalid next state, only RUNNING state allowed"); // TODO
         }
     }
     else if ( m_nObjectState == embed::EmbedStates::RUNNING )
@@ -271,7 +271,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
             else
             {
                 SAL_WARN( "embeddedobj.common", "Unacceptable state switch!" );
-                throw uno::RuntimeException(); // TODO
+                throw uno::RuntimeException("invalid next state,only LOADED/INPLACE_ACTIVE/ACTIVE allowed"); // TODO
             }
         }
     }
@@ -339,7 +339,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
         else
         {
             SAL_WARN( "embeddedobj.common", "Unacceptable state switch!" );
-            throw uno::RuntimeException(); // TODO
+            throw uno::RuntimeException("invalid next state,only RUNNING/UI_ACTIVE allowed"); // TODO
         }
     }
     else if ( m_nObjectState == embed::EmbedStates::ACTIVE )
@@ -352,7 +352,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
         else
         {
             SAL_WARN( "embeddedobj.common", "Unacceptable state switch!" );
-            throw uno::RuntimeException(); // TODO
+            throw uno::RuntimeException("invalid next state, only RUNNING state allowed"); // TODO
         }
     }
     else if ( m_nObjectState == embed::EmbedStates::UI_ACTIVE )


More information about the Libreoffice-commits mailing list