? esher.hxx.patch.txt ? importexport26-02-2003.txt ? patch3958-25022003.txt ? patchimport3958.txt Index: makefile.mk =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/makefile.mk,v retrieving revision 1.6.6.1 diff -u -r1.6.6.1 makefile.mk --- makefile.mk 6 Feb 2003 16:30:19 -0000 1.6.6.1 +++ makefile.mk 26 Feb 2003 16:42:13 -0000 @@ -121,7 +121,6 @@ $(SLO)$/ww8scan.obj EXCEPTIONSFILES = \ - $(SLO)$/ww8par5.obj \ $(SLO)$/ww8graf2.obj Index: wrtw8esh.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8esh.cxx,v retrieving revision 1.57.2.2.38.1 diff -u -r1.57.2.2.38.1 wrtw8esh.cxx --- wrtw8esh.cxx 25 Feb 2003 15:55:19 -0000 1.57.2.2.38.1 +++ wrtw8esh.cxx 26 Feb 2003 16:42:14 -0000 @@ -332,15 +332,27 @@ //xaLeft/yaTop/xaRight/yaBottom - rel. to anchor //(most of) the border is outside the graphic is word, so //change dimensions to fit - SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Left() + - aIter->mnThick); - SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + - aIter->mnThick); - SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() - - aIter->mnThick); - SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - - aIter->mnThick); - + if (FLY_IN_CNTNT==rFmt.GetAnchor().GetAnchorId()){ + SwWW8Writer::WriteLong(*rWrt.pTableStrm,aIter->mnThick); + SwWW8Writer::WriteLong(*rWrt.pTableStrm,aIter->mnThick); + + SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() - aRect.Left()- + aIter->mnThick); + SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() -aRect.Top()- + aIter->mnThick); + } + else + { + SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Left()+ + aIter->mnThick); + SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + + aIter->mnThick); + + SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() - + aIter->mnThick); + SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - + aIter->mnThick); + } //fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock USHORT nFlags=0; //If nFlags isn't 0x14 its overridden by the escher properties @@ -348,6 +360,7 @@ nFlags = 0x0000; else nFlags = 0x0014; // x-rel to text, y-rel to text + const SwFmtSurround& rSurr = rFmt.GetSurround(); USHORT nContour = rSurr.IsContour() ? 0x0080 : 0x0040; @@ -360,7 +373,11 @@ nFlags |= 0x0060; break; case SURROUND_PARALLEL: - nFlags |= 0x0000 | nContour; + /* Hack for setting the Wrapping to In Front of Text*/ + if (FLY_IN_CNTNT==rFmt.GetAnchor().GetAnchorId()) + nFlags |= 0x0060; + else + nFlags |= 0x0000 | nContour; break; case SURROUND_IDEAL: nFlags |= 0x0600 | nContour; @@ -2242,6 +2259,13 @@ pFound = (UINT32*)aHVMatcher; // take Element #0 if none found nYAlign = (*pFound & 0x000000F0) >> 4; nYRelTo = (*pFound & 0x0000000F); + if (eAnchor ==FLY_IN_CNTNT) + { + nXAlign = 0; + nXRelTo = 3; + nYAlign = 0; + nYRelTo = 3; + } } void SwEscherEx::WriteFrmExtraData( const SwFrmFmt& rFmt ) Index: wrtw8nds.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8nds.cxx,v retrieving revision 1.46.2.2 diff -u -r1.46.2.2 wrtw8nds.cxx --- wrtw8nds.cxx 21 Feb 2003 01:39:28 -0000 1.46.2.2 +++ wrtw8nds.cxx 26 Feb 2003 16:42:14 -0000 @@ -2302,7 +2302,8 @@ Note that something anchored as a character must be exported using the older WW6 mechanism */ - if( !bWrtWW8 || (FLY_IN_CNTNT == rAnch.GetAnchorId()) ) + //if( !bWrtWW8 || (FLY_IN_CNTNT == rAnch.GetAnchorId()) ) + if( !bWrtWW8 ) { if( RES_DRAWFRMFMT == rFrmFmt.Which() ) { Index: ww8graf.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/ww8graf.cxx,v retrieving revision 1.91.2.2 diff -u -r1.91.2.2 ww8graf.cxx --- ww8graf.cxx 21 Feb 2003 01:40:00 -0000 1.91.2.2 +++ ww8graf.cxx 26 Feb 2003 16:42:14 -0000 @@ -1774,20 +1774,29 @@ const SfxItemSet& rOldSet = pSdrObj->GetItemSet(); - // einige Items koennen direkt so uebernommen werden - const USHORT nDirectMatch = 2; - static RES_FRMATR __READONLY_DATA aDirectMatch[ nDirectMatch ] = - { - RES_LR_SPACE, // Aussenabstand links/rechts: SvxLRSpaceItem - RES_UL_SPACE // Aussenabstand Oben/unten: SvxULSpaceItem - }; - const SfxPoolItem* pPoolItem; - for(USHORT nItem = 0; nItem < nDirectMatch; ++nItem) - if( SFX_ITEM_SET == rOldSet.GetItemState( aDirectMatch[ nItem ], false, - &pPoolItem) ) - { - rFlySet.Put( *pPoolItem ); - } + /* + #i3958#, basically a winword bug here, in inline mode the left and right + spacing are ignored, (shown grayed out in word) + */ + if (!IsInlineEscherHack()) + { + // einige Items koennen direkt so uebernommen werden + const USHORT nDirectMatch = 2; + static RES_FRMATR __READONLY_DATA aDirectMatch[ nDirectMatch ] = + { + RES_LR_SPACE, // Aussenabstand links/rechts: SvxLRSpaceItem + RES_UL_SPACE // Aussenabstand Oben/unten: SvxULSpaceItem + }; + const SfxPoolItem* pPoolItem; + for (USHORT nItem = 0; nItem < nDirectMatch; ++nItem) + { + if (SFX_ITEM_SET == rOldSet.GetItemState(aDirectMatch[nItem], false, + &pPoolItem) ) + { + rFlySet.Put(*pPoolItem); + } + } + } // jetzt die Umrandung berechnen und die Box bauen: Das Mass wird fuer die @@ -1878,8 +1887,9 @@ //Sadly word puts escher borders outside the graphic, but orients the //graphic in relation to the top left inside the border. We don't - if (nOutside) - { + //Only relevent in the (normal) case of not being inside a shape field + if (nOutside && !IsInlineEscherHack()) + { SwFmtHoriOrient aHori = (const SwFmtHoriOrient &)(rFlySet.Get( RES_HORI_ORIENT)); aHori.SetPos(aHori.GetPos()-nOutside); @@ -2612,14 +2622,33 @@ pF->nby = WW8_FSPA::RelPageBorder; } - if (pF->nby != WW8_FSPA::RelText) - { - if (bIsHeader || bIsFooter) - pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode(); - } + RndStdIds eAnchor; + /* + #i3958# + If we are in a shape field, then we are to be anchored as character + and ignore the actual anchoring information. Word also vertically + aligns the inline Escher object to the base of the line so need to + override the default setting. + */ + if (IsInlineEscherHack()) + { + eAnchor = FLY_IN_CNTNT; + SwFmtAnchor aAnchor(eAnchor); + aAnchor.SetAnchor(pPaM->GetPoint()); + aFlySet.Put(aAnchor); + aFlySet.Put(SwFmtVertOrient(0, VERT_TOP, PRTAREA)); + } + else + { + if (pF->nby != WW8_FSPA::RelText) + { + if (bIsHeader || bIsFooter) + pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode(); + } - RndStdIds eAnchor = ProcessEscherAlign(pRecord, pF, aFlySet, - bReplaceable); + eAnchor = ProcessEscherAlign(pRecord, pF, aFlySet, + bReplaceable); + } // Should we, and is it possible to make this into a writer textbox if ((!(nIniFlags1 & WW8FL_NO_FLY_FOR_TXBX)) && pRecord->bReplaceByFly) @@ -2694,7 +2723,12 @@ } } - MatchWrapDistancesIntoFlyFmt(pRecord, pRetFrmFmt); + /* + #i3958#, basically a winword bug here, in inline mode the left and right + spacing are ignored, (shown grayed out in word) + */ + if (!IsInlineEscherHack()) + MatchWrapDistancesIntoFlyFmt(pRecord, pRetFrmFmt); return AddAutoAnchor(pRetFrmFmt); } Index: ww8par.hxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/ww8par.hxx,v retrieving revision 1.106.2.2.6.2 diff -u -r1.106.2.2.6.2 ww8par.hxx --- ww8par.hxx 25 Feb 2003 15:55:20 -0000 1.106.2.2.6.2 +++ ww8par.hxx 26 Feb 2003 16:42:15 -0000 @@ -1245,6 +1245,8 @@ void StoreMacroCmds(); //No copying + bool IsInlineEscherHack() + {return !maFieldStack.empty() ? maFieldStack.front() == 95 : false; }; SwWW8ImplReader(const SwWW8ImplReader &); SwWW8ImplReader& operator=(const SwWW8ImplReader&); public: // eigentlich private, geht aber leider nur public @@ -1393,6 +1395,7 @@ eF_ResT Read_F_OCX( WW8FieldDesc*, String& ); eF_ResT Read_F_Hyperlink( WW8FieldDesc*, String& rStr ); + eF_ResT Read_F_Shape(WW8FieldDesc* pF, String& rStr); void DeleteFormImpl(); Index: ww8par5.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/ww8par5.cxx,v retrieving revision 1.62.2.2 diff -u -r1.62.2.2 ww8par5.cxx --- ww8par5.cxx 21 Feb 2003 01:41:04 -0000 1.62.2.2 +++ ww8par5.cxx 26 Feb 2003 16:42:15 -0000 @@ -796,7 +796,8 @@ return 0; typedef eF_ResT (SwWW8ImplReader:: *FNReadField)( WW8FieldDesc*, String& ); - static FNReadField aWW8FieldTab[93] = + enum Limits {eMax = 96}; + static FNReadField aWW8FieldTab[eMax+1] = { 0, 0, @@ -894,11 +895,15 @@ 0, // 89 0, // 90 0, // 91 - 0 // 92 - Dummy leer Methode - }; // 92 == alle ueber 91 - - ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == 93 ), - "FeldFunc-Tabelle stimmt nicht" ); + 0, // 92 + 0, // 93 + 0, // 94 + &SwWW8ImplReader::Read_F_Shape, // 95 + 0 // eMax - Dummy leer Methode + }; + ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == eMax+1 ), + "FeldFunc-Tabelle stimmt nicht" ); + WW8PLCFx_FLD* pF = pPlcxMan->GetFld(); ASSERT(pF, "WW8PLCFx_FLD - Pointer nicht da"); @@ -930,7 +935,7 @@ if (bNested) return 0; - USHORT n = ( aF.nId <= 91 ) ? aF.nId : 92; // alle > 91 werden 92 + USHORT n = ( aF.nId <= eMax ) ? aF.nId : eMax; // alle > 91 werden 92 USHORT nI = n / 32; // # des UINT32 ULONG nMask = 1 << ( n % 32 ); // Maske fuer Bits @@ -940,7 +945,7 @@ if( !bOk || !aF.nId ) // Feld kaputt return aF.nLen; // -> ignorieren - if( aF.nId > 91) // WW: Nested Field + if( aF.nId > eMax - 1) // WW: Nested Field { if( nFieldTagBad[nI] & nMask ) // Flag: Tag it when bad return Read_F_Tag( &aF ); // Resultat nicht als Text @@ -1129,6 +1134,16 @@ eF_ResT SwWW8ImplReader::Read_F_Nul( WW8FieldDesc*, String& ) { return FLD_OK; +} + +eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* pF, String& rStr) +{ + /* + #i3958# 0x8 followed by 0x1 where the shape is the 0x8 and its anchoring + to be ignored followed by a 0x1 with an empty drawing. Detect in inserting + the drawing that we are in the Shape field and respond accordingly + */ + return FLD_TEXT; } eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, String& rStr )