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

ofz#7229 Divide by zero

Change-Id: I7bd2f19d5dc99e9041b3ef0fc10caef6d8b7ca6a
Reviewed-on: https://gerrit.libreoffice.org/52253Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 39715e98
......@@ -330,6 +330,10 @@ bool wwSectionManager::SetCols(SwFrameFormat &rFormat, const wwSection &rSection
if (nCols < 2) //check for no columns or other weird state
return false;
const sal_uInt16 nNetWriterWidth = writer_cast<sal_uInt16>(nNetWidth);
if (nNetWriterWidth == 0)
return false;
SwFormatCol aCol; // Create SwFormatCol
//sprmSDxaColumns - Default distance is 1.25 cm
......@@ -346,8 +350,7 @@ bool wwSectionManager::SetCols(SwFrameFormat &rFormat, const wwSection &rSection
aCol.SetLineWidth(1);
}
aCol.Init(nCols, writer_cast<sal_uInt16>(nColSpace),
writer_cast<sal_uInt16>(nNetWidth));
aCol.Init(nCols, writer_cast<sal_uInt16>(nColSpace), nNetWriterWidth);
// sprmSFEvenlySpaced
if (!rSep.fEvenlySpaced)
......@@ -365,7 +368,7 @@ bool wwSectionManager::SetCols(SwFrameFormat &rFormat, const wwSection &rSection
pCol->SetLeft(writer_cast<sal_uInt16>(nLeft));
pCol->SetRight(writer_cast<sal_uInt16>(nRight));
}
aCol.SetWishWidth(writer_cast<sal_uInt16>(nNetWidth));
aCol.SetWishWidth(nNetWriterWidth);
}
rFormat.SetFormatAttr(aCol);
return true;
......
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