-
Luboš Luňák yazdı
The SwFrmFmtAnchorMap class provides reverse mapping to SwFrmFmt::GetAnchor().GetCntntAnchor(), so that when code somewhere needs to update SwFrmFmt's anchored at a position, it's not necessary to iterate over all of them (which can be a large number e.g. with mail merge). One special catch with the multimap of SwNodeIndex keys is that the values of those keys change (whenever the node structure of the document changes, indexes of nodes change as a result). This makes it impossible to use any hashing container, as the hashes would change without the container noticing, but multimap should work fine, as it just requires that the keys remain sorted, and that is the case. Nevertheless, the old code in the two converted places is intentionally left there in debug mode to verify the reverse mapping is updated correctly. I intentionally went with SwNodeIndex rather than SwPosition, as SwIndex (the other component of SwPosition) was causing some trouble (see e.g. the SwPosition comparison operator< , where two same positions are different if one is registered and the other not) and it doesn't appear to be actually necessary. Change-Id: I7f1768558f60155d4ba83c84aa7f9e34dc65ebf9
738fb2ad