[Libreoffice-commits] core.git: 3 commits - editeng/source sw/source
Caolán McNamara
caolanm at redhat.com
Tue Apr 14 05:59:57 PDT 2015
editeng/source/items/borderline.cxx | 1 +
sw/source/filter/ww8/WW8TableInfo.cxx | 8 ++++++--
sw/source/filter/ww8/wrtww8.cxx | 12 ++----------
sw/source/filter/ww8/ww8atr.cxx | 3 ---
4 files changed, 9 insertions(+), 15 deletions(-)
New commits:
commit 70b74121f06ac1892c81584919c5ee8c359d6b73
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Apr 14 13:58:18 2015 +0100
fix MAXTABLECELLS related crash on export of ooo106020-1.odt to doc
word has a limit of MAXTABLECELLS cells in a row, we were clipping
the rowspan container to that max, but not the cell container
Change-Id: I5274dc7febd47e6c8c8e5337f638972b65239922
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 13efc75..c38d516 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -144,6 +144,8 @@ TableBoxVectorPtr WW8TableNodeInfoInner::getTableBoxesOfRow()
const SwTableBoxes & rTblBoxes = pTabLine->GetTabBoxes();
sal_uInt8 nBoxes = rTblBoxes.size();
+ if (nBoxes > MAXTABLECELLS)
+ nBoxes = MAXTABLECELLS;
for ( sal_uInt8 n = 0; n < nBoxes; n++ )
{
pResult->push_back(rTblBoxes[n]);
@@ -244,7 +246,7 @@ WidthsPtr WW8TableNodeInfoInner::getColumnWidthsBasedOnAllRows()
const SwTableLine *pCurrentLine = rTableLines[nLineIndex];
const SwTableBoxes & rTabBoxes = pCurrentLine->GetTabBoxes();
size_t nBoxes = rTabBoxes.size();
- if ( nBoxes > MAXTABLECELLS )
+ if (nBoxes > MAXTABLECELLS)
nBoxes = MAXTABLECELLS;
sal_uInt32 nSeparatorPosition = 0;
@@ -298,7 +300,7 @@ WidthsPtr WW8TableNodeInfoInner::getWidthsOfRow()
pWidths = WidthsPtr(new Widths);
// number of cell written
sal_uInt32 nBoxes = rTabBoxes.size();
- if ( nBoxes > MAXTABLECELLS )
+ if (nBoxes > MAXTABLECELLS)
nBoxes = MAXTABLECELLS;
for (sal_uInt32 n = 0; n < nBoxes; n++)
@@ -1432,6 +1434,8 @@ CellInfoMultiSet::const_iterator WW8TableCellGridRow::end() const
void WW8TableCellGridRow::setTableBoxVector(TableBoxVectorPtr pTableBoxVector)
{
+ if (pTableBoxVector->size() > MAXTABLECELLS)
+ pTableBoxVector->resize(MAXTABLECELLS);
m_pTableBoxVector = pTableBoxVector;
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f779521..695a189 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2205,8 +2205,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
pTableTextNodeInfoInner->getTableBoxesOfRow();
// number of cell written
sal_uInt32 nBoxes = pTableBoxes->size();
- if (nBoxes > ww8::MAXTABLECELLS)
- nBoxes = ww8::MAXTABLECELLS;
+ assert(nBoxes <= ww8::MAXTABLECELLS);
// sprm header
m_rWW8Export.InsUInt16( NS_sprm::LN_TDefTable );
@@ -2272,14 +2271,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
ww8::TableBoxVector::const_iterator aIt;
ww8::TableBoxVector::const_iterator aItEnd = pTableBoxes->end();
-#if OSL_DEBUG_LEVEL > 1
- size_t nRowSpans = pRowSpans->size();
- size_t nTableBoxes = pTableBoxes->size();
- (void) nRowSpans;
- (void) nTableBoxes;
-#endif
-
- for( aIt = pTableBoxes->begin(); aIt != aItEnd; ++aIt, ++aItRowSpans)
+ for (aIt = pTableBoxes->begin(); aIt != aItEnd; ++aIt, ++aItRowSpans)
{
sal_uInt16 npOCount = m_rWW8Export.pO->size();
commit 0de25f95910c308337855ff5bab7e3917b1f62fe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Apr 14 13:22:01 2015 +0100
fix assert on saving fdo70092-1.odt to .doc
Change-Id: Ib2e969ca54da16b29ec20338148ee51810cb3c47
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 1e768da..b4a8f6c 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -259,6 +259,7 @@ ConvertBorderWidthToWord(SvxBorderStyle const eStyle, double const fWidth)
// Double lines
case DOUBLE:
+ case DOUBLE_THIN:
return fWidth / 3.0;
case THINTHICK_MEDIUMGAP:
commit b11077a0d272e45d3483adb972582b0887cb7a41
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Apr 14 13:16:13 2015 +0100
SwRTFWriter::OutRTFBorder is gone, so no merging needed anymore
Change-Id: Ie60c09d7b7c626a0a7624e4c833d72eb5d0d5965
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 4ebf690..a9ba08a 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4211,9 +4211,6 @@ void WW8AttributeOutput::FormatFillGradient( const XFillGradientItem& /*rFillGra
WW8_BRCVer9 WW8Export::TranslateBorderLine(const SvxBorderLine& rLine,
sal_uInt16 nDist, bool bShadow)
{
- // M.M. This function writes out border lines to the word format similar to
- // what SwRTFWriter::OutRTFBorder does in the RTF filter Eventually it
- // would be nice if all this functionality was in the one place
sal_uInt32 nColBGR = 0;
sal_uInt16 nWidth = ::editeng::ConvertBorderWidthToWord(
rLine.GetBorderLineStyle(), rLine.GetWidth());
More information about the Libreoffice-commits
mailing list