? i3958_m.patch Index: escher.hxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/escher.hxx,v retrieving revision 1.3 diff -u -r1.3 escher.hxx --- escher.hxx 7 Nov 2002 16:54:12 -0000 1.3 +++ escher.hxx 20 Nov 2002 14:21:30 -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; @@ -104,6 +105,7 @@ virtual void SetPicId(const SdrObject &, UINT32, EscherPropertyContainer &); public: SwBasicEscherEx(SvStream* pStrm, SwWW8Writer& rWrt, UINT32 nDrawings = 1); + INT32 WriteDummyFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId); INT32 WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId); INT32 WriteOLEFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId); virtual void WriteFrmExtraData(const SwFrmFmt&); Index: wrtw8esh.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8esh.cxx,v retrieving revision 1.53 diff -u -r1.53 wrtw8esh.cxx --- wrtw8esh.cxx 7 Nov 2002 16:54:13 -0000 1.53 +++ wrtw8esh.cxx 20 Nov 2002 14:21:31 -0000 @@ -250,6 +250,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- @@ -277,37 +314,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); @@ -315,13 +322,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 @@ -355,6 +362,7 @@ nFlags |= 0x0400 | nContour; break; } + const SdrObject* pObj = rFmt.FindRealSdrObject(); if( pObj && pObj->GetLayer() == rWrt.pDoc->GetHellId() ) nFlags |= 0x4000; @@ -1098,7 +1106,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() { @@ -1164,6 +1178,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; @@ -1175,69 +1210,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; Index: wrtw8nds.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8nds.cxx,v retrieving revision 1.41 diff -u -r1.41 wrtw8nds.cxx --- wrtw8nds.cxx 7 Nov 2002 16:54:13 -0000 1.41 +++ wrtw8nds.cxx 20 Nov 2002 14:21:31 -0000 @@ -2283,12 +2283,38 @@ { 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()) ) + const SwFmtVertOrient& rVOr = rFrmFmt.GetVertOrient(); + + 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() ) { @@ -2374,12 +2400,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.39 diff -u -r1.39 wrtww8.hxx --- wrtww8.hxx 7 Nov 2002 16:54:14 -0000 1.39 +++ wrtww8.hxx 20 Nov 2002 14:21:31 -0000 @@ -355,6 +355,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); private: //No copying PlcDrawObj(const PlcDrawObj&); Index: wrtww8gr.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtww8gr.cxx,v retrieving revision 1.26 diff -u -r1.26 wrtww8gr.cxx --- wrtww8gr.cxx 7 Nov 2002 16:54:15 -0000 1.26 +++ wrtww8gr.cxx 20 Nov 2002 14:21:32 -0000 @@ -750,12 +750,44 @@ void SwWW8WrGrf::WriteGraphicNode(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 0x01 to shadow the 0x08 escher image."); + + if (!(rWrt.bWrtWW8 && pFly)) + return; + + 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)); + + SwBasicEscherEx aInlineEscher(&rStrm, rWrt); + aInlineEscher.WriteDummyFlyFrame(*pFly, 0x0401); + aInlineEscher.WritePictures(); + } + else if (pNd->IsGrfNode()) WriteGrfFromGrfNode(rStrm, pNd->GetGrfNode(), pFly, nWidth, nHeight); else if (pNd->IsOLENode()) { Index: ww8graf.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/ww8graf.cxx,v retrieving revision 1.87 diff -u -r1.87 ww8graf.cxx --- ww8graf.cxx 7 Nov 2002 16:54:16 -0000 1.87 +++ ww8graf.cxx 20 Nov 2002 14:21:32 -0000 @@ -1771,21 +1771,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! @@ -1874,8 +1883,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)); @@ -2426,37 +2436,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; } @@ -2506,7 +2517,6 @@ break; default: break; - } // Umfluss-Modus ermitteln @@ -2583,14 +2593,34 @@ pF->nby = WW8_FSPA::RelPageBorder; } - if (pF->nby != WW8_FSPA::RelText) - { - if (bIsHeader || bIsFooter) - pNode_FLY_AT_CNTNT = &pPaM->GetPoint()->nNode.GetNode(); - } + RndStdIds eAnchor; - RndStdIds eAnchor = ProcessEscherAlign(pRecord, pF, aFlySet, - bReplaceable); + /* + #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(); + } + + 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)) && @@ -2839,7 +2869,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.hxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/ww8par.hxx,v retrieving revision 1.101 diff -u -r1.101 ww8par.hxx --- ww8par.hxx 11 Nov 2002 13:31:03 -0000 1.101 +++ ww8par.hxx 20 Nov 2002 14:21:33 -0000 @@ -844,7 +844,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; @@ -1159,6 +1159,9 @@ void SetOutLineStyles(); //No copying + bool IsInlineEscherHack() + {return !maFieldStack.empty() ? maFieldStack.top() == 95 : false; }; + SwWW8ImplReader(const SwWW8ImplReader &); SwWW8ImplReader& operator=(const SwWW8ImplReader&); public: // eigentlich private, geht aber leider nur public @@ -1304,8 +1307,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.57 diff -u -r1.57 ww8par5.cxx --- ww8par5.cxx 12 Nov 2002 11:25:50 -0000 1.57 +++ ww8par5.cxx 20 Nov 2002 14:21:34 -0000 @@ -766,7 +766,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, @@ -864,10 +865,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" ); WW8PLCFx_FLD* pF = pPlcxMan->GetFld(); @@ -900,7 +905,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 @@ -910,7 +915,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 @@ -3029,7 +3034,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) { String sURL, sTarget, sMark; bool bDataImport = false;