diff options
author | Tarun Sharma <starun.1998@gmail.com> | 2021-01-14 10:16:35 +0530 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-01-20 12:02:53 +0100 |
commit | 3ff95c8df6be9aa01aef5c663ee2ffa9881193d4 (patch) | |
tree | f0133b8c5c4bdccd58771195ef5ac5cb707b166b /canvas | |
parent | 2cf9b8e265e9694803f55e30f2f392abfa512a5a (diff) |
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@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/directx/dx_surfacebitmap.cxx | 10 | ||||
-rw-r--r-- | canvas/source/directx/dx_surfacegraphics.cxx | 2 |
2 files changed, 6 insertions, 6 deletions
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"); } } |