View | Details | Raw Unified | Return to issue 3958
Collapse All | Expand All

(-)escher.hxx (+2 lines)
Lines 72-77 Link Here
72
{
72
{
73
public:
73
public:
74
    void WriteData(EscherEx& rEx) const;
74
    void WriteData(EscherEx& rEx) const;
75
    void WriteInline(EscherEx& rEx) const;
75
    void SetAnchoring(const SwFrmFmt& rFmt, bool bBROKEN = false);
76
    void SetAnchoring(const SwFrmFmt& rFmt, bool bBROKEN = false);
76
private:
77
private:
77
    sal_uInt32 nXAlign;
78
    sal_uInt32 nXAlign;
Lines 104-109 Link Here
104
    virtual void SetPicId(const SdrObject &, UINT32, EscherPropertyContainer &);
105
    virtual void SetPicId(const SdrObject &, UINT32, EscherPropertyContainer &);
105
public:
106
public:
106
    SwBasicEscherEx(SvStream* pStrm, SwWW8Writer& rWrt, UINT32 nDrawings = 1);
107
    SwBasicEscherEx(SvStream* pStrm, SwWW8Writer& rWrt, UINT32 nDrawings = 1);
108
    INT32 WriteDummyFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId);
107
	INT32 WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId);
109
	INT32 WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId);
108
	INT32 WriteOLEFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId);
110
	INT32 WriteOLEFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId);
109
	virtual void WriteFrmExtraData(const SwFrmFmt&);
111
	virtual void WriteFrmExtraData(const SwFrmFmt&);
(-)wrtw8esh.cxx (-83 / +118 lines)
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;
(-)wrtw8nds.cxx (-7 / +52 lines)
Lines 2283-2294 Link Here
2283
{
2283
{
2284
    const SwFmtAnchor& rAnch = rFrmFmt.GetAnchor();
2284
    const SwFmtAnchor& rAnch = rFrmFmt.GetAnchor();
2285
2285
2286
    /*
2286
	const SwFmtVertOrient& rVOr = rFrmFmt.GetVertOrient();
2287
    ##897##
2287
2288
    Note that something anchored as a character must be
2288
    bool bUseTraditionalInline = false;
2289
    exported using the older WW6 mechanism
2289
    if (!bWrtWW8)
2290
    */
2290
        bUseTraditionalInline = true;
2291
    if( !bWrtWW8 || (FLY_IN_CNTNT == rAnch.GetAnchorId()) )
2291
    else
2292
    {
2293
        /*
2294
        ##897##
2295
        Note that something anchored as a character must be exported with a
2296
        shape field with a 0x1 empty graphic following the 0x8
2297
        */
2298
        if (FLY_IN_CNTNT == rAnch.GetAnchorId())
2299
        {
2300
            if (const SwNodeIndex* pNdIdx = rFrmFmt.GetCntnt().GetCntntIdx())
2301
            {
2302
                SwNodeIndex aIdx( *pNdIdx, 1 );
2303
                switch( aIdx.GetNode().GetNodeType() )
2304
                {
2305
                    case ND_GRFNODE:
2306
                    case ND_OLENODE:
2307
                        bUseTraditionalInline = true;
2308
                        break;
2309
                    default:
2310
                        bUseTraditionalInline = false;
2311
                        break;
2312
                }
2313
            }
2314
        }
2315
    }
2316
2317
    if (bUseTraditionalInline)
2292
	{
2318
	{
2293
		if( RES_DRAWFRMFMT == rFrmFmt.Which() )
2319
		if( RES_DRAWFRMFMT == rFrmFmt.Which() )
2294
		{
2320
		{
Lines 2374-2385 Link Here
2374
	}
2400
	}
2375
	else
2401
	else
2376
	{
2402
	{
2403
        if (FLY_IN_CNTNT == rAnch.GetAnchorId())
2404
        {
2405
            String sShape(CREATE_CONST_ASC(" SHAPE "));
2406
            OutField(0, 95, sShape, WRITEFIELD_START | WRITEFIELD_CMD_START | 
2407
                WRITEFIELD_CMD_END);
2408
        }
2409
2377
		// write as escher
2410
		// write as escher
2378
		WW8_CP nCP = Fc2Cp( Strm().Tell() );
2411
		WW8_CP nCP = Fc2Cp( Strm().Tell() );
2379
		AppendFlyInFlys( nCP, rFrmFmt, rNdTopLeft );
2412
		AppendFlyInFlys( nCP, rFrmFmt, rNdTopLeft );
2413
2414
        if (FLY_IN_CNTNT == rAnch.GetAnchorId())
2415
        {
2416
            Point aTopLeft(0,0);
2417
            Rectangle aRect = PlcDrawObj::FindLayoutRect(rFrmFmt, aTopLeft);
2418
            nFlyWidth  = aRect.GetWidth();  // Fuer Anpassung Graphic-Groesse
2419
            nFlyHeight = aRect.GetHeight();
2420
            SwFlyFrmFmt *pOld = pFlyFmt;
2421
            pFlyFmt = (SwFlyFrmFmt*)&rFrmFmt;
2422
            OutGrf(0);    //0x1 graphic
2423
            pFlyFmt = pOld;
2424
            OutField(0, 95, aEmptyStr, WRITEFIELD_END | WRITEFIELD_CLOSE);
2425
        }
2380
	}
2426
	}
2381
}
2427
}
2382
2383
2428
2384
void SwWW8Writer::OutFlyFrms( const SwCntntNode& rNode )
2429
void SwWW8Writer::OutFlyFrms( const SwCntntNode& rNode )
2385
{
2430
{
(-)wrtww8.hxx (+1 lines)
Lines 355-360 Link Here
355
	const ::std::vector<DrawObj> &GetObjArr() const { return maDrawObjs; }
355
	const ::std::vector<DrawObj> &GetObjArr() const { return maDrawObjs; }
356
	void SetShapeDetails( const SwFrmFmt& rFmt, UINT32 nId, INT32 nThick );
356
	void SetShapeDetails( const SwFrmFmt& rFmt, UINT32 nId, INT32 nThick );
357
    virtual ~PlcDrawObj();
357
    virtual ~PlcDrawObj();
358
    static Rectangle FindLayoutRect(const SwFrmFmt &rFmt, Point aTopLeft);
358
private:
359
private:
359
    //No copying
360
    //No copying
360
    PlcDrawObj(const PlcDrawObj&);
361
    PlcDrawObj(const PlcDrawObj&);
(-)wrtww8gr.cxx (-2 / +34 lines)
Lines 750-761 Link Here
750
void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const SwNoTxtNode* pNd,
750
void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const SwNoTxtNode* pNd,
751
    const SwFlyFrmFmt* pFly, UINT16 nWidth, UINT16 nHeight)
751
    const SwFlyFrmFmt* pFly, UINT16 nWidth, UINT16 nHeight)
752
{
752
{
753
	if (!pNd || (!pNd->IsGrfNode() && !pNd->IsOLENode()))
753
	if (!pNd && (!pNd->IsGrfNode() && !pNd->IsOLENode()))
754
		return;
754
		return;
755
755
756
756
	UINT32 nPos = rStrm.Tell();			// Grafik-Anfang merken
757
	UINT32 nPos = rStrm.Tell();			// Grafik-Anfang merken
757
758
758
	if (pNd->IsGrfNode())
759
	if (!pNd)
760
	{
761
		ASSERT(rWrt.bWrtWW8 && pFly, "This only makes sense for ww8 and the "
762
			"shape field dummy 0x01 to shadow the 0x08 escher image.");
763
764
		if (!(rWrt.bWrtWW8 && pFly))
765
			return;
766
767
		BYTE aArr[0x44] = { 0 };
768
		BYTE *pArr = aArr + 4;
769
		Set_UInt16(pArr, sizeof(aArr));
770
		Set_UInt16(pArr ,0x64);
771
772
		Set_UInt16(pArr, nWidth * 254L / 144);
773
		Set_UInt16(pArr, nHeight * 254L / 144);
774
		pArr += 16;
775
		Set_UInt16(pArr, nWidth);
776
		Set_UInt16(pArr, nHeight);
777
778
		double fVal = nWidth * 1000.0 / (nWidth);
779
		Set_UInt16(pArr, (USHORT)SolarMath::Round(fVal));
780
781
		fVal = nHeight * 1000.0 / (nHeight);
782
		Set_UInt16(pArr, (USHORT)SolarMath::Round(fVal));
783
784
		rStrm.Write(aArr, sizeof(aArr));
785
786
		SwBasicEscherEx aInlineEscher(&rStrm, rWrt);
787
		aInlineEscher.WriteDummyFlyFrame(*pFly, 0x0401);
788
		aInlineEscher.WritePictures();
789
	}
790
	else if (pNd->IsGrfNode())
759
		WriteGrfFromGrfNode(rStrm, pNd->GetGrfNode(), pFly, nWidth, nHeight);
791
		WriteGrfFromGrfNode(rStrm, pNd->GetGrfNode(), pFly, nWidth, nHeight);
760
	else if (pNd->IsOLENode())
792
	else if (pNd->IsOLENode())
761
	{
793
	{
(-)ww8graf.cxx (-35 / +70 lines)
Lines 1771-1791 Link Here
1771
1771
1772
	const SfxItemSet& rOldSet = pSdrObj->GetItemSet();
1772
	const SfxItemSet& rOldSet = pSdrObj->GetItemSet();
1773
1773
1774
	// einige Items koennen direkt so uebernommen werden
1775
	const USHORT nDirectMatch = 2;
1776
	static RES_FRMATR __READONLY_DATA aDirectMatch[ nDirectMatch ] =
1777
	{
1778
		RES_LR_SPACE,	// Aussenabstand links/rechts: SvxLRSpaceItem
1779
		RES_UL_SPACE	// Aussenabstand Oben/unten:   SvxULSpaceItem
1780
	};
1781
	const SfxPoolItem* pPoolItem;
1782
	for(USHORT nItem = 0; nItem < nDirectMatch; ++nItem)
1783
		if( SFX_ITEM_SET == rOldSet.GetItemState( aDirectMatch[ nItem ], false,
1784
            &pPoolItem) )
1785
		{
1786
			rFlySet.Put( *pPoolItem );
1787
		}
1788
1774
1775
    /*
1776
    #i3958#, basically a winword bug here, in inline mode the left and right
1777
    spacing are ignored, (shown grayed out in word)
1778
    */
1779
    if (!IsInlineEscherHack())
1780
    {
1781
	    // einige Items koennen direkt so uebernommen werden
1782
	    const USHORT nDirectMatch = 2;
1783
	    static RES_FRMATR __READONLY_DATA aDirectMatch[ nDirectMatch ] =
1784
	    {
1785
		    RES_LR_SPACE,	// Aussenabstand links/rechts: SvxLRSpaceItem
1786
		    RES_UL_SPACE	// Aussenabstand Oben/unten:   SvxULSpaceItem
1787
	    };
1788
	    const SfxPoolItem* pPoolItem;
1789
	    for (USHORT nItem = 0; nItem < nDirectMatch; ++nItem)
1790
        {
1791
		    if (SFX_ITEM_SET == rOldSet.GetItemState(aDirectMatch[nItem], false,
1792
                &pPoolItem) )
1793
		    {
1794
			    rFlySet.Put(*pPoolItem);
1795
		    }
1796
        }
1797
    }
1789
1798
1790
    // jetzt die Umrandung berechnen und die Box bauen: Das Mass wird fuer die
1799
    // jetzt die Umrandung berechnen und die Box bauen: Das Mass wird fuer die
1791
    // Rahmen-GROESSE benoetigt!
1800
    // Rahmen-GROESSE benoetigt!
Lines 1874-1881 Link Here
1874
    }
1883
    }
1875
1884
1876
    //Sadly word puts escher borders outside the graphic, but orients the
1885
    //Sadly word puts escher borders outside the graphic, but orients the
1877
    //graphic in relation to the top left inside the border. We don't
1886
    //graphic in relation to the top left inside the border. We don't.
1878
    if (nOutside)
1887
    //Only relevent in the (normal) case of not being inside a shape field
1888
    if (nOutside && !IsInlineEscherHack())
1879
    {
1889
    {
1880
        SwFmtHoriOrient aHori = (const SwFmtHoriOrient &)(rFlySet.Get(
1890
        SwFmtHoriOrient aHori = (const SwFmtHoriOrient &)(rFlySet.Get(
1881
            RES_HORI_ORIENT));
1891
            RES_HORI_ORIENT));
Lines 2426-2462 Link Here
2426
				+ pWwFib->ccpHdr  + pWwFib->ccpMcr
2436
				+ pWwFib->ccpHdr  + pWwFib->ccpMcr
2427
				+ pWwFib->ccpAtn  + pWwFib->ccpEdn;
2437
				+ pWwFib->ccpAtn  + pWwFib->ccpEdn;
2428
2438
2429
	if( pPlcxMan->GetManType() == MAN_HDFT )
2439
	if (pPlcxMan->GetManType() == MAN_HDFT)
2430
        nDrawCpO += pWwFib->ccpTxbx;
2440
        nDrawCpO += pWwFib->ccpTxbx;
2431
2441
2432
    if( !pDrawModel )// 1. GrafikObjekt des Docs
2442
    if (!pDrawModel)// 1. GrafikObjekt des Docs
2433
	    GrafikCtor();
2443
	    GrafikCtor();
2434
2444
2435
    WW8PLCFspecial* pPF = pPlcxMan->GetFdoa();
2445
    WW8PLCFspecial* pPF = pPlcxMan->GetFdoa();
2436
	if( !pPF )
2446
	if (!pPF)
2437
    {
2447
    {
2438
		ASSERT( !this, "Where is the grapic (1) ?" );
2448
		ASSERT(!this, "Where is the grapic (1) ?");
2439
		return 0;
2449
		return 0;
2440
	}
2450
	}
2441
2451
2442
	if( bVer67 )
2452
	if (bVer67)
2443
	{
2453
	{
2444
		long nOldPos = pStrm->Tell();
2454
		long nOldPos = pStrm->Tell();
2445
2455
2446
		nDrawXOfs = nDrawYOfs = 0;
2456
		nDrawXOfs = nDrawYOfs = 0;
2447
		ReadGrafLayer1( pPF, nGrafAnchorCp );
2457
		ReadGrafLayer1(pPF, nGrafAnchorCp);
2448
2458
2449
		pStrm->Seek( nOldPos );
2459
		pStrm->Seek(nOldPos);
2450
        return 0;
2460
        return 0;
2451
	}
2461
	}
2452
2462
2453
    //Normal case of Word 8+ version stuff
2463
    //Normal case of Word 8+ version stuff
2454
    pPF->SeekPos( nGrafAnchorCp );
2464
    pPF->SeekPos(nGrafAnchorCp);
2455
2465
2456
    long nStartFc;
2466
    long nStartFc;
2457
    void* pF0;
2467
    void* pF0;
2458
    if( !pPF->Get( nStartFc, pF0 ) ){
2468
    if (!pPF->Get(nStartFc, pF0))
2459
        ASSERT( !this, "+Wo ist die Grafik (2) ?" );
2469
    {
2470
        ASSERT(!this, "+Wo ist die Grafik (2) ?");
2460
        return 0;
2471
        return 0;
2461
    }
2472
    }
2462
2473
Lines 2506-2512 Link Here
2506
            break;
2517
            break;
2507
        default:
2518
        default:
2508
            break;
2519
            break;
2509
2510
    }
2520
    }
2511
2521
2512
    // Umfluss-Modus ermitteln
2522
    // Umfluss-Modus ermitteln
Lines 2583-2596 Link Here
2583
            pF->nby = WW8_FSPA::RelPageBorder;
2593
            pF->nby = WW8_FSPA::RelPageBorder;
2584
        }
2594
        }
2585
2595
2586
        if (pF->nby != WW8_FSPA::RelText)
2596
		RndStdIds eAnchor;
2587
        {
2588
            if (bIsHeader || bIsFooter)
2589
                pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode();
2590
        }
2591
2597
2592
        RndStdIds eAnchor = ProcessEscherAlign(pRecord, pF, aFlySet, 
2598
		/*
2593
            bReplaceable);
2599
           #i3958#
2600
           If we are in a shape field, then we are to be anchored as character
2601
           and ignore the actual anchoring information.  Word also vertically 
2602
 		   aligns the inline Escher object to the base of the line so need to
2603
 		   override the default setting.
2604
         */
2605
		if (IsInlineEscherHack())
2606
		{
2607
			eAnchor = FLY_IN_CNTNT;
2608
            SwFmtAnchor aAnchor(eAnchor);
2609
            aAnchor.SetAnchor(pPaM->GetPoint());
2610
            aFlySet.Put(aAnchor);
2611
 			aFlySet.Put(SwFmtVertOrient(0, VERT_TOP, PRTAREA));
2612
		}
2613
		else 
2614
		{
2615
	        if (pF->nby != WW8_FSPA::RelText)
2616
		    {
2617
			    if (bIsHeader || bIsFooter)
2618
				    pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode();
2619
			}
2620
2621
	        eAnchor = ProcessEscherAlign(pRecord, pF, aFlySet, 
2622
				bReplaceable);
2623
		}
2594
2624
2595
        // Should we, and is it possible to make this into a writer textbox
2625
        // Should we, and is it possible to make this into a writer textbox
2596
        if( (!(nIniFlags1 & WW8FL_NO_FLY_FOR_TXBX)) &&
2626
        if( (!(nIniFlags1 & WW8FL_NO_FLY_FOR_TXBX)) &&
Lines 2839-2845 Link Here
2839
        ASSERT(pRetFrmFmt->GetAnchor().GetAnchorId() == eAnchor,
2869
        ASSERT(pRetFrmFmt->GetAnchor().GetAnchorId() == eAnchor,
2840
            "Not the anchor type requested!");
2870
            "Not the anchor type requested!");
2841
2871
2842
        MatchWrapDistancesIntoFlyFmt( pRecord, pRetFrmFmt );
2872
        /*
2873
        #i3958#, basically a winword bug here, in inline mode the left and right
2874
        spacing are ignored, (shown grayed out in word)
2875
        */
2876
        if (!IsInlineEscherHack())
2877
            MatchWrapDistancesIntoFlyFmt(pRecord, pRetFrmFmt);
2843
2878
2844
        // falls alles Ok, Zeiger auf neues Objekt ermitteln und Z-Order-Liste
2879
        // falls alles Ok, Zeiger auf neues Objekt ermitteln und Z-Order-Liste
2845
        // entsprechend korrigieren (oder Eintrag loeschen)
2880
        // entsprechend korrigieren (oder Eintrag loeschen)
(-)ww8par.hxx (-3 / +7 lines)
Lines 844-850 Link Here
844
	bool bWWBugNormal;		// WW-Version nit Bug Dya in Style Normal
844
	bool bWWBugNormal;		// WW-Version nit Bug Dya in Style Normal
845
	bool bNoAttrImport;		// Attribute ignorieren zum Ignorieren v. Styles
845
	bool bNoAttrImport;		// Attribute ignorieren zum Ignorieren v. Styles
846
	bool bInHyperlink;      // Sonderfall zum einlesen eines 0x01
846
	bool bInHyperlink;      // Sonderfall zum einlesen eines 0x01
847
								   // siehe: SwWW8ImplReader::Read_F_Hyperlink()
847
							// siehe: SwWW8ImplReader::Read_F_Hyperlink()
848
    bool bVerticalEnviron;
848
    bool bVerticalEnviron;
849
    bool bWasParaEnd;
849
    bool bWasParaEnd;
850
850
Lines 1159-1164 Link Here
1159
    void SetOutLineStyles();
1159
    void SetOutLineStyles();
1160
1160
1161
    //No copying
1161
    //No copying
1162
    bool IsInlineEscherHack()
1163
        {return !maFieldStack.empty() ? maFieldStack.top() == 95 : false; };
1164
1162
    SwWW8ImplReader(const SwWW8ImplReader &);
1165
    SwWW8ImplReader(const SwWW8ImplReader &);
1163
    SwWW8ImplReader& operator=(const SwWW8ImplReader&);
1166
    SwWW8ImplReader& operator=(const SwWW8ImplReader&);
1164
public:		// eigentlich private, geht aber leider nur public
1167
public:		// eigentlich private, geht aber leider nur public
Lines 1304-1311 Link Here
1304
	eF_ResT Read_F_IncludeText(    WW8FieldDesc*, String& rStr );
1307
	eF_ResT Read_F_IncludeText(    WW8FieldDesc*, String& rStr );
1305
	eF_ResT Read_F_Seq( WW8FieldDesc*, String& rStr );
1308
	eF_ResT Read_F_Seq( WW8FieldDesc*, String& rStr );
1306
1309
1307
	eF_ResT Read_F_OCX( WW8FieldDesc*, String& );
1310
	eF_ResT Read_F_OCX(WW8FieldDesc*, String&);
1308
	eF_ResT Read_F_Hyperlink( WW8FieldDesc*, String& rStr );
1311
	eF_ResT Read_F_Hyperlink(WW8FieldDesc*, String& rStr);
1312
    eF_ResT Read_F_Shape(WW8FieldDesc* pF, String& rStr);
1309
1313
1310
	void DeleteFormImpl();
1314
	void DeleteFormImpl();
1311
1315
(-)ww8par5.cxx (-7 / +22 lines)
Lines 766-772 Link Here
766
		return 0;
766
		return 0;
767
    
767
    
768
    typedef eF_ResT (SwWW8ImplReader:: *FNReadField)( WW8FieldDesc*, String& );
768
    typedef eF_ResT (SwWW8ImplReader:: *FNReadField)( WW8FieldDesc*, String& );
769
    static FNReadField aWW8FieldTab[93] = 
769
    enum Limits {eMax = 96};
770
    static FNReadField aWW8FieldTab[eMax+1] = 
770
    {
771
    {
771
        0,
772
        0,
772
        0,
773
        0,
Lines 864-873 Link Here
864
        0,											// 89
865
        0,											// 89
865
        0,											// 90
866
        0,											// 90
866
        0,											// 91
867
        0,											// 91
867
        0 											// 92 - Dummy leer Methode
868
        0,											// 92
868
    };											// 92   == alle ueber 91
869
        0,											// 93
870
        0,											// 94
871
        &SwWW8ImplReader::Read_F_Shape,				// 95
872
        0 											// eMax - Dummy leer Methode
873
    };											// eMax   == alle ueber eMax-1
869
874
870
	ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == 93 ),
875
	ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == eMax+1 ),
871
			"FeldFunc-Tabelle stimmt nicht" );
876
			"FeldFunc-Tabelle stimmt nicht" );
872
877
873
	WW8PLCFx_FLD* pF = pPlcxMan->GetFld();
878
	WW8PLCFx_FLD* pF = pPlcxMan->GetFld();
Lines 900-906 Link Here
900
    if (bNested)
905
    if (bNested)
901
        return 0;
906
        return 0;
902
907
903
	USHORT n = ( aF.nId <= 91 ) ? aF.nId : 92; // alle > 91 werden 92
908
	USHORT n = ( aF.nId <= eMax ) ? aF.nId : eMax; // alle > 91 werden 92
904
	USHORT nI = n / 32;						// # des UINT32
909
	USHORT nI = n / 32;						// # des UINT32
905
	ULONG nMask = 1 << ( n % 32 );			// Maske fuer Bits
910
	ULONG nMask = 1 << ( n % 32 );			// Maske fuer Bits
906
911
Lines 910-916 Link Here
910
	if( !bOk || !aF.nId )                   // Feld kaputt
915
	if( !bOk || !aF.nId )                   // Feld kaputt
911
		return aF.nLen;						// -> ignorieren
916
		return aF.nLen;						// -> ignorieren
912
917
913
	if( aF.nId > 91)                        // WW: Nested Field
918
	if( aF.nId > eMax - 1)                        // WW: Nested Field
914
    {
919
    {
915
		if( nFieldTagBad[nI] & nMask )		// Flag: Tag it when bad
920
		if( nFieldTagBad[nI] & nMask )		// Flag: Tag it when bad
916
			return Read_F_Tag( &aF );		// Resultat nicht als Text
921
			return Read_F_Tag( &aF );		// Resultat nicht als Text
Lines 3029-3035 Link Here
3029
	return FLD_OK;
3034
	return FLD_OK;
3030
}
3035
}
3031
3036
3032
eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* pF, String& rStr )
3037
eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* pF, String& rStr)
3038
{
3039
    /*
3040
    #i3958# 0x8 followed by 0x1 where the shape is the 0x8 and its anchoring
3041
    to be ignored followed by a 0x1 with an empty drawing. Detect in inserting
3042
    the drawing that we are in the Shape field and respond accordingly
3043
    */
3044
    return FLD_TEXT;
3045
}
3046
3047
eF_ResT SwWW8ImplReader::Read_F_Hyperlink(WW8FieldDesc* pF, String& rStr)
3033
{
3048
{
3034
	String sURL, sTarget, sMark;
3049
	String sURL, sTarget, sMark;
3035
	bool bDataImport = false;
3050
	bool bDataImport = false;

Return to issue 3958