[Libreoffice-commits] core.git: 2 commits - sw/source
Caolán McNamara
caolanm at redhat.com
Wed Apr 22 10:17:01 PDT 2015
sw/source/core/text/guess.cxx | 2 +-
sw/source/core/text/portxt.cxx | 2 +-
sw/source/filter/ww8/docxattributeoutput.cxx | 10 +++++-----
3 files changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 3635aec0c6595219946225cf02032c87b389db4c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 22 17:36:26 2015 +0100
fix export of ooo63048-1.sxw to .doc
I can't see that nCutPos = rInf.GetLen() makes a lot of sense, perhaps nCutPos
= rInf.GetIdx or nCutPos = rInf.GetLen() + rInf.GetIdx() makes more sense, but
nCutPos is only used in SwTxtPortion::BreakCut and the nLen has to be >= 0 to
be useful in there, so might as well straight-out flat invalidate it as -1 and
test for positive values in SwTxtPortion::BreakCut
Change-Id: Iad0c26efc47990cf2ffed54dc91207c3b8551096
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index b379308..5484520 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -201,7 +201,7 @@ bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
if ( rPor.IsFtnPortion() )
{
nBreakPos = rInf.GetIdx();
- nCutPos = rInf.GetLen();
+ nCutPos = -1;
return false;
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index c1c952f..3573b0f 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -221,7 +221,7 @@ void SwTxtPortion::BreakCut( SwTxtFormatInfo &rInf, const SwTxtGuess &rGuess )
// We truncate ...
const sal_uInt16 nLineWidth = (sal_uInt16)(rInf.Width() - rInf.X());
sal_Int32 nLen = rGuess.CutPos() - rInf.GetIdx();
- if( nLen )
+ if (nLen > 0)
{
// special case: guess does not always provide the correct
// width, only in common cases.
commit 9cd56129ab98653f3ce0b541a41572456514e242
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 22 14:53:05 2015 +0100
no need to take address
Change-Id: I76e8240b8e2fc731b5b6534eba37134db93ad4ed
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1783a28..25a1ffe 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2869,10 +2869,10 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
// Horizontal spans
const SwWriteTableRows& aRows = m_xTableWrt->GetRows( );
SwWriteTableRow *pRow = aRows[ nRow ];
- const SwWriteTableCells& tableCells = pRow->GetCells();
- if (nCell < tableCells.size() )
+ const SwWriteTableCells rTableCells = pRow->GetCells();
+ if (nCell < rTableCells.size() )
{
- const SwWriteTableCell& rCell = tableCells[nCell];
+ const SwWriteTableCell& rCell = rTableCells[nCell];
const sal_uInt16 nColSpan = rCell.GetColSpan();
if ( nColSpan > 1 )
m_pSerializer->singleElementNS( XML_w, XML_gridSpan,
@@ -3617,8 +3617,8 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer
const SwWriteTableRows& aRows = m_xTableWrt->GetRows( );
SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
sal_uInt32 nCell = pTableTextNodeInfoInner->getCell();
- const SwWriteTableCells *tableCells = &pRow->GetCells();
- if (nCell < tableCells->size() )
+ const SwWriteTableCells& rTableCells = pRow->GetCells();
+ if (nCell < rTableCells.size() )
{
const SwWriteTableCell *pCell = &pRow->GetCells( )[ nCell ];
switch( pCell->GetVertOri())
More information about the Libreoffice-commits
mailing list