~ubuntu-branches/ubuntu/oneiric/libinfinity/oneiric

« back to all changes in this revision

Viewing changes to libinftext/inf-text-remote-delete-operation.c

  • Committer: Bazaar Package Importer
  • Author(s): Philipp Kern
  • Date: 2011-04-03 15:50:33 UTC
  • mfrom: (1.3.4 upstream)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20110403155033-7f5ud651l9ctzpys
Tags: upstream-0.5.0
ImportĀ upstreamĀ versionĀ 0.5.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* libinfinity - a GObject-based infinote implementation
2
 
 * Copyright (C) 2007, 2008, 2009 Armin Burgmeier <armin@arbur.net>
 
2
 * Copyright (C) 2007-2011 Armin Burgmeier <armin@arbur.net>
3
3
 *
4
4
 * This library is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU Lesser General Public
598
598
  for(item = priv->recon; item != NULL; item = g_slist_next(item))
599
599
  {
600
600
    recon = (InfTextRemoteDeleteOperationRecon*)item->data;
 
601
 
 
602
    g_assert(recon->position >= recon_cur_len);
601
603
    if(recon->position - recon_cur_len <= split_pos)
602
604
    {
603
605
      new_recon = g_slice_new(InfTextRemoteDeleteOperationRecon);
604
606
      new_recon->position = recon->position;
605
607
      new_recon->chunk = inf_text_chunk_copy(recon->chunk);
606
608
      first_recon = g_slist_prepend(first_recon, new_recon);
 
609
 
 
610
      recon_cur_len += inf_text_chunk_get_length(recon->chunk);
607
611
    }
608
612
    else
609
613
    {
629
633
  );
630
634
 
631
635
  result_priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(first_operation);
632
 
  result_priv->recon = first_recon;
 
636
  result_priv->recon = g_slist_reverse(first_recon);
633
637
  result_priv->recon_offset = priv->recon_offset;
634
638
 
635
639
  result_priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(second_operation);
636
 
  result_priv->recon = second_recon;
 
640
  result_priv->recon = g_slist_reverse(second_recon);
637
641
  result_priv->recon_offset = priv->recon_offset + split_pos + recon_cur_len;
638
642
 
639
643
  result = inf_adopted_split_operation_new(