Lines 51-57
Link Here
|
51 |
#include "biff.hxx" |
51 |
#include "biff.hxx" |
52 |
#include <tools/stream.hxx> |
52 |
#include <tools/stream.hxx> |
53 |
|
53 |
|
54 |
FltError ScQProReader::readSheet( sal_uInt16 nTab, ScDocument* pDoc ) |
54 |
FltError ScQProReader::readSheet( sal_uInt16 nTab, ScDocument* pDoc, ScQProStyle *pStyle ) |
55 |
{ |
55 |
{ |
56 |
sal_uInt8 nCol, nDummy; |
56 |
sal_uInt8 nCol, nDummy; |
57 |
sal_uInt16 nRow; |
57 |
sal_uInt16 nRow; |
Lines 71-77
FltError ScQProReader::readSheet( sal_uI
Link Here
|
71 |
*mpStream >> nCol >> nDummy >> nRow >> nStyle >> nDummy; |
71 |
*mpStream >> nCol >> nDummy >> nRow >> nStyle >> nDummy; |
72 |
readString( aLabel, getLength() - 7 ); |
72 |
readString( aLabel, getLength() - 7 ); |
73 |
nStyle = nStyle >> 3; |
73 |
nStyle = nStyle >> 3; |
74 |
getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
74 |
pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
75 |
pDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aLabel ), (BOOL) TRUE ); |
75 |
pDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aLabel ), (BOOL) TRUE ); |
76 |
} |
76 |
} |
77 |
break; |
77 |
break; |
Lines 83-89
FltError ScQProReader::readSheet( sal_uI
Link Here
|
83 |
case 0x000c: // Blank cell |
83 |
case 0x000c: // Blank cell |
84 |
*mpStream >> nCol >> nDummy >> nRow >> nStyle; |
84 |
*mpStream >> nCol >> nDummy >> nRow >> nStyle; |
85 |
nStyle = nStyle >> 3; |
85 |
nStyle = nStyle >> 3; |
86 |
getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
86 |
pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
87 |
break; |
87 |
break; |
88 |
|
88 |
|
89 |
case 0x000d:{ // Integer cell |
89 |
case 0x000d:{ // Integer cell |
Lines 91-97
FltError ScQProReader::readSheet( sal_uI
Link Here
|
91 |
*mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue; |
91 |
*mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue; |
92 |
ScValueCell* pInteger = new ScValueCell( ( double ) nValue ); |
92 |
ScValueCell* pInteger = new ScValueCell( ( double ) nValue ); |
93 |
nStyle = nStyle >> 3; |
93 |
nStyle = nStyle >> 3; |
94 |
getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
94 |
pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
95 |
pDoc->PutCell(nCol ,nRow, nTab ,pInteger,(BOOL) TRUE); |
95 |
pDoc->PutCell(nCol ,nRow, nTab ,pInteger,(BOOL) TRUE); |
96 |
} |
96 |
} |
97 |
break; |
97 |
break; |
Lines 101-107
FltError ScQProReader::readSheet( sal_uI
Link Here
|
101 |
*mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue; |
101 |
*mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue; |
102 |
ScValueCell* pFloat = new ScValueCell( nValue ); |
102 |
ScValueCell* pFloat = new ScValueCell( nValue ); |
103 |
nStyle = nStyle >> 3; |
103 |
nStyle = nStyle >> 3; |
104 |
getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
104 |
pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
105 |
pDoc->PutCell( nCol, nRow, nTab, pFloat, (BOOL) TRUE ); |
105 |
pDoc->PutCell( nCol, nRow, nTab, pFloat, (BOOL) TRUE ); |
106 |
} |
106 |
} |
107 |
break; |
107 |
break; |
Lines 117-123
FltError ScQProReader::readSheet( sal_uI
Link Here
|
117 |
ScFormulaCell *pFormula = new ScFormulaCell( pDoc, aAddr, pArray ); |
117 |
ScFormulaCell *pFormula = new ScFormulaCell( pDoc, aAddr, pArray ); |
118 |
nStyle = nStyle >> 3; |
118 |
nStyle = nStyle >> 3; |
119 |
pFormula->AddRecalcMode( RECALCMODE_ONLOAD_ONCE ); |
119 |
pFormula->AddRecalcMode( RECALCMODE_ONLOAD_ONCE ); |
120 |
getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
120 |
pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); |
121 |
pDoc->PutCell( nCol, nRow, nTab, pFormula, ( BOOL ) TRUE ); |
121 |
pDoc->PutCell( nCol, nRow, nTab, pFormula, ( BOOL ) TRUE ); |
122 |
} |
122 |
} |
123 |
break; |
123 |
break; |
Lines 135-142
FltError ScImportQuattroPro( SfxMedium &
Link Here
|
135 |
} |
135 |
} |
136 |
|
136 |
|
137 |
ScQProReader::ScQProReader( SfxMedium &rMedium, ScDocument *pDoc ): |
137 |
ScQProReader::ScQProReader( SfxMedium &rMedium, ScDocument *pDoc ): |
138 |
ScBiffReader( rMedium ), |
138 |
ScBiffReader( rMedium ) |
139 |
aStyle() |
|
|
140 |
{ |
139 |
{ |
141 |
} |
140 |
} |
142 |
|
141 |
|
Lines 146-151
FltError ScQProReader::import( ScDocumen
Link Here
|
146 |
sal_uInt16 nVersion; |
145 |
sal_uInt16 nVersion; |
147 |
int i = 1 , j = 1; |
146 |
int i = 1 , j = 1; |
148 |
int nTab = 0; |
147 |
int nTab = 0; |
|
|
148 |
ScQProStyle *aStyleElement = new ScQProStyle(); |
149 |
SetEof( FALSE ); |
149 |
SetEof( FALSE ); |
150 |
|
150 |
|
151 |
if( !recordsLeft() ) |
151 |
if( !recordsLeft() ) |
Lines 166-172
FltError ScQProReader::import( ScDocumen
Link Here
|
166 |
aName.Append( sal_Unicode( 'A' + nTab ) ); |
166 |
aName.Append( sal_Unicode( 'A' + nTab ) ); |
167 |
pDoc->InsertTab( nTab, aName ); |
167 |
pDoc->InsertTab( nTab, aName ); |
168 |
} |
168 |
} |
169 |
eRet = readSheet( nTab, pDoc ); |
169 |
eRet = readSheet( nTab, pDoc, aStyleElement ); |
170 |
nTab++; |
170 |
nTab++; |
171 |
break; |
171 |
break; |
172 |
|
172 |
|
Lines 178-185
FltError ScQProReader::import( ScDocumen
Link Here
|
178 |
sal_uInt8 nFormat, nAlign, nFont; |
178 |
sal_uInt8 nFormat, nAlign, nFont; |
179 |
sal_Int16 nColor; |
179 |
sal_Int16 nColor; |
180 |
*mpStream >> nFormat >> nAlign >> nColor >> nFont; |
180 |
*mpStream >> nFormat >> nAlign >> nColor >> nFont; |
181 |
getStyleElement().setAlign( i, nAlign ); |
181 |
aStyleElement->setAlign( i, nAlign ); |
182 |
getStyleElement().setFont( i, nFont ); |
182 |
aStyleElement->setFont( i, nFont ); |
183 |
i++; |
183 |
i++; |
184 |
} |
184 |
} |
185 |
break; |
185 |
break; |
Lines 188-203
FltError ScQProReader::import( ScDocumen
Link Here
|
188 |
sal_uInt16 nPtSize, nFontAttr; |
188 |
sal_uInt16 nPtSize, nFontAttr; |
189 |
String aLabel; |
189 |
String aLabel; |
190 |
*mpStream >> nPtSize >> nFontAttr; |
190 |
*mpStream >> nPtSize >> nFontAttr; |
191 |
getStyleElement().setFontRecord( j, nFontAttr ); |
191 |
aStyleElement->setFontRecord( j, nFontAttr, nPtSize ); |
192 |
readString( aLabel, getLength() - 4 ); |
192 |
readString( aLabel, getLength() - 4 ); |
193 |
getStyleElement().setFontType( j, aLabel ); |
193 |
aStyleElement->setFontType( j, aLabel ); |
194 |
j++; |
194 |
j++; |
195 |
} |
195 |
} |
196 |
break; |
196 |
break; |
197 |
} |
197 |
} |
198 |
} |
198 |
} |
199 |
getStyleElement().setFontLimit( j ); |
|
|
200 |
getStyleElement().setAlignLimit( i ); |
201 |
pDoc->CalcAfterLoad(); |
199 |
pDoc->CalcAfterLoad(); |
202 |
return eRet; |
200 |
return eRet; |
203 |
} |
201 |
} |