Index: sc/source/ui/view/viewfun5.cxx
===================================================================
RCS file: /cvs/sc/sc/source/ui/view/viewfun5.cxx,v
retrieving revision 1.29
diff -u -r1.29 viewfun5.cxx
--- sc/source/ui/view/viewfun5.cxx	8 Sep 2004 15:56:29 -0000	1.29
+++ sc/source/ui/view/viewfun5.cxx	12 Oct 2004 13:51:30 -0000
@@ -119,6 +119,11 @@
 #include "tabvwsh.hxx"		//	wegen GetViewFrame
 #include "compiler.hxx"
 
+#include "asciiopt.hxx"
+#include "scabstdlg.hxx"
+#include "vcl/msgbox.hxx"
+#include "scresid.hxx"
+
 #ifndef _SFXVIEWFRM_HXX //autogen
 #include <sfx2/viewfrm.hxx>
 #endif
@@ -272,13 +276,44 @@
 			ScAddress aPos( nPosX, nPosY, GetViewData()->GetTabNo() );
 			ScImportExport aObj( GetViewData()->GetDocument(), aPos );
 
-            ::rtl::OUString aStr;
+			::rtl::OUString aStr;
 			SotStorageStreamRef xStream;
 			if ( aDataHelper.GetSotStorageStream( nFormatId, xStream ) && xStream.Is() )
                 // mba: clipboard always must contain absolute URLs (could be from alien source)
                 bRet = aObj.ImportStream( *xStream, String(), nFormatId );
-			else if ( aDataHelper.GetString( nFormatId, aStr ) )
-				bRet = aObj.ImportString( aStr, nFormatId );
+
+			else if ( aDataHelper.GetString( nFormatId, aStr ) ) {
+
+			  sal_Int32 newln;
+			  newln = aStr.indexOf ('\n');
+/*			  ::rtl::OString tmpStr = OUStringToOString
+			      ( aStr, RTL_TEXTENCODING_UTF8 );
+			  fprintf (stderr, "String is '%s' (%d) [%d]\n",
+				   tmpStr.getStr (), tmpStr.getLength(), newln); */
+			  if (newln >= 0 && newln != aStr.getLength () - 1) { // do dialog
+				// FIXME: split me out - if only C++ 'private' didn't suck rocks.
+
+				SvMemoryStream aStrm( (void*)aStr.getStr(), aStr.getLength() * sizeof(sal_Unicode), STREAM_READ );
+				aStrm.SetStreamCharSet( RTL_TEXTENCODING_UNICODE );
+				// Hack - copied from impex.cxx - we need a helper to do this [!]
+				aStrm.SetEndianSwap( FALSE );
+
+				ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
+				AbstractScImportAsciiDlg *pDlg = pFact->CreateScImportAsciiDlg
+					( NULL, String( ScResId( SCSTR_PASTED_DATA ) ), &aStrm, 
+					  ResId(RID_SCDLG_ASCII) );
+
+				if (pDlg->Execute() == RET_OK) {
+				  ScAsciiOptions aOptions;
+				  pDlg->GetOptions( aOptions );
+				  aObj.SetExtOptions( aOptions );
+
+				  bRet = aObj.ImportString( aStr, nFormatId );
+				} else
+				  bRet = FALSE;
+			  } else
+			    bRet = aObj.ImportString( aStr, nFormatId );
+			}
 
 			InvalidateAttribs();
 			GetViewData()->UpdateInputHandler();
Index: sc/inc/sc.hrc
===================================================================
RCS file: /cvs/sc/sc/inc/sc.hrc,v
retrieving revision 1.49
diff -u -p -u -r1.49 sc.hrc
--- sc/inc/sc.hrc	8 Sep 2005 17:52:24 -0000	1.49
+++ sc/inc/sc.hrc	29 Mar 2006 14:33:50 -0000
@@ -1344,6 +1346,7 @@
 #define SCSTR_FORMULA_AUTOCORRECTION	(STR_START + 214)
 
 #define SCSTR_RENAMEOBJECT			(STR_START + 215)
+#define SCSTR_PASTED_DATA			(STR_START + 216)
 
 // Navigator - in der Reihenfolge wie SC_CONTENT_...
 #define SCSTR_CONTENT_ROOT		(STR_START + 250)

Index: sc/source/ui/src/scstring.src
===================================================================
RCS file: /cvs/sc/sc/source/ui/src/scstring.src,v
retrieving revision 1.84
diff -u -p -u -r1.84 scstring.src
--- sc/source/ui/src/scstring.src	23 Sep 2005 15:09:41 -0000	1.84
+++ sc/source/ui/src/scstring.src	29 Mar 2006 14:33:51 -0000
@@ -407,6 +407,18 @@ String SCSTR_RENAMEOBJECT
 	Text [ de ] = "Objekt benennen" ;
 	Text [ en-US ] = "Name object";
 };
+String SCSTR_PASTED_DATA
+{
+	Text [ en-US ] = "Pasted Data";
+		Text[ de ] = "Eingefügte Daten";
+		Text[ es ] = "Datos pegados";
+		Text[ fr ] = "Données collées";
+		Text[ it ] = "Dati incollati";
+		Text[ ja ] = "貼り付けられたデータ";
+		Text[ pt-BR ] = "Dados Colados";
+		Text[ zh-CN ] = "粘贴的数据";
+		Text[ zh-TW ] = "貼上的資料";
+};
 String STR_INSERTGRAPHIC
 {
     Text [ de ] = "Bild einfügen" ;
