Lines 123-131
Link Here
|
123 |
{ |
123 |
{ |
124 |
sal_uInt16 nFlags; |
124 |
sal_uInt16 nFlags; |
125 |
sal_uInt8 nLen; |
125 |
sal_uInt8 nLen; |
126 |
rStrm >> nFlags >> mnStorageId >> nLen; |
|
|
127 |
rStrm.AppendUniString( maName, nLen ); |
128 |
|
126 |
|
|
|
127 |
rStrm >> nFlags >> mnStorageId >> nLen ; |
128 |
rStrm.AppendUniString( maName, nLen ); |
129 |
|
129 |
if( ::get_flag( nFlags, EXC_EXTN_BUILTIN ) || !::get_flag( nFlags, EXC_EXTN_OLE_OR_DDE ) ) |
130 |
if( ::get_flag( nFlags, EXC_EXTN_BUILTIN ) || !::get_flag( nFlags, EXC_EXTN_OLE_OR_DDE ) ) |
130 |
{ |
131 |
{ |
131 |
meType = xlExtName; |
132 |
meType = xlExtName; |
Lines 134-142
Link Here
|
134 |
} |
135 |
} |
135 |
else |
136 |
else |
136 |
meType = ::get_flagvalue( nFlags, EXC_EXTN_OLE, xlExtOLE, xlExtDDE ); |
137 |
meType = ::get_flagvalue( nFlags, EXC_EXTN_OLE, xlExtOLE, xlExtDDE ); |
|
|
138 |
|
139 |
if(meType == xlExtDDE && (rStrm.GetRecLeft() > 1)) |
140 |
{ |
141 |
sal_uInt8 nLastCol; |
142 |
sal_uInt16 nLastRow; |
143 |
rStrm >> nLastCol >> nLastRow; |
144 |
|
145 |
if( nLastRow <= MAXROW && nLastCol <= MAXCOL ) |
146 |
{ |
147 |
mpDdeMatrix.reset( new XclImpCachedMatrix(nLastCol + 1, nLastRow + 1)); |
148 |
|
149 |
for( sal_uInt16 nRow = 0; nRow < nLastRow+1 && (rStrm.GetRecLeft() > 1); ++nRow ) |
150 |
for( sal_uInt16 nCol = 0; nCol < nLastCol+1 && (rStrm.GetRecLeft() > 1); ++nCol ) |
151 |
mpDdeMatrix->AppendDde( new XclImpDde( rStrm, nCol, nRow )); |
152 |
} |
153 |
} |
137 |
} |
154 |
} |
138 |
|
155 |
|
139 |
|
156 |
|
|
|
157 |
void XclImpExtName::CreateDdeData( ScDocument& rDoc, const String& rApplic,const String& rTopic )const |
158 |
{ |
159 |
rDoc.CreateDdeLink( rApplic, rTopic, GetName() ); |
160 |
sal_uInt16 nPosition; |
161 |
if(!rDoc.FindDdeLink(rApplic, rTopic, GetName(), SC_DDE_IGNOREMODE, nPosition)) |
162 |
return ; |
163 |
|
164 |
if(!mpDdeMatrix.get()) |
165 |
return ; |
166 |
|
167 |
ScMatrix* pMatrix = NULL; |
168 |
if(!(rDoc.CreateDdeLinkResultDimension(nPosition, mpDdeMatrix->GetColumns(), mpDdeMatrix->GetRows(), pMatrix)) || !pMatrix) |
169 |
return ; |
170 |
|
171 |
|
172 |
bool bString, bEmpty = false; |
173 |
for( const XclImpDde* pDde = mpDdeMatrix->GetFirst(); pDde; pDde = mpDdeMatrix->GetNext() ) |
174 |
{ |
175 |
switch( pDde->GetType() ) |
176 |
{ |
177 |
case EXC_CACHEDVAL_DOUBLE: bString = bEmpty = false; break; |
178 |
case EXC_CACHEDVAL_STRING: bString = true; bEmpty = false; break; |
179 |
case EXC_CACHEDVAL_BOOL: bString = bEmpty = false; break; |
180 |
case EXC_CACHEDVAL_ERROR: bString = bEmpty = false; break; |
181 |
default: bString = false; bEmpty = true; break; |
182 |
} |
183 |
rDoc.SetDdeLinkResult(pMatrix,pDde->GetCol(),pDde->GetRow(),*(pDde->GetString()),pDde->GetValue(), bString, bEmpty); |
184 |
} |
185 |
} |
186 |
|
140 |
// ---------------------------------------------------------------------------- |
187 |
// ---------------------------------------------------------------------------- |
141 |
|
188 |
|
142 |
const XclImpExtName* XclImpExtNameList::GetName( sal_uInt16 nXclIndex ) const |
189 |
const XclImpExtName* XclImpExtNameList::GetName( sal_uInt16 nXclIndex ) const |
Lines 178-183
Link Here
|
178 |
} |
225 |
} |
179 |
break; |
226 |
break; |
180 |
} |
227 |
} |
|
|
228 |
} |
229 |
|
230 |
XclImpDde::XclImpDde( XclImpStream& rStrm, sal_uInt16 nCol, sal_uInt16 nRow ) : |
231 |
XclImpCachedValue( rStrm ), |
232 |
mnCol( nCol ), |
233 |
mnRow( nRow ) |
234 |
{ |
181 |
} |
235 |
} |
182 |
|
236 |
|
183 |
|
237 |
|