Line 297
Link Here
|
|
|
297 |
SwPosFlyFrms maFlyFrms; // i2916 |
298 |
|
Line 311
Link Here
|
|
|
313 |
~WW8_SwAttrIter(); //i2916 |
Line 391
Link Here
|
|
|
394 |
// i2916 |
395 |
// Create list of any graphics which may be anchored in this |
396 |
// paragraph. |
397 |
{ |
398 |
SwPosFlyFrms maAllFlys; |
399 |
|
400 |
rWrt.pDoc->GetAllFlyFmts(maAllFlys, rWrt.bWriteAll ? 0 : rWrt.GetEndPaM(), rWrt.bWrtWW8); |
401 |
ULONG nCurPos = rNd.GetIndex(); |
402 |
|
403 |
for (USHORT n = 0; n < maAllFlys.Count(); n++) |
404 |
{ |
405 |
ULONG flyNdPos = maAllFlys[n]->GetNdIndex().GetIndex(); |
406 |
|
407 |
if (flyNdPos == nCurPos) |
408 |
{ |
409 |
maFlyFrms.Insert(maAllFlys[n]); |
410 |
} |
411 |
else |
412 |
{ |
413 |
// If the array was sorted on the node indices we could |
414 |
// break, but unfortunately its only sorted on the pointer |
415 |
// of the fly objects. |
416 |
|
417 |
// Instead, can delete the ones we're not using. |
418 |
// Elimintates dangling references when maFlyFrms is disposed of |
419 |
delete maAllFlys[n]; |
420 |
} |
421 |
} |
422 |
} |
423 |
|
Line 399
Link Here
|
|
|
432 |
WW8_SwAttrIter::~WW8_SwAttrIter() |
433 |
{ |
434 |
//i2916 |
435 |
// Need to release the contents of maFlyFrms |
436 |
for (int i = 0; i < maFlyFrms.Count(); i++) |
437 |
{ |
438 |
delete maFlyFrms[i]; |
439 |
} |
440 |
} |
441 |
|
Line 501
Link Here
|
|
|
544 |
// i2916 |
545 |
// Check to see if there are any graphics anchored to characters |
546 |
// in this paragraph's text. |
547 |
// Set nMinPos to 1 past the placement because anchors in Word |
548 |
// appear after the character they are anchored to. |
549 |
if (maFlyFrms.Count() > 0) |
550 |
{ |
551 |
for (i = 0; i < maFlyFrms.Count(); i++) |
552 |
{ |
553 |
const SwPosition* pAnchorPos = maFlyFrms[i]->GetFmt().GetAnchor().GetCntntAnchor(); |
554 |
|
555 |
nPos = pAnchorPos->nContent.GetIndex(); |
556 |
if (nPos >= nStartPos && nPos <= nMinPos) |
557 |
{ |
558 |
nMinPos = nPos; |
559 |
} |
560 |
|
561 |
nPos++; |
562 |
|
563 |
if (nPos >= nStartPos && nPos <= nMinPos) |
564 |
{ |
565 |
nMinPos = nPos; |
566 |
} |
567 |
} |
568 |
} |
569 |
|
Line 587
Link Here
|
|
|
656 |
// i2916 |
657 |
// May have an anchored graphic to be placed. |
658 |
if (maFlyFrms.Count() > 0) |
659 |
{ |
660 |
for (xub_StrLen i = 0; i < maFlyFrms.Count(); i++) |
661 |
{ |
662 |
const SwFmtAnchor& rAnchor = maFlyFrms[i]->GetFmt().GetAnchor(); |
663 |
|
664 |
const SwPosition* pAnchorPos = rAnchor.GetCntntAnchor(); |
665 |
|
666 |
xub_StrLen nPos = pAnchorPos->nContent.GetIndex(); |
667 |
|
668 |
if (nPos == nSwPos) |
669 |
{ |
670 |
const SwFrmFmt& rFmt = maFlyFrms[i]->GetFmt(); |
671 |
|
672 |
if ( rAnchor.GetAnchorId() == FLY_AUTO_CNTNT ) |
673 |
{ |
674 |
// OutWW8FlyFrm will flush the attributes |
675 |
// for the anchored character. |
676 |
Point aNdPos = rNd.FindLayoutRect(false, &aNdPos).Pos(); |
677 |
Point* pLayPos = &aNdPos; |
678 |
|
679 |
rWrt.OutWW8FlyFrm(rFmt, *pLayPos); |
680 |
} |
681 |
break; |
682 |
} |
683 |
} |
684 |
} |
685 |
|
Line 604
Link Here
|
|
|
703 |
|
Line 2330
Link Here
|
2330 |
OutWW8FlyFrm( rFmt, *pLayPos ); |
2430 |
|
2331 |
-- |
2431 |
// i2916: |
|
|
2432 |
// Anchored Escher objects should be dealt with by the |
2433 |
// Attribute Iterator as part of the text processing, |
2434 |
// in a similar manner to inline graphics, rather than |
2435 |
// simply writing them all out at the start of the |
2436 |
// paragraph. |
2437 |
if ( rFmt.GetAnchor().GetAnchorId() != FLY_AUTO_CNTNT ) |
2438 |
{ |
2439 |
OutWW8FlyFrm( rFmt, *pLayPos ); |
2440 |
} |
2441 |
|