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

Tarun Sharma (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 20 11:03:32 UTC 2021


 canvas/source/directx/dx_surfacebitmap.cxx   |   10 +++++-----
 canvas/source/directx/dx_surfacegraphics.cxx |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3ff95c8df6be9aa01aef5c663ee2ffa9881193d4
Author:     Tarun Sharma <starun.1998 at gmail.com>
AuthorDate: Thu Jan 14 10:16:35 2021 +0530
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Jan 20 12:02:53 2021 +0100

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

diff --git a/canvas/source/directx/dx_surfacebitmap.cxx b/canvas/source/directx/dx_surfacebitmap.cxx
index 0d23674ca91b..a118b31db2d8 100644
--- a/canvas/source/directx/dx_surfacebitmap.cxx
+++ b/canvas/source/directx/dx_surfacebitmap.cxx
@@ -526,7 +526,7 @@ namespace dxcanvas
                                                                           // getMemoryLayout
                                                 &aBmpData ) )
             {
-                throw uno::RuntimeException();
+                throw uno::RuntimeException("GDIPlus method call was unsuccessful, problem with locking bitmap aRect object");
             }
 
             // commit data to bitmap
@@ -540,7 +540,7 @@ namespace dxcanvas
             // lock the directx surface to receive the pointer to the surface memory.
             D3DLOCKED_RECT aLockedRect;
             if(FAILED(mpSurface->LockRect(&aLockedRect,nullptr,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)))
-                throw uno::RuntimeException();
+                throw uno::RuntimeException("failed to lock direcrx surface to surface memory");
 
             sal_uInt8 const *pSrc = reinterpret_cast<sal_uInt8 const *>(data.getConstArray());
             sal_uInt8 *pDst = (static_cast<BYTE *>(aLockedRect.pBits)+(rect.Y1*aLockedRect.Pitch))+rect.X1;
@@ -580,7 +580,7 @@ namespace dxcanvas
             if( Gdiplus::Ok != mpGDIPlusBitmap->SetPixel( pos.X, pos.Y,
                                                 Gdiplus::Color( tools::sequenceToArgb( color ))))
             {
-                throw uno::RuntimeException();
+                throw uno::RuntimeException("Problem with setting the color of bitmap object");
             }
         }
         else
@@ -597,7 +597,7 @@ namespace dxcanvas
             // lock the directx surface to receive the pointer to the surface memory.
             D3DLOCKED_RECT aLockedRect;
             if(FAILED(mpSurface->LockRect(&aLockedRect,nullptr,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)))
-                throw uno::RuntimeException();
+                throw uno::RuntimeException("cannot lock the directx surface to surface memory");
 
             sal_uInt32 *pDst = reinterpret_cast<sal_uInt32 *>((static_cast<BYTE *>(aLockedRect.pBits)+(pos.Y*aLockedRect.Pitch))+pos.X);
             *pDst = aColor.GetValue();
@@ -640,7 +640,7 @@ namespace dxcanvas
             // lock the directx surface to receive the pointer to the surface memory.
             D3DLOCKED_RECT aLockedRect;
             if(FAILED(mpSurface->LockRect(&aLockedRect,nullptr,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)))
-                throw uno::RuntimeException();
+                throw uno::RuntimeException("failed to lock directX surface to surface memory");
 
             sal_uInt32 *pDst = reinterpret_cast<sal_uInt32 *>((static_cast<BYTE *>(aLockedRect.pBits)+(pos.Y*aLockedRect.Pitch))+pos.X);
             Gdiplus::Color aColor(*pDst);
diff --git a/canvas/source/directx/dx_surfacegraphics.cxx b/canvas/source/directx/dx_surfacegraphics.cxx
index c4f03e9db6ec..a496b41017dd 100644
--- a/canvas/source/directx/dx_surfacegraphics.cxx
+++ b/canvas/source/directx/dx_surfacegraphics.cxx
@@ -70,7 +70,7 @@ namespace dxcanvas
                 rSurface->ReleaseDC( aHDC );
         }
 
-        throw uno::RuntimeException();
+        throw uno::RuntimeException("could not get the DC to rSurface");
     }
 }
 


More information about the Libreoffice-commits mailing list