diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-16 17:35:52 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-12-17 07:31:17 +0000 |
commit | afb5143639598bdc7f78ba000569d80e10d0fbe4 (patch) | |
tree | bdcb00001e370eac8eaae92b3ac873dc69c42263 /fpicker | |
parent | d8b05b5951fd446ff3fa904a6f68846f1abdb2fe (diff) |
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: I1d037e87c69b1a7de019f1abf1f729bf7e28d762
Reviewed-on: https://gerrit.libreoffice.org/13494
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/win32/filepicker/dibpreview.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fpicker/source/win32/filepicker/dibpreview.cxx b/fpicker/source/win32/filepicker/dibpreview.cxx index 1df00d683dc3..1b28085c02e7 100644 --- a/fpicker/source/win32/filepicker/dibpreview.cxx +++ b/fpicker/source/win32/filepicker/dibpreview.cxx @@ -213,26 +213,20 @@ HWND SAL_CALL CDIBPreview::getWindowHandle() const void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) { - BITMAPFILEHEADER* pbmfh; - BITMAPINFO * pbmi; - sal_uInt8 * pBits; - int cxDib; - int cyDib; - osl::MutexGuard aGuard(m_PaintLock); try { - pbmfh = reinterpret_cast<BITMAPFILEHEADER*>(m_Image.getArray()); + BITMAPFILEHEADER* pbmfh = reinterpret_cast<BITMAPFILEHEADER*>(m_Image.getArray()); if ( !IsBadReadPtr( pbmfh, sizeof(BITMAPFILEHEADER)) && (pbmfh->bfType == ('B' | ('M' << 8))) ) { - pbmi = reinterpret_cast<BITMAPINFO*>((pbmfh + 1)); - pBits = reinterpret_cast<sal_uInt8*>(((DWORD_PTR)pbmfh) + pbmfh->bfOffBits); + BITMAPINFO * pbmi = reinterpret_cast<BITMAPINFO*>((pbmfh + 1)); + sal_uInt8 * pBits = reinterpret_cast<sal_uInt8*>(((DWORD_PTR)pbmfh) + pbmfh->bfOffBits); - cxDib = pbmi->bmiHeader.biWidth; - cyDib = abs (pbmi->bmiHeader.biHeight); + int cxDib = pbmi->bmiHeader.biWidth; + int cyDib = abs (pbmi->bmiHeader.biHeight); SetStretchBltMode(hDC, COLORONCOLOR); |