Kaydet (Commit) acecfab9 authored tarafından marc-andre@atc.tcs.com's avatar marc-andre@atc.tcs.com Kaydeden (comit) Caolán McNamara

Fixed a segmentation fault in some edge cases

üst bb494d6b
...@@ -915,6 +915,7 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/) ...@@ -915,6 +915,7 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
aNewSection.maSep.fEvenlySpaced = aNewSection.maSep.fEvenlySpaced =
ReadBSprm(pSep, (eVer <= ww::eWW7 ? 138 : 0x3005), 1) ? true : false; ReadBSprm(pSep, (eVer <= ww::eWW7 ? 138 : 0x3005), 1) ? true : false;
const sal_uInt8 numrgda = SAL_N_ELEMENTS(aNewSection.maSep.rgdxaColumnWidthSpacing);
if (aNewSection.maSep.ccolM1 > 0 && !aNewSection.maSep.fEvenlySpaced) if (aNewSection.maSep.ccolM1 > 0 && !aNewSection.maSep.fEvenlySpaced)
{ {
aNewSection.maSep.rgdxaColumnWidthSpacing[0] = 0; aNewSection.maSep.rgdxaColumnWidthSpacing[0] = 0;
...@@ -928,7 +929,8 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/) ...@@ -928,7 +929,8 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
OSL_ENSURE( pSW, "+Sprm 136 (bzw. 0xF203) (ColWidth) fehlt" ); OSL_ENSURE( pSW, "+Sprm 136 (bzw. 0xF203) (ColWidth) fehlt" );
sal_uInt16 nWidth = pSW ? SVBT16ToShort(pSW + 1) : 1440; sal_uInt16 nWidth = pSW ? SVBT16ToShort(pSW + 1) : 1440;
aNewSection.maSep.rgdxaColumnWidthSpacing[++nIdx] = nWidth; if (++nIdx < numrgda)
aNewSection.maSep.rgdxaColumnWidthSpacing[nIdx] = nWidth;
if (i < nCols-1) if (i < nCols-1)
{ {
...@@ -939,7 +941,8 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/) ...@@ -939,7 +941,8 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
if( pSD ) if( pSD )
{ {
nWidth = SVBT16ToShort(pSD + 1); nWidth = SVBT16ToShort(pSD + 1);
aNewSection.maSep.rgdxaColumnWidthSpacing[++nIdx] = nWidth; if (++nIdx < numrgda)
aNewSection.maSep.rgdxaColumnWidthSpacing[nIdx] = nWidth;
} }
} }
} }
......
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