/**
         * Writes out the drawings and the charts if nothing has been modified
         *
         * @param outputFile the output file
         * @exception IOException
         */
        private void writeUnmodified(File outputFile)
        {
            if (charts.Length == 0 && drawings.Count == 0)
            {
                // No drawings or charts
                return;
            }
            else if (charts.Length == 0 && drawings.Count != 0)
            {
                // If there are no charts, then write out the drawings and return
                foreach (DrawingGroupObject d in drawings)
                {
                    outputFile.write(d.getMsoDrawingRecord());
                    d.writeAdditionalRecords(outputFile);
                }

                foreach (DrawingGroupObject d in drawings)
                {
                    d.writeTailRecords(outputFile);
                }
                return;
            }
            else if (drawings.Count == 0 && charts.Length != 0)
            {
                // If there are no drawings, then write out the charts and return
                Chart curChart = null;
                for (int i = 0; i < charts.Length; i++)
                {
                    curChart = charts[i];
                    if (curChart.getMsoDrawingRecord() != null)
                    {
                        outputFile.write(curChart.getMsoDrawingRecord());
                    }

                    if (curChart.getObjRecord() != null)
                    {
                        outputFile.write(curChart.getObjRecord());
                    }

                    outputFile.write(curChart);
                }

                return;
            }

            // There are both charts and drawings - the output
            // drawing group records will need
            // to be re-jigged in order to write the drawings out first, then the
            // charts
            int numDrawings = drawings.Count;
            int length      = 0;

            EscherContainer[] spContainers = new EscherContainer[numDrawings + charts.Length];
            bool[]            isFormobject = new bool[numDrawings + charts.Length];

            for (int i = 0; i < numDrawings; i++)
            {
                DrawingGroupObject d = (DrawingGroupObject)drawings[i];
                spContainers[i] = d.getSpContainer();

                if (i > 0)
                {
                    length += spContainers[i].getLength();
                }

                if (d.isFormObject())
                {
                    isFormobject[i] = true;
                }
            }

            for (int i = 0; i < charts.Length; i++)
            {
                spContainers[i + numDrawings] = charts[i].getSpContainer();
                length += spContainers[i + numDrawings].getLength();
            }

            // Put the generalised stuff around the first item
            DgContainer dgContainer = new DgContainer();
            Dg          dg          = new Dg(numDrawings + charts.Length);

            dgContainer.add(dg);

            SpgrContainer spgrContainer = new SpgrContainer();

            SpContainer spContainer = new SpContainer();
            Spgr        spgr        = new Spgr();

            spContainer.add(spgr);
            Sp sp = new Sp(ShapeType.MIN, 1024, 5);

            spContainer.add(sp);
            spgrContainer.add(spContainer);

            spgrContainer.add(spContainers[0]);

            dgContainer.add(spgrContainer);

            byte[] firstMsoData = dgContainer.getData();

            // Adjust the length of the DgContainer
            int len = IntegerHelper.getInt(firstMsoData[4],
                                           firstMsoData[5],
                                           firstMsoData[6],
                                           firstMsoData[7]);

            IntegerHelper.getFourBytes(len + length, firstMsoData, 4);

            // Adjust the length of the SpgrContainer
            len = IntegerHelper.getInt(firstMsoData[28],
                                       firstMsoData[29],
                                       firstMsoData[30],
                                       firstMsoData[31]);
            IntegerHelper.getFourBytes(len + length, firstMsoData, 28);

            // Now write out each MsoDrawing record and object record

            // Hack to remove the last eight bytes (text box escher record)
            // from the container
            if (isFormobject[0] == true)
            {
                byte[] cbytes = new byte[firstMsoData.Length - 8];
                System.Array.Copy(firstMsoData, 0, cbytes, 0, cbytes.Length);
                firstMsoData = cbytes;
            }

            // First MsoRecord
            MsoDrawingRecord msoDrawingRecord = new MsoDrawingRecord(firstMsoData);

            outputFile.write(msoDrawingRecord);

            DrawingGroupObject dgo = (DrawingGroupObject)drawings[0];

            dgo.writeAdditionalRecords(outputFile);

            // Now do all the others
            for (int i = 1; i < spContainers.Length; i++)
            {
                byte[] bytes  = spContainers[i].getBytes();
                byte[] bytes2 = spContainers[i].setHeaderData(bytes);

                // Hack to remove the last eight bytes (text box escher record)
                // from the container
                if (isFormobject[i] == true)
                {
                    byte[] cbytes = new byte[bytes2.Length - 8];
                    System.Array.Copy(bytes2, 0, cbytes, 0, cbytes.Length);
                    bytes2 = cbytes;
                }

                msoDrawingRecord = new MsoDrawingRecord(bytes2);
                outputFile.write(msoDrawingRecord);

                if (i < numDrawings)
                {
                    dgo = (DrawingGroupObject)drawings[i];
                    dgo.writeAdditionalRecords(outputFile);
                }
                else
                {
                    Chart     chart     = charts[i - numDrawings];
                    ObjRecord objRecord = chart.getObjRecord();
                    outputFile.write(objRecord);
                    outputFile.write(chart);
                }
            }

            // Write any tail records that need to be written
            foreach (DrawingGroupObject dgo2 in drawings)
            {
                dgo2.writeTailRecords(outputFile);
            }
        }