diff options
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpbackgroundstuff.cxx | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx index 8a19cc92088c..ffaa7525bdda 100644 --- a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx +++ b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx @@ -83,14 +83,11 @@ void LwpBackgroundStuff::GetPattern(sal_uInt16 btPttnIndex, sal_uInt8* pPttnArra assert(false); return; } - if (pPttnArray) + assert((2 < btPttnIndex) && (btPttnIndex < 72)); + const sal_uInt8* pTempArray = s_pLwpPatternTab[btPttnIndex]; + for(sal_uInt8 i = 0; i < 32; i++) { - assert((2 < btPttnIndex) && (btPttnIndex < 72)); - const sal_uInt8* pTempArray = s_pLwpPatternTab[btPttnIndex]; - for(sal_uInt8 i = 0; i < 32; i++) - { - pPttnArray[i] = (i%4 == 0) ? pTempArray[7-i/4] : 0; - } + pPttnArray[i] = (i%4 == 0) ? pTempArray[7-i/4] : 0; } } @@ -113,22 +110,16 @@ XFBGImage* LwpBackgroundStuff::GetFillPattern() } // get pattern array from pattern table - sal_uInt8* pPttnArray = new sal_uInt8 [32]; - this->GetPattern(m_nID, pPttnArray); + sal_uInt8 aPttnArray[32]; + GetPattern(m_nID, aPttnArray); // create bitmap object from the pattern array Bitmap aBmp( Size(8, 8), 1 ); BitmapWriteAccess* pWA = aBmp.AcquireWriteAccess(); sal_uInt8* pBuf = pWA->GetBuffer(); - memcpy(pBuf, pPttnArray, 32); + memcpy(pBuf, aPttnArray, 32); aBmp.ReleaseAccess(pWA); - if (pPttnArray) - { - delete [] pPttnArray; - pPttnArray = NULL; - } - // create XOBitmap object from bitmap object XOBitmap aXOBitmap( aBmp ); aXOBitmap.Bitmap2Array(); |