summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2002-11-04 14:57:14 +0000
committerDaniel Rentz <dr@openoffice.org>2002-11-04 14:57:14 +0000
commitf5412bb121481cf1e48af4d6dc10674bec6c095c (patch)
tree07e846a9dfae018fe56d88b0dc7507ff4c18f195 /sc/source
parent08cc3d0566e4e780be0e172561a5bce011c75e5d (diff)
#101810# clipboard support for BIFF8
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/filter/excel/excimp8.cxx50
-rw-r--r--sc/source/filter/inc/excimp8.hxx5
-rw-r--r--sc/source/ui/view/cellsh.cxx5
-rw-r--r--sc/source/ui/view/gridwin.cxx6
-rw-r--r--sc/source/ui/view/viewfun3.cxx14
-rw-r--r--sc/source/ui/view/viewfun5.cxx8
6 files changed, 66 insertions, 22 deletions
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 6c08918a84a3..cc1ae10faef5 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: excimp8.cxx,v $
*
- * $Revision: 1.70 $
+ * $Revision: 1.71 $
*
- * last change: $Author: dr $ $Date: 2002-05-22 11:11:18 $
+ * last change: $Author: dr $ $Date: 2002-11-04 15:53:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -941,6 +941,38 @@ void ImportExcel8::Labelsst( void )
}
+void ImportExcel8::Rstring( void )
+{
+ UINT16 nRow, nCol, nXF;
+
+ aIn >> nRow >> nCol >> nXF;
+
+ if( nRow <= MAXROW && nCol <= MAXCOL )
+ {
+ // DR: It would be too simple to store a simple rich-string here.
+ // No, it is an unformatted Unicode string with separate formatting
+ // information. So we have to collect the data manually...
+ String aText;
+ sal_uInt16 nRunCount;
+ aIn.AppendUniString( aText );
+ aIn >> nRunCount;
+ ShStrTabFormEntry aHelpObj( aText, aIn, nRunCount );
+
+ ScBaseCell* pCell = CreateCellFromShStrTabEntry( &aHelpObj, nXF );
+ if( pCell )
+ pD->PutCell( nCol, nRow, nTab, pCell, ( BOOL ) TRUE );
+
+ pColRowBuff->Used( nCol, nRow );
+
+ pCellStyleBuffer->SetXF( nCol, nRow, nXF );
+ }
+ else
+ bTabTruncated = TRUE;
+
+ pLastFormCell = NULL;
+}
+
+
void ImportExcel8::Label( void )
{
UINT16 nRow, nCol, nXF;
@@ -1491,13 +1523,17 @@ void ImportExcel8::PostDocLoad( void )
}
// read doc info
- SfxDocumentInfo aNewDocInfo;
- SfxDocumentInfo& rOldDocInfo = pD->GetDocumentShell()->GetDocInfo();
+ // no docshell while pasting from clipboard
+ if( pD->GetDocumentShell() )
+ {
+ SfxDocumentInfo aNewDocInfo;
+ SfxDocumentInfo& rOldDocInfo = pD->GetDocumentShell()->GetDocInfo();
- aNewDocInfo.LoadPropertySet( pExcRoot->pRootStorage );
+ aNewDocInfo.LoadPropertySet( pExcRoot->pRootStorage );
- rOldDocInfo = aNewDocInfo;
- pD->GetDocumentShell()->Broadcast( SfxDocumentInfoHint( &rOldDocInfo ) );
+ rOldDocInfo = aNewDocInfo;
+ pD->GetDocumentShell()->Broadcast( SfxDocumentInfoHint( &rOldDocInfo ) );
+ }
// building pivot tables
aPivotTabList.Apply();
diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx
index f87185e565e1..c2384e562e7d 100644
--- a/sc/source/filter/inc/excimp8.hxx
+++ b/sc/source/filter/inc/excimp8.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: excimp8.hxx,v $
*
- * $Revision: 1.40 $
+ * $Revision: 1.41 $
*
- * last change: $Author: dr $ $Date: 2002-05-22 11:10:31 $
+ * last change: $Author: dr $ $Date: 2002-11-04 15:52:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -222,6 +222,7 @@ class ImportExcel8 : public ImportExcel
ScBaseCell* CreateCellFromShStrTabEntry( const ShStrTabEntry*,
const UINT16 nXF );
void Labelsst( void ); // 0xFD
+ void Rstring( void ); // 0xD6
void SXVdex( void ); // 0x0100
void Labelranges(); // 0x015F
void Label( void ); // 0x0204
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index e8f97119f016..59747302d5c7 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cellsh.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: nn $ $Date: 2002-10-08 08:00:01 $
+ * last change: $Author: dr $ $Date: 2002-11-04 15:57:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -378,6 +378,7 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats )
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_RTF );
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_HTML );
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_HTML_SIMPLE );
+ lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_BIFF_8 );
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_BIFF_5 );
}
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index fff99a231056..d131988d6645 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: gridwin.cxx,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: nn $ $Date: 2002-10-18 14:09:52 $
+ * last change: $Author: dr $ $Date: 2002-11-04 15:57:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2882,6 +2882,8 @@ ULONG lcl_GetDropFormatId( const uno::Reference<datatransfer::XTransferable>& xT
nFormatId = SOT_FORMATSTR_ID_SBA_DATAEXCHANGE;
else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ) )
nFormatId = SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE;
+ else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_BIFF_8 ) )
+ nFormatId = SOT_FORMATSTR_ID_BIFF_8;
else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_BIFF_5 ) )
nFormatId = SOT_FORMATSTR_ID_BIFF_5;
else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ) )
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 4d8334ed7ea1..6b552c426729 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewfun3.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: nn $ $Date: 2002-10-10 16:56:51 $
+ * last change: $Author: dr $ $Date: 2002-11-04 15:57:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -449,7 +449,9 @@ void ScViewFunc::PasteFromSystem()
// if (pClipObj.Is())
{
- ULONG nBiff = SotExchange::RegisterFormatName(
+ ULONG nBiff8 = SotExchange::RegisterFormatName(
+ String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Biff8")));
+ ULONG nBiff5 = SotExchange::RegisterFormatName(
String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Biff5")));
// als erstes SvDraw-Model, dann Grafik
@@ -482,8 +484,10 @@ void ScViewFunc::PasteFromSystem()
else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE ))
PasteFromSystem( SOT_FORMATSTR_ID_LINK_SOURCE );
// FORMAT_PRIVATE no longer here (can't work if pOwnClip is NULL)
- else if (aDataHelper.HasFormat(nBiff)) // before xxx_OLE formats
- PasteFromSystem(nBiff);
+ else if (aDataHelper.HasFormat(nBiff8)) // before xxx_OLE formats
+ PasteFromSystem(nBiff8);
+ else if (aDataHelper.HasFormat(nBiff5))
+ PasteFromSystem(nBiff5);
else if (aDataHelper.HasFormat(FORMAT_RTF))
PasteFromSystem(FORMAT_RTF);
else if (aDataHelper.HasFormat(SOT_FORMATSTR_ID_HTML))
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index d7be0c9fc61f..7628f0e361dd 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewfun5.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: nn $ $Date: 2002-07-16 15:17:55 $
+ * last change: $Author: dr $ $Date: 2002-11-04 15:57:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -431,12 +431,12 @@ BOOL ScViewFunc::PasteDataFormat( ULONG nFormatId,
bRet = TRUE;
}
}
- else if ( nFormatId == SOT_FORMATSTR_ID_BIFF_5 )
+ else if ( (nFormatId == SOT_FORMATSTR_ID_BIFF_5) || (nFormatId == SOT_FORMATSTR_ID_BIFF_8) )
{
// do excel import into a clipboard document
SotStorageStreamRef xStm;
- if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_BIFF_5, xStm ) )
+ if( aDataHelper.GetSotStorageStream( nFormatId, xStm ) )
{
SvStorageRef pStor = new SvStorage( *xStm );
#if 0