sc/source/ui/app/transobj.cxx | 3 --- sc/source/ui/docshell/impex.cxx | 20 ++++++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-)
New commits: commit 2a26fe4a39b6f3b2af269b801340c32c28806250 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue Mar 13 01:19:48 2012 +0100 only shrink to used area in text export, fdo#46230, related n#677811 diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 38afe52..b52ca6f 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -172,9 +172,6 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc } OSL_ENSURE(!bFirst, "no sheet selected"); - if (!pDoc->GetClipParam().isMultiRange() && nTab1 == nTab2) - pDoc->ShrinkToDataArea( nTab1, nCol1, nRow1, nCol2, nRow2 ); - // only limit to used cells if whole sheet was marked // (so empty cell areas can be copied) if ( nCol2>=MAXCOL && nRow2>=MAXROW ) diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 7bb959e..d4a8f80 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -70,6 +70,7 @@ class StarBASIC; #include "editable.hxx" #include "compiler.hxx" #include "warnbox.hxx" +#include "clipparam.hxx" #include "impex.hxx" @@ -1437,26 +1438,33 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm ) SCROW nRow; SCCOL nStartCol = aRange.aStart.Col(); SCROW nStartRow = aRange.aStart.Row(); + SCTAB nStartTab = aRange.aStart.Tab(); SCCOL nEndCol = aRange.aEnd.Col(); SCROW nEndRow = aRange.aEnd.Row(); + SCTAB nEndTab = aRange.aEnd.Tab(); + + if (!pDoc->GetClipParam().isMultiRange() && nStartTab == nEndTab) + pDoc->ShrinkToDataArea( nStartTab, nStartCol, nStartRow, nEndCol, nEndRow ); + String aCell; + bool bConvertLF = (GetSystemLineEnd() != LINEEND_LF); for (nRow = nStartRow; nRow <= nEndRow; nRow++) { - if (bIncludeFiltered || !pDoc->RowFiltered( nRow, aRange.aStart.Tab() )) + if (bIncludeFiltered || !pDoc->RowFiltered( nRow, nStartTab )) { for (nCol = nStartCol; nCol <= nEndCol; nCol++) { CellType eType; - pDoc->GetCellType( nCol, nRow, aRange.aStart.Tab(), eType ); + pDoc->GetCellType( nCol, nRow, nStartTab, eType ); switch (eType) { case CELLTYPE_FORMULA: { if (bFormulas) { - pDoc->GetFormula( nCol, nRow, aRange.aStart.Tab(), aCell ); + pDoc->GetFormula( nCol, nRow, nStartTab, aCell ); if( aCell.Search( cSep ) != STRING_NOTFOUND ) lcl_WriteString( rStrm, aCell, cStr, cStr ); else @@ -1464,7 +1472,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm ) } else { - pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCell ); + pDoc->GetString( nCol, nRow, nStartTab, aCell ); bool bMultiLineText = ( aCell.Search( _LF ) != STRING_NOTFOUND ); if( bMultiLineText ) @@ -1487,7 +1495,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm ) break; case CELLTYPE_VALUE: { - pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCell ); + pDoc->GetString( nCol, nRow, nStartTab, aCell ); lcl_WriteSimpleString( rStrm, aCell ); } break; @@ -1496,7 +1504,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm ) break; default: { - pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCell ); + pDoc->GetString( nCol, nRow, nStartTab, aCell ); bool bMultiLineText = ( aCell.Search( _LF ) != STRING_NOTFOUND ); if( bMultiLineText ) _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits