Kaydet (Commit) d59358ee authored tarafından Caolán McNamara's avatar Caolán McNamara

slightly odd stuff here

Change-Id: I715d49722ebe4658c108cb9b7bd6fa3934d973f8
üst d1698027
...@@ -83,14 +83,11 @@ void LwpBackgroundStuff::GetPattern(sal_uInt16 btPttnIndex, sal_uInt8* pPttnArra ...@@ -83,14 +83,11 @@ void LwpBackgroundStuff::GetPattern(sal_uInt16 btPttnIndex, sal_uInt8* pPttnArra
assert(false); assert(false);
return; 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)); pPttnArray[i] = (i%4 == 0) ? pTempArray[7-i/4] : 0;
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;
}
} }
} }
...@@ -113,22 +110,16 @@ XFBGImage* LwpBackgroundStuff::GetFillPattern() ...@@ -113,22 +110,16 @@ XFBGImage* LwpBackgroundStuff::GetFillPattern()
} }
// get pattern array from pattern table // get pattern array from pattern table
sal_uInt8* pPttnArray = new sal_uInt8 [32]; sal_uInt8 aPttnArray[32];
this->GetPattern(m_nID, pPttnArray); GetPattern(m_nID, aPttnArray);
// create bitmap object from the pattern array // create bitmap object from the pattern array
Bitmap aBmp( Size(8, 8), 1 ); Bitmap aBmp( Size(8, 8), 1 );
BitmapWriteAccess* pWA = aBmp.AcquireWriteAccess(); BitmapWriteAccess* pWA = aBmp.AcquireWriteAccess();
sal_uInt8* pBuf = pWA->GetBuffer(); sal_uInt8* pBuf = pWA->GetBuffer();
memcpy(pBuf, pPttnArray, 32); memcpy(pBuf, aPttnArray, 32);
aBmp.ReleaseAccess(pWA); aBmp.ReleaseAccess(pWA);
if (pPttnArray)
{
delete [] pPttnArray;
pPttnArray = NULL;
}
// create XOBitmap object from bitmap object // create XOBitmap object from bitmap object
XOBitmap aXOBitmap( aBmp ); XOBitmap aXOBitmap( aBmp );
aXOBitmap.Bitmap2Array(); aXOBitmap.Bitmap2Array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment