title: Initiate ApexPage.StandardSetController with List causes exception being thrown in later pagination calls
body: <p>I have a Paginated List displayed on the visual force page and in the backend I was using a StandardSetController to control the pagination. However, one column on the table is an aggregated field whose calculation is done in a wrapper class. Recently, I want to sort the paginated list against the calculated field. And unfortunately the calculated result cannot be done on the data model(SObject) level.</p>
  
  <p>So I am thinking to passed a sorted list of SObject to the StandardSetController constructor. That is to sort the record before it has been pass into the StandardSetController.
  The code is like below:</p>
  
  <pre><code>        List&lt;Job__c&gt; jobs = new List&lt;Job__c&gt;();
          List&lt;Job__c&gt; tempJobs = Database.Query(basicQuery + filterExpression);
          //sort with values
          List&lt;JobWrapper&gt; jws = createJobWrappers(tempJobs);
          JobWrapper.sortBy = JobWrapper.SORTBY_CALCULATEDFIELD_ASC;
          jws.sort();
          for(JobWrapper jw : jws){
              jobs.add(jw.JobRecord);
          }
          jobs = jobs.deepClone(true, true, true);
  
          StandardSetController con = new ApexPages.StandardSetController(jobs);
          con.setPageSize(10);
  </code></pre>
  
  <p>However after executing the last line system throw exception:<strong>Modified rows exist in the records collection!</strong></p>
  
  <p>I did not modify any rows in the controller. Could anyone help me understanding the exception?</p>