Lines 242-247
Link Here
|
242 |
{ |
242 |
{ |
243 |
} |
243 |
} |
244 |
|
244 |
|
|
|
245 |
Rectangle PlcDrawObj::FindLayoutRect(const SwFrmFmt &rFmt, Point aTopLeft) |
246 |
{ |
247 |
const SdrObject* pObj = rFmt.FindRealSdrObject(); |
248 |
|
249 |
Rectangle aRect; |
250 |
const SwFmtVertOrient& rVOr = rFmt.GetVertOrient(); |
251 |
const SwFmtHoriOrient& rHOr = rFmt.GetHoriOrient(); |
252 |
if (RES_FLYFRMFMT == rFmt.Which()) |
253 |
{ |
254 |
Point aObjPos; |
255 |
SwRect aLayRect(rFmt.FindLayoutRect(false, &aObjPos)); |
256 |
// the Object is not visible - so get the values from |
257 |
// the format. The Position may not be correct. |
258 |
if (aLayRect.IsEmpty()) |
259 |
aRect.SetSize(rFmt.GetFrmSize().GetSize()); |
260 |
else |
261 |
aRect = aLayRect.SVRect(); |
262 |
|
263 |
aRect -= aTopLeft; |
264 |
aObjPos = aRect.TopLeft(); |
265 |
if (VERT_NONE == rVOr.GetVertOrient()) |
266 |
aObjPos.Y() = rVOr.GetPos(); |
267 |
if (HORI_NONE == rHOr.GetHoriOrient()) |
268 |
aObjPos.X() = rHOr.GetPos(); |
269 |
aRect.SetPos( aObjPos ); |
270 |
} |
271 |
else |
272 |
{ |
273 |
ASSERT(pObj, "wo ist das SDR-Object?"); |
274 |
if (pObj) |
275 |
aRect = pObj->GetSnapRect(); |
276 |
aRect -= aTopLeft; |
277 |
} |
278 |
|
279 |
return aRect; |
280 |
} |
281 |
|
245 |
void PlcDrawObj::WritePlc(SwWW8Writer& rWrt) const |
282 |
void PlcDrawObj::WritePlc(SwWW8Writer& rWrt) const |
246 |
{ |
283 |
{ |
247 |
if (8 > rWrt.pFib->nVersion) // Cannot export drawobject in vers 7- |
284 |
if (8 > rWrt.pFib->nVersion) // Cannot export drawobject in vers 7- |
Lines 269-305
Link Here
|
269 |
{ |
306 |
{ |
270 |
// write the fspa-struct |
307 |
// write the fspa-struct |
271 |
const SwFrmFmt& rFmt = aIter->mrCntnt; |
308 |
const SwFrmFmt& rFmt = aIter->mrCntnt; |
272 |
const SdrObject* pObj = rFmt.FindRealSdrObject(); |
309 |
Rectangle aRect = FindLayoutRect(rFmt, aIter->maParentPos); |
273 |
|
|
|
274 |
Rectangle aRect; |
275 |
const SwFmtVertOrient& rVOr = rFmt.GetVertOrient(); |
276 |
const SwFmtHoriOrient& rHOr = rFmt.GetHoriOrient(); |
277 |
if (RES_FLYFRMFMT == rFmt.Which()) |
278 |
{ |
279 |
Point aObjPos; |
280 |
SwRect aLayRect(rFmt.FindLayoutRect(false, &aObjPos)); |
281 |
// the Object is not visible - so get the values from |
282 |
// the format. The Position may not be correct. |
283 |
if( aLayRect.IsEmpty() ) |
284 |
aRect.SetSize( rFmt.GetFrmSize().GetSize() ); |
285 |
else |
286 |
aRect = aLayRect.SVRect(); |
287 |
|
288 |
aRect -= aIter->maParentPos; |
289 |
aObjPos = aRect.TopLeft(); |
290 |
if (VERT_NONE == rVOr.GetVertOrient()) |
291 |
aObjPos.Y() = rVOr.GetPos(); |
292 |
if (HORI_NONE == rHOr.GetHoriOrient()) |
293 |
aObjPos.X() = rHOr.GetPos(); |
294 |
aRect.SetPos( aObjPos ); |
295 |
} |
296 |
else |
297 |
{ |
298 |
ASSERT(pObj, "wo ist das SDR-Object?"); |
299 |
if (pObj) |
300 |
aRect = pObj->GetSnapRect(); |
301 |
aRect -= aIter->maParentPos; |
302 |
} |
303 |
|
310 |
|
304 |
// spid |
311 |
// spid |
305 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aIter->mnShapeId); |
312 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aIter->mnShapeId); |
Lines 307-319
Link Here
|
307 |
//xaLeft/yaTop/xaRight/yaBottom - rel. to anchor |
314 |
//xaLeft/yaTop/xaRight/yaBottom - rel. to anchor |
308 |
//(most of) the border is outside the graphic is word, so |
315 |
//(most of) the border is outside the graphic is word, so |
309 |
//change dimensions to fit |
316 |
//change dimensions to fit |
310 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Left() + |
317 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Left() + |
311 |
aIter->mnThick); |
318 |
aIter->mnThick); |
312 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + |
319 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Top() + |
313 |
aIter->mnThick); |
320 |
aIter->mnThick); |
314 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() - |
321 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Right() - |
315 |
aIter->mnThick); |
322 |
aIter->mnThick); |
316 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - |
323 |
SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Bottom() - |
317 |
aIter->mnThick); |
324 |
aIter->mnThick); |
318 |
|
325 |
|
319 |
//fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock |
326 |
//fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock |
Lines 347-352
Link Here
|
347 |
nFlags |= 0x0400 | nContour; |
354 |
nFlags |= 0x0400 | nContour; |
348 |
break; |
355 |
break; |
349 |
} |
356 |
} |
|
|
357 |
const SdrObject* pObj = rFmt.FindRealSdrObject(); |
350 |
if( pObj && pObj->GetLayer() == rWrt.pDoc->GetHellId() ) |
358 |
if( pObj && pObj->GetLayer() == rWrt.pDoc->GetHellId() ) |
351 |
nFlags |= 0x4000; |
359 |
nFlags |= 0x4000; |
352 |
|
360 |
|
Lines 1076-1082
Link Here
|
1076 |
} |
1084 |
} |
1077 |
} |
1085 |
} |
1078 |
|
1086 |
|
1079 |
/* */ |
1087 |
void WinwordAnchoring::WriteInline(EscherEx& rEx) const |
|
|
1088 |
{ |
1089 |
rEx.AddAtom(24, DFF_msofbtUDefProp, 3, 4 ); //Prop id is 0xF122 |
1090 |
SvStream& rSt = rEx.GetStream(); |
1091 |
rSt << (UINT16)0x0390 << 3L; |
1092 |
rSt << (UINT16)0x0392 << 3L; |
1093 |
} |
1080 |
|
1094 |
|
1081 |
void SwWW8Writer::CreateEscher() |
1095 |
void SwWW8Writer::CreateEscher() |
1082 |
{ |
1096 |
{ |
Lines 1145-1150
Link Here
|
1145 |
GetStream() << 0x80000000; |
1159 |
GetStream() << 0x80000000; |
1146 |
} |
1160 |
} |
1147 |
|
1161 |
|
|
|
1162 |
INT32 SwBasicEscherEx::WriteDummyFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) |
1163 |
{ |
1164 |
INT32 nBorderThick=0; |
1165 |
OpenContainer( ESCHER_SpContainer ); |
1166 |
|
1167 |
AddShape(ESCHER_ShpInst_PictureFrame, 0xa00, nShapeId); |
1168 |
|
1169 |
EscherPropertyContainer aPropOpt; |
1170 |
|
1171 |
nBorderThick = WriteFlyFrameAttr(rFmt, mso_sptPictureFrame, aPropOpt); |
1172 |
|
1173 |
WinwordAnchoring aWinwordAnchoring; |
1174 |
aWinwordAnchoring.WriteInline(*this); |
1175 |
|
1176 |
aPropOpt.Commit(GetStream()); |
1177 |
|
1178 |
CloseContainer(); // ESCHER_SpContainer |
1179 |
return nBorderThick; |
1180 |
} |
1181 |
|
1182 |
|
1148 |
INT32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) |
1183 |
INT32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) |
1149 |
{ |
1184 |
{ |
1150 |
INT32 nBorderThick=0; |
1185 |
INT32 nBorderThick=0; |
Lines 1156-1224
Link Here
|
1156 |
|
1191 |
|
1157 |
UINT32 nFlags = ESCHER_BlipFlagDefault; |
1192 |
UINT32 nFlags = ESCHER_BlipFlagDefault; |
1158 |
SwNodeIndex aIdx( *rFmt.GetCntnt().GetCntntIdx(), 1 ); |
1193 |
SwNodeIndex aIdx( *rFmt.GetCntnt().GetCntntIdx(), 1 ); |
1159 |
SwGrfNode& rGrfNd = *aIdx.GetNode().GetGrfNode(); |
1194 |
SwGrfNode &rGrfNd = *aIdx.GetNode().GetGrfNode(); |
1160 |
if( rGrfNd.IsLinkedFile() ) |
1195 |
if(rGrfNd.IsLinkedFile()) |
1161 |
{ |
1196 |
{ |
1162 |
String sURL; |
1197 |
String sURL; |
1163 |
rGrfNd.GetFileFilterNms( &sURL, 0 ); |
1198 |
rGrfNd.GetFileFilterNms( &sURL, 0 ); |
1164 |
|
1199 |
|
1165 |
WW8Bytes aBuf; |
1200 |
WW8Bytes aBuf; |
1166 |
SwWW8Writer::InsAsString16( aBuf, sURL ); |
1201 |
SwWW8Writer::InsAsString16( aBuf, sURL ); |
1167 |
SwWW8Writer::InsUInt16( aBuf, 0 ); |
1202 |
SwWW8Writer::InsUInt16( aBuf, 0 ); |
1168 |
|
1203 |
|
1169 |
USHORT nArrLen = aBuf.Count(); |
1204 |
USHORT nArrLen = aBuf.Count(); |
1170 |
BYTE* pArr = new BYTE[ nArrLen ]; |
1205 |
BYTE* pArr = new BYTE[ nArrLen ]; |
1171 |
memcpy( pArr, aBuf.GetData(), nArrLen ); |
1206 |
memcpy( pArr, aBuf.GetData(), nArrLen ); |
1172 |
|
1207 |
|
1173 |
aPropOpt.AddOpt(ESCHER_Prop_pibName, true, nArrLen, pArr, nArrLen); |
1208 |
aPropOpt.AddOpt(ESCHER_Prop_pibName, true, nArrLen, pArr, nArrLen); |
1174 |
nFlags = ESCHER_BlipFlagLinkToFile | ESCHER_BlipFlagURL | |
1209 |
nFlags = ESCHER_BlipFlagLinkToFile | ESCHER_BlipFlagURL | |
1175 |
ESCHER_BlipFlagDoNotSave; |
1210 |
ESCHER_BlipFlagDoNotSave; |
1176 |
} |
1211 |
} |
1177 |
else |
1212 |
else |
1178 |
{ |
1213 |
{ |
1179 |
rGrfNd.SwapIn(true); |
1214 |
rGrfNd.SwapIn(true); |
1180 |
|
1215 |
|
1181 |
Graphic aGraphic( rGrfNd.GetGrf() ); |
1216 |
Graphic aGraphic(rGrfNd.GetGrf()); |
1182 |
GraphicObject aGraphicObject( aGraphic ); |
1217 |
GraphicObject aGraphicObject(aGraphic); |
1183 |
ByteString aUniqueId = aGraphicObject.GetUniqueID(); |
1218 |
ByteString aUniqueId = aGraphicObject.GetUniqueID(); |
1184 |
|
1219 |
|
1185 |
if ( aUniqueId.Len() ) |
1220 |
if ( aUniqueId.Len() ) |
1186 |
{ |
1221 |
{ |
1187 |
const MapMode aMap100mm( MAP_100TH_MM ); |
1222 |
const MapMode aMap100mm( MAP_100TH_MM ); |
1188 |
Size aSize( aGraphic.GetPrefSize() ); |
1223 |
Size aSize( aGraphic.GetPrefSize() ); |
1189 |
|
1224 |
|
1190 |
if ( MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit() ) |
1225 |
if ( MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit() ) |
1191 |
{ |
1226 |
{ |
1192 |
aSize = Application::GetDefaultDevice()->PixelToLogic( |
1227 |
aSize = Application::GetDefaultDevice()->PixelToLogic( |
1193 |
aSize, aMap100mm ); |
1228 |
aSize, aMap100mm ); |
1194 |
} |
1229 |
} |
1195 |
else |
1230 |
else |
1196 |
{ |
1231 |
{ |
1197 |
aSize = OutputDevice::LogicToLogic( aSize, |
1232 |
aSize = OutputDevice::LogicToLogic( aSize, |
1198 |
aGraphic.GetPrefMapMode(), aMap100mm ); |
1233 |
aGraphic.GetPrefMapMode(), aMap100mm ); |
1199 |
} |
1234 |
} |
1200 |
|
1235 |
|
1201 |
Point aEmptyPoint = Point(); |
1236 |
Point aEmptyPoint = Point(); |
1202 |
Rectangle aRect( aEmptyPoint, aSize ); |
1237 |
Rectangle aRect( aEmptyPoint, aSize ); |
1203 |
|
1238 |
|
1204 |
sal_uInt32 nBlibId = GetBlibID( *QueryPicStream(), aUniqueId, |
1239 |
sal_uInt32 nBlibId = GetBlibID( *QueryPicStream(), aUniqueId, |
1205 |
aRect, 0 ); |
1240 |
aRect, 0 ); |
1206 |
if ( nBlibId ) |
1241 |
if (nBlibId) |
1207 |
{ |
1242 |
{ |
1208 |
aPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); |
1243 |
aPropOpt.AddOpt(ESCHER_Prop_fillType, ESCHER_FillPicture); |
1209 |
aPropOpt.AddOpt( ESCHER_Prop_pib, nBlibId, sal_True ); |
1244 |
aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True); |
1210 |
} |
1245 |
} |
1211 |
} |
1246 |
} |
1212 |
} |
1247 |
} |
1213 |
|
1248 |
|
1214 |
aPropOpt.AddOpt( ESCHER_Prop_pibFlags, nFlags ); |
1249 |
aPropOpt.AddOpt(ESCHER_Prop_pibFlags, nFlags); |
1215 |
nBorderThick = WriteFlyFrameAttr(rFmt,mso_sptPictureFrame,aPropOpt); |
1250 |
nBorderThick = WriteFlyFrameAttr(rFmt,mso_sptPictureFrame,aPropOpt); |
1216 |
WriteGrfAttr( rGrfNd, aPropOpt ); |
1251 |
WriteGrfAttr(rGrfNd, aPropOpt); |
1217 |
|
1252 |
|
1218 |
aPropOpt.Commit( GetStream() ); |
1253 |
aPropOpt.Commit(GetStream()); |
1219 |
|
1254 |
|
1220 |
// store anchor attribute |
1255 |
// store anchor attribute |
1221 |
WriteFrmExtraData( rFmt ); |
1256 |
WriteFrmExtraData(rFmt); |
1222 |
|
1257 |
|
1223 |
CloseContainer(); // ESCHER_SpContainer |
1258 |
CloseContainer(); // ESCHER_SpContainer |
1224 |
return nBorderThick; |
1259 |
return nBorderThick; |
Lines 2158-2164
Link Here
|
2158 |
|
2193 |
|
2159 |
void SwEscherEx::WriteFrmExtraData( const SwFrmFmt& rFmt ) |
2194 |
void SwEscherEx::WriteFrmExtraData( const SwFrmFmt& rFmt ) |
2160 |
{ |
2195 |
{ |
2161 |
aWinwordAnchoring.SetAnchoring(rFmt ); |
2196 |
aWinwordAnchoring.SetAnchoring(rFmt); |
2162 |
aWinwordAnchoring.WriteData(*this); |
2197 |
aWinwordAnchoring.WriteData(*this); |
2163 |
|
2198 |
|
2164 |
AddAtom(4, ESCHER_ClientAnchor); |
2199 |
AddAtom(4, ESCHER_ClientAnchor); |