To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=45248





------- Additional comments from [EMAIL PROTECTED] Mon May  2 22:05:47 -0700 
2005 -------
heres (my) updated version:
this would actually iterate twice: once without actual paste, to find the range
and the next time - to paste.

--- sc/source/ui/docshell/impex.cxx     2005-04-14 09:50:04.000000000 +0530
+++ sc/source/ui/docshell/impex.cxx     2005-05-03 10:29:04.727361887 +0530
@@ -1084,6 +1084,8 @@ BOOL ScImportExport::ExtText2Doc( SvStre
        SCCOL nStartCol = aRange.aStart.Col();
        SCROW nStartRow = aRange.aStart.Row();
        SCTAB nTab = aRange.aStart.Tab();
+       SCCOL nEndCol = aRange.aEnd.Col();
+       SCROW nEndRow = aRange.aEnd.Row();
 
        BOOL    bFixed                  = pExtOptions->IsFixedLen();
        const String& rSeps     = pExtOptions->GetFieldSeps();
@@ -1127,6 +1129,14 @@ BOOL ScImportExport::ExtText2Doc( SvStre
                if ( rStrm.IsEof() )
                        break;
        }
+
+       bool bGetRange = FALSE;
+       nOldPos = rStrm.Tell();
+
+       do
+       {
+       bGetRange = !bGetRange; // Toggle
+
        for( ;; )
        {
                rStrm.ReadCsvLine( aLine, !bFixed, rSeps, cStr);
@@ -1144,9 +1154,12 @@ BOOL ScImportExport::ExtText2Doc( SvStre
                                {
                                        xub_StrLen nStart = pColStart[i];
                                        xub_StrLen nNext = ( i+1 < nInfoCount ) 
? pColStart[i+1] : nLineLen;
-                                       aCell = lcl_GetFixed( aLine, nStart, 
nNext );
-                                       bMultiLine |= lcl_PutString( pDoc, 
nCol, nRow, nTab, aCell, pColFormat[i],
-                        aTransliteration, aCalendar, pEnglishTransliteration,
pEnglishCalendar );
+                                       if( !bGetRange )
+                                       {
+                                               aCell = lcl_GetFixed( aLine, 
nStart, nNext );
+                                               bMultiLine |= lcl_PutString( 
pDoc, nCol, nRow, nTab, aCell, pColFormat[i],
+                           aTransliteration, aCalendar, 
pEnglishTransliteration,
pEnglishCalendar );
+                                       }
                                        ++nCol;
                                }
                        }
@@ -1172,7 +1185,8 @@ BOOL ScImportExport::ExtText2Doc( SvStre
                                }
                                if ( nFmt != SC_COL_SKIP )
                                {
-                                       bMultiLine |= lcl_PutString( pDoc, 
nCol, nRow, nTab, aCell, nFmt,
+                                       if( !bGetRange )
+                                               bMultiLine |= lcl_PutString( 
pDoc, nCol, nRow, nTab, aCell, nFmt,
                         aTransliteration, aCalendar, pEnglishTransliteration,
pEnglishCalendar );
                                        ++nCol;
                                }
@@ -1190,7 +1204,24 @@ BOOL ScImportExport::ExtText2Doc( SvStre
                        bOverflow = TRUE;                       // beim Import 
Warnung ausgeben
                        break;
                }
+
+               // Find the correct End Col and End Row
+               if( bGetRange )
+               {
+                       if(nCol>nEndCol) nEndCol=nCol;
+                       if(nRow>nEndRow) nEndRow=nRow;
+               }
        }
+               if( bGetRange )
+               {
+                       aRange.aEnd.SetCol( nEndCol - 1 );
+                       aRange.aEnd.SetRow( nEndRow - 1 );
+                       StartPaste();           // Start the Paste, in the next 
iteration the actual paste is 
+                                                               // performed.
+                       rStrm.Seek( nOldPos );
+                       nRow = nStartRow;
+               }
+       } while(bGetRange);
 
        ScColumn::bDoubleAlloc = bOld;
        pDoc->DoColResize( nTab, 0, MAXCOL, 0 );
@@ -1198,6 +1229,8 @@ BOOL ScImportExport::ExtText2Doc( SvStre
     delete pEnglishTransliteration;
        delete pEnglishCalendar;
 
+       EndPaste();             // Paste was successful, refresh, etc.
+
        return TRUE;
 }
 

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to