? i2916patch.diff Index: wrtw8esh.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8esh.cxx,v retrieving revision 1.48 diff -r1.48 wrtw8esh.cxx 2012a2013,2028 > // i2916 > // RndStdIds: FLY_AUTO_CNTNT: 1 > // > // As for FLY_AT_CNTNT with the addition > // of following. > // > // SwRelationOrient: REL_CHAR: 8 > // | > 0x01080013, > 0x01080113, > 0x01080233, > 0x01080333, > 0x01080423, > 0x01080503, > > Index: wrtw8nds.cxx =================================================================== RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8nds.cxx,v retrieving revision 1.39 diff -r1.39 wrtw8nds.cxx 296a297,298 > SwPosFlyFrms maFlyFrms; // i2916 > 310a313 > ~WW8_SwAttrIter(); //i2916 390a394,423 > // i2916 > // Create list of any graphics which may be anchored in this > // paragraph. > { > SwPosFlyFrms maAllFlys; > > rWrt.pDoc->GetAllFlyFmts(maAllFlys, rWrt.bWriteAll ? 0 : rWrt.GetEndPaM(), rWrt.bWrtWW8); > ULONG nCurPos = rNd.GetIndex(); > > for (USHORT n = 0; n < maAllFlys.Count(); n++) > { > ULONG flyNdPos = maAllFlys[n]->GetNdIndex().GetIndex(); > > if (flyNdPos == nCurPos) > { > maFlyFrms.Insert(maAllFlys[n]); > } > else > { > // If the array was sorted on the node indices we could > // break, but unfortunately its only sorted on the pointer > // of the fly objects. > > // Instead, can delete the ones we're not using. > // Elimintates dangling references when maFlyFrms is disposed of > delete maAllFlys[n]; > } > } > } > 398a432,441 > WW8_SwAttrIter::~WW8_SwAttrIter() > { > //i2916 > // Need to release the contents of maFlyFrms > for (int i = 0; i < maFlyFrms.Count(); i++) > { > delete maFlyFrms[i]; > } > } > 500a544,569 > // i2916 > // Check to see if there are any graphics anchored to characters > // in this paragraph's text. > // Set nMinPos to 1 past the placement because anchors in Word > // appear after the character they are anchored to. > if (maFlyFrms.Count() > 0) > { > for (i = 0; i < maFlyFrms.Count(); i++) > { > const SwPosition* pAnchorPos = maFlyFrms[i]->GetFmt().GetAnchor().GetCntntAnchor(); > > nPos = pAnchorPos->nContent.GetIndex(); > if (nPos >= nStartPos && nPos <= nMinPos) > { > nMinPos = nPos; > } > > nPos++; > > if (nPos >= nStartPos && nPos <= nMinPos) > { > nMinPos = nPos; > } > } > } > 586a656,685 > // i2916 > // May have an anchored graphic to be placed. > if (maFlyFrms.Count() > 0) > { > for (xub_StrLen i = 0; i < maFlyFrms.Count(); i++) > { > const SwFmtAnchor& rAnchor = maFlyFrms[i]->GetFmt().GetAnchor(); > > const SwPosition* pAnchorPos = rAnchor.GetCntntAnchor(); > > xub_StrLen nPos = pAnchorPos->nContent.GetIndex(); > > if (nPos == nSwPos) > { > const SwFrmFmt& rFmt = maFlyFrms[i]->GetFmt(); > > if ( rAnchor.GetAnchorId() == FLY_AUTO_CNTNT ) > { > // OutWW8FlyFrm will flush the attributes > // for the anchored character. > Point aNdPos = rNd.FindLayoutRect(false, &aNdPos).Pos(); > Point* pLayPos = &aNdPos; > > rWrt.OutWW8FlyFrm(rFmt, *pLayPos); > } > break; > } > } > } > 603a703 > 2330c2430,2441 < OutWW8FlyFrm( rFmt, *pLayPos ); --- > > // i2916: > // Anchored Escher objects should be dealt with by the > // Attribute Iterator as part of the text processing, > // in a similar manner to inline graphics, rather than > // simply writing them all out at the start of the > // paragraph. > if ( rFmt.GetAnchor().GetAnchorId() != FLY_AUTO_CNTNT ) > { > OutWW8FlyFrm( rFmt, *pLayPos ); > } >