summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2001-05-10 16:31:17 +0000
committerDaniel Rentz <dr@openoffice.org>2001-05-10 16:31:17 +0000
commite431a92cddaa01e47629ae705d488b4fec1092ff (patch)
treecd5220ae80b7d19765a9b204e89054b7bfbdf826
parente6d3bb572ffc9ef537faa8ed4152e1bb26474f87 (diff)
excel import/export of view settings
-rw-r--r--sc/inc/scextopt.hxx55
-rw-r--r--sc/inc/viewopti.hxx10
-rw-r--r--sc/source/core/tool/viewopti.cxx6
-rw-r--r--sc/source/filter/excel/colrowst.cxx67
-rw-r--r--sc/source/filter/excel/excdoc.cxx15
-rw-r--r--sc/source/filter/excel/excrecds.cxx69
-rw-r--r--sc/source/filter/excel/impop.cxx87
-rw-r--r--sc/source/filter/inc/colrowst.hxx26
-rw-r--r--sc/source/filter/inc/excdefs.hxx19
-rw-r--r--sc/source/filter/inc/excrecds.hxx38
-rw-r--r--sc/source/filter/inc/xcl97rec.hxx60
-rw-r--r--sc/source/filter/xcl97/xcl97dum.cxx10
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx152
-rw-r--r--sc/source/ui/docshell/docsh.cxx15
-rw-r--r--sc/source/ui/inc/viewdata.hxx5
-rw-r--r--sc/source/ui/optdlg/tpview.cxx8
-rw-r--r--sc/source/ui/view/viewdata.cxx92
17 files changed, 482 insertions, 252 deletions
diff --git a/sc/inc/scextopt.hxx b/sc/inc/scextopt.hxx
index 6bee5d431250..7e53c137cc74 100644
--- a/sc/inc/scextopt.hxx
+++ b/sc/inc/scextopt.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scextopt.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: gt $ $Date: 2000-09-28 09:28:03 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:22:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -86,22 +86,24 @@ struct ScExtTabOptions
{
// Split -Info
UINT16 nTabNum;
- UINT16 nSplitX; // horiz. Pos. in Twips, 0 = kein Split
- UINT16 nSplitY; // vert. Pos. ~
- UINT16 nLeftSplitCol; // linke sichtbare Col im rechten Teil
- UINT16 nTopSplitRow; // obere sichtbare Row im unteren Teil
- UINT16 nActPane; // 0: ur, 1: or, 2: ul, 3: ol
-
- ScRange aLastSel; // letzte Selektion
+ UINT16 nSplitX; // horiz. pos. in twips, 0 = no split
+ UINT16 nSplitY; // vert. pos. ~
+ UINT16 nLeftCol; // leftmost column visible
+ UINT16 nTopRow; // topmost row visible
+ UINT16 nLeftSplitCol; // leftmost column after horizontal split
+ UINT16 nTopSplitRow; // topmost row after vertical split
+ UINT16 nActPane; // 0: br, 1: tr, 2: bl, 3: tl
+
+ ScRange aLastSel; // last selection
BOOL bValidSel;
- ScRange aDim; // original Excel-Groesse
+ ScRange aDim; // original Excel size
BOOL bValidDim;
- BOOL bFrozen; // = TRUE -> nSplitX / nSplitY Anzahl
- // sichtbarer Col/Row links bzw. oben
+ BOOL bSelected;
+ BOOL bFrozen; // = TRUE -> nSplitX / nSplitY contain
+ // count of visible columns/rows
inline ScExtTabOptions( void );
- inline ScExtTabOptions( const ScRange& rLastSel );
inline ScExtTabOptions( const ScExtTabOptions& rCpy );
inline void operator =( const ScExtTabOptions& rCpy );
@@ -148,8 +150,7 @@ public:
UINT32 nLinkCnt; // Zaehlt die Rekursionstufe beim Laden
// von externen Dokumenten
UINT16 nActTab; // aktuelle Tabelle
- UINT16 nVisLeftCol; // linke Col des sichtbaren Tabellenteils
- UINT16 nVisTopRow; // rechte Row des sichtbaren Tabellenteils
+ UINT16 nSelTabs; // count of selected sheets
Color* pGridCol; // Farbe Grid und Row-/Col-Heading
UINT16 nZoom; // in %
// Cursor
@@ -162,9 +163,10 @@ public:
ScExtDocOptions& operator =( const ScExtDocOptions& rCpy );
- void SetGridCol( BYTE nR, BYTE nG, BYTE nB );
+ void SetExtTabOptions( UINT16 nTabNum, ScExtTabOptions* pTabOpt );
+
+ void SetGridCol( const Color& rColor );
void SetActTab( UINT16 nTab );
- void SetVisCorner( UINT16 nCol, UINT16 nRow );
void SetCursor( UINT16 nCol, UINT16 nRow );
void SetZoom( UINT16 nZaehler, UINT16 nNenner );
@@ -215,16 +217,9 @@ inline const String* CodenameList::Act( void ) const
inline ScExtTabOptions::ScExtTabOptions( void )
{
- nSplitX = nSplitY = nLeftSplitCol = nTopSplitRow = nActPane = 0;
- bFrozen = bValidSel = bValidDim = FALSE;
-}
-
-
-inline ScExtTabOptions::ScExtTabOptions( const ScRange& rLastSel ) : aLastSel( rLastSel )
-{
- nTabNum = nSplitX = nSplitY = nLeftSplitCol = nTopSplitRow = nActPane = 0;
- bFrozen = bValidDim = FALSE;
- bValidSel = TRUE;
+ nTabNum = nSplitX = nSplitY = nLeftCol = nTopRow = nLeftSplitCol = nTopSplitRow = 0;
+ nActPane = 3;
+ bSelected = bFrozen = bValidSel = bValidDim = FALSE;
}
@@ -233,11 +228,14 @@ inline ScExtTabOptions::ScExtTabOptions( const ScExtTabOptions& rCpy )
nTabNum = rCpy.nTabNum;
nSplitX = rCpy.nSplitX;
nSplitY = rCpy.nSplitY;
+ nLeftCol = rCpy.nLeftCol;
+ nTopRow = rCpy.nTopRow;
nLeftSplitCol = rCpy.nLeftSplitCol;
nTopSplitRow = rCpy.nTopSplitRow;
nActPane = rCpy.nActPane;
aLastSel = rCpy.aLastSel;
aDim = rCpy.aDim;
+ bSelected = rCpy.bSelected;
bFrozen = rCpy.bFrozen;
bValidSel = rCpy.bValidSel;
bValidDim = rCpy.bValidDim;
@@ -249,11 +247,14 @@ inline void ScExtTabOptions::operator =( const ScExtTabOptions& rCpy )
nTabNum = rCpy.nTabNum;
nSplitX = rCpy.nSplitX;
nSplitY = rCpy.nSplitY;
+ nLeftCol = rCpy.nLeftCol;
+ nTopRow = rCpy.nTopRow;
nLeftSplitCol = rCpy.nLeftSplitCol;
nTopSplitRow = rCpy.nTopSplitRow;
nActPane = rCpy.nActPane;
aLastSel = rCpy.aLastSel;
aDim = rCpy.aDim;
+ bSelected = rCpy.bSelected;
bFrozen = rCpy.bFrozen;
bValidSel = rCpy.bValidSel;
bValidDim = rCpy.bValidDim;
diff --git a/sc/inc/viewopti.hxx b/sc/inc/viewopti.hxx
index 4cd189a3073d..ed2dc7e65b99 100644
--- a/sc/inc/viewopti.hxx
+++ b/sc/inc/viewopti.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewopti.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: nn $ $Date: 2000-11-02 19:10:56 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:22:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -109,8 +109,10 @@ enum ScVObjType
VOBJ_TYPE_DRAW
};
-#define MAX_OPT (USHORT)VOPT_BIGHANDLES+1
-#define MAX_TYPE (USHORT)VOBJ_TYPE_DRAW+1
+#define MAX_OPT (USHORT)VOPT_BIGHANDLES+1
+#define MAX_TYPE (USHORT)VOBJ_TYPE_DRAW+1
+
+#define SC_STD_GRIDCOLOR COL_LIGHTGRAY
//==================================================================
// SvxGrid-Optionen mit Standard-Operatoren
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 994c4c2ddd31..6f13d0dc0b2e 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewopti.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: nn $ $Date: 2000-11-02 19:12:16 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:23:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -241,7 +241,7 @@ void ScViewOptions::SetDefaults()
aModeArr[VOBJ_TYPE_CHART] =
aModeArr[VOBJ_TYPE_DRAW ] = VOBJ_MODE_SHOW;
- aGridCol = Color( COL_LIGHTGRAY );
+ aGridCol = Color( SC_STD_GRIDCOLOR );
aGridColName = ScGlobal::GetRscString( STR_GRIDCOLOR );
aGridOpt.SetDefaults();
diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx
index a4597755fdc4..ede621fe450a 100644
--- a/sc/source/filter/excel/colrowst.cxx
+++ b/sc/source/filter/excel/colrowst.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: colrowst.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: gt $ $Date: 2001-04-17 12:51:46 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:24:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,7 +78,6 @@
#endif
#include "document.hxx"
-#include "scextopt.hxx"
#include "XclImpStream.hxx"
#include "root.hxx"
#include "xfbuff.hxx"
@@ -376,11 +375,9 @@ void ColRowSettings::_SetRowSettings( const UINT16 nRow, const UINT16 nExcelHeig
void ColRowSettings::ReadSplit( XclImpStream& rIn )
{
- if( !pExtTabOpt )
- {
- pExtTabOpt = new ScExtTabOptions;
- pExtTabOpt->bFrozen = FALSE;
- }
+ GetExtTabOpt();
+
+ pExtTabOpt->bFrozen = FALSE;
rIn >> pExtTabOpt->nSplitX >> pExtTabOpt->nSplitY >> pExtTabOpt->nTopSplitRow >> pExtTabOpt->nLeftSplitCol;
@@ -395,33 +392,12 @@ void ColRowSettings::ReadSplit( XclImpStream& rIn )
void ColRowSettings::SetFrozen( const BOOL bFrozen )
{
- if( !pExtTabOpt )
- pExtTabOpt = new ScExtTabOptions;
-
- pExtTabOpt->nTabNum = *pExcRoot->pAktTab;
- pExtTabOpt->bFrozen = bFrozen;
+ GetExtTabOpt().nTabNum = *pExcRoot->pAktTab;
+ GetExtTabOpt().bFrozen = bFrozen;
}
-void ColRowSettings::SetSelection( const ScRange& rSel )
-{
- if( pExtTabOpt )
- pExtTabOpt->SetSelection( rSel );
- else
- pExtTabOpt = new ScExtTabOptions( rSel );
-}
-
-
-void ColRowSettings::SetDimension( const ScRange& rDim )
-{
- if( !pExtTabOpt )
- pExtTabOpt = new ScExtTabOptions;
-
- pExtTabOpt->SetDimension( rDim );
-}
-
-
void ColRowSettings::SetHorizPagebreak( const UINT16 n )
{
DBG_ASSERT( n, "+ColRowSettings::SetHorizPagebreak(): 0 ist hier nicht zulaessig!" );
@@ -936,7 +912,7 @@ CodenameList::~CodenameList()
ScExtDocOptions::ScExtDocOptions( void )
{
pGridCol = NULL;
- nActTab = nVisLeftCol = nVisTopRow = 0;
+ nActTab = nSelTabs = nVisLeftCol = nVisTopRow = nCurCol = nCurRow = 0;
nLinkCnt = 0; // -> 'Root'-Dokument
nZoom = 100;
@@ -975,8 +951,12 @@ ScExtDocOptions& ScExtDocOptions::operator =( const ScExtDocOptions& rCpy )
{
nLinkCnt = rCpy.nLinkCnt;
nActTab = rCpy.nActTab;
+ nSelTabs = rCpy.nSelTabs;
nVisLeftCol = rCpy.nVisLeftCol;
nVisTopRow = rCpy.nVisTopRow;
+ nCurCol = rCpy.nCurCol;
+ nCurRow = rCpy.nCurRow;
+
if( pGridCol )
{
if( rCpy.pGridCol )
@@ -1024,27 +1004,26 @@ ScExtDocOptions& ScExtDocOptions::operator =( const ScExtDocOptions& rCpy )
}
-void ScExtDocOptions::SetGridCol( BYTE nR, BYTE nG, BYTE nB )
+void ScExtDocOptions::SetExtTabOptions( UINT16 nTabNum, ScExtTabOptions* pTabOpt )
{
- const static UINT16 nFakt = 257; // 0...255 * 257 = 0...65535
-
- if( pGridCol )
- delete pGridCol;
-
- pGridCol = new Color( nFakt * nR, nFakt * nG, nFakt * nB );
+ if( ppExtTabOpts[ nTabNum ] )
+ delete ppExtTabOpts[ nTabNum ];
+ ppExtTabOpts[ nTabNum ] = pTabOpt;
}
-void ScExtDocOptions::SetActTab( UINT16 nTab )
+void ScExtDocOptions::SetGridCol( const Color& rColor )
{
- nActTab = ( nTab <= MAXTAB )? nTab : MAXTAB;
+ if( pGridCol )
+ pGridCol->SetColor( rColor.GetColor() );
+ else
+ pGridCol = new Color( rColor );
}
-void ScExtDocOptions::SetVisCorner( UINT16 nCol, UINT16 nRow )
+void ScExtDocOptions::SetActTab( UINT16 nTab )
{
- nVisLeftCol = ( nCol <= MAXCOL )? nCol : MAXCOL;
- nVisTopRow = ( nRow <= MAXROW )? nRow : MAXROW;
+ nActTab = ( nTab <= MAXTAB )? nTab : MAXTAB;
}
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index e1de723afdcc..32abbe3a018c 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: excdoc.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: dr $ $Date: 2001-04-19 14:17:26 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:24:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -502,6 +502,7 @@ void ExcTable::FillAsHeader( ExcRecordListRefs& rBSRecList )
else
{
Add( new ExcDummy8_040 );
+ Add( new ExcWindow18( rR ) );
Add( new Exc1904( rDoc ) );
Add( new ExcDummy8_041 );
// Font
@@ -1126,7 +1127,10 @@ void ExcTable::FillAsTable( void )
aTableOpList.UpdateCells();
if( rR.eDateiTyp < Biff8 )
+ {
Add( new ExcWindow2( nExcTab ) );
+ Add( new ExcSelection( 3, 0, 0 ) );
+ }
else
{
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
@@ -1164,12 +1168,9 @@ void ExcTable::FillAsTable( void )
}
// WINDOW2
- Add( new ExcWindow28( nExcTab ) );
+ Add( new ExcWindow28( rR, nScTab ) );
}
- // Default-Recs am Ende
- Add( new ExcDummy_03 );
-
if( rR.eDateiTyp >= Biff8 )
{
// web queries
@@ -1280,7 +1281,7 @@ void ExcTable::NullTab( const String* pCodename )
}
// WINDOW2
- Add( new ExcWindow28( nExcTab ) );
+ Add( new ExcWindow28( rR, nScTab ) );
}
Add( new ExcEof );
}
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 5bef89e62935..0760e389d75c 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: excrecds.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: dr $ $Date: 2001-04-19 09:55:55 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:24:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -430,13 +430,7 @@ const ULONG ExcDummy_02::nMyLen = sizeof( ExcDummy_02::pMyData );
// /*0x09 +*/ 0x02 + 0x02 + /*0x22 +*/ /*0x02 + */15 * 4;
-//--------------------------------------------------------- class ExcDummy_03 -
-const BYTE ExcDummy_03::pMyData[] = {
- 0x1d, 0x00, 0x0f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // SELECTION
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00
-};
-const ULONG ExcDummy_03::nMyLen = sizeof( ExcDummy_03::pMyData );
+//---------------------------------------------------------
ExcPalette2* ExcFont::pPalette2 = NULL;
@@ -2176,21 +2170,6 @@ void ExcNameList::Save( XclExpStream& rStrm )
-//--------------------------------------------------------- class ExcDummy_03 -
-
-ULONG ExcDummy_03::GetLen( void ) const
-{
- return nMyLen;
-}
-
-
-const BYTE* ExcDummy_03::GetData( void ) const
-{
- return pMyData;
-}
-
-
-
//------------------------------------------------------- class ExcDimensions -
ExcDimensions::ExcDimensions( BiffTyp eBiffP )
@@ -2931,20 +2910,13 @@ void ExcPal2Entry::UpdateEntry( UINT16 nColorType )
{
switch( nColorType )
{
- case EXC_COLOR_CHARTLINE:
- nWeight++;
- break;
+ case EXC_COLOR_CHARTLINE: nWeight++; break;
case EXC_COLOR_CELLBORDER:
- case EXC_COLOR_CHARTAREA:
- nWeight += 2;
- break;
+ case EXC_COLOR_CHARTAREA: nWeight += 2; break;
case EXC_COLOR_CELLTEXT:
- case EXC_COLOR_CHARTTEXT:
- nWeight += 10;
- break;
- case EXC_COLOR_CELLBGROUND:
- nWeight += 20;
- break;
+ case EXC_COLOR_CHARTTEXT: nWeight += 10; break;
+ case EXC_COLOR_CELLBGROUND: nWeight += 20; break;
+ case EXC_COLOR_GRID: nWeight += 50; break;
}
}
@@ -3444,6 +3416,31 @@ ULONG ExcWindow2::GetLen( void ) const
+//-------------------------------------------------------- class ExcSelection -
+
+void ExcSelection::SaveCont( XclExpStream& rStrm )
+{
+ rStrm << nPane // pane
+ << nRow << nCol // active cell
+ << (UINT16) 0 // index in ref array
+ << (UINT16) 1 // size of ref array
+ << nRow << nRow // ref array (activ cell only)
+ << (UINT8) nCol << (UINT8) nCol;
+}
+
+
+UINT16 ExcSelection::GetNum( void ) const
+{
+ return 0x001D;
+}
+
+
+ULONG ExcSelection::GetLen( void ) const
+{
+ return 15;
+}
+
+
//------------------------------------------------------------ class UsedList -
void UsedList::Save( XclExpStream& rStrm )
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index db4846ca01ee..5704195c8e0a 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impop.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: dr $ $Date: 2001-04-12 08:46:14 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:24:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -83,6 +83,7 @@
#include <svx/paperinf.hxx>
#include <svx/sizeitem.hxx>
#include <svx/ulspitem.hxx>
+#include <svx/colritem.hxx>
#include <sfx2/printer.hxx>
#include <svtools/zforlist.hxx>
@@ -697,20 +698,17 @@ void ImportExcel::Note( void )
void ImportExcel::Selection( void )
{
UINT16 nNumRefs, nFirstRow, nLastRow;
- UINT8 nFirstCol, nLastCol;
-
- aIn.Ignore( 7 );
+ UINT8 nPane, nFirstCol, nLastCol;
+ aIn >> nPane;
+ aIn.Ignore( 6 );
aIn >> nNumRefs;
- if( nNumRefs )
+ if( (nPane == aColRowBuff.GetActivePane()) && nNumRefs )
{
nNumRefs--;
-
aIn.Ignore( nNumRefs * 6 ); // nur letzte Selektion interessiert
-
aIn >> nFirstRow >> nLastRow >> nFirstCol >> nLastCol;
-
aColRowBuff.SetSelection( ScRange( ( UINT16 ) nFirstCol, nFirstRow, nTab,
( UINT16 ) nLastCol, nLastRow, nTab ) );
}
@@ -2022,70 +2020,39 @@ void ImportExcel::TableOp( void )
void ImportExcel::Window2_5( void )
{
ScExtDocOptions& rExtOpt = *pExcRoot->pExtDocOpt;
- UINT16 nOpt;
- aIn >> nOpt;
+ UINT16 nOpt, nRow, nCol;
+ UINT32 nColorIndex;
- if( nOpt & 0x0400 )
- {// Paged
- UINT16 nCol, nRow;
+ aIn >> nOpt >> nRow >> nCol >> nColorIndex;
- aIn >> nRow >> nCol;
- if( nRow > MAXROW )
- nRow = MAXROW;
- if( nCol > MAXCOL )
- nCol = MAXCOL;
+ if( nOpt & EXC_WIN2_DISPLAYED )
+ {
+ nRow = Min( nRow, (UINT16)MAXROW );
+ nCol = Min( nCol, (UINT16)MAXCOL );
rExtOpt.SetActTab( nTab );
rExtOpt.SetVisCorner( nCol, nRow );
}
+ aColRowBuff.SetTabSelected( TRUEBOOL( nOpt & EXC_WIN2_SELECTED ) );
- if( nOpt & 0x0008 ) // Frozen
+ if( nOpt & EXC_WIN2_FROZEN ) // Frozen
aColRowBuff.SetFrozen( TRUE );
- if( !( nOpt & 0x0020 ) )
- {// Use RGB
- BYTE nGridR, nGridG, nGridB;
-
- aIn >> nGridR >> nGridG >> nGridB;
-
- rExtOpt.SetGridCol( nGridR, nGridG, nGridB );
+ if( !( nOpt & EXC_WIN2_DEFAULTCOLOR ) )
+ {
+ const SvxColorItem* pColorItem = pExcRoot->pColor->GetColor( (UINT16) nColorIndex );
+ if( pColorItem )
+ rExtOpt.SetGridCol( pColorItem->GetValue() );
}
if( !nTab ) // nur Tabelle 0 wird uebernommen!
{
- ScViewOptions aOpts( pD->GetViewOptions() );
-
- if( nOpt & 0x0001 )
- // Display Formulas
- aOpts.SetOption( VOPT_FORMULAS, TRUE );
- else
- aOpts.SetOption( VOPT_FORMULAS, FALSE );
-
- if( nOpt & 0x0002 )
- // Display Gridlines
- aOpts.SetOption( VOPT_GRID, TRUE );
- else
- // Display No Gridlines
- aOpts.SetOption( VOPT_GRID, FALSE );
-
- if( nOpt & 0x0004 )
- aOpts.SetOption( VOPT_HEADER, TRUE );
- else
- // No Row-/Col-Headings
- aOpts.SetOption( VOPT_HEADER, FALSE );
-
- if( nOpt & 0x0010 )
- aOpts.SetOption( VOPT_NULLVALS, TRUE );
- else
- // Suppress Zero-Values
- aOpts.SetOption( VOPT_NULLVALS, FALSE );
-
- if( nOpt & 0x0080 )
- aOpts.SetOption( VOPT_OUTLINER, TRUE );
- else
- // Hide Outline
- aOpts.SetOption( VOPT_OUTLINER, FALSE );
-
+ ScViewOptions aOpts( pD->GetViewOptions() );
+ aOpts.SetOption( VOPT_FORMULAS, TRUEBOOL( nOpt & EXC_WIN2_SHOWFORMULAS ) );
+ aOpts.SetOption( VOPT_GRID, TRUEBOOL( nOpt & EXC_WIN2_SHOWGRID ) );
+ aOpts.SetOption( VOPT_HEADER, TRUEBOOL( nOpt & EXC_WIN2_SHOWHEADINGS ) );
+ aOpts.SetOption( VOPT_NULLVALS, TRUEBOOL( nOpt & EXC_WIN2_SHOWZEROS ) );
+ aOpts.SetOption( VOPT_OUTLINER, TRUEBOOL( nOpt & EXC_WIN2_OUTLINE ) );
pD->SetViewOptions( aOpts );
}
}
diff --git a/sc/source/filter/inc/colrowst.hxx b/sc/source/filter/inc/colrowst.hxx
index 880f02b7e3d2..e332fe6536fc 100644
--- a/sc/source/filter/inc/colrowst.hxx
+++ b/sc/source/filter/inc/colrowst.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: colrowst.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: gt $ $Date: 2001-04-17 12:52:44 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:26:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,6 +66,9 @@
#include <tools/debug.hxx>
#endif
+#ifndef _SCEXTOPT_HXX
+#include "scextopt.hxx"
+#endif
#ifndef _ROOT_HXX
#include "root.hxx"
#endif
@@ -75,12 +78,9 @@
// ----- forwards --------------------------------------------------------
+
class XF_Buffer;
class XclImpStream;
-class ScExtDocOptions;
-struct ScExtTabOptions;
-
-
// ----------------------------------------------- class ColRowSettings --
@@ -134,10 +134,20 @@ public:
inline void SetRowSettings( const UINT16 nRow, const UINT16 nExcelHeight, const UINT16 nGrbit );
// Auswertung/Umrechung von nExcelHeight und Auswertung nGrbit
+ inline ScExtTabOptions& GetExtTabOpt()
+ { if( !pExtTabOpt ) pExtTabOpt = new ScExtTabOptions; return *pExtTabOpt; }
+ inline UINT16 GetActivePane() const
+ { return pExtTabOpt ? pExtTabOpt->nActPane : 3; }
+
+
void ReadSplit( XclImpStream& rIn );
void SetFrozen( const BOOL bFrozen );
- void SetSelection( const ScRange& rSel );
- void SetDimension( const ScRange& rDim );
+ inline void SetTabSelected( const BOOL bSelected )
+ { GetExtTabOpt().bSelected = bSelected; }
+ inline void SetSelection( const ScRange& rSel );
+ { GetExtTabOpt().SetSelection( rSel ); }
+ inline void SetDimension( const ScRange& rDim )
+ { GetExtTabOpt().SetDimension( rDim ); }
void SetHorizPagebreak( const UINT16 nRow );
void SetVertPagebreak( const UINT16 nCol );
diff --git a/sc/source/filter/inc/excdefs.hxx b/sc/source/filter/inc/excdefs.hxx
index 6d69d181393b..563949cfc8ab 100644
--- a/sc/source/filter/inc/excdefs.hxx
+++ b/sc/source/filter/inc/excdefs.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: excdefs.hxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: dr $ $Date: 2001-04-19 09:57:04 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:26:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -216,6 +216,7 @@
#define EXC_COLOR_CHARTTEXT 0x0011
#define EXC_COLOR_CHARTLINE 0x0012
#define EXC_COLOR_CHARTAREA 0x0013
+#define EXC_COLOR_GRID 0x0101
// special color indices
#define EXC_COLIND_AUTOTEXT 77
@@ -327,6 +328,20 @@
#define EXC_TABOP_BOTH 0x0008
//_________________________________________________________
+// (0x023E) WINDOW2
+
+#define EXC_WIN2_SHOWFORMULAS 0x0001
+#define EXC_WIN2_SHOWGRID 0x0002
+#define EXC_WIN2_SHOWHEADINGS 0x0004
+#define EXC_WIN2_FROZEN 0x0008
+#define EXC_WIN2_SHOWZEROS 0x0010
+#define EXC_WIN2_DEFAULTCOLOR 0x0020
+#define EXC_WIN2_OUTLINE 0x0080
+#define EXC_WIN2_FROZENNOSPLIT 0x0100
+#define EXC_WIN2_SELECTED 0x0200
+#define EXC_WIN2_DISPLAYED 0x0400
+
+//_________________________________________________________
// Specials for outlines
#define EXC_OUTLINE_MAX 7
diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx
index 40e98930d758..63c169e11eec 100644
--- a/sc/source/filter/inc/excrecds.hxx
+++ b/sc/source/filter/inc/excrecds.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: excrecds.hxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: dr $ $Date: 2001-04-19 09:57:26 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:26:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -942,20 +942,6 @@ public:
};
-//--------------------------------------------------------- class ExcDummy_03 -
-// sheet record: SELECTION
-
-class ExcDummy_03 : public ExcDummyRec
-{
-private:
- static const BYTE pMyData[];
- static const ULONG nMyLen;
-public:
- virtual ULONG GetLen( void ) const;
- virtual const BYTE* GetData( void ) const;
-};
-
-
//------------------------------------------------------- class ExcDimensions -
class ExcDimensions : public ExcRecord
@@ -1402,6 +1388,26 @@ public:
};
+//-------------------------------------------------------- class ExcSelection -
+
+class ExcSelection : public ExcRecord
+{
+private:
+ UINT16 nCol;
+ UINT16 nRow;
+ UINT8 nPane;
+
+ virtual void SaveCont( XclExpStream& rStrm );
+
+public:
+ inline ExcSelection( UINT16 _nCol, UINT16 _nRow, UINT8 _nPane ) :
+ nCol( _nCol ), nRow( _nRow ), nPane( _nPane ) {}
+
+ virtual UINT16 GetNum( void ) const;
+ virtual ULONG GetLen( void ) const;
+};
+
+
//------------------------------------------------------------ class UsedList -
class UsedList : public List, public ExcEmptyRec
diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index 7caa0d6ef6d3..b4d684bb8a13 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97rec.hxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: dr $ $Date: 2001-04-19 09:57:04 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:26:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,6 +69,7 @@
#endif
struct SingleRefData;
+struct ScExtTabOptions;
// --- class XclSstList ----------------------------------------------
@@ -853,17 +854,68 @@ public:
};
+// --- class ExcWindow18 ---------------------------------------------
+
+class ExcWindow18 : public ExcRecord
+{
+private:
+ UINT16 nCurrTable;
+ UINT16 nSelTabs;
+
+ virtual void SaveCont( XclExpStream& rStrm );
+
+public:
+ ExcWindow18( RootData& rRootData );
+
+ virtual UINT16 GetNum( void ) const;
+ virtual ULONG GetLen( void ) const;
+};
+
+
+// --- class ExcPane8 ------------------------------------------------
+
+class ExcPane8 : public ExcRecord
+{
+private:
+ UINT16 nSplitX;
+ UINT16 nSplitY;
+ UINT16 nLeftCol;
+ UINT16 nTopRow;
+ UINT16 nActivePane;
+
+ virtual void SaveCont( XclExpStream& rStrm );
+
+public:
+ ExcPane8( const ScExtTabOptions& rTabOptions );
+
+ virtual UINT16 GetNum() const;
+ virtual ULONG GetLen() const;
+};
+
+
// --- class ExcWindow28 ---------------------------------------------
-class ExcWindow28 : public ExcWindow2
+class ExcWindow28 : public ExcRecord
{
private:
+ ExcPalette2& rPalette;
+ ExcPane8* pPaneRec;
+ UINT32 nGridColorSer;
+ UINT16 nFlags;
+ UINT16 nLeftCol;
+ UINT16 nTopRow;
+ UINT16 nActiveCol;
+ UINT16 nActiveRow;
+ BOOL bHorSplit : 1;
+ BOOL bVertSplit : 1;
virtual void SaveCont( XclExpStream& rStrm );
public:
- ExcWindow28( UINT16 nTab ) : ExcWindow2( nTab ) {}
+ ExcWindow28( RootData& rRootData, UINT16 nTab );
+ virtual ~ExcWindow28();
+ virtual void Save( XclExpStream& rStrm );
virtual UINT16 GetNum() const;
virtual ULONG GetLen() const;
};
diff --git a/sc/source/filter/xcl97/xcl97dum.cxx b/sc/source/filter/xcl97/xcl97dum.cxx
index 2cb6569400cf..8b2602060658 100644
--- a/sc/source/filter/xcl97/xcl97dum.cxx
+++ b/sc/source/filter/xcl97/xcl97dum.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97dum.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dr $ $Date: 2001-02-26 06:53:18 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:27:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -112,9 +112,9 @@ const BYTE ExcDummy8_040::pMyData[] = {
0x13, 0x00, 0x02, 0x00, 0x00, 0x00, // PASSWORD
0xaf, 0x01, 0x02, 0x00, 0x00, 0x00, // PROT4REV (8+)
0xbc, 0x01, 0x02, 0x00, 0x00, 0x00, // PROT4REVPASS (8+)
- 0x3d, 0x00, 0x12, 0x00, 0xe0, 0x01, 0x5a, 0x00, 0xcf, // WINDOW1
- 0x3f, 0x4e, 0x2a, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x58, 0x02,
+// 0x3d, 0x00, 0x12, 0x00, 0xe0, 0x01, 0x5a, 0x00, 0xcf, // WINDOW1
+// 0x3f, 0x4e, 0x2a, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
+// 0x01, 0x00, 0x58, 0x02,
0x40, 0x00, 0x02, 0x00, 0x00, 0x00, // BACKUP
0x8d, 0x00, 0x02, 0x00, 0x00, 0x00 // HIDEOBJ
};
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index a9a0a4a9b2f7..fbc06a489657 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97rec.cxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: dr $ $Date: 2001-04-24 14:48:06 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:27:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,7 +136,8 @@
#include "conditio.hxx"
#include "rangelst.hxx"
#include "stlpool.hxx"
-
+#include "viewopti.hxx"
+#include "scextopt.hxx"
// --- class XclSstList ----------------------------------------------
@@ -1810,25 +1811,150 @@ ULONG ExcBundlesheet8::GetLen() const
+// --- class ExcWindow18 ---------------------------------------------
+
+ExcWindow18::ExcWindow18( RootData& rRootData )
+{
+ ScExtDocOptions& rOpt = *rRootData.pExtDocOpt;
+ nCurrTable = rOpt.nActTab;
+ nSelTabs = rOpt.nSelTabs;
+}
+
+
+void ExcWindow18::SaveCont( XclExpStream& rStrm )
+{
+ rStrm << (UINT16) 0x01E0
+ << (UINT16) 0x005A
+ << (UINT16) 0x3FCF
+ << (UINT16) 0x2A4E
+ << (UINT16) 0x0038
+ << nCurrTable
+ << (UINT16) 0x0000
+ << nSelTabs
+ << (UINT16) 0x0258;
+}
+
+
+UINT16 ExcWindow18::GetNum( void ) const
+{
+ return 0x003D;
+}
+
+
+ULONG ExcWindow18::GetLen( void ) const
+{
+ return 18;
+}
+
+
+// --- class ExcPane8 ------------------------------------------------
+
+ExcPane8::ExcPane8( const ScExtTabOptions& rTabOptions ) :
+ nSplitX( rTabOptions.nSplitX ),
+ nSplitY( rTabOptions.nSplitY ),
+ nLeftCol( rTabOptions.nLeftSplitCol ),
+ nTopRow( rTabOptions.nTopSplitRow ),
+ nActivePane( rTabOptions.nActPane )
+{
+}
+
+
+void ExcPane8::SaveCont( XclExpStream& rStrm )
+{
+ rStrm << nSplitX << nSplitY << nTopRow << nLeftCol << nActivePane;
+}
+
+
+UINT16 ExcPane8::GetNum() const
+{
+ return 0x0041;
+}
+
+
+ULONG ExcPane8::GetLen() const
+{
+ return 10;
+}
+
+
// --- class ExcWindow28 ---------------------------------------------
+ExcWindow28::ExcWindow28( RootData& rRootData, UINT16 nTab ) :
+ rPalette( *rRootData.pPalette2 ),
+ pPaneRec( NULL ),
+ nFlags( 0 ),
+ nLeftCol( 0 ),
+ nTopRow( 0 ),
+ nActiveCol( 0 ),
+ nActiveRow( 0 ),
+ bHorSplit( FALSE ),
+ bVertSplit( FALSE )
+{
+ const ScViewOptions& rViewOpt = rRootData.pDoc->GetViewOptions();
+ nFlags |= rViewOpt.GetOption( VOPT_FORMULAS ) ? EXC_WIN2_SHOWFORMULAS : 0;
+ nFlags |= rViewOpt.GetOption( VOPT_GRID ) ? EXC_WIN2_SHOWGRID : 0;
+ nFlags |= rViewOpt.GetOption( VOPT_HEADER ) ? EXC_WIN2_SHOWHEADINGS : 0;
+ nFlags |= rViewOpt.GetOption( VOPT_NULLVALS ) ? EXC_WIN2_SHOWZEROS : 0;
+ nFlags |= rViewOpt.GetOption( VOPT_OUTLINER ) ? EXC_WIN2_OUTLINE : 0;
+
+ ScExtDocOptions& rOpt = *rRootData.pExtDocOpt;
+ nFlags |= (nTab == rOpt.nActTab) ? (EXC_WIN2_DISPLAYED|EXC_WIN2_SELECTED) : 0;
+ nFlags |= rOpt.pGridCol ? 0 : EXC_WIN2_DEFAULTCOLOR;
+ nGridColorSer = rOpt.pGridCol ? rPalette.InsertColor( *rOpt.pGridCol, EXC_COLOR_GRID ) : rPalette.InsertIndex( 64 );
+
+ const ScExtTabOptions* pTabOpt = rOpt.GetExtTabOptions( nTab );
+ if( pTabOpt )
+ {
+ nFlags |= pTabOpt->bSelected ? EXC_WIN2_SELECTED : 0;
+ nFlags |= pTabOpt->bFrozen ? (EXC_WIN2_FROZEN|EXC_WIN2_FROZENNOSPLIT) : 0;
+ nLeftCol = pTabOpt->nLeftCol;
+ nTopRow = pTabOpt->nTopRow;
+ nActiveCol = pTabOpt->aLastSel.aStart.Col();
+ nActiveRow = pTabOpt->aLastSel.aStart.Row();
+ bHorSplit = (pTabOpt->nSplitX != 0);
+ bVertSplit = (pTabOpt->nSplitY != 0);
+ if( bHorSplit || bVertSplit )
+ pPaneRec = new ExcPane8( *pTabOpt );
+ }
+}
+
+
+ExcWindow28::~ExcWindow28()
+{
+ if( pPaneRec )
+ delete pPaneRec;
+}
+
+
void ExcWindow28::SaveCont( XclExpStream& rStrm )
{
- BYTE pData[] = {
- 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00
- };
- DBG_ASSERT( sizeof(pData) == GetLen(), "ExcWindow28::SaveCont: length mismatch" );
- if ( GetTable() == 0 )
- pData[1] |= 0x06; // displayed and selected
- rStrm.Write( pData, GetLen() );
+ rStrm << nFlags
+ << nTopRow
+ << nLeftCol
+ << (UINT32) rPalette.GetColorIndex( nGridColorSer )
+ << (UINT32) 0
+ << (UINT32) 0;
+}
+
+
+void ExcWindow28::Save( XclExpStream& rStrm )
+{
+ ExcRecord::Save( rStrm );
+ if( pPaneRec )
+ pPaneRec->Save( rStrm );
+ ExcSelection( nActiveCol, nActiveRow, 3 ).Save( rStrm );
+ if( bHorSplit )
+ ExcSelection( nActiveCol, nActiveRow, 1 ).Save( rStrm );
+ if( bVertSplit )
+ ExcSelection( nActiveCol, nActiveRow, 2 ).Save( rStrm );
+ if( bHorSplit && bVertSplit )
+ ExcSelection( nActiveCol, nActiveRow, 0 ).Save( rStrm );
}
UINT16 ExcWindow28::GetNum() const
{
- return 0x023e;
+ return 0x023E;
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a5862bd94233..15f52672b1dd 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docsh.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: nn $ $Date: 2001-05-10 14:11:39 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:29:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -138,6 +138,7 @@ SO2_DECL_REF(SvStorageStream)
#include "drwlayer.hxx"
#include "refreshtimer.hxx"
#include "dbcolect.hxx"
+#include "scextopt.hxx"
#include "docsh.hxx"
@@ -1693,6 +1694,16 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp))
{
WaitObject aWait( GetDialogParent() );
+
+ ScExtDocOptions* pExtDocOpt = NULL;
+ ScTabViewShell* pViewShell = GetBestViewShell();
+ if( pViewShell )
+ {
+ pExtDocOpt = new ScExtDocOptions;
+ pViewShell->GetViewData()->WriteExtOptions( *pExtDocOpt );
+ }
+ aDocument.SetExtDocOptions( pExtDocOpt );
+
BOOL bFake97 = ( aFltName.EqualsAscii(pFilterExcel97) || aFltName.EqualsAscii(pFilterEx97Temp) );
FltError eError = ScExportExcel5( rMed, &aDocument, bFake97, RTL_TEXTENCODING_MS_1252 );
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index df53cdb0a73b..db6390591710 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewdata.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: nn $ $Date: 2001-04-27 08:54:27 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:30:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -252,6 +252,7 @@ public:
void WriteUserData(String& rData);
void ReadUserData(const String& rData);
+ void WriteExtOptions(ScExtDocOptions& rOpt);
void ReadExtOptions(const ScExtDocOptions& rOpt);
void WriteUserDataSequence(com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings);
void ReadUserDataSequence(const com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings);
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 1348a9d0e431..49e818086f44 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tpview.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: os $ $Date: 2001-05-04 10:06:50 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:30:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -410,9 +410,9 @@ void ScTpContentOptions::InitGridOpt()
aColorLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
- // Standard-Gitterfarbe (hellgrau) immer
+ // Standard-Gitterfarbe
- Color aStdCol( COL_LIGHTGRAY ); // wie Default in ScViewOptions
+ Color aStdCol( SC_STD_GRIDCOLOR ); // wie Default in ScViewOptions
if ( LISTBOX_ENTRY_NOTFOUND ==
aColorLB.GetEntryPos( aStdCol ) )
aColorLB.InsertEntry( aStdCol, ScGlobal::GetRscString( STR_GRIDCOLOR ) );
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 344f968e374e..a9a16719c02c 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewdata.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: sab $ $Date: 2001-05-02 14:52:01 $
+ * last change: $Author: dr $ $Date: 2001-05-10 17:31:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1992,9 +1992,77 @@ void ScViewData::ReadUserData(const String& rData)
RecalcPixPos();
}
+void ScViewData::WriteExtOptions(ScExtDocOptions& rOpt)
+{
+ // for Excel export
+
+ // document settings
+ rOpt.SetActTab( GetTabNo() );
+ rOpt.nSelTabs = 0;
+ if( pOptions && (pOptions->GetGridColor().GetColor() != SC_STD_GRIDCOLOR) )
+ rOpt.SetGridCol( pOptions->GetGridColor() );
+
+ // table settings
+ USHORT nTabCount = pDoc->GetTableCount();
+ for( USHORT nTab = 0; nTab < nTabCount; nTab++ )
+ {
+ ScViewDataTable* pViewTab = pTabData[ nTab ];
+ if( pViewTab )
+ {
+ ScExtTabOptions* pTabOpt = new ScExtTabOptions;
+ pTabOpt->nTabNum = nTab;
+ pTabOpt->bSelected = GetMarkData().GetTableSelect( nTab );
+ if( pTabOpt->bSelected )
+ rOpt.nSelTabs++;
+
+ BOOL bHorSplit = (pViewTab->eHSplitMode != SC_SPLIT_NONE);
+ BOOL bVertSplit = (pViewTab->eVSplitMode != SC_SPLIT_NONE);
+ BOOL bNormalSplit = (pViewTab->eHSplitMode == SC_SPLIT_NORMAL) || (pViewTab->eVSplitMode == SC_SPLIT_NORMAL);
+ pTabOpt->bFrozen = (pViewTab->eHSplitMode == SC_SPLIT_FIX) || (pViewTab->eVSplitMode == SC_SPLIT_FIX);
+
+ if( bNormalSplit )
+ {
+ Point aPixel = Application::GetDefaultDevice()->PixelToLogic(
+ Point( pViewTab->nHSplitPos, pViewTab->nVSplitPos ), MapMode( MAP_TWIP ) );
+ if ( pDocShell )
+ aPixel.X() = (long)((double)aPixel.X() / pDocShell->GetOutputFactor());
+ pTabOpt->nSplitX = aPixel.X();
+ pTabOpt->nSplitY = aPixel.Y();
+ }
+ else if( pTabOpt->bFrozen )
+ {
+ pTabOpt->nSplitX = (pViewTab->eHSplitMode == SC_SPLIT_FIX) ? pViewTab->nFixPosX : 0;
+ pTabOpt->nSplitY = (pViewTab->eVSplitMode == SC_SPLIT_FIX) ? pViewTab->nFixPosY : 0;
+ }
+
+ pTabOpt->nLeftCol = pViewTab->nPosX[ SC_SPLIT_LEFT ];
+ pTabOpt->nLeftSplitCol = pViewTab->nPosX[ SC_SPLIT_RIGHT ];
+ pTabOpt->nTopRow = pViewTab->nPosY[ SC_SPLIT_TOP ];
+ pTabOpt->nTopSplitRow = pViewTab->nPosY[ SC_SPLIT_BOTTOM ];
+
+ switch( pViewTab->eWhichActive )
+ {
+ case SC_SPLIT_TOPLEFT: pTabOpt->nActPane = 3; break;
+ case SC_SPLIT_TOPRIGHT: pTabOpt->nActPane = 1; break;
+ case SC_SPLIT_BOTTOMLEFT: pTabOpt->nActPane = 2; break;
+ case SC_SPLIT_BOTTOMRIGHT: pTabOpt->nActPane = 0; break;
+ }
+ if( !bHorSplit )
+ pTabOpt->nActPane |= 2;
+ if( !bVertSplit )
+ pTabOpt->nActPane |= 1;
+
+ pTabOpt->aLastSel.aStart.Set( pViewTab->nCurX, pViewTab->nCurY, nTab );
+ pTabOpt->aLastSel.aEnd = pTabOpt->aLastSel.aStart;
+
+ rOpt.SetExtTabOptions( nTab, pTabOpt );
+ }
+ }
+}
+
void ScViewData::ReadExtOptions( const ScExtDocOptions& rOpt )
{
- // fuer Excel-Import
+ // for Excel import
USHORT nTabCount = pDoc->GetTableCount();
for (USHORT nTab=0; nTab<nTabCount; nTab++)
@@ -2006,18 +2074,9 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rOpt )
pTabData[nTab] = new ScViewDataTable;
ScViewDataTable* pViewTab = pTabData[nTab];
-#if 0
- // aDim ist nicht der sichtbare, sondern der belegte Bereich
- //! GT sollte mal die linke obere Ecke des sichtbaren Bereichs herausruecken
-
- if ( pExtTab->bValidDim ) // Scroll-Position muss vor Fixierung kommen
- {
- ScRange aVisRange = pExtTab->aDim;
- pViewTab->nPosX[SC_SPLIT_LEFT] = aVisRange.aStart.Col();
- ScVSplitPos eDefV = pExtTab->nSplitY ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
- pViewTab->nPosY[eDefV] = aVisRange.aStart.Row();
- }
-#endif
+ pViewTab->nPosX[SC_SPLIT_LEFT] = pExtTab->nLeftCol;
+ ScVSplitPos eDefV = pExtTab->nSplitY ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
+ pViewTab->nPosY[eDefV] = pExtTab->nTopRow;
if ( pExtTab->nSplitX || pExtTab->nSplitY )
{
@@ -2095,10 +2154,13 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rOpt )
pViewTab->nCurX = aSelRange.aStart.Col();
pViewTab->nCurY = aSelRange.aStart.Row();
}
+ GetMarkData().SelectTable( nTab, pExtTab->bSelected );
}
}
SetTabNo( rOpt.nActTab );
+ if( pOptions && rOpt.pGridCol )
+ pOptions->SetGridColor( *rOpt.pGridCol, EMPTY_STRING );
// RecalcPixPos oder so - auch nMPos - auch bei ReadUserData ??!?!
}