Exemplo n.º 1
0
		/// <summary>
		/// Figure what the new contents needs to be. (Also sets OldContents.)
		/// </summary>
		/// <param name="cache"></param>
		public void MakeNewContents(FdoCache cache, string oldSpelling, string newSpelling, RespellUndoAction action)
		{
			m_oldContents = RespellUndoAction.AnnotationTargetString(m_hvoTarget, m_flid, m_ws, cache);
			ITsStrBldr bldr = m_oldContents.GetBldr();
			SortChanges(cache);
			for (int i = m_changes.Count - 1; i >= 0; i--)
			{
				int ichMin = cache.GetIntProperty(m_changes[i], (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginOffset);
				int ichLim = cache.GetIntProperty(m_changes[i], (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidEndOffset);
				string replacement = action.Replacement(action.OldOccurrence(m_changes[i]));
				bldr.Replace(ichMin, ichLim, replacement, null);
			}
			m_newContents = bldr.GetString();
		}