Lines 250-255
Link Here
|
250 |
{ |
250 |
{ |
251 |
} |
251 |
} |
252 |
|
252 |
|
|
|
253 |
Rectangle PlcDrawObj::FindLayoutRect(const SwFrmFmt &rFmt, Point aTopLeft) |
254 |
{ |
255 |
const SdrObject* pObj = rFmt.FindRealSdrObject(); |
256 |
|
257 |
Rectangle aRect; |
258 |
const SwFmtVertOrient& rVOr = rFmt.GetVertOrient(); |
259 |
const SwFmtHoriOrient& rHOr = rFmt.GetHoriOrient(); |
260 |
if (RES_FLYFRMFMT == rFmt.Which()) |
261 |
{ |
262 |
Point aObjPos; |
263 |
SwRect aLayRect(rFmt.FindLayoutRect(false, &aObjPos)); |
264 |
// the Object is not visible - so get the values from |
265 |
// the format. The Position may not be correct. |
266 |
if (aLayRect.IsEmpty()) |
267 |
aRect.SetSize(rFmt.GetFrmSize().GetSize()); |
268 |
else |
269 |
aRect = aLayRect.SVRect(); |
270 |
|
271 |
aRect -= aTopLeft; |
272 |
aObjPos = aRect.TopLeft(); |
273 |
if (VERT_NONE == rVOr.GetVertOrient()) |
274 |
aObjPos.Y() = rVOr.GetPos(); |
275 |
if (HORI_NONE == rHOr.GetHoriOrient()) |
276 |
aObjPos.X() = rHOr.GetPos(); |
277 |
aRect.SetPos( aObjPos ); |
278 |
} |
279 |
else |
280 |
{ |
281 |
ASSERT(pObj, "wo ist das SDR-Object?"); |
282 |
if (pObj) |
283 |
aRect = pObj->GetSnapRect(); |
284 |
aRect -= aTopLeft; |
285 |
} |
286 |
|
287 |
return aRect; |
288 |
} |
289 |
|
253 |
void PlcDrawObj::WritePlc(SwWW8Writer& rWrt) const |
290 |
void PlcDrawObj::WritePlc(SwWW8Writer& rWrt) const |
254 |
{ |
291 |
{ |
255 |
if (8 > rWrt.pFib->nVersion) // Cannot export drawobject in vers 7- |
292 |
if (8 > rWrt.pFib->nVersion) // Cannot export drawobject in vers 7- |
Lines 277-313
Link Here
|
277 |
{ |
314 |
{ |
278 |
// write the fspa-struct |
315 |
// write the fspa-struct |
279 |
const SwFrmFmt& rFmt = aIter->mrCntnt; |
316 |
const SwFrmFmt& rFmt = aIter->mrCntnt; |
280 |
const SdrObject* pObj = rFmt.FindRealSdrObject(); |
317 |
Rectangle aRect = FindLayoutRect(rFmt, aIter->maParentPos); |
281 |
|
|
|
282 |
Rectangle aRect; |
283 |
const SwFmtVertOrient& rVOr = rFmt.GetVertOrient(); |
284 |
const SwFmtHoriOrient& rHOr = rFmt.GetHoriOrient(); |
285 |
if (RES_FLYFRMFMT == rFmt.Which()) |
286 |
{ |
287 |
Point aObjPos; |
288 |
SwRect aLayRect(rFmt.FindLayoutRect(false, &aObjPos)); |
289 |
// the Object is not visible - so get the values from |
290 |
// the format. The Position may not be correct. |
291 |
if( aLayRect.IsEmpty() ) |
292 |
aRect.SetSize( rFmt.GetFrmSize().GetSize() ); |
293 |
else |
294 |
aRect = aLayRect.SVRect(); |
295 |
|
296 |
aRect -= aIter->maParentPos; |
297 |
aObjPos = aRect.TopLeft(); |
298 |
if (VERT_NONE == rVOr.GetVertOrient()) |
299 |
aObjPos.Y() = rVOr.GetPos(); |
300 |
if (HORI_NONE == rHOr.GetHoriOrient()) |
301 |
aObjPos.X() = rHOr.GetPos(); |
302 |
aRect.SetPos( aObjPos ); |
303 |
} |
304 |
else |
305 |
{ |
306 |
ASSERT(pObj, "wo ist das SDR-Object?"); |
307 |
if (pObj) |
308 |
aRect = pObj->GetSnapRect(); |
309 |
aRect -= aIter->maParentPos; |
310 |
} |
311 |
|
318 |
|
312 |
// spid |
319 |
// spid |
313 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aIter->mnShapeId); |
320 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aIter->mnShapeId); |
Lines 315-327
Link Here
|
315 |
//xaLeft/yaTop/xaRight/yaBottom - rel. to anchor |
322 |
//xaLeft/yaTop/xaRight/yaBottom - rel. to anchor |
316 |
//(most of) the border is outside the graphic is word, so |
323 |
//(most of) the border is outside the graphic is word, so |
317 |
//change dimensions to fit |
324 |
//change dimensions to fit |
318 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Left() + |
325 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Left() + |
319 |
aIter->mnThick); |
326 |
aIter->mnThick); |
320 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + |
327 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Top() + |
321 |
aIter->mnThick); |
328 |
aIter->mnThick); |
322 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() - |
329 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Right() - |
323 |
aIter->mnThick); |
330 |
aIter->mnThick); |
324 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - |
331 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Bottom() - |
325 |
aIter->mnThick); |
332 |
aIter->mnThick); |
326 |
|
333 |
|
327 |
//fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock |
334 |
//fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock |
Lines 355-360
Link Here
|
355 |
nFlags |= 0x0400 | nContour; |
362 |
nFlags |= 0x0400 | nContour; |
356 |
break; |
363 |
break; |
357 |
} |
364 |
} |
|
|
365 |
const SdrObject* pObj = rFmt.FindRealSdrObject(); |
358 |
if( pObj && pObj->GetLayer() == rWrt.pDoc->GetHellId() ) |
366 |
if( pObj && pObj->GetLayer() == rWrt.pDoc->GetHellId() ) |
359 |
nFlags |= 0x4000; |
367 |
nFlags |= 0x4000; |
360 |
|
368 |
|
Lines 1098-1104
Link Here
|
1098 |
} |
1106 |
} |
1099 |
} |
1107 |
} |
1100 |
|
1108 |
|
1101 |
/* */ |
1109 |
void WinwordAnchoring::WriteInline(EscherEx& rEx) const |
|
|
1110 |
{ |
1111 |
rEx.AddAtom(24, DFF_msofbtUDefProp, 3, 4 ); //Prop id is 0xF122 |
1112 |
SvStream& rSt = rEx.GetStream(); |
1113 |
rSt << (UINT16)0x0390 << 3L; |
1114 |
rSt << (UINT16)0x0392 << 3L; |
1115 |
} |
1102 |
|
1116 |
|
1103 |
void SwWW8Writer::CreateEscher() |
1117 |
void SwWW8Writer::CreateEscher() |
1104 |
{ |
1118 |
{ |
Lines 1164-1169
Link Here
|
1164 |
GetStream() << 0x80000000; |
1178 |
GetStream() << 0x80000000; |
1165 |
} |
1179 |
} |
1166 |
|
1180 |
|
|
|
1181 |
INT32 SwBasicEscherEx::WriteDummyFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) |
1182 |
{ |
1183 |
INT32 nBorderThick=0; |
1184 |
OpenContainer( ESCHER_SpContainer ); |
1185 |
|
1186 |
AddShape(ESCHER_ShpInst_PictureFrame, 0xa00, nShapeId); |
1187 |
|
1188 |
EscherPropertyContainer aPropOpt; |
1189 |
|
1190 |
nBorderThick = WriteFlyFrameAttr(rFmt, mso_sptPictureFrame, aPropOpt); |
1191 |
|
1192 |
WinwordAnchoring aWinwordAnchoring; |
1193 |
aWinwordAnchoring.WriteInline(*this); |
1194 |
|
1195 |
aPropOpt.Commit(GetStream()); |
1196 |
|
1197 |
CloseContainer(); // ESCHER_SpContainer |
1198 |
return nBorderThick; |
1199 |
} |
1200 |
|
1201 |
|
1167 |
INT32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) |
1202 |
INT32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) |
1168 |
{ |
1203 |
{ |
1169 |
INT32 nBorderThick=0; |
1204 |
INT32 nBorderThick=0; |
Lines 1175-1243
Link Here
|
1175 |
|
1210 |
|
1176 |
UINT32 nFlags = ESCHER_BlipFlagDefault; |
1211 |
UINT32 nFlags = ESCHER_BlipFlagDefault; |
1177 |
SwNodeIndex aIdx( *rFmt.GetCntnt().GetCntntIdx(), 1 ); |
1212 |
SwNodeIndex aIdx( *rFmt.GetCntnt().GetCntntIdx(), 1 ); |
1178 |
SwGrfNode& rGrfNd = *aIdx.GetNode().GetGrfNode(); |
1213 |
SwGrfNode &rGrfNd = *aIdx.GetNode().GetGrfNode(); |
1179 |
if( rGrfNd.IsLinkedFile() ) |
1214 |
if(rGrfNd.IsLinkedFile()) |
1180 |
{ |
1215 |
{ |
1181 |
String sURL; |
1216 |
String sURL; |
1182 |
rGrfNd.GetFileFilterNms( &sURL, 0 ); |
1217 |
rGrfNd.GetFileFilterNms( &sURL, 0 ); |
1183 |
|
1218 |
|
1184 |
WW8Bytes aBuf; |
1219 |
WW8Bytes aBuf; |
1185 |
SwWW8Writer::InsAsString16( aBuf, sURL ); |
1220 |
SwWW8Writer::InsAsString16( aBuf, sURL ); |
1186 |
SwWW8Writer::InsUInt16( aBuf, 0 ); |
1221 |
SwWW8Writer::InsUInt16( aBuf, 0 ); |
1187 |
|
1222 |
|
1188 |
USHORT nArrLen = aBuf.Count(); |
1223 |
USHORT nArrLen = aBuf.Count(); |
1189 |
BYTE* pArr = new BYTE[ nArrLen ]; |
1224 |
BYTE* pArr = new BYTE[ nArrLen ]; |
1190 |
memcpy( pArr, aBuf.GetData(), nArrLen ); |
1225 |
memcpy( pArr, aBuf.GetData(), nArrLen ); |
1191 |
|
1226 |
|
1192 |
aPropOpt.AddOpt(ESCHER_Prop_pibName, true, nArrLen, pArr, nArrLen); |
1227 |
aPropOpt.AddOpt(ESCHER_Prop_pibName, true, nArrLen, pArr, nArrLen); |
1193 |
nFlags = ESCHER_BlipFlagLinkToFile | ESCHER_BlipFlagURL | |
1228 |
nFlags = ESCHER_BlipFlagLinkToFile | ESCHER_BlipFlagURL | |
1194 |
ESCHER_BlipFlagDoNotSave; |
1229 |
ESCHER_BlipFlagDoNotSave; |
1195 |
} |
1230 |
} |
1196 |
else |
1231 |
else |
1197 |
{ |
1232 |
{ |
1198 |
rGrfNd.SwapIn(true); |
1233 |
rGrfNd.SwapIn(true); |
1199 |
|
1234 |
|
1200 |
Graphic aGraphic( rGrfNd.GetGrf() ); |
1235 |
Graphic aGraphic(rGrfNd.GetGrf()); |
1201 |
GraphicObject aGraphicObject( aGraphic ); |
1236 |
GraphicObject aGraphicObject(aGraphic); |
1202 |
ByteString aUniqueId = aGraphicObject.GetUniqueID(); |
1237 |
ByteString aUniqueId = aGraphicObject.GetUniqueID(); |
1203 |
|
1238 |
|
1204 |
if ( aUniqueId.Len() ) |
1239 |
if ( aUniqueId.Len() ) |
1205 |
{ |
1240 |
{ |
1206 |
const MapMode aMap100mm( MAP_100TH_MM ); |
1241 |
const MapMode aMap100mm( MAP_100TH_MM ); |
1207 |
Size aSize( aGraphic.GetPrefSize() ); |
1242 |
Size aSize( aGraphic.GetPrefSize() ); |
1208 |
|
1243 |
|
1209 |
if ( MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit() ) |
1244 |
if ( MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit() ) |
1210 |
{ |
1245 |
{ |
1211 |
aSize = Application::GetDefaultDevice()->PixelToLogic( |
1246 |
aSize = Application::GetDefaultDevice()->PixelToLogic( |
1212 |
aSize, aMap100mm ); |
1247 |
aSize, aMap100mm ); |
1213 |
} |
1248 |
} |
1214 |
else |
1249 |
else |
1215 |
{ |
1250 |
{ |
1216 |
aSize = OutputDevice::LogicToLogic( aSize, |
1251 |
aSize = OutputDevice::LogicToLogic( aSize, |
1217 |
aGraphic.GetPrefMapMode(), aMap100mm ); |
1252 |
aGraphic.GetPrefMapMode(), aMap100mm ); |
1218 |
} |
1253 |
} |
1219 |
|
1254 |
|
1220 |
Point aEmptyPoint = Point(); |
1255 |
Point aEmptyPoint = Point(); |
1221 |
Rectangle aRect( aEmptyPoint, aSize ); |
1256 |
Rectangle aRect( aEmptyPoint, aSize ); |
1222 |
|
1257 |
|
1223 |
sal_uInt32 nBlibId = GetBlibID( *QueryPicStream(), aUniqueId, |
1258 |
sal_uInt32 nBlibId = GetBlibID( *QueryPicStream(), aUniqueId, |
1224 |
aRect, 0 ); |
1259 |
aRect, 0 ); |
1225 |
if ( nBlibId ) |
1260 |
if (nBlibId) |
1226 |
{ |
1261 |
{ |
1227 |
aPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); |
1262 |
aPropOpt.AddOpt(ESCHER_Prop_fillType, ESCHER_FillPicture); |
1228 |
aPropOpt.AddOpt( ESCHER_Prop_pib, nBlibId, sal_True ); |
1263 |
aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True); |
1229 |
} |
1264 |
} |
1230 |
} |
1265 |
} |
1231 |
} |
1266 |
} |
1232 |
|
1267 |
|
1233 |
aPropOpt.AddOpt( ESCHER_Prop_pibFlags, nFlags ); |
1268 |
aPropOpt.AddOpt(ESCHER_Prop_pibFlags, nFlags); |
1234 |
nBorderThick = WriteFlyFrameAttr(rFmt,mso_sptPictureFrame,aPropOpt); |
1269 |
nBorderThick = WriteFlyFrameAttr(rFmt,mso_sptPictureFrame,aPropOpt); |
1235 |
WriteGrfAttr( rGrfNd, aPropOpt ); |
1270 |
WriteGrfAttr(rGrfNd, aPropOpt); |
1236 |
|
1271 |
|
1237 |
aPropOpt.Commit( GetStream() ); |
1272 |
aPropOpt.Commit(GetStream()); |
1238 |
|
1273 |
|
1239 |
// store anchor attribute |
1274 |
// store anchor attribute |
1240 |
WriteFrmExtraData( rFmt ); |
1275 |
WriteFrmExtraData(rFmt); |
1241 |
|
1276 |
|
1242 |
CloseContainer(); // ESCHER_SpContainer |
1277 |
CloseContainer(); // ESCHER_SpContainer |
1243 |
return nBorderThick; |
1278 |
return nBorderThick; |