summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-03-13 01:19:48 +0100
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-03-19 14:52:18 -0400
commita58d877fd576bacd738972a78c8310d4eccb0daa (patch)
treeae909b54a91a961aefd2d7c7c4a6802da6f08d30
parent5eceb03e2b756595d83550a6d662d789aec83e90 (diff)
only shrink to used area in text export, fdo#46230, related n#677811
Signed-off-by: Kohei Yoshida <kohei.yoshida@gmail.com>
-rw-r--r--sc/source/ui/app/transobj.cxx3
-rw-r--r--sc/source/ui/docshell/impex.cxx20
2 files changed, 14 insertions, 9 deletions
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index ae735420822b..3d70f841c44e 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 5abf7d595e02..c183387eb9a9 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -69,6 +69,7 @@ class StarBASIC;
#include "editable.hxx"
#include "compiler.hxx"
#include "warnbox.hxx"
+#include "clipparam.hxx"
#include "impex.hxx"
@@ -1436,26 +1437,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
@@ -1463,7 +1471,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 )
@@ -1486,7 +1494,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;
@@ -1495,7 +1503,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 )