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

(-)makefile.mk (-1 lines)
Lines 121-127 Link Here
121
		$(SLO)$/ww8scan.obj
121
		$(SLO)$/ww8scan.obj
122
122
123
EXCEPTIONSFILES = \
123
EXCEPTIONSFILES = \
124
		$(SLO)$/ww8par5.obj \
125
		$(SLO)$/ww8graf2.obj
124
		$(SLO)$/ww8graf2.obj
126
125
127
126
(-)wrtw8esh.cxx (-10 / +34 lines)
Lines 332-346 Link Here
332
			//xaLeft/yaTop/xaRight/yaBottom - rel. to anchor
332
			//xaLeft/yaTop/xaRight/yaBottom - rel. to anchor
333
            //(most of) the border is outside the graphic is word, so
333
            //(most of) the border is outside the graphic is word, so
334
            //change dimensions to fit
334
            //change dimensions to fit
335
			SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Left() +
335
           if (FLY_IN_CNTNT==rFmt.GetAnchor().GetAnchorId()){
336
                aIter->mnThick);
336
			    SwWW8Writer::WriteLong(*rWrt.pTableStrm,aIter->mnThick);
337
			SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() +
337
		        SwWW8Writer::WriteLong(*rWrt.pTableStrm,aIter->mnThick);
338
                aIter->mnThick);
338
		    
339
			SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() -
339
                SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() - aRect.Left()-
340
                aIter->mnThick);
340
                        aIter->mnThick);
341
			SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() -
341
		        SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() -aRect.Top()-
342
                aIter->mnThick);
342
                    aIter->mnThick);
343
343
            }
344
            else
345
            {
346
                SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Left()+ 
347
                    aIter->mnThick);
348
		        SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() +
349
                    aIter->mnThick);
350
		    
351
                SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() -
352
                        aIter->mnThick);
353
		        SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() -
354
                    aIter->mnThick);
355
            }
344
			//fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock
356
			//fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock
345
			USHORT nFlags=0;
357
			USHORT nFlags=0;
346
            //If nFlags isn't 0x14 its overridden by the escher properties
358
            //If nFlags isn't 0x14 its overridden by the escher properties
Lines 348-353 Link Here
348
				nFlags = 0x0000;
360
				nFlags = 0x0000;
349
			else
361
			else
350
				nFlags = 0x0014;		// x-rel to text,  y-rel to text
362
				nFlags = 0x0014;		// x-rel to text,  y-rel to text
363
            
351
364
352
			const SwFmtSurround& rSurr = rFmt.GetSurround();
365
			const SwFmtSurround& rSurr = rFmt.GetSurround();
353
			USHORT nContour = rSurr.IsContour() ? 0x0080 : 0x0040;
366
			USHORT nContour = rSurr.IsContour() ? 0x0080 : 0x0040;
Lines 360-366 Link Here
360
                    nFlags |= 0x0060;
373
                    nFlags |= 0x0060;
361
                    break;
374
                    break;
362
                case SURROUND_PARALLEL:
375
                case SURROUND_PARALLEL:
363
                    nFlags |= 0x0000 | nContour;
376
                     /* Hack for setting the Wrapping to In Front of Text*/
377
                    if (FLY_IN_CNTNT==rFmt.GetAnchor().GetAnchorId())
378
                        nFlags |= 0x0060;
379
                    else
380
                        nFlags |= 0x0000 | nContour;
364
                    break;
381
                    break;
365
                case SURROUND_IDEAL:
382
                case SURROUND_IDEAL:
366
                    nFlags |= 0x0600 | nContour;
383
                    nFlags |= 0x0600 | nContour;
Lines 2242-2247 Link Here
2242
		pFound = (UINT32*)aHVMatcher; // take Element #0 if none found
2259
		pFound = (UINT32*)aHVMatcher; // take Element #0 if none found
2243
	nYAlign = (*pFound & 0x000000F0) >> 4;
2260
	nYAlign = (*pFound & 0x000000F0) >> 4;
2244
	nYRelTo = (*pFound & 0x0000000F);
2261
	nYRelTo = (*pFound & 0x0000000F);
2262
    if (eAnchor ==FLY_IN_CNTNT)
2263
    {
2264
        nXAlign = 0;
2265
        nXRelTo = 3;
2266
        nYAlign = 0;
2267
        nYRelTo = 3;
2268
    }
2245
}
2269
}
2246
2270
2247
void SwEscherEx::WriteFrmExtraData( const SwFrmFmt& rFmt )
2271
void SwEscherEx::WriteFrmExtraData( const SwFrmFmt& rFmt )
(-)wrtw8nds.cxx (-1 / +2 lines)
Lines 2302-2308 Link Here
2302
    Note that something anchored as a character must be
2302
    Note that something anchored as a character must be
2303
    exported using the older WW6 mechanism
2303
    exported using the older WW6 mechanism
2304
    */
2304
    */
2305
    if( !bWrtWW8 || (FLY_IN_CNTNT == rAnch.GetAnchorId()) )
2305
    //if( !bWrtWW8 || (FLY_IN_CNTNT == rAnch.GetAnchorId()) )
2306
    if( !bWrtWW8  )
2306
	{
2307
	{
2307
		if( RES_DRAWFRMFMT == rFrmFmt.Which() )
2308
		if( RES_DRAWFRMFMT == rFrmFmt.Which() )
2308
		{
2309
		{
(-)ww8graf.cxx (-24 / +58 lines)
Lines 1774-1793 Link Here
1774
1774
1775
	const SfxItemSet& rOldSet = pSdrObj->GetItemSet();
1775
	const SfxItemSet& rOldSet = pSdrObj->GetItemSet();
1776
1776
1777
	// einige Items koennen direkt so uebernommen werden
1777
	/*
1778
	const USHORT nDirectMatch = 2;
1778
    #i3958#, basically a winword bug here, in inline mode the left and right
1779
	static RES_FRMATR __READONLY_DATA aDirectMatch[ nDirectMatch ] =
1779
    spacing are ignored, (shown grayed out in word)
1780
	{
1780
    */
1781
		RES_LR_SPACE,	// Aussenabstand links/rechts: SvxLRSpaceItem
1781
    if (!IsInlineEscherHack())
1782
		RES_UL_SPACE	// Aussenabstand Oben/unten:   SvxULSpaceItem
1782
    {
1783
	};
1783
	    // einige Items koennen direkt so uebernommen werden
1784
	const SfxPoolItem* pPoolItem;
1784
    const USHORT nDirectMatch = 2;
1785
	for(USHORT nItem = 0; nItem < nDirectMatch; ++nItem)
1785
	    static RES_FRMATR __READONLY_DATA aDirectMatch[ nDirectMatch ] =
1786
		if( SFX_ITEM_SET == rOldSet.GetItemState( aDirectMatch[ nItem ], false,
1786
	    {
1787
            &pPoolItem) )
1787
		    RES_LR_SPACE,	// Aussenabstand links/rechts: SvxLRSpaceItem
1788
		{
1788
		    RES_UL_SPACE	// Aussenabstand Oben/unten:   SvxULSpaceItem
1789
			rFlySet.Put( *pPoolItem );
1789
	    };
1790
		}
1790
	    const SfxPoolItem* pPoolItem;
1791
	    for (USHORT nItem = 0; nItem < nDirectMatch; ++nItem)
1792
       {
1793
		    if (SFX_ITEM_SET == rOldSet.GetItemState(aDirectMatch[nItem], false,
1794
                &pPoolItem) )
1795
		    {
1796
			    rFlySet.Put(*pPoolItem);
1797
		    }
1798
        }
1799
    }
1791
1800
1792
1801
1793
    // jetzt die Umrandung berechnen und die Box bauen: Das Mass wird fuer die
1802
    // jetzt die Umrandung berechnen und die Box bauen: Das Mass wird fuer die
Lines 1878-1885 Link Here
1878
1887
1879
    //Sadly word puts escher borders outside the graphic, but orients the
1888
    //Sadly word puts escher borders outside the graphic, but orients the
1880
    //graphic in relation to the top left inside the border. We don't
1889
    //graphic in relation to the top left inside the border. We don't
1881
    if (nOutside)
1890
   //Only relevent in the (normal) case of not being inside a shape field
1882
    {
1891
    if (nOutside && !IsInlineEscherHack())
1892
     {
1883
        SwFmtHoriOrient aHori = (const SwFmtHoriOrient &)(rFlySet.Get(
1893
        SwFmtHoriOrient aHori = (const SwFmtHoriOrient &)(rFlySet.Get(
1884
            RES_HORI_ORIENT));
1894
            RES_HORI_ORIENT));
1885
        aHori.SetPos(aHori.GetPos()-nOutside);
1895
        aHori.SetPos(aHori.GetPos()-nOutside);
Lines 2612-2625 Link Here
2612
            pF->nby = WW8_FSPA::RelPageBorder;
2622
            pF->nby = WW8_FSPA::RelPageBorder;
2613
        }
2623
        }
2614
2624
2615
        if (pF->nby != WW8_FSPA::RelText)
2625
         RndStdIds eAnchor;
2616
        {
2626
       	/*
2617
            if (bIsHeader || bIsFooter)
2627
           #i3958#
2618
                pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode();
2628
           If we are in a shape field, then we are to be anchored as character
2619
        }
2629
           and ignore the actual anchoring information.  Word also vertically 
2630
 		   aligns the inline Escher object to the base of the line so need to
2631
 		   override the default setting.
2632
         */
2633
		if (IsInlineEscherHack())
2634
		{
2635
			eAnchor = FLY_IN_CNTNT;
2636
            SwFmtAnchor aAnchor(eAnchor);
2637
            aAnchor.SetAnchor(pPaM->GetPoint());
2638
            aFlySet.Put(aAnchor);
2639
 			aFlySet.Put(SwFmtVertOrient(0, VERT_TOP, PRTAREA));
2640
		}
2641
		else 
2642
		{
2643
	        if (pF->nby != WW8_FSPA::RelText)
2644
		    {
2645
			    if (bIsHeader || bIsFooter)
2646
				    pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode();
2647
			}
2620
2648
2621
        RndStdIds eAnchor = ProcessEscherAlign(pRecord, pF, aFlySet, 
2649
	        eAnchor = ProcessEscherAlign(pRecord, pF, aFlySet, 
2622
            bReplaceable);
2650
				bReplaceable);
2651
		}
2623
2652
2624
        // Should we, and is it possible to make this into a writer textbox
2653
        // Should we, and is it possible to make this into a writer textbox
2625
        if ((!(nIniFlags1 & WW8FL_NO_FLY_FOR_TXBX)) && pRecord->bReplaceByFly)
2654
        if ((!(nIniFlags1 & WW8FL_NO_FLY_FOR_TXBX)) && pRecord->bReplaceByFly)
Lines 2694-2700 Link Here
2694
        }
2723
        }
2695
    }
2724
    }
2696
2725
2697
    MatchWrapDistancesIntoFlyFmt(pRecord, pRetFrmFmt);
2726
    /*
2727
    #i3958#, basically a winword bug here, in inline mode the left and right
2728
    spacing are ignored, (shown grayed out in word)
2729
    */
2730
    if (!IsInlineEscherHack())
2731
         MatchWrapDistancesIntoFlyFmt(pRecord, pRetFrmFmt);
2698
    return AddAutoAnchor(pRetFrmFmt);
2732
    return AddAutoAnchor(pRetFrmFmt);
2699
}
2733
}
2700
2734
(-)ww8par.hxx (+3 lines)
Lines 1245-1250 Link Here
1245
    void StoreMacroCmds();
1245
    void StoreMacroCmds();
1246
1246
1247
    //No copying
1247
    //No copying
1248
	bool IsInlineEscherHack()
1249
        {return !maFieldStack.empty() ? maFieldStack.front() == 95 : false; };
1248
    SwWW8ImplReader(const SwWW8ImplReader &);
1250
    SwWW8ImplReader(const SwWW8ImplReader &);
1249
    SwWW8ImplReader& operator=(const SwWW8ImplReader&);
1251
    SwWW8ImplReader& operator=(const SwWW8ImplReader&);
1250
public:		// eigentlich private, geht aber leider nur public
1252
public:		// eigentlich private, geht aber leider nur public
Lines 1393-1398 Link Here
1393
1395
1394
	eF_ResT Read_F_OCX( WW8FieldDesc*, String& );
1396
	eF_ResT Read_F_OCX( WW8FieldDesc*, String& );
1395
	eF_ResT Read_F_Hyperlink( WW8FieldDesc*, String& rStr );
1397
	eF_ResT Read_F_Hyperlink( WW8FieldDesc*, String& rStr );
1398
	eF_ResT Read_F_Shape(WW8FieldDesc* pF, String& rStr);
1396
1399
1397
	void DeleteFormImpl();
1400
	void DeleteFormImpl();
1398
1401
(-)ww8par5.cxx (-8 / +23 lines)
Lines 796-802 Link Here
796
		return 0;
796
		return 0;
797
    
797
    
798
    typedef eF_ResT (SwWW8ImplReader:: *FNReadField)( WW8FieldDesc*, String& );
798
    typedef eF_ResT (SwWW8ImplReader:: *FNReadField)( WW8FieldDesc*, String& );
799
    static FNReadField aWW8FieldTab[93] = 
799
	enum Limits {eMax = 96};
800
    static FNReadField aWW8FieldTab[eMax+1] =  
800
    {
801
    {
801
        0,
802
        0,
802
        0,
803
        0,
Lines 894-904 Link Here
894
        0,											// 89
895
        0,											// 89
895
        0,											// 90
896
        0,											// 90
896
        0,											// 91
897
        0,											// 91
897
        0 											// 92 - Dummy leer Methode
898
        0,											// 92	
898
    };											// 92   == alle ueber 91
899
		0,											// 93
899
900
        0,											// 94
900
	ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == 93 ),
901
        &SwWW8ImplReader::Read_F_Shape,				// 95
901
			"FeldFunc-Tabelle stimmt nicht" );
902
        0 											// eMax - Dummy leer Methode
903
    };			
904
    ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == eMax+1 ),
905
 			"FeldFunc-Tabelle stimmt nicht" );
906
 										
902
907
903
	WW8PLCFx_FLD* pF = pPlcxMan->GetFld();
908
	WW8PLCFx_FLD* pF = pPlcxMan->GetFld();
904
	ASSERT(pF, "WW8PLCFx_FLD - Pointer nicht da");
909
	ASSERT(pF, "WW8PLCFx_FLD - Pointer nicht da");
Lines 930-936 Link Here
930
    if (bNested)
935
    if (bNested)
931
        return 0;
936
        return 0;
932
937
933
	USHORT n = ( aF.nId <= 91 ) ? aF.nId : 92; // alle > 91 werden 92
938
	USHORT n = ( aF.nId <= eMax ) ? aF.nId : eMax; // alle > 91 werden 92
934
	USHORT nI = n / 32;						// # des UINT32
939
	USHORT nI = n / 32;						// # des UINT32
935
	ULONG nMask = 1 << ( n % 32 );			// Maske fuer Bits
940
	ULONG nMask = 1 << ( n % 32 );			// Maske fuer Bits
936
941
Lines 940-946 Link Here
940
	if( !bOk || !aF.nId )                   // Feld kaputt
945
	if( !bOk || !aF.nId )                   // Feld kaputt
941
		return aF.nLen;						// -> ignorieren
946
		return aF.nLen;						// -> ignorieren
942
947
943
	if( aF.nId > 91)                        // WW: Nested Field
948
	if( aF.nId > eMax - 1)                        // WW: Nested Field
944
    {
949
    {
945
		if( nFieldTagBad[nI] & nMask )		// Flag: Tag it when bad
950
		if( nFieldTagBad[nI] & nMask )		// Flag: Tag it when bad
946
			return Read_F_Tag( &aF );		// Resultat nicht als Text
951
			return Read_F_Tag( &aF );		// Resultat nicht als Text
Lines 1129-1134 Link Here
1129
eF_ResT SwWW8ImplReader::Read_F_Nul( WW8FieldDesc*, String& )
1134
eF_ResT SwWW8ImplReader::Read_F_Nul( WW8FieldDesc*, String& )
1130
{
1135
{
1131
	return FLD_OK;
1136
	return FLD_OK;
1137
}
1138
1139
eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* pF, String& rStr)
1140
{
1141
    /*
1142
    #i3958# 0x8 followed by 0x1 where the shape is the 0x8 and its anchoring
1143
    to be ignored followed by a 0x1 with an empty drawing. Detect in inserting
1144
    the drawing that we are in the Shape field and respond accordingly
1145
    */
1146
    return FLD_TEXT;
1132
}
1147
}
1133
1148
1134
eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, String& rStr )
1149
eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, String& rStr )

Return to issue 3958