[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Mar 19 11:53:30 PDT 2012


 sc/source/ui/app/transobj.cxx   |    3 ---
 sc/source/ui/docshell/impex.cxx |   20 ++++++++++++++------
 2 files changed, 14 insertions(+), 9 deletions(-)

New commits:
commit a58d877fd576bacd738972a78c8310d4eccb0daa
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Mar 13 01:19:48 2012 +0100

    only shrink to used area in text export, fdo#46230, related n#677811
    
    Signed-off-by: Kohei Yoshida <kohei.yoshida at gmail.com>

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index ae73542..3d70f84 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 5abf7d5..c183387 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 )


More information about the Libreoffice-commits mailing list