CVS wrapper -- version: 1.57 ? foobar ? full.patch ? holdon ? inline.patch ? link.patch ? mixed.patch ? mypatch ? mystring ? output ? patch ? realinline.patch Index: escher.hxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/escher.hxx,v retrieving revision 1.1 diff -u -r1.1 escher.hxx --- escher.hxx 28 Aug 2002 12:11:22 -0000 1.1 +++ escher.hxx 18 Sep 2002 08:32:09 -0000 @@ -72,6 +72,7 @@ { public: void WriteData(EscherEx& rEx) const; + void WriteInline(EscherEx& rEx) const; void SetAnchoring(const SwFrmFmt& rFmt, bool bBROKEN = false); private: sal_uInt32 nXAlign; @@ -103,6 +104,7 @@ SvStream* QueryPicStream(); public: SwBasicEscherEx(SvStream* pStrm, SwWW8Writer& rWrt, UINT32 nDrawings = 1); + INT32 WriteDummyFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId); INT32 WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId); virtual void WriteFrmExtraData(const SwFrmFmt& rFmt); virtual void WritePictures(); Index: wrtw8esh.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8esh.cxx,v retrieving revision 1.45 diff -u -r1.45 wrtw8esh.cxx --- wrtw8esh.cxx 30 Aug 2002 13:17:34 -0000 1.45 +++ wrtw8esh.cxx 18 Sep 2002 08:32:09 -0000 @@ -242,6 +242,43 @@ { } +Rectangle PlcDrawObj::FindLayoutRect(const SwFrmFmt &rFmt, Point aTopLeft) +{ + const SdrObject* pObj = rFmt.FindRealSdrObject(); + + Rectangle aRect; + const SwFmtVertOrient& rVOr = rFmt.GetVertOrient(); + const SwFmtHoriOrient& rHOr = rFmt.GetHoriOrient(); + if (RES_FLYFRMFMT == rFmt.Which()) + { + Point aObjPos; + SwRect aLayRect(rFmt.FindLayoutRect(false, &aObjPos)); + // the Object is not visible - so get the values from + // the format. The Position may not be correct. + if (aLayRect.IsEmpty()) + aRect.SetSize(rFmt.GetFrmSize().GetSize()); + else + aRect = aLayRect.SVRect(); + + aRect -= aTopLeft; + aObjPos = aRect.TopLeft(); + if (VERT_NONE == rVOr.GetVertOrient()) + aObjPos.Y() = rVOr.GetPos(); + if (HORI_NONE == rHOr.GetHoriOrient()) + aObjPos.X() = rHOr.GetPos(); + aRect.SetPos( aObjPos ); + } + else + { + ASSERT(pObj, "wo ist das SDR-Object?"); + if (pObj) + aRect = pObj->GetSnapRect(); + aRect -= aTopLeft; + } + + return aRect; +} + void PlcDrawObj::WritePlc(SwWW8Writer& rWrt) const { if (8 > rWrt.pFib->nVersion) // Cannot export drawobject in vers 7- @@ -269,37 +306,7 @@ { // write the fspa-struct const SwFrmFmt& rFmt = aIter->mrCntnt; - const SdrObject* pObj = rFmt.FindRealSdrObject(); - - Rectangle aRect; - const SwFmtVertOrient& rVOr = rFmt.GetVertOrient(); - const SwFmtHoriOrient& rHOr = rFmt.GetHoriOrient(); - if (RES_FLYFRMFMT == rFmt.Which()) - { - Point aObjPos; - SwRect aLayRect(rFmt.FindLayoutRect(false, &aObjPos)); - // the Object is not visible - so get the values from - // the format. The Position may not be correct. - if( aLayRect.IsEmpty() ) - aRect.SetSize( rFmt.GetFrmSize().GetSize() ); - else - aRect = aLayRect.SVRect(); - - aRect -= aIter->maParentPos; - aObjPos = aRect.TopLeft(); - if (VERT_NONE == rVOr.GetVertOrient()) - aObjPos.Y() = rVOr.GetPos(); - if (HORI_NONE == rHOr.GetHoriOrient()) - aObjPos.X() = rHOr.GetPos(); - aRect.SetPos( aObjPos ); - } - else - { - ASSERT(pObj, "wo ist das SDR-Object?"); - if (pObj) - aRect = pObj->GetSnapRect(); - aRect -= aIter->maParentPos; - } + Rectangle aRect = FindLayoutRect(rFmt, aIter->maParentPos); // spid SwWW8Writer::WriteLong(*rWrt.pTableStrm, aIter->mnShapeId); @@ -307,13 +314,13 @@ //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() + + SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Left() + aIter->mnThick); - SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + + SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Top() + aIter->mnThick); - SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Right() - + SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Right() - aIter->mnThick); - SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - + SwWW8Writer::WriteLong(*rWrt.pTableStrm, aRect.Bottom() - aIter->mnThick); //fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock @@ -347,6 +354,7 @@ nFlags |= 0x0400 | nContour; break; } + const SdrObject* pObj = rFmt.FindRealSdrObject(); if( pObj && pObj->GetLayer() == rWrt.pDoc->GetHellId() ) nFlags |= 0x4000; @@ -1076,7 +1084,13 @@ } } -/* */ +void WinwordAnchoring::WriteInline(EscherEx& rEx) const +{ + rEx.AddAtom(24, DFF_msofbtUDefProp, 3, 4 ); //Prop id is 0xF122 + SvStream& rSt = rEx.GetStream(); + rSt << (UINT16)0x0390 << 3L; + rSt << (UINT16)0x0392 << 3L; +} void SwWW8Writer::CreateEscher() { @@ -1145,6 +1159,27 @@ GetStream() << 0x80000000; } +INT32 SwBasicEscherEx::WriteDummyFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) +{ + INT32 nBorderThick=0; + OpenContainer( ESCHER_SpContainer ); + + AddShape(ESCHER_ShpInst_PictureFrame, 0xa00, nShapeId); + + EscherPropertyContainer aPropOpt; + + nBorderThick = WriteFlyFrameAttr(rFmt, mso_sptPictureFrame, aPropOpt); + + WinwordAnchoring aWinwordAnchoring; + aWinwordAnchoring.WriteInline(*this); + + aPropOpt.Commit(GetStream()); + + CloseContainer(); // ESCHER_SpContainer + return nBorderThick; +} + + INT32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId) { INT32 nBorderThick=0; @@ -1156,69 +1191,69 @@ UINT32 nFlags = ESCHER_BlipFlagDefault; SwNodeIndex aIdx( *rFmt.GetCntnt().GetCntntIdx(), 1 ); - SwGrfNode& rGrfNd = *aIdx.GetNode().GetGrfNode(); - if( rGrfNd.IsLinkedFile() ) - { - String sURL; - rGrfNd.GetFileFilterNms( &sURL, 0 ); + SwGrfNode &rGrfNd = *aIdx.GetNode().GetGrfNode(); + if(rGrfNd.IsLinkedFile()) + { + String sURL; + rGrfNd.GetFileFilterNms( &sURL, 0 ); - WW8Bytes aBuf; - SwWW8Writer::InsAsString16( aBuf, sURL ); - SwWW8Writer::InsUInt16( aBuf, 0 ); - - USHORT nArrLen = aBuf.Count(); - BYTE* pArr = new BYTE[ nArrLen ]; - memcpy( pArr, aBuf.GetData(), nArrLen ); - - aPropOpt.AddOpt(ESCHER_Prop_pibName, true, nArrLen, pArr, nArrLen); - nFlags = ESCHER_BlipFlagLinkToFile | ESCHER_BlipFlagURL | - ESCHER_BlipFlagDoNotSave; - } - else - { - rGrfNd.SwapIn(true); + WW8Bytes aBuf; + SwWW8Writer::InsAsString16( aBuf, sURL ); + SwWW8Writer::InsUInt16( aBuf, 0 ); + + USHORT nArrLen = aBuf.Count(); + BYTE* pArr = new BYTE[ nArrLen ]; + memcpy( pArr, aBuf.GetData(), nArrLen ); + + aPropOpt.AddOpt(ESCHER_Prop_pibName, true, nArrLen, pArr, nArrLen); + nFlags = ESCHER_BlipFlagLinkToFile | ESCHER_BlipFlagURL | + ESCHER_BlipFlagDoNotSave; + } + else + { + rGrfNd.SwapIn(true); - Graphic aGraphic( rGrfNd.GetGrf() ); - GraphicObject aGraphicObject( aGraphic ); - ByteString aUniqueId = aGraphicObject.GetUniqueID(); + Graphic aGraphic(rGrfNd.GetGrf()); + GraphicObject aGraphicObject(aGraphic); + ByteString aUniqueId = aGraphicObject.GetUniqueID(); - if ( aUniqueId.Len() ) - { - const MapMode aMap100mm( MAP_100TH_MM ); - Size aSize( aGraphic.GetPrefSize() ); + if ( aUniqueId.Len() ) + { + const MapMode aMap100mm( MAP_100TH_MM ); + Size aSize( aGraphic.GetPrefSize() ); - if ( MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit() ) + if ( MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit() ) { - aSize = Application::GetDefaultDevice()->PixelToLogic( + aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, aMap100mm ); } - else + else { - aSize = OutputDevice::LogicToLogic( aSize, + aSize = OutputDevice::LogicToLogic( aSize, aGraphic.GetPrefMapMode(), aMap100mm ); } - Point aEmptyPoint = Point(); - Rectangle aRect( aEmptyPoint, aSize ); + Point aEmptyPoint = Point(); + Rectangle aRect( aEmptyPoint, aSize ); - sal_uInt32 nBlibId = GetBlibID( *QueryPicStream(), aUniqueId, + sal_uInt32 nBlibId = GetBlibID( *QueryPicStream(), aUniqueId, aRect, 0 ); - if ( nBlibId ) - { - aPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); - aPropOpt.AddOpt( ESCHER_Prop_pib, nBlibId, sal_True ); - } - } - } + if (nBlibId) + { + aPropOpt.AddOpt(ESCHER_Prop_fillType, ESCHER_FillPicture); + aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True); + } + } + } - aPropOpt.AddOpt( ESCHER_Prop_pibFlags, nFlags ); - nBorderThick = WriteFlyFrameAttr(rFmt,mso_sptPictureFrame,aPropOpt); - WriteGrfAttr( rGrfNd, aPropOpt ); - - aPropOpt.Commit( GetStream() ); + aPropOpt.AddOpt(ESCHER_Prop_pibFlags, nFlags); + nBorderThick = WriteFlyFrameAttr(rFmt,mso_sptPictureFrame,aPropOpt); + WriteGrfAttr(rGrfNd, aPropOpt); + + aPropOpt.Commit(GetStream()); // store anchor attribute - WriteFrmExtraData( rFmt ); + WriteFrmExtraData(rFmt); CloseContainer(); // ESCHER_SpContainer return nBorderThick; @@ -2158,7 +2193,7 @@ void SwEscherEx::WriteFrmExtraData( const SwFrmFmt& rFmt ) { - aWinwordAnchoring.SetAnchoring(rFmt ); + aWinwordAnchoring.SetAnchoring(rFmt); aWinwordAnchoring.WriteData(*this); AddAtom(4, ESCHER_ClientAnchor); Index: wrtw8nds.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8nds.cxx,v retrieving revision 1.36 diff -u -r1.36 wrtw8nds.cxx --- wrtw8nds.cxx 28 Aug 2002 15:55:03 -0000 1.36 +++ wrtw8nds.cxx 18 Sep 2002 08:32:09 -0000 @@ -2111,12 +2111,36 @@ { const SwFmtAnchor& rAnch = rFrmFmt.GetAnchor(); - /* - ##897## - Note that something anchored as a character must be - exported using the older WW6 mechanism - */ - if( !bWrtWW8 || (FLY_IN_CNTNT == rAnch.GetAnchorId()) ) + bool bUseTraditionalInline = false; + if (!bWrtWW8) + bUseTraditionalInline = true; + else + { + /* + ##897## + Note that something anchored as a character must be exported with a + shape field with a 0x1 empty graphic following the 0x8 + */ + if (FLY_IN_CNTNT == rAnch.GetAnchorId()) + { + if (const SwNodeIndex* pNdIdx = rFrmFmt.GetCntnt().GetCntntIdx()) + { + SwNodeIndex aIdx( *pNdIdx, 1 ); + switch( aIdx.GetNode().GetNodeType() ) + { + case ND_GRFNODE: + case ND_OLENODE: + bUseTraditionalInline = true; + break; + default: + bUseTraditionalInline = false; + break; + } + } + } + } + + if (bUseTraditionalInline) { if( RES_DRAWFRMFMT == rFrmFmt.Which() ) { @@ -2202,12 +2226,31 @@ } else { + if (FLY_IN_CNTNT == rAnch.GetAnchorId()) + { + String sShape(CREATE_CONST_ASC(" SHAPE ")); + OutField(0, 95, sShape, WRITEFIELD_START | WRITEFIELD_CMD_START | + WRITEFIELD_CMD_END); + } + // write as escher WW8_CP nCP = Fc2Cp( Strm().Tell() ); AppendFlyInFlys( nCP, rFrmFmt, rNdTopLeft ); + + if (FLY_IN_CNTNT == rAnch.GetAnchorId()) + { + Point aTopLeft(0,0); + Rectangle aRect = PlcDrawObj::FindLayoutRect(rFrmFmt, aTopLeft); + nFlyWidth = aRect.GetWidth(); // Fuer Anpassung Graphic-Groesse + nFlyHeight = aRect.GetHeight(); + SwFlyFrmFmt *pOld = pFlyFmt; + pFlyFmt = (SwFlyFrmFmt*)&rFrmFmt; + OutGrf(0); //0x1 graphic + pFlyFmt = pOld; + OutField(0, 95, aEmptyStr, WRITEFIELD_END | WRITEFIELD_CLOSE); + } } } - void SwWW8Writer::OutFlyFrms( const SwCntntNode& rNode ) { Index: wrtww8.hxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtww8.hxx,v retrieving revision 1.34 diff -u -r1.34 wrtww8.hxx --- wrtww8.hxx 19 Aug 2002 15:11:56 -0000 1.34 +++ wrtww8.hxx 18 Sep 2002 08:32:10 -0000 @@ -354,6 +354,7 @@ const ::std::vector &GetObjArr() const { return maDrawObjs; } void SetShapeDetails( const SwFrmFmt& rFmt, UINT32 nId, INT32 nThick ); virtual ~PlcDrawObj(); + static Rectangle FindLayoutRect(const SwFrmFmt &rFmt, Point aTopLeft); }; class MainTxtPlcDrawObj : public PlcDrawObj Index: wrtww8gr.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtww8gr.cxx,v retrieving revision 1.22 diff -u -r1.22 wrtww8gr.cxx --- wrtww8gr.cxx 28 Aug 2002 12:15:07 -0000 1.22 +++ wrtww8gr.cxx 18 Sep 2002 08:32:10 -0000 @@ -800,17 +800,47 @@ void SwWW8WrGrf::Write1Grf( SvStream& rStrm, const SwNoTxtNode* pNd, const SwFlyFrmFmt* pFly, UINT16 nWidth, UINT16 nHeight ) { - if( !pNd || ( !pNd->IsGrfNode() && !pNd->IsOLENode() ) ) + if (pNd && (!pNd->IsGrfNode() && !pNd->IsOLENode())) return; UINT32 nPos = rStrm.Tell(); // Grafik-Anfang merken - if( pNd->IsGrfNode() ) + if (!pNd) + { + ASSERT(rWrt.bWrtWW8 && pFly, "This only makes sense for ww8 and the" + "shape field dummy 0x1 to shadow the 0x8 escher image"); + if (!(rWrt.bWrtWW8 && pFly)) + return; +#if 1 + BYTE aArr[ 0x44 ] = { 0 }; + BYTE *pArr = aArr + 4; + Set_UInt16(pArr, sizeof(aArr)); + Set_UInt16(pArr, 0x64); + + Set_UInt16(pArr, nWidth * 254L / 144); + Set_UInt16(pArr, nHeight * 254L / 144); + pArr += 16; + Set_UInt16(pArr, nWidth); + Set_UInt16(pArr, nHeight); + + double fVal = nWidth * 1000.0 / (nWidth); + Set_UInt16(pArr, (USHORT)SolarMath::Round(fVal)); + + fVal = nHeight * 1000.0 / (nHeight); + Set_UInt16(pArr, (USHORT)SolarMath::Round(fVal)); + + rStrm.Write(aArr, sizeof(aArr)); +#endif + SwBasicEscherEx aInlineEscher(&rStrm, rWrt); + aInlineEscher.WriteDummyFlyFrame(*pFly, 0x401); + aInlineEscher.WritePictures(); + } + else if (pNd->IsGrfNode()) { const SwGrfNode* pGrfNd = pNd->GetGrfNode(); Write1Grf1( rStrm, pGrfNd, pFly, nWidth, nHeight ); } - else if( pNd->IsOLENode() ) + else if (pNd->IsOLENode()) { // cast away const SwOLENode *pOleNd = ((SwNoTxtNode*)pNd)->GetOLENode(); Index: ww8graf.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/ww8graf.cxx,v retrieving revision 1.78 diff -u -r1.78 ww8graf.cxx --- ww8graf.cxx 29 Aug 2002 11:21:48 -0000 1.78 +++ ww8graf.cxx 18 Sep 2002 08:32:11 -0000 @@ -1764,21 +1764,30 @@ 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 // Rahmen-GROESSE benoetigt! @@ -1867,8 +1876,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) + //graphic in relation to the top left inside the border. We don't. + //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)); @@ -2393,37 +2403,38 @@ + pWwFib->ccpHdr + pWwFib->ccpMcr + pWwFib->ccpAtn + pWwFib->ccpEdn; - if( pPlcxMan->GetManType() == MAN_HDFT ) + if (pPlcxMan->GetManType() == MAN_HDFT) nDrawCpO += pWwFib->ccpTxbx; - if( !pDrawModel )// 1. GrafikObjekt des Docs + if (!pDrawModel)// 1. GrafikObjekt des Docs GrafikCtor(); WW8PLCFspecial* pPF = pPlcxMan->GetFdoa(); - if( !pPF ) + if (!pPF) { - ASSERT( !this, "Where is the grapic (1) ?" ); + ASSERT(!this, "Where is the grapic (1) ?"); return 0; } - if( bVer67 ) + if (bVer67) { long nOldPos = pStrm->Tell(); nDrawXOfs = nDrawYOfs = 0; - ReadGrafLayer1( pPF, nGrafAnchorCp ); + ReadGrafLayer1(pPF, nGrafAnchorCp); - pStrm->Seek( nOldPos ); + pStrm->Seek(nOldPos); return 0; } //Normal case of Word 8+ version stuff - pPF->SeekPos( nGrafAnchorCp ); + pPF->SeekPos(nGrafAnchorCp); long nStartFc; void* pF0; - if( !pPF->Get( nStartFc, pF0 ) ){ - ASSERT( !this, "+Wo ist die Grafik (2) ?" ); + if (!pPF->Get(nStartFc, pF0)) + { + ASSERT(!this, "+Wo ist die Grafik (2) ?"); return 0; } @@ -2473,7 +2484,6 @@ break; default: break; - } // Umfluss-Modus ermitteln @@ -2551,16 +2561,32 @@ } RndStdIds eAnchor = FLY_AT_CNTNT; - if (pF->nby != WW8_FSPA::RelText) + + /* + #i3958# + If we are in a shape field, then we are to be anchored as character + and ignore the actual anchoring information + */ + if (IsInlineEscherHack()) { - if( bIsHeader || bIsFooter) - pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode(); - else - eAnchor = FLY_PAGE; + eAnchor = FLY_IN_CNTNT; + SwFmtAnchor aAnchor(eAnchor); + aAnchor.SetAnchor(pPaM->GetPoint()); + aFlySet.Put(aAnchor); } + else + { + if (pF->nby != WW8_FSPA::RelText) + { + if (bIsHeader || bIsFooter) + pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode(); + else + eAnchor = FLY_PAGE; + } - if (pRecord) - eAnchor = ProcessEscherAlign(pRecord, pF, aFlySet, bReplaceable); + if (pRecord) + 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)) && @@ -2809,7 +2835,12 @@ ASSERT(pRetFrmFmt->GetAnchor().GetAnchorId() == eAnchor, "Not the anchor type requested!"); - 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); // falls alles Ok, Zeiger auf neues Objekt ermitteln und Z-Order-Liste // entsprechend korrigieren (oder Eintrag loeschen) Index: ww8par.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/ww8par.cxx,v retrieving revision 1.84 diff -u -r1.84 ww8par.cxx --- ww8par.cxx 22 Aug 2002 11:13:40 -0000 1.84 +++ ww8par.cxx 18 Sep 2002 08:32:11 -0000 @@ -1840,7 +1840,6 @@ // reset the flags. bObj = bEmbeddObj = false; nObjLocFc = 0; - pFmtOfJustInsertedGraphicOrOLE = pResult; //##515## set nLastFlyNode so we can determine if a section //has ended with this paragraph unclosed nLastFlyNode = (*pPaM->GetPoint()).nNode.GetIndex(); @@ -1848,7 +1847,7 @@ } break; case 0x8: - if( !bObj ) + if (!bObj) { Read_GrafLayer( nPosCp ); //##515##. Set nLastFlyNode so we can determine if a @@ -2074,14 +2073,15 @@ bool b = pPlcxMan->Get(&aRes); // hole Attribut-Pos - if( !b - && (aRes.nSprmId >= 0) // nur Attributenden noch bearbeiten, - && ( (aRes.nSprmId < eFTN) - || (aRes.nSprmId >= 0x0800) ) - ) - { // Anfaenge gehoeren zum naechsten Spezialtext - EndSprm( aRes.nSprmId ); // Fussnoten und Felder ignorieren - } + // nur Attributenden noch bearbeiten, + if ((aRes.nSprmId > 0) && + ((aRes.nSprmId < eFTN) || (aRes.nSprmId >= 0x0800))) + { + if (b) + ImportSprm(aRes.pMemPos, aRes.nSprmId); + else + EndSprm(aRes.nSprmId ); + } (*pPlcxMan)++; rNext = pPlcxMan->Where(); } @@ -2245,7 +2245,6 @@ pWFlyPara = 0; pSFlyPara = 0; pFlyFmtOfJustInsertedGraphic = 0; - pFmtOfJustInsertedGraphicOrOLE = 0; nColls = nAktColl = 0; nObjLocFc = nPicLocFc = 0; nTable=0; Index: ww8par.hxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/ww8par.hxx,v retrieving revision 1.89 diff -u -r1.89 ww8par.hxx --- ww8par.hxx 29 Aug 2002 11:21:48 -0000 1.89 +++ ww8par.hxx 18 Sep 2002 08:32:11 -0000 @@ -667,7 +667,6 @@ SwMSConvertControls *pFormImpl; // Control-Implementierung SwFlyFrmFmt* pFlyFmtOfJustInsertedGraphic; - SwFrmFmt* pFmtOfJustInsertedGraphicOrOLE; /* Keep track of generated Ruby character formats we we can minimize the @@ -833,7 +832,7 @@ bool bWWBugNormal; // WW-Version nit Bug Dya in Style Normal bool bNoAttrImport; // Attribute ignorieren zum Ignorieren v. Styles bool bInHyperlink; // Sonderfall zum einlesen eines 0x01 - // siehe: SwWW8ImplReader::Read_F_Hyperlink() + // siehe: SwWW8ImplReader::Read_F_Hyperlink() bool bVerticalEnviron; bool bWasParaEnd; @@ -1148,6 +1147,9 @@ void SetOutLineStyles(); + bool IsInlineEscherHack() + {return !maFieldStack.empty() ? maFieldStack.top() == 95 : false; }; + //No copying SwWW8ImplReader(const SwWW8ImplReader &); SwWW8ImplReader& operator=(const SwWW8ImplReader&); @@ -1291,8 +1293,9 @@ eF_ResT Read_F_IncludeText( WW8FieldDesc*, String& rStr ); eF_ResT Read_F_Seq( WW8FieldDesc*, String& rStr ); - eF_ResT Read_F_OCX( WW8FieldDesc*, String& ); - eF_ResT Read_F_Hyperlink( WW8FieldDesc*, String& rStr ); + 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.49 diff -u -r1.49 ww8par5.cxx --- ww8par5.cxx 19 Aug 2002 15:12:02 -0000 1.49 +++ ww8par5.cxx 18 Sep 2002 08:32:12 -0000 @@ -701,7 +701,8 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) { typedef eF_ResT (SwWW8ImplReader:: *FNReadField)( WW8FieldDesc*, String& ); - static FNReadField aWW8FieldTab[93] = + enum Limits {eMax = 96}; + static FNReadField aWW8FieldTab[eMax+1] = { 0, 0, @@ -799,10 +800,14 @@ 0, // 89 0, // 90 0, // 91 - 0 // 92 - Dummy leer Methode - }; // 92 == alle ueber 91 + 0, // 92 + 0, // 93 + 0, // 94 + &SwWW8ImplReader::Read_F_Shape, // 95 + 0 // eMax - Dummy leer Methode + }; // eMax == alle ueber eMax-1 - ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == 93 ), + ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == eMax+1 ), "FeldFunc-Tabelle stimmt nicht" ); if( nIniFlags & WW8FL_NO_FLD ) return 0; @@ -820,23 +825,23 @@ maFieldStack.push(aF.nId); - USHORT n = ( aF.nId <= 91 ) ? aF.nId : 92; // alle > 91 werden 92 + USHORT n = (aF.nId < eMax) ? aF.nId : eMax; // alle > eMax-1 werden eMax USHORT nI = n / 32; // # des UINT32 ULONG nMask = 1 << ( n % 32 ); // Maske fuer Bits if( nFieldTagAlways[nI] & nMask ) // Flag: Tag it return Read_F_Tag( &aF ); // Resultat nicht als Text - if( !bOk || !aF.nId ) // Feld kaputt + if (!bOk || !aF.nId) // Feld kaputt return aF.nLen; // -> ignorieren - if( aF.nId > 91 -// || ( aF.nOpt & 0x40 ) // 0x40-Result Nest -> OK - ) // WW: Nested Field + if (aF.nId > eMax-1) + { if( nFieldTagBad[nI] & nMask ) // Flag: Tag it when bad return Read_F_Tag( &aF ); // Resultat nicht als Text else return aF.nLen; + } if( aWW8FieldTab[aF.nId] == 0 // keine Routine vorhanden || aF.bCodeNest ) @@ -2924,7 +2929,17 @@ return FLD_OK; } -eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* pF, String& rStr ) +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_Hyperlink(WW8FieldDesc* pF, String& rStr) { eF_ResT eRet = FLD_OK; String sURL, sTarget, sMark;